Skip to content

Commit

Permalink
Bug Fix - Update Docker Exec Command for Persistent HPCX Environment (#…
Browse files Browse the repository at this point in the history
…635)

Add 10-hpcx.sh to /etc/profile.d
Update the Docker exec command to ensure a persistent HPCX environment.
  • Loading branch information
RyoYang authored Aug 13, 2024
1 parent 9de841b commit 46a5792
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dockerfile/cuda12.2.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ ENV PATH="${PATH}" \
RUN echo PATH="$PATH" > /etc/environment && \
echo LD_LIBRARY_PATH="$LD_LIBRARY_PATH" >> /etc/environment && \
echo SB_MICRO_PATH="$SB_MICRO_PATH" >> /etc/environment && \
echo "source /opt/hpcx/hpcx-init.sh && hpcx_load" >> /etc/bash.bashrc
echo "source /opt/hpcx/hpcx-init.sh && hpcx_load" | tee -a /etc/bash.bashrc >> /etc/profile.d/10-hpcx.sh

# Add config files
ADD dockerfile/etc /opt/microsoft/
Expand Down
2 changes: 1 addition & 1 deletion dockerfile/cuda12.4.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ ENV PATH="${PATH}" \
RUN echo PATH="$PATH" > /etc/environment && \
echo LD_LIBRARY_PATH="$LD_LIBRARY_PATH" >> /etc/environment && \
echo SB_MICRO_PATH="$SB_MICRO_PATH" >> /etc/environment && \
echo "source /opt/hpcx/hpcx-init.sh && hpcx_load" >> /etc/bash.bashrc
echo "source /opt/hpcx/hpcx-init.sh && hpcx_load" | tee -a /etc/bash.bashrc >> /etc/profile.d/10-hpcx.sh

# Add config files
ADD dockerfile/etc /opt/microsoft/
Expand Down
4 changes: 2 additions & 2 deletions superbench/runner/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def run_sys_info(self):

logger.info('Runner is going to get node system info.')

fcmd = "docker exec sb-workspace bash -c '{command}'"
fcmd = "docker exec sb-workspace bash -lc '{command}'"

if 'skip' not in self._docker_config:
self._docker_config.skip = False
Expand Down Expand Up @@ -462,7 +462,7 @@ def _run_proc(self, benchmark_name, mode, vars):
envvar = f'{k}={str(v).format(proc_rank=mode.proc_rank, proc_num=mode.proc_num)}'
env_list += f' -e {envvar}' if not self._docker_config.skip else f' && export {envvar}'

fcmd = "docker exec {env_list} sb-workspace bash -c '{command}'"
fcmd = "docker exec {env_list} sb-workspace bash -lc '{command}'"
if self._docker_config.skip:
fcmd = "bash -c '{env_list} && cd $SB_WORKSPACE && {command}'"
ansible_runner_config = self._ansible_client.get_shell_config(
Expand Down

0 comments on commit 46a5792

Please sign in to comment.