Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 204 additions & 0 deletions .github/workflows/_update_dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: ~Update dependencies template
on:
workflow_call:
inputs:
target-branch:
required: true
type: string
description: "The target branch to bump"
secrets:
PAT:
required: true
AZURE_CLIENT_ID:
required: true
AZURE_TENANT_ID:
required: true
AZURE_SUBSCRIPTION_ID:
required: true
SSH_KEY:
required: true
SSH_PWD:
required: true
workflow_dispatch:
inputs:
target-branch:
required: true
type: string
description: "The target branch to bump"
default: "main"

jobs:
pre-flight:
runs-on: ubuntu-latest
outputs:
bump-branch: bump-ci-container-${{ steps.ref.outputs.date }}-${{ inputs.target-branch || github.event.inputs.target-branch }}
date: ${{ steps.ref.outputs.date }}
steps:
- name: Get date
id: ref
run: echo "date=$(date +%F)" | tee -a "$GITHUB_OUTPUT"

update-lockfile:
environment: nemo-ci
runs-on: linux-amd64-cpu16
needs: [pre-flight]
env:
SOURCE_BRANCH: ${{ needs.pre-flight.outputs.bump-branch }}
TARGET_BRANCH: ${{ inputs.target-branch || github.event.inputs.target-branch }}
steps:
- name: Free up disk space BEFORE pulling container
run: |
echo "Disk space before cleanup:"
df -h
# Remove unnecessary files from the runner
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf /usr/local/share/boost
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo apt-get remove -y '^dotnet-.*' '^llvm-.*' 'php.*' '^mongodb-.*' '^mysql-.*' azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri || true
sudo apt-get autoremove -y
sudo apt-get clean
sudo docker system prune -a -f
echo "Disk space after cleanup:"
df -h

- name: Install Azure CLI
run: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

- name: Azure Login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Azure ACR Login
run: az acr login --name nemoci

- name: Checkout repo (TARGET_BRANCH for branch creation)
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
ref: ${{ env.TARGET_BRANCH }}
submodules: recursive

- name: Build container
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to build the container to update the uv lock file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After our meeting/conversation: Understood context .

Thank you for your feedback and suggestion I took a look at this

Yes . Please refer to new PR based on all the changes here, building on top. This PR to close in favor of the new one. Refer to: #1307

env:
GH_TOKEN: ${{ secrets.PAT }}
run: |
docker build -f docker/Dockerfile -t ray-curator .

- name: Configure git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

- name: Create bump branch if not exists
env:
GH_TOKEN: ${{ secrets.PAT }}
run: |
if ! git ls-remote --exit-code origin $SOURCE_BRANCH; then
git checkout -b $SOURCE_BRANCH $TARGET_BRANCH
git push https://token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git $SOURCE_BRANCH
fi

- name: Checkout repo
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
ref: ${{ env.SOURCE_BRANCH }}
submodules: recursive

- name: Upgrade lock file
env:
GH_TOKEN: ${{ secrets.PAT }}
run: |
docker run \
--rm \
-v $(pwd):/workspace \
-w /workspace \
-e GH_TOKEN=${{ secrets.PAT }} \
ray-curator \
bash -c 'cd /workspace && uv lock --upgrade'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please test out running this on cpu in a venv

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes . Please refer to new PR based on all the changes here, building on top. This PR to close in favor of the new one. Refer to: #1307


- name: Upload lock file
uses: actions/upload-artifact@v4
with:
name: lock-file-${{ env.SOURCE_BRANCH }}
path: uv.lock

create-pr:
needs: [update-lockfile, pre-flight]
runs-on: ubuntu-latest
environment: main
env:
SOURCE_BRANCH: ${{ needs.pre-flight.outputs.bump-branch }}
TARGET_BRANCH: ${{ inputs.target-branch || github.event.inputs.target-branch }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
ref: ${{ env.TARGET_BRANCH }}

- name: Install GPG
run: sudo apt-get install -y gnupg2

- name: Import GPG key (for signing)
uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec
id: gpg-action
with:
gpg_private_key: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.SSH_PWD }}
git_user_signingkey: true
git_commit_gpgsign: true

- name: Rebase against ${{ env.SOURCE_BRANCH }}
run: |
if git ls-remote --exit-code origin ${{ env.SOURCE_BRANCH }}; then
git fetch origin ${{ env.SOURCE_BRANCH }}
git rebase -S origin/${{ env.SOURCE_BRANCH }}
fi

- name: Download lock file
uses: actions/download-artifact@v4
with:
name: lock-file-${{ env.SOURCE_BRANCH }}

- name: Create Bump PR
uses: peter-evans/create-pull-request@v6
id: create-pull-request
env:
title: "chore(beep boop 🤖): Bump `uv.lock` (${{ inputs.target-branch || github.event.inputs.target-branch }}) (${{ needs.pre-flight.outputs.date }})"
with:
branch: ${{ env.SOURCE_BRANCH }}
base: ${{ env.TARGET_BRANCH }}
title: ${{ env.title }}
token: ${{ secrets.PAT }}
body: |
🚀 PR to bump `uv.lock` in `${{ inputs.target-branch || github.event.inputs.target-branch }}`.

📝 Please remember the following to-do's before merge:
- [ ] Verify the presubmit CI

🙏 Please merge this PR only if the CI workflow completed successfully.
commit-message: ${{ env.title }}
signoff: true
committer: "${{ steps.gpg-action.outputs.name }} <${{ steps.gpg-action.outputs.email }}>"

78 changes: 78 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Dependabot
on:
schedule:
- cron: "0 8 * * 1" # Run at 8 AM UTC on Mondays
workflow_dispatch: # Allow manual triggering

permissions:
id-token: write
contents: write

jobs:
get-release-branch-names:
runs-on: ubuntu-latest
environment: nemo-ci
outputs:
curator: ${{ steps.get-branch.outputs.curator_release_branch }}
steps:
- name: Get release branch names
id: get-branch
env:
PAT: ${{ secrets.PAT }}
run: |
latest_branch=$(git ls-remote --heads https://token:${PAT}@github.com/NVIDIA-NeMo/Curator.git 'refs/heads/r*' |
grep -o 'r[0-9]\+\.[0-9]\+\.[0-9]\+' |
sort -V |
tail -n1)
echo "curator_release_branch=$latest_branch" >> $GITHUB_OUTPUT

bump-tags:
needs: [get-release-branch-names]
strategy:
fail-fast: false
matrix:
include:
- target-branch: ${{ needs.get-release-branch-names.outputs.curator }}
- target-branch: main
uses: ./.github/workflows/_update_dependencies.yml
with:
target-branch: ${{ matrix.target-branch }}
secrets:
PAT: ${{ secrets.PAT }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_PWD: ${{ secrets.SSH_PWD }}

notify:
if: failure()
runs-on: ubuntu-latest
needs: [bump-tags]
steps:
- name: Notify
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does this slack message go?

Copy link
Contributor Author

@pablo-garay pablo-garay Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will go to
swdl-nemo-curator-github-ci-alerts
same as other ones unless we decide to do something else

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refer to new PR based on all the changes here, building on top. This PR to close in favor of the new one. Refer to: #1307

SLACK_WEBHOOK_ADMIN: <!subteam^${{ secrets.SLACK_WEBHOOK_ADMIN }}>
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: |
curl -X POST \
-H 'Content-type: application/json' \
--data "{\"text\":\":robot_joy: <https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}|Dependabot workflow> failed. Please fix manually.\n\ncc ${SLACK_WEBHOOK_ADMIN}\"}" \
$SLACK_WEBHOOK