-
Notifications
You must be signed in to change notification settings - Fork 0
/
.dazelrc
127 lines (100 loc) · 5.31 KB
/
.dazelrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
##########################################################################
# Copyright (c) 2018-2019 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# File: DL4AGX/.dazelrc
# Description: dazel configurations for the project
##########################################################################
import os
import dazel
import subprocess
# The name of the docker container to run.
DAZEL_INSTANCE_NAME="dazel_sample_builder"
# The name of the dazel image to build or pull.
DAZEL_IMAGE_NAME="dl4agx:latest"
DAZEL_RUN_FLAGS="--runtime=nvidia -e NVIDIA_DRIVER_CAPABILITIES=all -u ${UID}:${GID}"
# The command to run when running the image (the continuous command that will
# hold the container active while we connect to it).
DAZEL_RUN_COMMAND="/bin/bash"
# The command to run to invoke docker (can be changed to `nvidia-docker` for GPUs).
DAZEL_DOCKER_COMMAND="docker"
DAZEL_DOCKERFILE = os.path.join(
dazel.DockerInstance._find_workspace_directory(),
"Dockerfile.dazel")
# The path to the Dockerfile to use to build the dazel image.
#DAZEL_DOCKERFILE="Dockerfile.dazel" # in DAZEL_DIRECTORY
# The repository to pull the dazel image from.
DAZEL_REPOSITORY="nvidia"
# The directory to build the dazel image in.
DAZEL_DIRECTORY="."
# The command to run inside the container.
# NOTE: You should add flags to the .bazelrc file instead of here, since it is
# also shared in the volume and it is a much cleaner way.
DAZEL_COMMAND="/usr/bin/bazel"
# Add any additional volumes you want to share between the host and the docker
# container, in the normal "hostdir:dockerdir" format.
# This can be a python iterable, or a comma-separated string.
DAZEL_VOLUMES=[]
# Add any ports you want to publish from the dazel container to the host, in the
# normal "interface:dockerport:hostport" (e.g. "0.0.0.0:80:80").
# This can be useful if you use the "dazel run //my/cool/webserver/target"
# command for example, and need to publish port 80.
DAZEL_PORTS=[]
# The name of the network on which to load all run dependencies and dazel container.
# If you are using a docker-compose.yml file to load the environment, this must
# be the network name to which all of the necessary dependencies are connected.
DAZEL_NETWORK="host"
# Add any additional images that you want to run as dependencies and hook up to
# the same docker network as the main container.
# The format is the standard "repository/image:tag", but you can optionally add
# the name of the container to create with "repository/image:tag::container".
# This is useful if you want to add "postgres" or "rabbitmq" for instance, and
# have them run as part of your test environment in a seamless reproducible way.
# This can be a python iterable, or a comma-separated string.
# Note: alternatively, you can use a docker-compose.yml file for dependencies.
DAZEL_RUN_DEPS=[]
# Add a docker-compose.yml file here to use it to load any services you want to
# launch as part of the environment for running bazel.
# This can be a much more complex environment than what is possible using run
# dependencies.
# Note: you can control both the project name and which services to run with the
# variables below.
DAZEL_DOCKER_COMPOSE_FILE=""
# The command to run to invoke docker-compose (can be changed to
# `nvidia-docker-compose` for GPUs).
DAZEL_DOCKER_COMPOSE_COMMAND="docker-compose"
# If using a docker-compose.yml file, this will set the COMPOSE_PROJECT_NAME
# environment variable and thus the project name.
DAZEL_DOCKER_COMPOSE_PROJECT_NAME="dazel"
# If using a docker-compose.yml file, you can specify the services to run in the
# file (and empty string means all services - as in running: docker-compose up).
# This can be a python iterable, or a comma-separated string.
DAZEL_DOCKER_COMPOSE_SERVICES=""
# Whether or not to run in privileged mode (fixes bazel sandboxing issues on some
# systems). Note that this can be a python boolean equivalent, so if setting
# this from the environment, simply set it to an empty string.
DAZEL_DOCKER_RUN_PRIVILEGED=False
# Path to custom .bazelrc file to use when running the bazel commands.
DAZEL_BAZEL_RC_FILE=""
# Use the :delegated flag of the --volume option of docker for the bind-mounting of
# the bazel cache directory. This vastly improves throughput on MacOSX.
# More information on the :delegated flag: https://docs.docker.com/docker-for-mac/osxfs-caching/.
# NOTE: This will fail on Docker versions < 17.04.
DAZEL_DELEGATED_VOLUME=True
# The user, in the same format as the --user option docker run and docker exec takes,
# to use when starting the container and executing commands inside of the container
DAZEL_USER = ""
# Watch all files used for building the dazel image, forces image rebuild in case they change.
# User's .dazelrc and this global .dazelrc are added to the list of watched files automatically.
DAZEL_FILES_WATCH=DAZEL_DOCKERFILE