Skip to content

Commit 16b1fe7

Browse files
authored
Allow custom s3 upload path within pytorch (#7280)
To be used by forge and torchcomms
1 parent b4472bd commit 16b1fe7

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

.github/workflows/_binary_upload.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ on:
3636
description: The comma-separated list of CUDA arch to be uploaded to pypi
3737
default: ''
3838
type: string
39+
wheel-upload-path:
40+
description: Custom wheel upload path
41+
required: false
42+
type: string
43+
default: ''
3944
secrets:
4045
PYPI_API_TOKEN:
4146
description: An optional token to upload to pypi
@@ -99,6 +104,8 @@ jobs:
99104
- name: Upload package to pytorch.org
100105
shell: bash
101106
working-directory: ${{ inputs.repository }}
107+
env:
108+
WHEEL_UPLOAD_PATH: ${{ inputs.wheel-upload-path }}
102109
run: |
103110
set -ex
104111
@@ -112,6 +119,11 @@ jobs:
112119
AWS_CMD="aws s3 cp"
113120
fi
114121
122+
# set path to specific wheel-upload-path
123+
if [[ -n "$WHEEL_UPLOAD_PATH" ]]; then
124+
PYTORCH_S3_BUCKET_PATH="s3://pytorch/${WHEEL_UPLOAD_PATH}"
125+
fi
126+
115127
for pkg in dist/*; do
116128
shm_id=$(sha256sum "${pkg}" | awk '{print $1}')
117129
${AWS_CMD} "$pkg" "${PYTORCH_S3_BUCKET_PATH}" --acl public-read \

.github/workflows/build_wheels_linux.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ on:
8888
required: false
8989
default: "python -m build --wheel"
9090
type: string
91+
wheel-upload-path:
92+
description: Custom wheel upload path
93+
required: false
94+
type: string
9195
pip-install-torch-extra-args:
9296
# NOTE: Why does this exist?
9397
# Well setuptools / python packaging doesn't actually allow you to specify dependencies
@@ -325,6 +329,7 @@ jobs:
325329
architecture: ${{ inputs.architecture }}
326330
trigger-event: ${{ inputs.trigger-event }}
327331
upload-to-pypi: ${{ inputs.upload-to-pypi }}
332+
wheel-upload-path: ${{ inputs.wheel-upload-path }}
328333
secrets:
329334
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
330335

.github/workflows/test_build_wheels_linux_without_cuda.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
package-name: ${{ matrix.package-name }}
4646
trigger-event: "${{ github.event_name }}"
4747
build-platform: python-build-package
48+
wheel-upload-path: "test/custom/path/"
4849
pip-install-torch-extra-args:
4950
torchvision
5051
torchao

0 commit comments

Comments
 (0)