You need to sign in or sign up before continuing.
Unverified Commit f755c0b6 authored by Yifan Xiong's avatar Yifan Xiong Committed by GitHub
Browse files

Bug - Fix env path to absolute path (#327)

Fix env file path to absolute path in `docker exec`, in case there're mixed ssh and local connections or different users are used.
parent 1ec055e1
...@@ -40,8 +40,11 @@ ...@@ -40,8 +40,11 @@
- name: Updating Env Variables - name: Updating Env Variables
copy: copy:
content: '{{ sb_env }}' content: '{{ sb_env }}'
dest: '{{ workspace }}/sb.env' dest: '{{ item }}'
mode: 0644 mode: 0644
with_items:
- '{{ workspace }}/sb.env'
- /tmp/sb.env
become: yes become: yes
- name: Updating Hostfile - name: Updating Hostfile
copy: copy:
......
...@@ -387,7 +387,7 @@ def _run_proc(self, benchmark_name, mode, vars): ...@@ -387,7 +387,7 @@ def _run_proc(self, benchmark_name, mode, vars):
logger.info('Runner is going to run %s in %s mode, proc rank %d.', benchmark_name, mode.name, mode.proc_rank) logger.info('Runner is going to run %s in %s mode, proc rank %d.', benchmark_name, mode.name, mode.proc_rank)
timeout = self._sb_benchmarks[benchmark_name].timeout timeout = self._sb_benchmarks[benchmark_name].timeout
env_list = '--env-file sb-workspace/sb.env' env_list = '--env-file /tmp/sb.env'
for k, v in mode.env.items(): for k, v in mode.env.items():
if isinstance(v, str): if isinstance(v, str):
env_list += f' -e {k}={str(v).format(proc_rank=mode.proc_rank, proc_num=mode.proc_num)}' env_list += f' -e {k}={str(v).format(proc_rank=mode.proc_rank, proc_num=mode.proc_num)}'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment