Skip to content
Closed
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
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ jobs:
date: ${{ inputs.date }}
package-name: cuopt_sh_client
package-type: python
service-container:
if: inputs.build_type == 'nightly'
build-images:
if: inputs.build_type == 'nightly' || inputs.build_type == 'release'
needs: [wheel-build-cuopt, wheel-build-cuopt-server]
runs-on: ubuntu-latest
steps:
Expand All @@ -206,7 +206,7 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
gh workflow run service_nightly.yaml \
gh workflow run build_test_publish_images.yml \
-f branch=${{ inputs.branch }} \
-f sha=${{ inputs.sha }} \
-f date=${{ inputs.date }} \
Expand Down
92 changes: 92 additions & 0 deletions .github/workflows/build_images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# 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: Build and push image variant

on:
workflow_call:
inputs:
ARCHES:
required: true
type: string
CUDA_VER:
required: true
type: string
PYTHON_VER:
required: true
type: string
CUOPT_VER:
required: true
type: string
IMAGE_TAG_PREFIX:
required: true
type: string

jobs:
build:
strategy:
matrix:
ARCH: ${{ fromJSON(inputs.ARCHES) }}
CUDA_VER: ["${{ inputs.CUDA_VER }}"]
PYTHON_VER: ["${{ inputs.PYTHON_VER }}"]
CUOPT_VER: ["${{ inputs.CUOPT_VER }}"]
fail-fast: false
runs-on: "linux-${{ matrix.ARCH }}-cpu4"
steps:
- name: Checkout code repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.CUOPT_DOCKERHUB_USERNAME }}
password: ${{ secrets.CUOPT_DOCKERHUB_TOKEN }}
- name: Login to NGC
uses: docker/login-action@v3
with:
registry: "nvcr.io"
username: "$oauthtoken"
password: ${{ secrets.CUOPT_NGC_DOCKER_KEY }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
# Using the built-in config from NVIDIA's self-hosted runners means that 'docker build'
# will use NVIDIA's self-hosted DockerHub pull-through cache, which should mean faster builds,
# fewer network failures, and fewer rate-limiting issues
buildkitd-config: /etc/buildkit/buildkitd.toml
driver: docker
endpoint: builders
- name: Build image and push to DockerHub and NGC
uses: docker/build-push-action@v6
with:
context: context
file: ./ci/docker/Dockerfile
target: cuopt
push: true
pull: true
build-args: |
CUDA_VER=${{ inputs.CUDA_VER }}
PYTHON_VER=${{ inputs.PYTHON_VER }}
CUOPT_VER=${{ inputs.CUOPT_VER }}
tags: nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ inputs.CUDA_VER }}-${{ matrix.PYTHON_VER }}-${{ matrix.ARCH }}

- name: Push image to NGC
run: |
docker tag nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ inputs.CUDA_VER }}-${{ matrix.PYTHON_VER }}-${{ matrix.ARCH }} nvcr.io/nvstaging/nvaie/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ inputs.CUDA_VER }}-${{ matrix.PYTHON_VER }}-${{ matrix.ARCH }}
docker push nvcr.io/nvstaging/nvaie/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ inputs.CUDA_VER }}-${{ matrix.PYTHON_VER }}-${{ matrix.ARCH }}



138 changes: 138 additions & 0 deletions .github/workflows/build_test_publish_images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# 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: Build, Test and Publish cuopt images

on:
workflow_dispatch:
inputs:
branch:
type: string
date:
type: string
sha:
type: string
build_type:
type: string

defaults:
run:
shell: bash

permissions:
actions: read
checks: none
contents: read
deployments: none
discussions: none
id-token: write
issues: none
packages: read
pages: none
pull-requests: read
repository-projects: none
security-events: none
statuses: none

jobs:
compute-matrix:
runs-on: ubuntu-latest
container:
image: rapidsai/ci-conda:latest
outputs:
MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }}
CUOPT_VER: ${{ steps.compute-cuopt-ver.outputs.CUOPT_VER }}
IMAGE_TAG_PREFIX: ${{ steps.compute-cuopt-ver.outputs.IMAGE_TAG_PREFIX }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # unshallow fetch for setuptools-scm
persist-credentials: false

- name: Compute matrix
id: compute-matrix
run: |
MATRIX=$(cat <<EOF
arch: [amd64, arm64]
cuda_ver: [12.8.0]
python_ver: [3.12.11]
EOF
)
echo "MATRIX=${MATRIX}" >> $GITHUB_OUTPUT

- name: Install gha-tools
run: |
mkdir -p /tmp/gha-tools
curl -s -L 'https://github.com/rapidsai/gha-tools/releases/latest/download/tools.tar.gz' | tar -xz -C /tmp/gha-tools
echo "/tmp/gha-tools" >> "${GITHUB_PATH}"

- name: Compute cuopt version
id: compute-cuopt-ver
run: |
ver=$(rapids-generate-version)
CUOPT_VER=$(echo "$ver" | sed -E 's/^v//' \
| sed -E 's/\.0+([0-9])/\.\1/g' \
| sed -E 's/\.0+([a-zA-Z].*)/.0\1/g' \
| sed -E 's/\b0*([0-9]+)\b/\1/g')
echo "$CUOPT_VER" >> $GITHUB_OUTPUT
if [[ "$CUOPT_VER" == *"a"* ]]; then
IMAGE_TAG_PREFIX=$(echo "$CUOPT_VER" | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+)a.*/\1a/')
else
IMAGE_TAG_PREFIX="$CUOPT_VER"
fi
build-images:
name: Build images for ${inputs.arch} architecture
needs: compute-matrix
strategy:
matrix: ${{ fromJson(needs.compute-matrix.outputs.MATRIX) }}
uses: ./.github/workflows/build-images.yaml
with:
ARCHES: ${{ matrix.arch }}
CUDA_VER: ${{ matrix.cuda_ver }}
PYTHON_VER: ${{ matrix.python_ver }}
CUOPT_VER: ${{ steps.compute-cuopt-ver.outputs.CUOPT_VER }}
IMAGE_TAG_PREFIX: ${{ steps.compute-cuopt-ver.outputs.IMAGE_TAG_PREFIX }}

build-cuopt-multiarch-manifest:
name: Build cuopt multiarch manifest
needs: build-images
runs-on: ubuntu-latest
steps:
- name: Checkout code repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.CUOPT_DOCKERHUB_USERNAME }}
password: ${{ secrets.CUOPT_DOCKERHUB_PASSWORD }}
- name: Login to NGC
uses: docker/login-action@v3
with:
username: ${{ secrets.CUOPT_NGC_USERNAME }}
password: ${{ secrets.CUOPT_NGC_PASSWORD }}
- name: Create multiarch manifest
shell: bash
env:
CUOPT_VER: ${{ steps.compute-cuopt-ver.outputs.CUOPT_VER }}
CUDA_VER: ${{ matrix.cuda_ver }}
PYTHON_VER: ${{ matrix.python_ver }}
IMAGE_TAG_PREFIX: ${{ steps.compute-cuopt-ver.outputs.IMAGE_TAG_PREFIX }}
ARCH: ${{ matrix.arch }}

run: ci/docker/create_multiarch_manifest.sh
Loading
Loading