Repository navigation
Upload the wheels to R2 from a workflow_run workflow - #25356
Conversation
The reusable build workflows in test-infra only upload to R2 when the caller passes the R2 secrets, and executorch passes none, so executorch wheels never reach R2. Passing repo-level secrets from the build workflows would expose them to a pull request that gets a ciflow tag (pytorch/FBGEMM#6852), so the upload goes in its own workflow, as in pytorch/vision#9765, pytorch/audio#4244 and pytorch/FBGEMM#6855.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/25356
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 4d66e58 with merge base ba0d826 ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
huydhn
left a comment
There was a problem hiding this comment.
Wait a sec, I don't think ET uploads to R2 at all now that I check the secrets. It doesn't have any R2 secrets
shoumikhin
left a comment
There was a problem hiding this comment.
Thanks for this. The workflow matches the audio and vision version, and I checked that the artifact names, channel and bucket path line up with the current S3 upload for all 7 builds. One thing blocks it, see the inline comment. It is a settings change, not a code change.
| upload-r2: | ||
| needs: get-matrix | ||
| runs-on: ubuntu-22.04 | ||
| environment: pytorchbot-env |
There was a problem hiding this comment.
I think this job will be blocked by the environment rules in this repo.
A workflow_run run always has the default branch (main) as its ref, and GitHub checks the environment's allowed branches against that ref. In this repo, pytorchbot-env only allows nightly, release/* and 2 v tag patterns. main is not on the list, so every upload-r2 job would be refused and no wheel would reach R2. In audio and vision, pytorchbot-env allows main, which is why the same workflow works there.
Could a repo admin add main to the allowed branches of pytorchbot-env before this merges? Please also add that step to the rollout list in the description. The 3 R2 secrets are already in the environment, so this looks like the last missing piece.
There was a problem hiding this comment.
@shoumikhin this is correct we only want to upload from nightly to r2, not on main
Executorch wheels are not uploaded to R2 today. test-infra's reusable build workflows (
_binary_upload.yml) upload to R2 only when the caller passes the R2 secrets, and none of executorch's build workflows does.pytorch/executorchis already on the R2 allowlist there, so only the secrets are missing.Passing the repo-level
secrets.R2_*from the build workflows would let a workflow in a pull request that gets a ciflow tag read them (pytorch/FBGEMM#6852 showed this in FBGEMM). A reusable workflow does not see the caller's environment secrets, and a calling job cannot setenvironment:, so the R2 upload gets its own workflow, as in pytorch/vision#9765, pytorch/audio#4244 and pytorch/FBGEMM#6855.upload_wheels_r2.ymlruns onworkflow_runfor the seven wheel builds: Linux, Aarch64 Linux, Linux CUDA, Aarch64 Linux CUDA, Windows, Windows CUDA and macOS. Aworkflow_runworkflow always comes from main. It only acts when the build was a push tonightlyin this repo.get-matrixreads the build matrix, which each build workflow now saves as thebuild-matrixartifact (the filtered matrix for the CUDA ones), andupload-r2(environment: pytorchbot-env) downloads each wheel from the build run and copies it to R2 with the same steps as test-infra's_binary_upload.yml. The run is named after the build run it handled, and its summary links to it.The architecture in the artifact name follows what each build passes to the upload:
x86_64for Linux,aarch64for Aarch64 Linux,x64for Windows, none for macOS. I checked these, and the CUDA names, against the artifacts of the 2026-11-20 nightly runs (for examplepytorch_executorch__3.11_cpu_x86_64,..._cu132_aarch64,..._cpu_x64,pytorch_executorch__3.11_cpu_).Not included: the two Native wheel workflows. They pass
trigger-event: development, so they never upload, and the comment there says executorch-native is not published yet.The build workflows' own S3 upload (an AWS role through OIDC) is unchanged. The only change to them is the
save-build-matrixjob.DO NOT MERGE before the
R2_ACCOUNT_ID,R2_ACCESS_KEY_IDandR2_SECRET_ACCESS_KEYsecrets exist in thepytorchbot-envenvironment of pytorch/executorch. Rollout:pytorchbot-env.Not verified: a
workflow_runworkflow only runs once it is on main, so none of this has run in executorch. pytorch/audio#4244 ran this design end to end, with the environment secrets, on 2026-11-19. I checked that the workflows parse as YAML and thatshellcheckis clean on the new scripts, and that the matrix fields the upload reads (build_name,python_version,desired_cuda,upload_to_base_bucket) are kept byfilter_cuda_matrix.py.Created with Claude