Skip to content

Commit a5dd4c1

Browse files
committed
Merge branch 'add_link_checker' of github.com:rgsl888prabhu/cuopt_public into add_link_checker
2 parents f2a0916 + 66c38e6 commit a5dd4c1

File tree

23 files changed

+1128
-230
lines changed

23 files changed

+1128
-230
lines changed

.github/workflows/build.yaml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -207,23 +207,12 @@ jobs:
207207
date: ${{ inputs.date }}
208208
package-name: cuopt_sh_client
209209
package-type: python
210-
service-container:
211-
if: inputs.build_type == 'nightly'
212-
needs: [wheel-build-cuopt, wheel-build-cuopt-server]
213-
runs-on: ubuntu-latest
214-
steps:
215-
- name: Checkout code repo
216-
uses: actions/checkout@v3
217-
with:
218-
ref: ${{ inputs.sha }}
219-
fetch-depth: 0 # unshallow fetch for setuptools-scm
220-
persist-credentials: false
221-
- name: build service
222-
env:
223-
GH_TOKEN: ${{ github.token }}
224-
run: |
225-
gh workflow run service_nightly.yaml \
226-
-f branch=${{ inputs.branch }} \
227-
-f sha=${{ inputs.sha }} \
228-
-f date=${{ inputs.date }} \
229-
-f build_type=${{ inputs.build_type }}
210+
build-images:
211+
needs: [wheel-publish-cuopt, wheel-publish-cuopt-server]
212+
uses: ./.github/workflows/build_test_publish_images.yaml
213+
secrets: inherit
214+
with:
215+
branch: ${{ inputs.branch }}
216+
sha: ${{ inputs.sha }}
217+
date: ${{ inputs.date }}
218+
build_type: ${{ inputs.build_type || 'branch' }}
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: Build and push image variant
17+
18+
on:
19+
workflow_call:
20+
inputs:
21+
ARCHES:
22+
required: true
23+
type: string
24+
CUDA_VER:
25+
required: true
26+
type: string
27+
CUOPT_VER:
28+
required: true
29+
type: string
30+
IMAGE_TAG_PREFIX:
31+
required: true
32+
type: string
33+
LINUX_VER:
34+
required: true
35+
type: string
36+
PYTHON_VER:
37+
required: true
38+
type: string
39+
40+
jobs:
41+
build:
42+
strategy:
43+
matrix:
44+
ARCH: ["${{ inputs.ARCHES }}"]
45+
CUDA_VER: ["${{ inputs.CUDA_VER }}"]
46+
PYTHON_VER: ["${{ inputs.PYTHON_VER }}"]
47+
LINUX_VER: ["${{ inputs.LINUX_VER }}"]
48+
fail-fast: false
49+
runs-on: "linux-${{ matrix.ARCH }}-cpu4"
50+
steps:
51+
- name: Checkout code repo
52+
uses: actions/checkout@v4
53+
with:
54+
fetch-depth: 0
55+
- name: Login to DockerHub
56+
uses: docker/login-action@v3
57+
with:
58+
username: ${{ secrets.CUOPT_DOCKERHUB_USERNAME }}
59+
password: ${{ secrets.CUOPT_DOCKERHUB_TOKEN }}
60+
- name: Copy License and Version files
61+
run: |
62+
cp ./LICENSE ./ci/docker/context/LICENSE
63+
cp ./VERSION ./ci/docker/context/VERSION
64+
cp ./thirdparty/THIRD_PARTY_LICENSES ./ci/docker/context/THIRD_PARTY_LICENSES
65+
- name: Login to NGC
66+
uses: docker/login-action@v3
67+
with:
68+
registry: "nvcr.io"
69+
username: "$oauthtoken"
70+
password: ${{ secrets.CUOPT_NGC_DOCKER_KEY }}
71+
- name: Set up Docker Context for Buildx
72+
id: buildx-context
73+
run: |
74+
docker context create builders
75+
- name: Set up Docker Buildx
76+
uses: docker/setup-buildx-action@v3
77+
with:
78+
driver: docker
79+
endpoint: ./ci/docker/context
80+
- name: Trim CUDA and Python versions
81+
id: trim
82+
run: |
83+
echo "CUDA_SHORT=$(echo '${{ inputs.CUDA_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT
84+
echo "PYTHON_SHORT=$(echo '${{ inputs.PYTHON_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT
85+
- name: Build image and push to DockerHub and NGC
86+
uses: docker/build-push-action@v6
87+
with:
88+
context: ./ci/docker/context
89+
file: ./ci/docker/Dockerfile
90+
push: true
91+
pull: true
92+
build-args: |
93+
CUDA_VER=${{ inputs.CUDA_VER }}
94+
PYTHON_SHORT_VER=${{ steps.trim.outputs.PYTHON_SHORT }}
95+
CUOPT_VER=${{ inputs.CUOPT_VER }}
96+
LINUX_VER=${{ inputs.LINUX_VER }}
97+
tags: nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-py${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }}
98+
99+
- name: Push image to NGC
100+
run: |
101+
docker tag nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-py${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }} nvcr.io/nvstaging/nvaie/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-py${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }}
102+
docker push nvcr.io/nvstaging/nvaie/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-py${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }}
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: Build, Test and Publish cuopt images
17+
18+
on:
19+
workflow_call:
20+
inputs:
21+
branch:
22+
type: string
23+
date:
24+
type: string
25+
sha:
26+
type: string
27+
build_type:
28+
type: string
29+
arch:
30+
type: string
31+
default: '["amd64", "arm64"]'
32+
description: 'JSON array of architectures to build for'
33+
cuda_ver:
34+
type: string
35+
default: '["12.8.0"]'
36+
description: 'JSON array of CUDA versions to build for'
37+
python_ver:
38+
type: string
39+
default: '["3.12.11"]'
40+
description: 'JSON array of Python versions to build for'
41+
linux_ver:
42+
type: string
43+
default: '["22.04"]'
44+
description: 'JSON array of Linux versions to build for'
45+
46+
47+
defaults:
48+
run:
49+
shell: bash
50+
51+
permissions:
52+
actions: read
53+
checks: none
54+
contents: read
55+
deployments: none
56+
discussions: none
57+
id-token: write
58+
issues: none
59+
packages: read
60+
pages: none
61+
pull-requests: read
62+
repository-projects: none
63+
security-events: none
64+
statuses: none
65+
66+
jobs:
67+
compute-matrix:
68+
runs-on: ubuntu-latest
69+
container:
70+
image: rapidsai/ci-conda:25.08-latest
71+
outputs:
72+
MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }}
73+
CUOPT_VER: ${{ steps.compute-cuopt-ver.outputs.CUOPT_VER }}
74+
IMAGE_TAG_PREFIX: ${{ steps.compute-cuopt-ver.outputs.IMAGE_TAG_PREFIX }}
75+
76+
steps:
77+
- name: Checkout
78+
uses: actions/checkout@v4
79+
with:
80+
fetch-depth: 0 # unshallow fetch for setuptools-scm
81+
persist-credentials: false
82+
83+
- name: Compute matrix
84+
id: compute-matrix
85+
run: |
86+
MATRIX=$(jq -c '.' <<EOF
87+
{
88+
"arch": ${{ inputs.arch }},
89+
"cuda_ver": ${{ inputs.cuda_ver }},
90+
"python_ver": ${{ inputs.python_ver }},
91+
"linux_ver": ${{ inputs.linux_ver }}
92+
}
93+
EOF
94+
)
95+
echo "MATRIX=$MATRIX" >> $GITHUB_OUTPUT
96+
97+
- name: Install gha-tools
98+
run: |
99+
mkdir -p /tmp/gha-tools
100+
curl -s -L 'https://github.com/rapidsai/gha-tools/releases/latest/download/tools.tar.gz' | tar -xz -C /tmp/gha-tools
101+
echo "/tmp/gha-tools" >> "${GITHUB_PATH}"
102+
103+
- name: Compute cuopt version
104+
id: compute-cuopt-ver
105+
run: |
106+
ver=$(rapids-generate-version)
107+
# Remove starting 0s from version 25.08.0a18 -> 25.8.0a18
108+
CUOPT_VER=$(echo "$ver" | sed -E 's/\.0+([0-9])/\.\1/g')
109+
echo "CUOPT_VER=$CUOPT_VER" >> $GITHUB_OUTPUT
110+
if rapids-is-release-build; then
111+
IMAGE_TAG_PREFIX="$CUOPT_VER"
112+
else
113+
IMAGE_TAG_PREFIX=$(echo "$CUOPT_VER" | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+)a.*/\1a/')
114+
fi
115+
echo "IMAGE_TAG_PREFIX=$IMAGE_TAG_PREFIX" >> $GITHUB_OUTPUT
116+
117+
build-images:
118+
name: Build images
119+
needs: compute-matrix
120+
secrets: inherit
121+
strategy:
122+
matrix: ${{ fromJson(needs.compute-matrix.outputs.MATRIX) }}
123+
uses: ./.github/workflows/build_images.yaml
124+
with:
125+
ARCHES: ${{ matrix.arch }}
126+
CUDA_VER: ${{ matrix.cuda_ver }}
127+
CUOPT_VER: ${{ needs.compute-matrix.outputs.CUOPT_VER }}
128+
IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }}
129+
LINUX_VER: ${{ matrix.linux_ver }}
130+
PYTHON_VER: ${{ matrix.python_ver }}
131+
132+
build-cuopt-multiarch-manifest:
133+
name: Build cuopt multiarch manifest
134+
needs: [build-images, compute-matrix]
135+
strategy:
136+
matrix:
137+
CUDA_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }}
138+
PYTHON_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).python_ver }}
139+
runs-on: ubuntu-latest
140+
steps:
141+
- name: Checkout code repo
142+
uses: actions/checkout@v4
143+
with:
144+
fetch-depth: 0
145+
- name: Login to DockerHub
146+
uses: docker/login-action@v3
147+
with:
148+
username: ${{ secrets.CUOPT_DOCKERHUB_USERNAME }}
149+
password: ${{ secrets.CUOPT_DOCKERHUB_TOKEN }}
150+
- name: Login to NGC
151+
uses: docker/login-action@v3
152+
with:
153+
registry: "nvcr.io"
154+
username: "$oauthtoken"
155+
password: ${{ secrets.CUOPT_NGC_DOCKER_KEY }}
156+
- name: Trim CUDA and Python versions
157+
id: trim
158+
run: |
159+
echo "CUDA_SHORT=$(echo '${{ matrix.CUDA_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT
160+
echo "PYTHON_SHORT=$(echo '${{ matrix.PYTHON_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT
161+
- name: Create multiarch manifest
162+
shell: bash
163+
env:
164+
CUOPT_VER: ${{ needs.compute-matrix.outputs.CUOPT_VER }}
165+
CUDA_SHORT: ${{ steps.trim.outputs.CUDA_SHORT }}
166+
PYTHON_SHORT: ${{ steps.trim.outputs.PYTHON_SHORT }}
167+
IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }}
168+
BUILD_TYPE: ${{ inputs.build_type }}
169+
run: bash ci/docker/create_multiarch_manifest.sh
170+
171+
test-images:
172+
name: Test images
173+
needs: [build-cuopt-multiarch-manifest, compute-matrix]
174+
secrets: inherit
175+
strategy:
176+
matrix:
177+
CUDA_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }}
178+
PYTHON_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).python_ver }}
179+
ARCH: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).arch }}
180+
uses: ./.github/workflows/test_images.yaml
181+
with:
182+
ARCH: ${{ matrix.ARCH }}
183+
CUDA_VER: ${{ matrix.CUDA_VER }}
184+
PYTHON_VER: ${{ matrix.PYTHON_VER }}
185+
IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }}

.github/workflows/nightly.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
include:
1515
- cuopt_version: "25.08"
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- name: Trigger Pipeline
1919
env:
2020
GH_TOKEN: ${{ github.token }}
@@ -61,7 +61,7 @@ jobs:
6161
include:
6262
- cuopt_version: "25.08"
6363
steps:
64-
- uses: actions/checkout@v3
64+
- uses: actions/checkout@v4
6565
- name: Trigger Test
6666
env:
6767
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)