Developer Tools

trunk/6a635dedbd99a180f8f20a671ba5712e9a0678cf: [OSDC] Graceful OIDC degradation for fork PRs on ARC runners (#179341)

A single commit now prevents CI failures for thousands of external PyTorch contributors by implementing smart authentication fallbacks.

Deep Dive

The PyTorch development team, led by engineer huydhn, has resolved a major pain point in their continuous integration (CI) workflow with a single, strategic commit (6a635de). The core issue was a security restriction in GitHub Actions: for any pull request (PR) originating from a forked repository, GitHub refuses to issue the necessary OIDC (OpenID Connect) tokens required for secure authentication with cloud services like AWS S3. Previously, this would cause the entire CI build to fail for external contributors, blocking automated testing and artifact storage.

Instead of letting builds fail, the new implementation introduces a system of graceful degradation. Key steps in the CI pipeline, like fetching AWS credentials, are now marked with `continue-on-error`. Downstream steps check the outcome to dynamically adjust their behavior. For example, the `sccache` compiler cache tool is configured for anonymous reads from public S3 buckets, silently failing on writes. Build artifacts automatically fall back to GitHub's own storage when S3 is unavailable, and non-essential uploads for stats and benchmark data are simply skipped. This elegant solution ensures that the vast majority of the CI process—compilation, testing, and basic artifact generation—completes successfully for the project's 27,000+ forks, while maintaining full, secure S3 functionality for PRs from within the main PyTorch repository.

Key Points
  • Solves GitHub's OIDC token restriction for fork-based PRs, a major blocker for external contributors.
  • Implements 'continue-on-error' and fallback logic for AWS credentials, artifact storage, and cache uploads.
  • Ensures sccache uses anonymous reads (SCCACHE_S3_NO_CREDENTIALS) and test artifacts have S3-to-GitHub fallback.

Why It Matters

This removes a critical friction point for open-source collaboration, enabling seamless automated testing for thousands of external PyTorch contributors and accelerating development.