Skip to content

Commit 4c7402d

Browse files
authored
Added an option to turn off google DNS (#189)
1 parent 39aff4a commit 4c7402d

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

automation/script/docker_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def prepare_docker_inputs(input_params, docker_settings,
109109
keys += [
110110
"skip_run_cmd", "pre_run_cmds", "run_cmd_prefix", "all_gpus", "num_gpus", "device", "gh_token",
111111
"port_maps", "shm_size", "pass_user_id", "pass_user_group", "extra_run_args", "detached", "interactive",
112-
"dt", "it", "use_host_group_id", "use_host_user_id", "keep_detached", "reuse_existing"
112+
"dt", "it", "use_host_group_id", "use_host_user_id", "keep_detached", "reuse_existing", "use_google_dns"
113113
]
114114
# Collect Dockerfile inputs
115115
docker_inputs = {

script/app-mlperf-inference/meta.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1959,7 +1959,8 @@ docker:
19591959
skip_run_cmd: 'no'
19601960
shm_size: '32gb'
19611961
interactive: True
1962-
extra_run_args: ' --dns 8.8.8.8 --dns 8.8.4.4 --cap-add SYS_ADMIN --cap-add SYS_TIME --security-opt apparmor=unconfined --security-opt seccomp=unconfined'
1962+
extra_run_args: ' --cap-add SYS_ADMIN --cap-add SYS_TIME --security-opt apparmor=unconfined --security-opt seccomp=unconfined'
1963+
use_google_dns: yes
19631964
os: ubuntu
19641965
user: mlcuser
19651966
mlc_repo: mlcommons@mlperf-automations

script/run-docker-container/customize.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ def postprocess(i):
181181
if env.get('MLC_DOCKER_EXTRA_RUN_ARGS', '') != '':
182182
run_opts += env['MLC_DOCKER_EXTRA_RUN_ARGS']
183183

184+
if is_true(env.get('MLC_DOCKER_USE_GOOGLE_DNS', '')):
185+
run_opts += ' --dns 8.8.8.8 --dns 8.8.4.4 '
186+
184187
if env.get('MLC_CONTAINER_TOOL', '') == 'podman' and env.get(
185188
'MLC_PODMAN_MAP_USER_ID', '').lower() not in ["no", "0", "false"]:
186189
run_opts += " --userns=keep-id"

script/run-docker-container/meta.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ input_mapping:
5858
save_script: MLC_DOCKER_SAVE_SCRIPT
5959
script_tags: MLC_DOCKER_RUN_SCRIPT_TAGS
6060
shm_size: MLC_DOCKER_SHM_SIZE
61+
use_google_dns: MLC_DOCKER_USE_GOOGLE_DNS
6162

6263
new_env_keys:
6364
- 'MLC_DOCKER_CONTAINER_ID'

0 commit comments

Comments
 (0)