-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lluo/auto release cherry pick main (#2992)
- Loading branch information
1 parent
0d4af77
commit 0c25d92
Showing
7 changed files
with
762 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import argparse | ||
import json | ||
import sys | ||
|
||
RELEASE_CUDA_VERSION = { | ||
"wheel": ["cu124"], | ||
"tarball": ["cu124"], | ||
} | ||
RELEASE_PYTHON_VERSION = { | ||
"wheel": ["3.8", "3.9", "3.10", "3.11", "3.12"], | ||
"tarball": ["3.10"], | ||
} | ||
|
||
CXX11_TARBALL_CONTAINER_IMAGE = { | ||
"cu124": "pytorch/libtorch-cxx11-builder:cuda12.4-main", | ||
} | ||
|
||
|
||
def main(args: list[str]) -> None: | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
"--wheel_matrix", | ||
help="wheel matrix", | ||
type=str, | ||
default="", | ||
) | ||
parser.add_argument( | ||
"--tarball_matrix", | ||
help="tarball matrix", | ||
type=str, | ||
default="", | ||
) | ||
options = parser.parse_args(args) | ||
cuda_versions = [] | ||
python_versions = [] | ||
|
||
if options.tarball_matrix != "": | ||
cuda_versions = RELEASE_CUDA_VERSION["tarball"] | ||
python_versions = RELEASE_PYTHON_VERSION["tarball"] | ||
matrix_dict = json.loads(options.tarball_matrix) | ||
elif options.wheel_matrix != "": | ||
cuda_versions = RELEASE_CUDA_VERSION["wheel"] | ||
python_versions = RELEASE_PYTHON_VERSION["wheel"] | ||
matrix_dict = json.loads(options.wheel_matrix) | ||
else: | ||
raise Exception( | ||
"Either --wheel_matrix or --tarball_matrix needs to be provided" | ||
) | ||
|
||
includes = matrix_dict["include"] | ||
filtered_includes = [] | ||
for item in includes: | ||
if ( | ||
item["desired_cuda"] in cuda_versions | ||
and item["python_version"] in python_versions | ||
): | ||
if options.tarball_matrix != "": | ||
item["container_image"] = CXX11_TARBALL_CONTAINER_IMAGE[ | ||
item["desired_cuda"] | ||
] | ||
filtered_includes.append(item) | ||
filtered_matrix_dict = {} | ||
filtered_matrix_dict["include"] = filtered_includes | ||
print(json.dumps(filtered_matrix_dict)) | ||
|
||
|
||
if __name__ == "__main__": | ||
main(sys.argv[1:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
name: Release Linux wheels and tarball artifacts | ||
|
||
on: | ||
push: | ||
tags: | ||
# NOTE: Binary build pipelines should only get triggered on release candidate builds | ||
# Release candidate tags look like: v1.11.0-rc1 | ||
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+ | ||
workflow_dispatch: | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
generate-matrix: | ||
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main | ||
if: ${{ contains(github.event.pull_request.labels.*.name, 'build-release-artifacts') || startsWith(github.event.ref, 'refs/tags/v') }} | ||
with: | ||
package-type: wheel | ||
os: linux | ||
test-infra-repository: pytorch/test-infra | ||
test-infra-ref: main | ||
with-rocm: false | ||
with-cpu: false | ||
|
||
generate-release-tarball-matrix: | ||
needs: [generate-matrix] | ||
outputs: | ||
matrix: ${{ steps.generate.outputs.matrix }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: pytorch/tensorrt | ||
- name: Generate release matrix | ||
id: generate | ||
run: | | ||
set -eou pipefail | ||
MATRIX_BLOB=${{ toJSON(needs.generate-matrix.outputs.matrix) }} | ||
MATRIX_BLOB="$(python3 .github/scripts/generate-release-matrix.py --tarball_matrix "${MATRIX_BLOB}")" | ||
echo "${MATRIX_BLOB}" | ||
echo "matrix=${MATRIX_BLOB}" >> "${GITHUB_OUTPUT}" | ||
release-cxx11-tarball-artifacts: | ||
needs: [generate-release-tarball-matrix] | ||
name: Release torch-tensorrt cxx11 tarball artifacts | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- repository: pytorch/tensorrt | ||
package-name: torch_tensorrt | ||
pre-script: packaging/pre_build_script.sh | ||
env-var-script: packaging/env_vars.txt | ||
post-script: packaging/post_build_script.sh | ||
smoke-test-script: packaging/smoke_test_script.sh | ||
cxx11-tarball-release: "true" | ||
uses: ./.github/workflows/release-wheel-linux.yml | ||
with: | ||
repository: ${{ matrix.repository }} | ||
ref: "" | ||
test-infra-repository: pytorch/test-infra | ||
test-infra-ref: main | ||
build-matrix: ${{ needs.generate-release-tarball-matrix.outputs.matrix }} | ||
pre-script: ${{ matrix.pre-script }} | ||
env-var-script: ${{ matrix.env-var-script }} | ||
post-script: ${{ matrix.post-script }} | ||
package-name: ${{ matrix.package-name }} | ||
smoke-test-script: ${{ matrix.smoke-test-script }} | ||
trigger-event: ${{ github.event_name }} | ||
cxx11-tarball-release: "true" | ||
|
||
generate-release-wheel-matrix: | ||
needs: [generate-matrix] | ||
outputs: | ||
matrix: ${{ steps.generate.outputs.matrix }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: pytorch/tensorrt | ||
- name: Generate release matrix | ||
id: generate | ||
run: | | ||
set -eou pipefail | ||
MATRIX_BLOB=${{ toJSON(needs.generate-matrix.outputs.matrix) }} | ||
MATRIX_BLOB="$(python3 .github/scripts/generate-release-matrix.py --wheel_matrix "${MATRIX_BLOB}")" | ||
echo "${MATRIX_BLOB}" | ||
echo "matrix=${MATRIX_BLOB}" >> "${GITHUB_OUTPUT}" | ||
release-other-artifacts: | ||
name: Release torch-tensorrt wheel and pre-cxx11 tarball artifacts | ||
needs: [generate-release-wheel-matrix] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- repository: pytorch/tensorrt | ||
package-name: torch_tensorrt | ||
pre-script: packaging/pre_build_script.sh | ||
env-var-script: packaging/env_vars.txt | ||
post-script: packaging/post_build_script.sh | ||
smoke-test-script: packaging/smoke_test_script.sh | ||
cxx11-tarball-release: "true" | ||
uses: ./.github/workflows/release-wheel-linux.yml | ||
with: | ||
repository: ${{ matrix.repository }} | ||
ref: "" | ||
test-infra-repository: pytorch/test-infra | ||
test-infra-ref: main | ||
build-matrix: ${{ needs.generate-release-wheel-matrix.outputs.matrix }} | ||
pre-script: ${{ matrix.pre-script }} | ||
env-var-script: ${{ matrix.env-var-script }} | ||
post-script: ${{ matrix.post-script }} | ||
package-name: ${{ matrix.package-name }} | ||
smoke-test-script: ${{ matrix.smoke-test-script }} | ||
trigger-event: ${{ github.event_name }} | ||
cxx11-tarball-release: "false" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ inputs.repository }}-${{ github.event_name == 'workflow_dispatch' }}-${{ inputs.job-name }} | ||
cancel-in-progress: true |
Oops, something went wrong.