Skip to content

Commit

Permalink
Update run_with_env_secrets.py
Browse files Browse the repository at this point in the history
  • Loading branch information
amdfaa authored Dec 5, 2024
1 parent 171ee05 commit e37d94f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/scripts/run_with_env_secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ def main():
os.environ[senv] = str(all_secrets.get(sname, ""))
except KeyError as e:
print(f"Could not set {senv} from secret {sname}: {e}")

env_file = f"{ os.environ.get('RUNNER_TEMP', '') }/github_env_{ os.environ.get('GITHUB_RUN_ID', '') }"
if f"{ os.environ.get('ROCM', '') }" == "true":
env_file = f"/tmp/github_env_{ os.environ.get('GITHUB_RUN_ID', '') }"

docker_path = shutil.which("docker")
if not docker_path:
run_cmd_or_die(f"bash { os.environ.get('RUNNER_TEMP', '') }/exec_script")
Expand All @@ -67,7 +69,6 @@ def main():
f"""
docker run \
-e PR_NUMBER \
-e HIP_VISIBLE_DEVICES=0 \
-e RUNNER_ARTIFACT_DIR=/artifacts \
-e RUNNER_DOCS_DIR=/docs \
-e RUNNER_TEST_RESULTS_DIR=/test-results \
Expand All @@ -86,9 +87,9 @@ def main():
{ os.environ.get('GPU_FLAG', '') } \
-v "{ os.environ.get('GITHUB_WORKSPACE', '') }/{ os.environ.get('REPOSITORY', '') }:/{ os.environ.get('REPOSITORY', 'work') }" \
-v "{ os.environ.get('GITHUB_WORKSPACE', '') }/test-infra:/test-infra" \
-v "/var/home/pytorchci/actions-runner/_work/_temp/artifacts:/artifacts" \
-v "/var/home/pytorchci/actions-runner/_work/_temp/docs:/docs" \
-v "/var/home/pytorchci/actions-runner/_work/_temp/test-results:/test-results" \
-v "{ os.environ.get('RUNNER_TEMP', '') }/artifacts:/artifacts" \
-v "{ os.environ.get('RUNNER_TEMP', '') }/docs:/docs" \
-v "{ os.environ.get('RUNNER_TEMP', '') }/test-results:/test-results" \
-v "{ os.environ.get('RUNNER_TEMP', '') }/exec_script:/exec" \
-v "{ os.environ.get('GITHUB_STEP_SUMMARY', '') }":"{ os.environ.get('GITHUB_STEP_SUMMARY', '') }" \
-w /{ os.environ.get('REPOSITORY', 'work') } \
Expand Down

0 comments on commit e37d94f

Please sign in to comment.