diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4c7458727d..79a2ffee6c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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: @@ -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 }} \ diff --git a/.github/workflows/build_images.yml b/.github/workflows/build_images.yml new file mode 100644 index 0000000000..842b313a1f --- /dev/null +++ b/.github/workflows/build_images.yml @@ -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 }} + + + diff --git a/.github/workflows/build_test_publish_images.yml b/.github/workflows/build_test_publish_images.yml new file mode 100644 index 0000000000..4a7e321710 --- /dev/null +++ b/.github/workflows/build_test_publish_images.yml @@ -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 <> $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 \ No newline at end of file diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index d21d8e4d3c..7db270e1e3 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -10,226 +10,22 @@ concurrency: cancel-in-progress: true jobs: - pr-builder: - needs: - - changed-files - - checks - - conda-cpp-build - - conda-cpp-tests - - conda-python-build - - conda-python-tests - - wheel-build-libcuopt - # - conda-notebook-tests - - wheel-build-cuopt - - wheel-tests-cuopt - - wheel-build-cuopt-server - - wheel-tests-cuopt-server - - wheel-build-cuopt-mps-parser - - wheel-build-cuopt-sh-client - - test-self-hosted-server - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-25.08 - changed-files: - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/changed-files.yaml@branch-25.08 - with: - files_yaml: | - test_cpp: - - '**' - - '!CONTRIBUTING.md' - - '!README.md' - - '!ci/release/update-version-cuopt.sh' - - '!ci/release/update-version-rapids.sh' - - '!docs/**' - - '!img/**' - - '!notebooks/**' - - '!python/**' - - '!readme_pages/**' - - '!container-builder/**' - - '!helm-chart/**' - - '!ngc/**' - - '!omniverse/**' - - '!regression/**' - - '!resources/**' - - '!ucf/**' - - '!utilities/**' - test_notebooks: - - '**' - - '!CONTRIBUTING.md' - - '!README.md' - - '!ci/release/update-version-cuopt.sh' - - '!ci/release/update-version-rapids.sh' - - '!docs/**' - - '!python/nvcf_client/**' - test_python: - - '**' - - '!CONTRIBUTING.md' - - '!README.md' - - '!ci/release/update-version-cuopt.sh' - - '!ci/release/update-version-rapids.sh' - - '!docs/**' - - '!img/**' - - '!notebooks/**' - - '!python/nvcf_client/**' - test_python_cuopt: - - '**' - - '!CONTRIBUTING.md' - - '!README.md' - - '!ci/release/update-version-cuopt.sh' - - '!ci/release/update-version-rapids.sh' - - '!docs/**' - - '!img/**' - - '!notebooks/**' - - '!python/cuopt_self_hosted/**' - - '!python/cuopt_server/**' - - '!python/nvcf_client/**' - test_python_cuopt_server: - - '**' - - '!CONTRIBUTING.md' - - '!README.md' - - '!ci/release/update-version-cuopt.sh' - - '!ci/release/update-version-rapids.sh' - - '!docs/**' - - '!img/**' - - '!notebooks/**' - - '!python/cuopt_self_hosted/**' - - '!python/nvcf_client/**' - checks: - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-25.08 - with: - enable_check_generated_files: false - - conda-cpp-build: - needs: checks - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-25.08 - with: - build_type: pull-request - matrix_filter: map(select((.CUDA_VER | startswith("12")))) - script: ci/build_cpp.sh - conda-cpp-tests: - needs: [conda-cpp-build, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-25.08 - #if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp - with: - build_type: pull-request - matrix_filter: map(select((.CUDA_VER | startswith("12")))) - script: ci/test_cpp.sh - conda-python-build: - needs: conda-cpp-build - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-25.08 - with: - build_type: pull-request - matrix_filter: map(select((.CUDA_VER | startswith("12")))) - script: ci/build_python.sh - conda-python-tests: - needs: [conda-python-build, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-25.08 - #if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python - with: - run_codecov: false - build_type: pull-request - matrix_filter: map(select((.CUDA_VER | startswith("12")))) - script: ci/test_python.sh - #docs-build: - # needs: checks - # secrets: inherit - # uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-25.08 - # with: - # build_type: pull-request - # node_type: "cpu4" - # arch: amd64 - # container_image: rapidsai/ci-conda:cuda11.8.0-ubuntu22.04-py3.10 - # run_script: ci/build_docs.sh - #conda-notebook-tests: - # needs: [conda-python-build, changed-files] - # secrets: inherit - # uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-25.08 - # #if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_notebooks - # with: - # build_type: pull-request - # node_type: "gpu-l4-latest-1" - # arch: "amd64" - # container_image: "rapidsai/ci-conda:cuda11.8.0-ubuntu22.04-py3.10" - # run_script: "ci/test_notebooks.sh" - wheel-build-cuopt-mps-parser: - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-25.08 - with: - build_type: pull-request - script: ci/build_wheel_cuopt_mps_parser.sh - package-name: cuopt_mps_parser - package-type: python - append-cuda-suffix: false - matrix_filter: map(select((.CUDA_VER | startswith("12")))) - wheel-build-libcuopt: - needs: wheel-build-cuopt-mps-parser - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-25.08 - with: - # build for every combination of arch and CUDA version, but only for the latest Python - matrix_filter: map(select((.CUDA_VER | startswith("12")) and .PY_VER == "3.12")) - package-type: cpp - package-name: libcuopt - build_type: pull-request - script: ci/build_wheel_libcuopt.sh - wheel-build-cuopt: - needs: [wheel-build-cuopt-mps-parser, wheel-build-libcuopt] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-25.08 - with: - build_type: pull-request - script: ci/build_wheel_cuopt.sh - package-name: cuopt - package-type: python - matrix_filter: map(select((.CUDA_VER | startswith("12")))) - wheel-tests-cuopt: - needs: [wheel-build-cuopt, wheel-build-cuopt-mps-parser, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-25.08 - #if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_cuopt - with: - build_type: pull-request - script: ci/test_wheel_cuopt.sh - matrix_filter: map(select((.CUDA_VER | startswith("12")))) - wheel-build-cuopt-server: - needs: wheel-build-cuopt - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-25.08 - with: - build_type: pull-request - script: ci/build_wheel_cuopt_server.sh - package-name: cuopt_server - package-type: python - matrix_filter: map(select((.CUDA_VER | startswith("12")))) - wheel-build-cuopt-sh-client: - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-25.08 - with: - build_type: pull-request - script: ci/build_wheel_cuopt_sh_client.sh - matrix_filter: map(select((.CUDA_VER | startswith("12")))) - package-name: cuopt_sh_client - package-type: python - append-cuda-suffix: false - wheel-tests-cuopt-server: - needs: [wheel-build-cuopt-server, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-25.08 - #if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_cuopt_server - with: - build_type: pull-request - script: ci/test_wheel_cuopt_server.sh - matrix_filter: map(select((.CUDA_VER | startswith("12")))) - test-self-hosted-server: - needs: [wheel-build-cuopt-server, changed-files] - secrets: inherit - uses: ./.github/workflows/self_hosted_service_test.yaml - #if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python - with: - build_type: pull-request - script: ci/test_self_hosted_service.sh + build-images: + runs-on: ubuntu-latest + steps: + - name: Checkout code repo + uses: actions/checkout@v3 + with: + ref: ${{ inputs.sha }} + fetch-depth: 0 # unshallow fetch for setuptools-scm + persist-credentials: false + - name: build service + env: + GH_TOKEN: ${{ github.token }} + run: | + gh workflow run build_test_publish_images.yml --repo NVIDIA/cuopt \ + --ref add_nightly_container_support \ + -f branch="branch-25.08" \ + -f sha="e0dc603" \ + -f date="2025-07-02" \ + -f build_type="nightly" diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile new file mode 100644 index 0000000000..e766e1919d --- /dev/null +++ b/ci/docker/Dockerfile @@ -0,0 +1,117 @@ +# syntax=docker/dockerfile:1.2 +# SPDX-FileCopyrightText: Copyright (c) 2023-2024 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. + +ARG CUDA_VER=12.8.0 +ARG CUOPT_VER=25.8.0 +ARG PYTHON_VER=3.12.11 +ARG PYTHON_SHORT_VER=3.12 + +FROM nvidia/cuda:${CUDA_VER}-runtime-ubuntu22.04 AS cuda-libs + +# Install cuOpt +FROM nvidia/cuda:${CUDA_VER}-base-ubuntu22.04 AS python-env + +ARG CUDA_VER +ARG CUOPT_VER +ARG PYTHON_VER + +RUN apt-get update && apt-get install -y \ + wget \ + git \ + gcc \ + build-essential \ + zlib1g-dev \ + libncurses5-dev \ + libgdbm-dev \ + libnss3-dev \ + libssl-dev \ + libreadline-dev \ + libffi-dev \ + libsqlite3-dev \ + libbz2-dev \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +RUN wget https://www.python.org/ftp/python/${PYTHON_VER}/Python-${PYTHON_VER}.tgz \ + && tar xzf Python-${PYTHON_VER}.tgz \ + && cd Python-${PYTHON_VER} \ + && ./configure --enable-optimizations \ + && make -j$(nproc) \ + && make install \ + && cd .. \ + && rm -rf Python-${PYTHON_VER} Python-${PYTHON_VER}.tgz \ + && python3 -m pip install --upgrade pip + +RUN apt-get purge -y \ + build-essential \ + zlib1g-dev \ + libncurses5-dev \ + libgdbm-dev \ + libnss3-dev \ + libssl-dev \ + libreadline-dev \ + libffi-dev \ + libsqlite3-dev \ + libbz2-dev \ + && apt-get autoremove -y \ + && apt-get clean + +RUN ln -sf /usr/local/bin/python3 /usr/local/bin/python +RUN groupadd -r cuopt && useradd -r -g cuopt cuopt +RUN chown -R cuopt:cuopt /usr/local/lib/python3.12/site-packages +USER cuopt + +FROM python-env AS install-env + +WORKDIR /home/cuopt + +ARG cuda-suffix=cu$(echo ${CUDA_VER} | cut -d'.' -f1) +ARG CUOPT_VERSION + +ENV PIP_EXTRA_INDEX_URL="https://pypi.nvidia.com https://pypi.anaconda.org/rapidsai-wheels-nightly/simple" + +SHELL ["/bin/bash", "-c"] +RUN if [[ "${CUDA_VER}" =~ ^12\. ]]; then \ + cuda_suffix="cu12"; \ + python -m pip install nvidia-cuda-runtime-cu12==$(echo ${CUDA_VER} | cut -d'.' -f1-2).*; \ + fi && \ + python -m pip install --user --no-cache-dir cuopt-server-${cuda_suffix}==${CUOPT_VER} cuopt-sh-client==${CUOPT_VER} && \ + python -m pip list + +USER root + +RUN apt-get purge -y gcc git \ + && apt-get update \ + && apt-get install -y unzip \ + && apt-get autoremove -y \ + && apt-get clean + +USER cuopt + +COPY ./LICENSE /home/cuopt/LICENSE +COPY ./VERSION /home/cuopt/VERSION + +FROM install-env AS cuopt-final + +ARG PYTHON_SHORT_VER + +ENV PATH="/usr/local/cuda/bin:/usr/bin:/usr/local/bin:/usr/local/nvidia/bin/:/home/cuopt/.local/lib/python3.12/site-packages/libcuopt/bin/:/home/cuopt/.local/bin:$PATH" +ENV LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:/usr/lib/aarch64-linux-gnu:/usr/local/cuda/lib64:/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/lib/wsl/lib:/usr/lib/wsl/lib/libnvidia-container:/usr/lib/nvidia:/usr/lib/nvidia-current:/home/cuopt/.local/lib/python3.12/site-packages/libcuopt/lib/:/home/cuopt/.local/lib/python3.12/site-packages/rapids_logger/lib64:${LD_LIBRARY_PATH}" +# Make pip packages accessible to all users +ENV PYTHONPATH="/home/cuopt/.local/lib/python${PYTHON_SHORT_VER}/site-packages:/usr/local/lib/python${PYTHON_SHORT_VER}/site-packages:${PYTHONPATH:-}" + +COPY --from=cuda-libs /usr/local/cuda/lib64/libnvrtc* /usr/local/cuda/lib64/ +COPY --from=cuda-libs /usr/local/cuda/lib64/libnvJitLink* /usr/local/cuda/lib64/ \ No newline at end of file diff --git a/ci/docker/create_multiarch_manifest.sh b/ci/docker/create_multiarch_manifest.sh new file mode 100644 index 0000000000..d77d4caecd --- /dev/null +++ b/ci/docker/create_multiarch_manifest.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +# SPDX-FileCopyrightText: Copyright (c) 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. + +# Create manifest for dockerhub and nvstaging + +docker manifest create --amend nvidia/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER} \ + nvidia/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER}-amd64 \ + nvidia/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER}-arm64 + +docker manifest annotate nvidia/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER} \ + nvidia/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER}-arm64 \ + --arch arm64 + +docker manifest annotate nvidia/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER} \ + nvidia/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER}-amd64 \ + --arch amd64 + +docker manifest push nvidia/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER} + +docker manifest create --amend nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER} \ + nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER}-amd64 \ + nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER}-arm64 + +docker manifest annotate nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER} \ + nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER}-arm64 \ + --arch arm64 + +docker manifest annotate nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER} \ + nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER}-amd64 \ + --arch amd64 + +docker manifest push nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER} + +# Only create latest manifests for release builds +if [[ "${BUILD_TYPE}" == "release" ]]; then + docker manifest create --amend nvidia/cuopt:latest-cuda${CUDA_VER}-py${PYTHON_VER} \ + nvidia/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER}-amd64 \ + nvidia/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER}-arm64 + + docker manifest annotate nvidia/cuopt:latest-cuda${CUDA_VER}-py${PYTHON_VER} \ + nvidia/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER}-arm64 \ + --arch arm64 + + docker manifest annotate nvidia/cuopt:latest-cuda${CUDA_VER}-py${PYTHON_VER} \ + nvidia/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER}-amd64 \ + --arch amd64 + + docker manifest push nvidia/cuopt:latest-cuda${CUDA_VER}-py${PYTHON_VER} + + docker manifest create --amend nvcr.io/nvstaging/nvaie/cuopt:latest-cuda${CUDA_VER}-py${PYTHON_VER} \ + nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER}-amd64 \ + nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER}-arm64 + + docker manifest annotate nvcr.io/nvstaging/nvaie/cuopt:latest-cuda${CUDA_VER}-py${PYTHON_VER} \ + nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER}-arm64 \ + --arch arm64 + + docker manifest annotate nvcr.io/nvstaging/nvaie/cuopt:latest-cuda${CUDA_VER}-py${PYTHON_VER} \ + nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER}-amd64 \ + --arch amd64 + + docker manifest push nvcr.io/nvstaging/nvaie/cuopt:latest-cuda${CUDA_VER}-py${PYTHON_VER} +fi \ No newline at end of file