From 7ed279e6570a75542e3e55722b4dc457e7885ff6 Mon Sep 17 00:00:00 2001 From: lanluo-nvidia Date: Wed, 25 Jun 2025 11:26:23 -0700 Subject: [PATCH 1/3] add weekly cron job to upgrade uv lock --- .github/workflows/weeklies.yml | 84 ++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/workflows/weeklies.yml diff --git a/.github/workflows/weeklies.yml b/.github/workflows/weeklies.yml new file mode 100644 index 0000000000..fcc8fc4894 --- /dev/null +++ b/.github/workflows/weeklies.yml @@ -0,0 +1,84 @@ +name: Routine WeeklyCron Job + +on: + pull_request: + schedule: + - cron: '0 0 * * 1' # Runs at 00:00 UTC every Monday (minute hour day-of-month month-of-year day-of-week) + + workflow_dispatch: + +permissions: + id-token: write + contents: read + packages: write + +jobs: + upgrade_uv_lock: + runs-on: ubuntu-latest + timeout-minutes: 120 + steps: + - name: Clean workspace + shell: bash -l {0} + run: | + set -euxo pipefail + echo "::group::Cleanup debug output" + rm -rf "${GITHUB_WORKSPACE}" + mkdir -p "${GITHUB_WORKSPACE}" + + if [[ "${{ inputs.architecture }}" = "aarch64" ]]; then + rm -rf "${RUNNER_TEMP}/*" + fi + echo "::endgroup::" + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: pytorch/torch-tensorrt + ref: main + path: torch-tensorrt + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install uv and upgrade lock file + run: | + set -euo pipefail + set -x + python -m pip install uv + uv sync --upgrade + - name: Create Branch and Commit changes + id: commit + shell: bash + run: | + set -euo pipefail + set -x + git config --global user.email "pytorchbot@pytorch.com" + git config --global user.name "pytorchbot" + # Check for changes only in uv.lock + if git diff --quiet uv.lock; then + echo "changes=false" >> $GITHUB_OUTPUT + echo "No dependency updates found for uv.lock file" + else + echo "changes=true" >> $GITHUB_OUTPUT + echo "uv.lock file changed" + timestamp=$(date +%s) + branch_name="deps/uv-upgrade-$timestamp" + echo "branch=$branch_name" >> $GITHUB_OUTPUT + git checkout -b $branch_name + git add uv.lock + git commit -m "chore(deps): weekly automated upgrade via uv" + git push -u origin $branch_name + fi + - name: Create Pull Request + if: steps.commit.outputs.changes == 'true' + uses: peter-evans/create-pull-request@v6 + with: + title: "chore(deps): weekly automated upgrade via uv" + body: "This PR is automatically created by the weekly routine job" + base: main + branch: ${{ steps.commit.outputs.branch }} + labels: "dependencies,automated" + assignees: "lanl@nvidia.com" # Add your team's GitHub usernames + reviewers: "lanl@nvidia.com" # Add reviewers if desired + commit-message: "chore(deps): weekly automated upgrade via uv" # Keep the commit we already made + delete-branch: true # Auto-delete branch after merge \ No newline at end of file From d49f5a92f06c4c2a05848ac623bb150365cfdfe6 Mon Sep 17 00:00:00 2001 From: lanluo-nvidia Date: Wed, 25 Jun 2025 11:46:40 -0700 Subject: [PATCH 2/3] test --- .github/workflows/build-test-linux-aarch64-jetpack.yml | 2 +- .github/workflows/build-test-linux-aarch64.yml | 2 +- .github/workflows/build-test-linux-x86_64.yml | 2 +- .github/workflows/build-test-windows.yml | 2 +- .github/workflows/weeklies.yml | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-test-linux-aarch64-jetpack.yml b/.github/workflows/build-test-linux-aarch64-jetpack.yml index 744a802bfa..ad35bd6da5 100644 --- a/.github/workflows/build-test-linux-aarch64-jetpack.yml +++ b/.github/workflows/build-test-linux-aarch64-jetpack.yml @@ -1,7 +1,7 @@ name: Build and test Linux aarch64 wheels for Jetpack on: - pull_request: + #pull_request: push: branches: - main diff --git a/.github/workflows/build-test-linux-aarch64.yml b/.github/workflows/build-test-linux-aarch64.yml index 1f2c98da56..fb1ed0af0a 100644 --- a/.github/workflows/build-test-linux-aarch64.yml +++ b/.github/workflows/build-test-linux-aarch64.yml @@ -1,7 +1,7 @@ name: Build and test Linux aarch64 wheels on: - pull_request: + #pull_request: push: branches: - main diff --git a/.github/workflows/build-test-linux-x86_64.yml b/.github/workflows/build-test-linux-x86_64.yml index 51f3730d02..fbd8aa0d7e 100644 --- a/.github/workflows/build-test-linux-x86_64.yml +++ b/.github/workflows/build-test-linux-x86_64.yml @@ -1,7 +1,7 @@ name: Build and test Linux x86_64 wheels on: - pull_request: + #pull_request: push: branches: - main diff --git a/.github/workflows/build-test-windows.yml b/.github/workflows/build-test-windows.yml index 40171540fc..f731b344e4 100644 --- a/.github/workflows/build-test-windows.yml +++ b/.github/workflows/build-test-windows.yml @@ -1,7 +1,7 @@ name: Build and test Windows wheels on: - pull_request: + #pull_request: push: branches: - main diff --git a/.github/workflows/weeklies.yml b/.github/workflows/weeklies.yml index fcc8fc4894..9d733eb35b 100644 --- a/.github/workflows/weeklies.yml +++ b/.github/workflows/weeklies.yml @@ -32,10 +32,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - repository: pytorch/torch-tensorrt + repository: pytorch/tensorrt ref: main - path: torch-tensorrt - fetch-depth: 0 + fetch-depth: -1 + path: pytorch/tensorrt - name: Set up Python uses: actions/setup-python@v5 with: From 7ec65079791812388d15a7deac02d3d08aad1175 Mon Sep 17 00:00:00 2001 From: lanluo-nvidia Date: Wed, 25 Jun 2025 14:06:41 -0700 Subject: [PATCH 3/3] test --- .github/workflows/weeklies.yml | 47 +++++++++++++++------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/.github/workflows/weeklies.yml b/.github/workflows/weeklies.yml index 9d733eb35b..c9c85ab69b 100644 --- a/.github/workflows/weeklies.yml +++ b/.github/workflows/weeklies.yml @@ -7,44 +7,35 @@ on: workflow_dispatch: -permissions: - id-token: write - contents: read - packages: write - jobs: upgrade_uv_lock: - runs-on: ubuntu-latest + runs-on: linux.g5.4xlarge.nvidia.gpu + environment: pytorchbot-env + container: + image: docker.io/pytorch/manylinux2_28-builder:cuda12.8 + options: --gpus all + env: + CUDA_HOME: /usr/local/cuda-12.8 + VERSION_SUFFIX: cu128 + CU_VERSION: cu128 timeout-minutes: 120 steps: - - name: Clean workspace - shell: bash -l {0} - run: | - set -euxo pipefail - echo "::group::Cleanup debug output" - rm -rf "${GITHUB_WORKSPACE}" - mkdir -p "${GITHUB_WORKSPACE}" - - if [[ "${{ inputs.architecture }}" = "aarch64" ]]; then - rm -rf "${RUNNER_TEMP}/*" - fi - echo "::endgroup::" - - name: Checkout repository + - name: Checkout Repository uses: actions/checkout@v4 with: repository: pytorch/tensorrt ref: main - fetch-depth: -1 - path: pytorch/tensorrt - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' + token: ${{ secrets.GH_PYTORCHBOT_TOKEN }} - name: Install uv and upgrade lock file run: | set -euo pipefail set -x python -m pip install uv + echo "github.ref_name: ${{ github.ref_name }}" + echo "github.head_ref: ${{ github.head_ref }}" + pwd + ls -lart + git config --global --add safe.directory /__w/TensorRT/TensorRT uv sync --upgrade - name: Create Branch and Commit changes id: commit @@ -81,4 +72,8 @@ jobs: assignees: "lanl@nvidia.com" # Add your team's GitHub usernames reviewers: "lanl@nvidia.com" # Add reviewers if desired commit-message: "chore(deps): weekly automated upgrade via uv" # Keep the commit we already made - delete-branch: true # Auto-delete branch after merge \ No newline at end of file + delete-branch: true # Auto-delete branch after merge + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }} + cancel-in-progress: true \ No newline at end of file