Skip to content

Commit 288e95d

Browse files
authored
Add update dependencies workflow (#7410)
Add Update S3 HTML dependencies for download.pytorch.org
1 parent 0ffc3c1 commit 288e95d

File tree

2 files changed

+79
-1
lines changed

2 files changed

+79
-1
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Update S3 HTML dependencies for download.pytorch.org nightly and test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- s3_management/update_dependencies.py
9+
workflow_dispatch:
10+
inputs:
11+
dryrun:
12+
description: 'Enable dry run mode'
13+
required: true
14+
type: choice
15+
default: enabled
16+
options:
17+
- enabled
18+
- disabled
19+
package:
20+
description: 'Package to update'
21+
required: true
22+
type: choice
23+
default: torch
24+
options:
25+
- all
26+
- torch
27+
- triton
28+
- torchtune
29+
- torch_xpu
30+
31+
permissions:
32+
id-token: write
33+
contents: read
34+
35+
jobs:
36+
update:
37+
runs-on: ubuntu-22.04
38+
environment: pytorchbot-env
39+
container:
40+
image: continuumio/miniconda3:23.10.0-1
41+
steps:
42+
- name: configure aws credentials
43+
id: aws_creds
44+
uses: aws-actions/configure-aws-credentials@50ac8dd1e1b10d09dac7b8727528b91bed831ac0 # v3.0.2
45+
with:
46+
role-to-assume: arn:aws:iam::749337293305:role/gha_workflow_s3_update
47+
aws-region: us-east-1
48+
49+
- name: Checkout repository test-infra
50+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
51+
with:
52+
repository: pytorch/test-infra
53+
ref: ${{ github.ref }}
54+
55+
- name: Update s3 html index
56+
shell: bash
57+
env:
58+
DRYRUN: ${{ github.event.inputs.dryrun || 'disabled' }}
59+
PACKAGE: ${{ github.event.inputs.package || 'torch' }}
60+
run: |
61+
set -ex
62+
63+
# Install requirements
64+
pip install -r s3_management/requirements.txt
65+
66+
# shellcheck disable=SC2086
67+
ARGS="--package ${PACKAGE}"
68+
69+
# Add dry-run flag if enabled
70+
if [[ ${DRYRUN} == 'enabled' ]]; then
71+
ARGS="${ARGS} --dry-run"
72+
fi
73+
74+
# shellcheck disable=SC2086
75+
python3 s3_management/update_dependencies.py ${ARGS}

s3_management/update_dependencies.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ def main() -> None:
654654
for config in pkg_configs
655655
}
656656
)
657+
project_paths += ["all"]
657658
parser.add_argument("--package", choices=project_paths, default="torch")
658659
parser.add_argument("--dry-run", action="store_true")
659660
parser.add_argument("--only-pypi", action="store_true")
@@ -669,7 +670,9 @@ def main() -> None:
669670
for pkg_name, pkg_configs in PACKAGES_PER_PROJECT.items():
670671
# Filter configurations by the selected project
671672
selected_configs = [
672-
config for config in pkg_configs if config["project"] == args.package
673+
config
674+
for config in pkg_configs
675+
if args.package == "all" or config["project"] == args.package
673676
]
674677

675678
# Process each configuration for this package

0 commit comments

Comments
 (0)