From b7457e0bafdf9f40f40b4b6cd27bdefbb60f120f Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 1 Jul 2025 10:44:43 -0500 Subject: [PATCH 001/131] Add version change --- ci/build_wheel.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 3abf5ca8f0..7af2a9f718 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -24,6 +24,9 @@ source rapids-configure-sccache source rapids-date-string source rapids-init-pip +# Update the version to accomdate nightly and release changes for the wheel name +rapids-generate-version > ./VERSION + cd "${package_dir}" sccache --zero-stats From 2c83df0b028f643b0c3e8305f5a361ad0d5960bc Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 1 Jul 2025 16:57:15 -0500 Subject: [PATCH 002/131] Add workflow to build image --- .github/workflows/build_images.yml | 96 ++++++++++++++ .../workflows/build_test_publish_images.yml | 125 ++++++++++++++++++ 2 files changed, 221 insertions(+) create mode 100644 .github/workflows/build_images.yml create mode 100644 .github/workflows/build_test_publish_images.yml diff --git a/.github/workflows/build_images.yml b/.github/workflows/build_images.yml new file mode 100644 index 0000000000..8ed20c7481 --- /dev/null +++ b/.github/workflows/build_images.yml @@ -0,0 +1,96 @@ +# 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 + +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: 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: 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.CUOPT_VER }}-cuda${{ inputs.CUDA_VER }}-${{ matrix.PYTHON_VER }}-${{ matrix.ARCH }} + + - name: Push image to NGC + run: | + docker tag nvidia/cuopt:${{ inputs.CUOPT_VER }}-cuda${{ inputs.CUDA_VER }}-${{ matrix.PYTHON_VER }}-${{ matrix.ARCH }} nvcr.io/nvstaging/nvaie/cuopt:${{ inputs.CUOPT_VER }}-cuda${{ inputs.CUDA_VER }}-${{ matrix.PYTHON_VER }}-${{ matrix.ARCH }} + docker push nvcr.io/nvstaging/nvaie/cuopt:${{ inputs.CUOPT_VER }}-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..017486926f --- /dev/null +++ b/.github/workflows/build_test_publish_images.yml @@ -0,0 +1,125 @@ +# 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 }} + + 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: Compute cuopt version + id: compute-cuopt-ver + run: | + ver=$(git describe --tags --abbrev=0) + 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 + + 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: + arch: ${{ matrix.arch }} + cuda_ver: ${{ matrix.cuda_ver }} + python_ver: ${{ matrix.python_ver }} + cuopt_ver: ${{ steps.compute-cuopt-ver.outputs.CUOPT_VER }} + + 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 }} + ARCH: ${{ matrix.arch }} + + run: ci/docker/create_multiarch_manifest.sh \ No newline at end of file From 49f4095ec79345640fb9f610f443f067cba72d30 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 1 Jul 2025 18:09:44 -0500 Subject: [PATCH 003/131] add docker folder and update yml --- .../workflows/build_test_publish_images.yml | 4 +- ci/docker/Dockerfile | 109 ++++++++++++++++++ 2 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 ci/docker/Dockerfile diff --git a/.github/workflows/build_test_publish_images.yml b/.github/workflows/build_test_publish_images.yml index 017486926f..cd81d097f2 100644 --- a/.github/workflows/build_test_publish_images.yml +++ b/.github/workflows/build_test_publish_images.yml @@ -67,8 +67,8 @@ jobs: run: | MATRIX=$(cat <> $GITHUB_OUTPUT diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile new file mode 100644 index 0000000000..0f013b690f --- /dev/null +++ b/ci/docker/Dockerfile @@ -0,0 +1,109 @@ +# 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 + +FROM nvidia/cuda:${CUDA_VER}-runtime-ubuntu22.04 AS cuda-libs + +# Install cuOpt +FROM nvidia/cuda:${CUDA_VER}-base-ubuntu22.04 AS python-env + +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" + +RUN if [[ "${CUDA_VER}" == "12.8" ]]; then \ + cuda_suffix="cu12"; \ + python -m pip install nvidia-cuda-runtime-cu12==12.8.0; \ + fi + +RUN python -m pip install --user --no-cache-dir cuopt-server-${cuda_suffix}==${CUOPT_VER}* cuopt-sh-client==${CUOPT_VER}* +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 + +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_VER%.*}/site-packages:/usr/local/lib/python${PYTHON_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 From 369d07916d4896969c664e83518ac13967f3704d Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Wed, 2 Jul 2025 14:08:47 -0500 Subject: [PATCH 004/131] Update dockerfile --- ci/docker/Dockerfile | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index 0f013b690f..e766e1919d 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -17,12 +17,17 @@ 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 \ @@ -78,12 +83,14 @@ ARG CUOPT_VERSION ENV PIP_EXTRA_INDEX_URL="https://pypi.nvidia.com https://pypi.anaconda.org/rapidsai-wheels-nightly/simple" -RUN if [[ "${CUDA_VER}" == "12.8" ]]; then \ +SHELL ["/bin/bash", "-c"] +RUN if [[ "${CUDA_VER}" =~ ^12\. ]]; then \ cuda_suffix="cu12"; \ - python -m pip install nvidia-cuda-runtime-cu12==12.8.0; \ - fi + 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 -RUN python -m pip install --user --no-cache-dir cuopt-server-${cuda_suffix}==${CUOPT_VER}* cuopt-sh-client==${CUOPT_VER}* USER root RUN apt-get purge -y gcc git \ @@ -97,13 +104,14 @@ 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_VER%.*}/site-packages:/usr/local/lib/python${PYTHON_VER%.*}/site-packages:${PYTHONPATH:-}" +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 From 23a34eb7346171e9ce09a9279405c12b3cbf9ae7 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Wed, 2 Jul 2025 14:15:32 -0500 Subject: [PATCH 005/131] Update workflow --- .github/workflows/build_images.yml | 7 ------- .github/workflows/build_test_publish_images.yml | 10 ++++++++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_images.yml b/.github/workflows/build_images.yml index 8ed20c7481..38d1269e4b 100644 --- a/.github/workflows/build_images.yml +++ b/.github/workflows/build_images.yml @@ -46,24 +46,17 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - 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: 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: diff --git a/.github/workflows/build_test_publish_images.yml b/.github/workflows/build_test_publish_images.yml index cd81d097f2..dfdb49ea71 100644 --- a/.github/workflows/build_test_publish_images.yml +++ b/.github/workflows/build_test_publish_images.yml @@ -66,17 +66,23 @@ jobs: 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=$(git describe --tags --abbrev=0) + 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' \ From 48544e183031145242f281bcf19ad327b1732263 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Wed, 2 Jul 2025 15:43:12 -0500 Subject: [PATCH 006/131] Add changes to accomdate image tag --- .github/workflows/build_images.yml | 9 ++++++--- .github/workflows/build_test_publish_images.yml | 16 +++++++++++----- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_images.yml b/.github/workflows/build_images.yml index 38d1269e4b..842b313a1f 100644 --- a/.github/workflows/build_images.yml +++ b/.github/workflows/build_images.yml @@ -30,6 +30,9 @@ on: CUOPT_VER: required: true type: string + IMAGE_TAG_PREFIX: + required: true + type: string jobs: build: @@ -78,12 +81,12 @@ jobs: CUDA_VER=${{ inputs.CUDA_VER }} PYTHON_VER=${{ inputs.PYTHON_VER }} CUOPT_VER=${{ inputs.CUOPT_VER }} - tags: nvidia/cuopt:${{ inputs.CUOPT_VER }}-cuda${{ inputs.CUDA_VER }}-${{ matrix.PYTHON_VER }}-${{ matrix.ARCH }} + 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.CUOPT_VER }}-cuda${{ inputs.CUDA_VER }}-${{ matrix.PYTHON_VER }}-${{ matrix.ARCH }} nvcr.io/nvstaging/nvaie/cuopt:${{ inputs.CUOPT_VER }}-cuda${{ inputs.CUDA_VER }}-${{ matrix.PYTHON_VER }}-${{ matrix.ARCH }} - docker push nvcr.io/nvstaging/nvaie/cuopt:${{ inputs.CUOPT_VER }}-cuda${{ inputs.CUDA_VER }}-${{ matrix.PYTHON_VER }}-${{ matrix.ARCH }} + 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 index dfdb49ea71..8e551f9ac4 100644 --- a/.github/workflows/build_test_publish_images.yml +++ b/.github/workflows/build_test_publish_images.yml @@ -54,6 +54,7 @@ jobs: 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 @@ -88,7 +89,11 @@ jobs: | 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 @@ -96,10 +101,11 @@ jobs: matrix: ${{ fromJson(needs.compute-matrix.outputs.MATRIX) }} uses: ./.github/workflows/build-images.yaml with: - arch: ${{ matrix.arch }} - cuda_ver: ${{ matrix.cuda_ver }} - python_ver: ${{ matrix.python_ver }} - cuopt_ver: ${{ steps.compute-cuopt-ver.outputs.CUOPT_VER }} + 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 From 3968704ab064ca1b0b5a5aeffa90af7d3e103a1a Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Wed, 2 Jul 2025 17:26:08 -0500 Subject: [PATCH 007/131] Add multi arch script --- .../workflows/build_test_publish_images.yml | 1 + ci/docker/create_multiarch_manifest.sh | 75 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 ci/docker/create_multiarch_manifest.sh diff --git a/.github/workflows/build_test_publish_images.yml b/.github/workflows/build_test_publish_images.yml index 8e551f9ac4..4a7e321710 100644 --- a/.github/workflows/build_test_publish_images.yml +++ b/.github/workflows/build_test_publish_images.yml @@ -132,6 +132,7 @@ jobs: 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/ci/docker/create_multiarch_manifest.sh b/ci/docker/create_multiarch_manifest.sh new file mode 100644 index 0000000000..237e7849d7 --- /dev/null +++ b/ci/docker/create_multiarch_manifest.sh @@ -0,0 +1,75 @@ +# 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 From de1e24ec6e065518555b5a85f9281fe6ca22d303 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Wed, 2 Jul 2025 17:30:35 -0500 Subject: [PATCH 008/131] Add multi arch script --- ci/docker/create_multiarch_manifest.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/docker/create_multiarch_manifest.sh b/ci/docker/create_multiarch_manifest.sh index 237e7849d7..d77d4caecd 100644 --- a/ci/docker/create_multiarch_manifest.sh +++ b/ci/docker/create_multiarch_manifest.sh @@ -1,3 +1,5 @@ +#!/bin/bash + # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # From 6ddf3a725d12911242e01952c21a9f57801136b6 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 10:07:49 -0500 Subject: [PATCH 009/131] enable nightly build --- .github/workflows/build.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 }} \ From 812d7515f24d7757ea3a335bd2487921ba5ae086 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 10:16:46 -0500 Subject: [PATCH 010/131] test nightly --- .github/workflows/pr.yaml | 241 +++----------------------------------- 1 file changed, 18 insertions(+), 223 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index d21d8e4d3c..94a37b7e62 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -10,226 +10,21 @@ 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 \ + -f branch="branch-25.08" \ + -f sha="e0dc603" \ + -f date="2025-07-02" \ + -f build_type="nightly" From be5f42c6962ed0ce8ed8bc5711f0946a028fcaef Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 10:19:53 -0500 Subject: [PATCH 011/131] fix --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 94a37b7e62..f5f8e0ef46 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -23,7 +23,7 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - gh workflow run build_test_publish_images.yml \ + gh workflow run build_test_publish_images.yml --ref pull-request/180 \ -f branch="branch-25.08" \ -f sha="e0dc603" \ -f date="2025-07-02" \ From e9dad7f16542f0308705ee937dbd7f1e22b26403 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 10:35:49 -0500 Subject: [PATCH 012/131] test workflow --- .github/workflows/pr.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index f5f8e0ef46..7db270e1e3 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -23,7 +23,8 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - gh workflow run build_test_publish_images.yml --ref pull-request/180 \ + 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" \ From 80bc564ec2a31ba350e4271fe4d99fd123f3fcc4 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 10:53:04 -0500 Subject: [PATCH 013/131] test workflow --- .github/workflows/build_test_publish_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test_publish_images.yml b/.github/workflows/build_test_publish_images.yml index 4a7e321710..96ad4b4dcf 100644 --- a/.github/workflows/build_test_publish_images.yml +++ b/.github/workflows/build_test_publish_images.yml @@ -99,7 +99,7 @@ jobs: needs: compute-matrix strategy: matrix: ${{ fromJson(needs.compute-matrix.outputs.MATRIX) }} - uses: ./.github/workflows/build-images.yaml + uses: ./.github/workflows/build_images.yaml with: ARCHES: ${{ matrix.arch }} CUDA_VER: ${{ matrix.cuda_ver }} From bfdb58018f548c1a9a588f7e70d6d00c36e4e651 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 10:59:16 -0500 Subject: [PATCH 014/131] reconfigure test --- .github/workflows/pr.yaml | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 7db270e1e3..a3fb35aaa5 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -11,21 +11,11 @@ concurrency: jobs: build-images: + uses: ./.github/workflows/build_test_publish_images.yml 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" + with: + branch: "branch-25.08" + sha: "e0dc603" + date: "2025-07-02" + build_type: "nightly" + \ No newline at end of file From b9b76f22674ebd41ce83c98ab73b33ca7909a696 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 11:00:00 -0500 Subject: [PATCH 015/131] fix workflow type --- .github/workflows/build_test_publish_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test_publish_images.yml b/.github/workflows/build_test_publish_images.yml index 96ad4b4dcf..08393093f8 100644 --- a/.github/workflows/build_test_publish_images.yml +++ b/.github/workflows/build_test_publish_images.yml @@ -16,7 +16,7 @@ name: Build, Test and Publish cuopt images on: - workflow_dispatch: + workflow_call: inputs: branch: type: string From 8770f90265f57cdd36517b67ea939aecd173f4e2 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 11:13:58 -0500 Subject: [PATCH 016/131] name changes --- .github/workflows/{build_images.yml => build_images.yaml} | 0 ...ild_test_publish_images.yml => build_test_publish_images.yaml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build_images.yml => build_images.yaml} (100%) rename .github/workflows/{build_test_publish_images.yml => build_test_publish_images.yaml} (100%) diff --git a/.github/workflows/build_images.yml b/.github/workflows/build_images.yaml similarity index 100% rename from .github/workflows/build_images.yml rename to .github/workflows/build_images.yaml diff --git a/.github/workflows/build_test_publish_images.yml b/.github/workflows/build_test_publish_images.yaml similarity index 100% rename from .github/workflows/build_test_publish_images.yml rename to .github/workflows/build_test_publish_images.yaml From aa077e0be8b5baa4bb4495a77f6cc0806e0f24ca Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 11:15:40 -0500 Subject: [PATCH 017/131] name update --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index a3fb35aaa5..5b767d3b36 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -11,7 +11,7 @@ concurrency: jobs: build-images: - uses: ./.github/workflows/build_test_publish_images.yml + uses: ./.github/workflows/build_test_publish_images.yaml runs-on: ubuntu-latest with: branch: "branch-25.08" From 6df3fc676dda7c4ea1b6c56179a0f9ae3db14f96 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 11:17:09 -0500 Subject: [PATCH 018/131] fix workflow --- .github/workflows/pr.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 5b767d3b36..7bddc0958f 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -12,7 +12,6 @@ concurrency: jobs: build-images: uses: ./.github/workflows/build_test_publish_images.yaml - runs-on: ubuntu-latest with: branch: "branch-25.08" sha: "e0dc603" From ab66e7b2d38be49afc5aa7270e46ec3b0a771f02 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 11:21:06 -0500 Subject: [PATCH 019/131] fix errors --- .github/workflows/build_test_publish_images.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 08393093f8..ff7dab2d86 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -104,8 +104,8 @@ jobs: 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 }} + CUOPT_VER: ${{ needs.compute-matrix.outputs.CUOPT_VER }} + IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} build-cuopt-multiarch-manifest: name: Build cuopt multiarch manifest From 9b8870b6541c179856318ea4c58d401e11b3adf6 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 11:38:39 -0500 Subject: [PATCH 020/131] fix errors --- .github/workflows/build.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 79a2ffee6c..f49c17cbc4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -206,7 +206,8 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - gh workflow run build_test_publish_images.yml \ + gh workflow run build_test_publish_images.yml --repo NVIDIA/cuopt \ + --ref add_nightly_container_support \ -f branch=${{ inputs.branch }} \ -f sha=${{ inputs.sha }} \ -f date=${{ inputs.date }} \ From a3b2106e9ff523d18f7dbd76dbb7cb517fb9208a Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 12:19:59 -0500 Subject: [PATCH 021/131] fix error --- .github/workflows/build_test_publish_images.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index ff7dab2d86..9dd375454b 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -129,10 +129,10 @@ jobs: - name: Create multiarch manifest shell: bash env: - CUOPT_VER: ${{ steps.compute-cuopt-ver.outputs.CUOPT_VER }} + CUOPT_VER: ${{ needs.compute-matrix.outputs.CUOPT_VER }} CUDA_VER: ${{ matrix.cuda_ver }} PYTHON_VER: ${{ matrix.python_ver }} - IMAGE_TAG_PREFIX: ${{ steps.compute-cuopt-ver.outputs.IMAGE_TAG_PREFIX }} + IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} ARCH: ${{ matrix.arch }} run: ci/docker/create_multiarch_manifest.sh \ No newline at end of file From 2c527d36f5c87f4a947cadceaaef268ac68c56a5 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 12:21:10 -0500 Subject: [PATCH 022/131] fix error[A --- .github/workflows/build_test_publish_images.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 9dd375454b..48ed90d2cd 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -67,12 +67,14 @@ jobs: id: compute-matrix run: | MATRIX=$(cat <> $GITHUB_OUTPUT + echo "MATRIX=$MATRIX" >> $GITHUB_OUTPUT - name: Install gha-tools run: | From 9bb6ec5f6bb67e71cd041dd2a27a90c97ad38287 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 12:47:40 -0500 Subject: [PATCH 023/131] fix error --- .github/workflows/build_test_publish_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 48ed90d2cd..f829e36c40 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -66,7 +66,7 @@ jobs: - name: Compute matrix id: compute-matrix run: | - MATRIX=$(cat < Date: Thu, 3 Jul 2025 12:50:57 -0500 Subject: [PATCH 024/131] fix error --- .github/workflows/build_test_publish_images.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index f829e36c40..5d87693f61 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -90,12 +90,13 @@ jobs: | 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 + echo "CUOPT_VER=$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 + echo "IMAGE_TAG_PREFIX=$IMAGE_TAG_PREFIX" >> $GITHUB_OUTPUT build-images: name: Build images for ${inputs.arch} architecture needs: compute-matrix From f55ba0aa0ee33ce8b20293329563dcc1c39dd0ed Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 12:53:22 -0500 Subject: [PATCH 025/131] fix error --- .github/workflows/build_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index 842b313a1f..cb6e1bb445 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -38,7 +38,7 @@ jobs: build: strategy: matrix: - ARCH: ${{ fromJSON(inputs.ARCHES) }} + ARCH: ${{ inputs.ARCHES }} CUDA_VER: ["${{ inputs.CUDA_VER }}"] PYTHON_VER: ["${{ inputs.PYTHON_VER }}"] CUOPT_VER: ["${{ inputs.CUOPT_VER }}"] From fb706981b7dda124216280db844a0d0e87339dcc Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 12:57:33 -0500 Subject: [PATCH 026/131] fix error --- .github/workflows/build_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index cb6e1bb445..c177cd9c08 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -38,7 +38,7 @@ jobs: build: strategy: matrix: - ARCH: ${{ inputs.ARCHES }} + ARCH: ["${{ inputs.ARCHES }}"] CUDA_VER: ["${{ inputs.CUDA_VER }}"] PYTHON_VER: ["${{ inputs.PYTHON_VER }}"] CUOPT_VER: ["${{ inputs.CUOPT_VER }}"] From 5109fe5d225065293cc6e408ed8fe56c74514cd5 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 13:45:07 -0500 Subject: [PATCH 027/131] fix error --- .github/workflows/build_images.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index c177cd9c08..43b11922fe 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -49,6 +49,11 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.GPUCIBOT_DOCKERHUB_USER }} + password: ${{ secrets.GPUCIBOT_DOCKERHUB_TOKEN }} - name: Login to DockerHub uses: docker/login-action@v3 with: From a5548f83b693e02b5cbaa195127ccf4a5c746dbf Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 14:25:18 -0500 Subject: [PATCH 028/131] fix --- .github/workflows/build_images.yaml | 5 ----- .github/workflows/build_test_publish_images.yaml | 1 + .github/workflows/pr.yaml | 3 ++- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index 43b11922fe..c177cd9c08 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -49,11 +49,6 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.GPUCIBOT_DOCKERHUB_USER }} - password: ${{ secrets.GPUCIBOT_DOCKERHUB_TOKEN }} - name: Login to DockerHub uses: docker/login-action@v3 with: diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 5d87693f61..96225b0e65 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -100,6 +100,7 @@ jobs: build-images: name: Build images for ${inputs.arch} architecture needs: compute-matrix + secrets: inherit strategy: matrix: ${{ fromJson(needs.compute-matrix.outputs.MATRIX) }} uses: ./.github/workflows/build_images.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 7bddc0958f..b39dbdd0cc 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -12,9 +12,10 @@ concurrency: jobs: build-images: uses: ./.github/workflows/build_test_publish_images.yaml + secrets: inherit with: branch: "branch-25.08" sha: "e0dc603" - date: "2025-07-02" + date: "2025-07-03" build_type: "nightly" \ No newline at end of file From b0aa96357649f5af40e5f386ea45df5a9ab705a0 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 14:32:09 -0500 Subject: [PATCH 029/131] fix image --- .github/workflows/build_images.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index c177cd9c08..5854e11fb2 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -60,6 +60,10 @@ jobs: registry: "nvcr.io" username: "$oauthtoken" password: ${{ secrets.CUOPT_NGC_DOCKER_KEY }} + - name: Set up Docker Context for Buildx + id: buildx-context + run: | + docker context create builders - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: @@ -80,7 +84,7 @@ jobs: build-args: | CUDA_VER=${{ inputs.CUDA_VER }} PYTHON_VER=${{ inputs.PYTHON_VER }} - CUOPT_VER=${{ inputs.CUOPT_VER }} + CUOPT_VER=${{ "25.08.0a43" }} tags: nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ inputs.CUDA_VER }}-${{ matrix.PYTHON_VER }}-${{ matrix.ARCH }} - name: Push image to NGC From 9a6b3ebf2837c17bbc431559474b3683c8f5da04 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 14:33:56 -0500 Subject: [PATCH 030/131] fix image --- .github/workflows/build_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index 5854e11fb2..148facc5a7 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -84,7 +84,7 @@ jobs: build-args: | CUDA_VER=${{ inputs.CUDA_VER }} PYTHON_VER=${{ inputs.PYTHON_VER }} - CUOPT_VER=${{ "25.08.0a43" }} + CUOPT_VER="25.08.0a43" tags: nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ inputs.CUDA_VER }}-${{ matrix.PYTHON_VER }}-${{ matrix.ARCH }} - name: Push image to NGC From ee8803989670c17024c4fd4ea075250eb93028c9 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 14:42:15 -0500 Subject: [PATCH 031/131] fix image --- .github/workflows/build_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index 148facc5a7..8f9d6b3edc 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -76,7 +76,7 @@ jobs: - name: Build image and push to DockerHub and NGC uses: docker/build-push-action@v6 with: - context: context + context: builders file: ./ci/docker/Dockerfile target: cuopt push: true From cd28dc54fe383c05837a8eee89787fea434d706f Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 14:47:46 -0500 Subject: [PATCH 032/131] fix image --- .github/workflows/build_images.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index 8f9d6b3edc..20779f7dd4 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -67,16 +67,12 @@ jobs: - 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: builders + context: context file: ./ci/docker/Dockerfile target: cuopt push: true From caace7563b667a3c44123149f12b8241f6eb27a8 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 15:29:35 -0500 Subject: [PATCH 033/131] fix image --- .github/workflows/build_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index 20779f7dd4..a49c06828f 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -72,7 +72,7 @@ jobs: - name: Build image and push to DockerHub and NGC uses: docker/build-push-action@v6 with: - context: context + context: ./ci/docker/ file: ./ci/docker/Dockerfile target: cuopt push: true From 3dfaad317627c26850aeb24254373b73f8ed36b8 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 15:34:51 -0500 Subject: [PATCH 034/131] fix image --- .github/workflows/build_images.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index a49c06828f..37547f4a7a 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -74,7 +74,6 @@ jobs: with: context: ./ci/docker/ file: ./ci/docker/Dockerfile - target: cuopt push: true pull: true build-args: | From 65655f2b2d1770c87cca59c3634fcb79ac181a3e Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 15:39:33 -0500 Subject: [PATCH 035/131] fix image --- .github/workflows/build_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index 37547f4a7a..2929a63a02 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -72,7 +72,7 @@ jobs: - name: Build image and push to DockerHub and NGC uses: docker/build-push-action@v6 with: - context: ./ci/docker/ + context: . file: ./ci/docker/Dockerfile push: true pull: true From 3dc77a73f3d012c01f319fd34ee6bca443471b4e Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 15:55:12 -0500 Subject: [PATCH 036/131] create a context folder and setup context --- .github/workflows/build_images.yaml | 4 ++-- ci/docker/context/LICENSE | 1 + ci/docker/context/VERSION | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) create mode 120000 ci/docker/context/LICENSE create mode 120000 ci/docker/context/VERSION diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index 2929a63a02..af7f4507bb 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -68,11 +68,11 @@ jobs: uses: docker/setup-buildx-action@v3 with: driver: docker - endpoint: builders + endpoint: context - name: Build image and push to DockerHub and NGC uses: docker/build-push-action@v6 with: - context: . + context: context file: ./ci/docker/Dockerfile push: true pull: true diff --git a/ci/docker/context/LICENSE b/ci/docker/context/LICENSE new file mode 120000 index 0000000000..5853aaea53 --- /dev/null +++ b/ci/docker/context/LICENSE @@ -0,0 +1 @@ +../../../LICENSE \ No newline at end of file diff --git a/ci/docker/context/VERSION b/ci/docker/context/VERSION new file mode 120000 index 0000000000..d62dc733ef --- /dev/null +++ b/ci/docker/context/VERSION @@ -0,0 +1 @@ +../../../VERSION \ No newline at end of file From c750458450b27e5202330d20b0a4586855c9daee Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 15:55:51 -0500 Subject: [PATCH 037/131] create a context folder and setup context --- .github/workflows/build_images.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index af7f4507bb..96b3c1fb76 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -68,11 +68,11 @@ jobs: uses: docker/setup-buildx-action@v3 with: driver: docker - endpoint: context + endpoint: ./ci/docker/context - name: Build image and push to DockerHub and NGC uses: docker/build-push-action@v6 with: - context: context + context: ./ci/docker/context file: ./ci/docker/Dockerfile push: true pull: true From c97b9bee25e8349f0efd70dc797dcd03a358d3a2 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 17:28:54 -0500 Subject: [PATCH 038/131] fix context --- .github/workflows/build_images.yaml | 4 ++++ ci/docker/context/LICENSE | 1 - ci/docker/context/README.md | 1 + ci/docker/context/VERSION | 1 - 4 files changed, 5 insertions(+), 2 deletions(-) delete mode 120000 ci/docker/context/LICENSE create mode 100644 ci/docker/context/README.md delete mode 120000 ci/docker/context/VERSION diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index 96b3c1fb76..148eb7f98e 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -54,6 +54,10 @@ jobs: with: username: ${{ secrets.CUOPT_DOCKERHUB_USERNAME }} password: ${{ secrets.CUOPT_DOCKERHUB_TOKEN }} + - name: Copy License and Version files + run: | + cp ./LICENSE ./ci/docker/context/LICENSE + cp ./VERSION ./ci/docker/context/VERSION - name: Login to NGC uses: docker/login-action@v3 with: diff --git a/ci/docker/context/LICENSE b/ci/docker/context/LICENSE deleted file mode 120000 index 5853aaea53..0000000000 --- a/ci/docker/context/LICENSE +++ /dev/null @@ -1 +0,0 @@ -../../../LICENSE \ No newline at end of file diff --git a/ci/docker/context/README.md b/ci/docker/context/README.md new file mode 100644 index 0000000000..c9f038722f --- /dev/null +++ b/ci/docker/context/README.md @@ -0,0 +1 @@ +Add all the docker file required elements required for the buildx context. \ No newline at end of file diff --git a/ci/docker/context/VERSION b/ci/docker/context/VERSION deleted file mode 120000 index d62dc733ef..0000000000 --- a/ci/docker/context/VERSION +++ /dev/null @@ -1 +0,0 @@ -../../../VERSION \ No newline at end of file From 4dfdfb452772e43ed3aaef4c73d30494b25943d3 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 17:40:37 -0500 Subject: [PATCH 039/131] fix version --- .github/workflows/build_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index 148eb7f98e..4d3b170dbc 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -83,7 +83,7 @@ jobs: build-args: | CUDA_VER=${{ inputs.CUDA_VER }} PYTHON_VER=${{ inputs.PYTHON_VER }} - CUOPT_VER="25.08.0a43" + CUOPT_VER="25.8.0a43" tags: nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ inputs.CUDA_VER }}-${{ matrix.PYTHON_VER }}-${{ matrix.ARCH }} - name: Push image to NGC From 55600a763641e9b5b71ee9579fc630e4f2e43a69 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 17:57:15 -0500 Subject: [PATCH 040/131] fix branch name quotes --- .github/workflows/build_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index 4d3b170dbc..5a804a4518 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -83,7 +83,7 @@ jobs: build-args: | CUDA_VER=${{ inputs.CUDA_VER }} PYTHON_VER=${{ inputs.PYTHON_VER }} - CUOPT_VER="25.8.0a43" + CUOPT_VER=25.8.0a43 tags: nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ inputs.CUDA_VER }}-${{ matrix.PYTHON_VER }}-${{ matrix.ARCH }} - name: Push image to NGC From 77491503224f0d0c6e2e0e2c122da9511284d726 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 18:25:55 -0500 Subject: [PATCH 041/131] fix manifest --- .github/workflows/build_test_publish_images.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 96225b0e65..153e5f647f 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -114,6 +114,11 @@ jobs: build-cuopt-multiarch-manifest: name: Build cuopt multiarch manifest needs: build-images + secrets: inherit + strategy: + matrix: + cuda_ver: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} + python_ver: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).python_ver }} runs-on: ubuntu-latest steps: - name: Checkout code repo @@ -124,12 +129,13 @@ jobs: uses: docker/login-action@v3 with: username: ${{ secrets.CUOPT_DOCKERHUB_USERNAME }} - password: ${{ secrets.CUOPT_DOCKERHUB_PASSWORD }} + password: ${{ secrets.CUOPT_DOCKERHUB_TOKEN }} - name: Login to NGC uses: docker/login-action@v3 with: - username: ${{ secrets.CUOPT_NGC_USERNAME }} - password: ${{ secrets.CUOPT_NGC_PASSWORD }} + registry: "nvcr.io" + username: "$oauthtoken" + password: ${{ secrets.CUOPT_NGC_DOCKER_KEY }} - name: Create multiarch manifest shell: bash env: @@ -137,6 +143,5 @@ jobs: CUDA_VER: ${{ matrix.cuda_ver }} PYTHON_VER: ${{ matrix.python_ver }} IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} - ARCH: ${{ matrix.arch }} run: ci/docker/create_multiarch_manifest.sh \ No newline at end of file From 14413185e9472dca0bb81ceeee09d4ab44355e7c Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 3 Jul 2025 18:41:54 -0500 Subject: [PATCH 042/131] fix manifest job --- .github/workflows/build_test_publish_images.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 153e5f647f..d528929071 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -114,7 +114,6 @@ jobs: build-cuopt-multiarch-manifest: name: Build cuopt multiarch manifest needs: build-images - secrets: inherit strategy: matrix: cuda_ver: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} @@ -143,5 +142,4 @@ jobs: CUDA_VER: ${{ matrix.cuda_ver }} PYTHON_VER: ${{ matrix.python_ver }} IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} - run: ci/docker/create_multiarch_manifest.sh \ No newline at end of file From 92f3ec723cfa8a67ef3bf51c5825f706e11986a6 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 09:45:48 -0500 Subject: [PATCH 043/131] fix manifest --- .../workflows/build_test_publish_images.yaml | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index d528929071..105c6e12fa 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -97,27 +97,27 @@ jobs: IMAGE_TAG_PREFIX="$CUOPT_VER" fi echo "IMAGE_TAG_PREFIX=$IMAGE_TAG_PREFIX" >> $GITHUB_OUTPUT - build-images: - name: Build images for ${inputs.arch} architecture - needs: compute-matrix - secrets: inherit - 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: ${{ needs.compute-matrix.outputs.CUOPT_VER }} - IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} + #build-images: + #name: Build images for ${inputs.arch} architecture + #needs: compute-matrix + #secrets: inherit + #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: ${{ needs.compute-matrix.outputs.CUOPT_VER }} + #IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} build-cuopt-multiarch-manifest: name: Build cuopt multiarch manifest - needs: build-images + #needs: build-images strategy: matrix: - cuda_ver: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} - python_ver: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).python_ver }} + cuda_ver: ${{ needs.compute-matrix.outputs.MATRIX.cuda_ver }} + python_ver: ${{ needs.compute-matrix.outputs.MATRIX.python_ver }} runs-on: ubuntu-latest steps: - name: Checkout code repo From 272d12a37f16d55422b076c4577a69572f2662d2 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 09:50:27 -0500 Subject: [PATCH 044/131] fix manifest --- .github/workflows/build_test_publish_images.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 105c6e12fa..6503e9516e 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -113,11 +113,11 @@ jobs: build-cuopt-multiarch-manifest: name: Build cuopt multiarch manifest - #needs: build-images + needs: compute-matrix strategy: matrix: - cuda_ver: ${{ needs.compute-matrix.outputs.MATRIX.cuda_ver }} - python_ver: ${{ needs.compute-matrix.outputs.MATRIX.python_ver }} + cuda_ver: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} + python_ver: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).python_ver }} runs-on: ubuntu-latest steps: - name: Checkout code repo From fab26a4fd5059353238646c2fe72be8f31350ba1 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 09:53:33 -0500 Subject: [PATCH 045/131] fix manifest --- .github/workflows/build_test_publish_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 6503e9516e..3b271b50fd 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -142,4 +142,4 @@ jobs: CUDA_VER: ${{ matrix.cuda_ver }} PYTHON_VER: ${{ matrix.python_ver }} IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} - run: ci/docker/create_multiarch_manifest.sh \ No newline at end of file + run: bash ci/docker/create_multiarch_manifest.sh \ No newline at end of file From 1ab9265690332c4cfa52f4f399480d5a5e850da5 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 10:33:40 -0500 Subject: [PATCH 046/131] fix docker image names and manifest --- .github/workflows/build_images.yaml | 11 +- .../workflows/build_test_publish_images.yaml | 9 +- ci/docker/create_multiarch_manifest.sh | 139 +++++++++++------- 3 files changed, 98 insertions(+), 61 deletions(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index 5a804a4518..d8e3c3cb78 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -73,6 +73,11 @@ jobs: with: driver: docker endpoint: ./ci/docker/context + - name: Trim CUDA and Python versions + id: trim + run: | + echo "CUDA_SHORT=$(echo '${{ inputs.CUDA_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT + echo "PYTHON_SHORT=$(echo '${{ inputs.PYTHON_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT - name: Build image and push to DockerHub and NGC uses: docker/build-push-action@v6 with: @@ -84,12 +89,12 @@ jobs: CUDA_VER=${{ inputs.CUDA_VER }} PYTHON_VER=${{ inputs.PYTHON_VER }} CUOPT_VER=25.8.0a43 - tags: nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ inputs.CUDA_VER }}-${{ matrix.PYTHON_VER }}-${{ matrix.ARCH }} + tags: nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-${{ steps.trim.outputs.PYTHON_SHORT }}-${{ 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 }} + docker tag nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }} nvcr.io/nvstaging/nvaie/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }} + docker push nvcr.io/nvstaging/nvaie/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }} diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 3b271b50fd..b809d18c55 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -135,11 +135,16 @@ jobs: registry: "nvcr.io" username: "$oauthtoken" password: ${{ secrets.CUOPT_NGC_DOCKER_KEY }} + - name: Trim CUDA and Python versions + id: trim + run: | + echo "CUDA_SHORT=$(echo '${{ inputs.CUDA_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT + echo "PYTHON_SHORT=$(echo '${{ inputs.PYTHON_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT - name: Create multiarch manifest shell: bash env: CUOPT_VER: ${{ needs.compute-matrix.outputs.CUOPT_VER }} - CUDA_VER: ${{ matrix.cuda_ver }} - PYTHON_VER: ${{ matrix.python_ver }} + CUDA_SHORT: ${{ steps.trim.outputs.CUDA_SHORT }} + PYTHON_SHORT: ${{ steps.trim.outputs.PYTHON_SHORT }} IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} run: bash ci/docker/create_multiarch_manifest.sh \ No newline at end of file diff --git a/ci/docker/create_multiarch_manifest.sh b/ci/docker/create_multiarch_manifest.sh index d77d4caecd..a579e9e32e 100644 --- a/ci/docker/create_multiarch_manifest.sh +++ b/ci/docker/create_multiarch_manifest.sh @@ -15,63 +15,90 @@ # 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 +set -euo pipefail + +# Function to check if a Docker image exists in the registry +check_image_exists() { + local image=$1 + echo "Checking if image exists: $image" + + # Try to pull the image manifest to check if it exists + if docker manifest inspect "$image" >/dev/null 2>&1; then + echo "✓ Image exists: $image" + return 0 + else + echo "✗ Image does not exist: $image" + return 1 + fi +} + +# Function to create manifest with error checking +create_manifest() { + local manifest_name=$1 + local amd64_image=$2 + local arm64_image=$3 + + echo "Creating manifest: $manifest_name" + + # Check if both architecture images exist + if ! check_image_exists "$amd64_image"; then + echo "Error: AMD64 image not found: $amd64_image" + return 1 + fi + + if ! check_image_exists "$arm64_image"; then + echo "Error: ARM64 image not found: $arm64_image" + return 1 + fi + + # Create the manifest + echo "Creating multi-arch manifest..." + docker manifest create --amend "$manifest_name" "$amd64_image" "$arm64_image" + + # Annotate with architecture information + echo "Annotating ARM64 architecture..." + docker manifest annotate "$manifest_name" "$arm64_image" --arch arm64 + + echo "Annotating AMD64 architecture..." + docker manifest annotate "$manifest_name" "$amd64_image" --arch amd64 + + # Push the manifest + echo "Pushing manifest: $manifest_name" + docker manifest push "$manifest_name" + + echo "✓ Successfully created and pushed manifest: $manifest_name" +} -docker manifest push nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_VER}-py${PYTHON_VER} +# Create manifest for dockerhub and nvstaging +echo "=== Creating Docker Hub manifests ===" +create_manifest \ + "nvidia/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_SHORT}-py${PYTHON_SHORT}" \ + "nvidia/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_SHORT}-py${PYTHON_SHORT}-amd64" \ + "nvidia/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_SHORT}-py${PYTHON_SHORT}-arm64" + +echo "=== Creating NVCR staging manifests ===" +create_manifest \ + "nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_SHORT}-py${PYTHON_SHORT}" \ + "nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_SHORT}-py${PYTHON_SHORT}-amd64" \ + "nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_SHORT}-py${PYTHON_SHORT}-arm64" # 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 + echo "=== Creating latest manifests for release build ===" + + echo "Creating Docker Hub latest manifest..." + create_manifest \ + "nvidia/cuopt:latest-cuda${CUDA_SHORT}-py${PYTHON_SHORT}" \ + "nvidia/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_SHORT}-py${PYTHON_SHORT}-amd64" \ + "nvidia/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_SHORT}-py${PYTHON_SHORT}-arm64" + + echo "Creating NVCR staging latest manifest..." + create_manifest \ + "nvcr.io/nvstaging/nvaie/cuopt:latest-cuda${CUDA_SHORT}-py${PYTHON_SHORT}" \ + "nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_SHORT}-py${PYTHON_SHORT}-amd64" \ + "nvcr.io/nvstaging/nvaie/cuopt:${IMAGE_TAG_PREFIX}-cuda${CUDA_SHORT}-py${PYTHON_SHORT}-arm64" +else + echo "Skipping latest manifest creation (BUILD_TYPE=${BUILD_TYPE}, not 'release')" +fi + +echo "=== Multi-architecture manifest creation completed ===" \ No newline at end of file From 89c5f4980d36d12f1d1d7d155b69e13a77f9e017 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 10:35:28 -0500 Subject: [PATCH 047/131] fix image --- .../workflows/build_test_publish_images.yaml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index b809d18c55..20e6b5bfe0 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -97,23 +97,23 @@ jobs: IMAGE_TAG_PREFIX="$CUOPT_VER" fi echo "IMAGE_TAG_PREFIX=$IMAGE_TAG_PREFIX" >> $GITHUB_OUTPUT - #build-images: - #name: Build images for ${inputs.arch} architecture - #needs: compute-matrix - #secrets: inherit - #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: ${{ needs.compute-matrix.outputs.CUOPT_VER }} - #IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} + build-images: + name: Build images for ${inputs.arch} architecture + needs: compute-matrix + secrets: inherit + 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: ${{ needs.compute-matrix.outputs.CUOPT_VER }} + IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} build-cuopt-multiarch-manifest: name: Build cuopt multiarch manifest - needs: compute-matrix + needs: compute-matrix, build-images strategy: matrix: cuda_ver: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} From 623e7c6919b1e5429e85d3643f86ebc44417b805 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 10:37:45 -0500 Subject: [PATCH 048/131] fix image --- .github/workflows/build_test_publish_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 20e6b5bfe0..9fde2cdb37 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -113,7 +113,7 @@ jobs: build-cuopt-multiarch-manifest: name: Build cuopt multiarch manifest - needs: compute-matrix, build-images + needs: [compute-matrix, build-images] strategy: matrix: cuda_ver: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} From b26ce5d10d12e6fd05f531e6725aa9066c0e3064 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 13:43:11 -0500 Subject: [PATCH 049/131] fix image names --- .github/workflows/build_images.yaml | 6 +++--- .github/workflows/build_test_publish_images.yaml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index d8e3c3cb78..ed10b88138 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -89,12 +89,12 @@ jobs: CUDA_VER=${{ inputs.CUDA_VER }} PYTHON_VER=${{ inputs.PYTHON_VER }} CUOPT_VER=25.8.0a43 - tags: nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }} + tags: nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-py${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }} - name: Push image to NGC run: | - docker tag nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }} nvcr.io/nvstaging/nvaie/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }} - docker push nvcr.io/nvstaging/nvaie/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }} + 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 }} + 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 }} diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 9fde2cdb37..cf987e43ea 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -116,8 +116,8 @@ jobs: needs: [compute-matrix, build-images] strategy: matrix: - cuda_ver: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} - python_ver: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).python_ver }} + CUDA_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} + PYTHON_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).python_ver }} runs-on: ubuntu-latest steps: - name: Checkout code repo @@ -138,8 +138,8 @@ jobs: - name: Trim CUDA and Python versions id: trim run: | - echo "CUDA_SHORT=$(echo '${{ inputs.CUDA_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT - echo "PYTHON_SHORT=$(echo '${{ inputs.PYTHON_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT + echo "CUDA_SHORT=$(echo '${{ matrix.CUDA_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT + echo "PYTHON_SHORT=$(echo '${{ matrix.PYTHON_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT - name: Create multiarch manifest shell: bash env: From 8c94fedc29c4e77530e3d90135a6275fcdef039d Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 14:21:26 -0500 Subject: [PATCH 050/131] fix image names --- .../workflows/build_test_publish_images.yaml | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index cf987e43ea..8bfd0fef8d 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -97,23 +97,24 @@ jobs: IMAGE_TAG_PREFIX="$CUOPT_VER" fi echo "IMAGE_TAG_PREFIX=$IMAGE_TAG_PREFIX" >> $GITHUB_OUTPUT - build-images: - name: Build images for ${inputs.arch} architecture - needs: compute-matrix - secrets: inherit - 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: ${{ needs.compute-matrix.outputs.CUOPT_VER }} - IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} + #build-images: + #name: Build images for ${inputs.arch} architecture + #needs: compute-matrix + #secrets: inherit + #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: ${{ needs.compute-matrix.outputs.CUOPT_VER }} + #IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} build-cuopt-multiarch-manifest: name: Build cuopt multiarch manifest - needs: [compute-matrix, build-images] + #needs: [compute-matrix, build-images] + needs: compute-matrix strategy: matrix: CUDA_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} @@ -147,4 +148,5 @@ jobs: CUDA_SHORT: ${{ steps.trim.outputs.CUDA_SHORT }} PYTHON_SHORT: ${{ steps.trim.outputs.PYTHON_SHORT }} IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} + BUILD_TYPE: ${{ inputs.build_type }} run: bash ci/docker/create_multiarch_manifest.sh \ No newline at end of file From 67f6a4e8825dd793c40ab69720f37658e2a52017 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 14:38:05 -0500 Subject: [PATCH 051/131] update workflows --- .github/workflows/build_images.yaml | 4 +-- .../workflows/build_test_publish_images.yaml | 31 +++++++++---------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index ed10b88138..4663441de6 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# 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"); @@ -88,7 +88,7 @@ jobs: build-args: | CUDA_VER=${{ inputs.CUDA_VER }} PYTHON_VER=${{ inputs.PYTHON_VER }} - CUOPT_VER=25.8.0a43 + CUOPT_VER=${{ inputs.CUOPT_VER }} tags: nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-py${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }} - name: Push image to NGC diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 8bfd0fef8d..615825f0cf 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# 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"); @@ -97,24 +97,23 @@ jobs: IMAGE_TAG_PREFIX="$CUOPT_VER" fi echo "IMAGE_TAG_PREFIX=$IMAGE_TAG_PREFIX" >> $GITHUB_OUTPUT - #build-images: - #name: Build images for ${inputs.arch} architecture - #needs: compute-matrix - #secrets: inherit - #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: ${{ needs.compute-matrix.outputs.CUOPT_VER }} - #IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} + build-images: + name: Build images for ${inputs.arch} architecture + needs: compute-matrix + secrets: inherit + 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: ${{ needs.compute-matrix.outputs.CUOPT_VER }} + IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} build-cuopt-multiarch-manifest: name: Build cuopt multiarch manifest - #needs: [compute-matrix, build-images] - needs: compute-matrix + needs: build-images strategy: matrix: CUDA_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} From 5f38cd80e78574160f775464181a7b35b6666874 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 14:42:10 -0500 Subject: [PATCH 052/131] update workflow --- .github/workflows/build.yaml | 28 ++--- .github/workflows/pr.yaml | 228 +++++++++++++++++++++++++++++++++-- 2 files changed, 229 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f49c17cbc4..d755b16c84 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -192,23 +192,11 @@ jobs: package-name: cuopt_sh_client package-type: python build-images: - if: inputs.build_type == 'nightly' || inputs.build_type == 'release' - needs: [wheel-build-cuopt, wheel-build-cuopt-server] - 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=${{ inputs.branch }} \ - -f sha=${{ inputs.sha }} \ - -f date=${{ inputs.date }} \ - -f build_type=${{ inputs.build_type }} + needs: [wheel-publish-cuopt, wheel-publish-cuopt-server] + uses: ./.github/workflows/build_test_publish_images.yaml + secrets: inherit + with: + branch: ${{ inputs.branch }} + sha: ${{ inputs.sha }} + date: ${{ inputs.date }} + build_type: ${{ inputs.build_type || 'branch' }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index b39dbdd0cc..d21d8e4d3c 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -10,12 +10,226 @@ concurrency: cancel-in-progress: true jobs: - build-images: - uses: ./.github/workflows/build_test_publish_images.yaml + 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: - branch: "branch-25.08" - sha: "e0dc603" - date: "2025-07-03" - build_type: "nightly" - \ No newline at end of file + build_type: pull-request + script: ci/test_self_hosted_service.sh From ef09b4de7e81dde97feb87a96ef658363762a7ea Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 14:46:14 -0500 Subject: [PATCH 053/131] Add copyright --- .github/workflows/build.yaml | 15 +++++++++++++++ .github/workflows/pr.yaml | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d755b16c84..aea275d432 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,3 +1,18 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-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 on: diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index d21d8e4d3c..c90022e26e 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,3 +1,18 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-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: pr on: From 6e60a2db43b8b8ac6e6d86578c6d0332b7436a33 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 15:58:22 -0500 Subject: [PATCH 054/131] Add testing --- .github/workflows/build_images.yaml | 1 - .../workflows/build_test_publish_images.yaml | 19 +- .github/workflows/pr.yaml | 243 +----------------- .github/workflows/test_images.yaml | 79 ++++++ ci/docker/Dockerfile | 6 +- 5 files changed, 108 insertions(+), 240 deletions(-) create mode 100644 .github/workflows/test_images.yaml diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index 4663441de6..7d9a5b07da 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -41,7 +41,6 @@ jobs: ARCH: ["${{ 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: diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 615825f0cf..08bf731dd9 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -98,7 +98,7 @@ jobs: fi echo "IMAGE_TAG_PREFIX=$IMAGE_TAG_PREFIX" >> $GITHUB_OUTPUT build-images: - name: Build images for ${inputs.arch} architecture + name: Build images needs: compute-matrix secrets: inherit strategy: @@ -148,4 +148,19 @@ jobs: PYTHON_SHORT: ${{ steps.trim.outputs.PYTHON_SHORT }} IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} BUILD_TYPE: ${{ inputs.build_type }} - run: bash ci/docker/create_multiarch_manifest.sh \ No newline at end of file + run: bash ci/docker/create_multiarch_manifest.sh + + test-images: + name: Test images for ${inputs.arch} architecture + needs: build-cuopt-multiarch-manifest + strategy: + matrix: + CUDA_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} + PYTHON_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).python_ver }} + ARCHES: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).arch }} + uses: ./.github/workflows/test_images.yaml + with: + ARCHES: ${{ matrix.arch }} + CUDA_VER: ${{ matrix.cuda_ver }} + PYTHON_VER: ${{ matrix.python_ver }} + IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} \ No newline at end of file diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index c90022e26e..b39dbdd0cc 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,18 +1,3 @@ -# SPDX-FileCopyrightText: Copyright (c) 2022-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: pr on: @@ -25,226 +10,12 @@ 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] + build-images: + uses: ./.github/workflows/build_test_publish_images.yaml 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 + branch: "branch-25.08" + sha: "e0dc603" + date: "2025-07-03" + build_type: "nightly" + \ No newline at end of file diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml new file mode 100644 index 0000000000..880d0fdace --- /dev/null +++ b/.github/workflows/test_images.yaml @@ -0,0 +1,79 @@ +# 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, + +name: Test images + +on: + workflow_call: + inputs: + ARCHES: + required: true + type: string + CUDA_VER: + required: true + type: string + PYTHON_VER: + required: true + type: string + IMAGE_TAG_PREFIX: + required: true + type: string + + +jobs: + + prepare: + runs-on: ubuntu-latest + outputs: + CUDA_SHORT: ${{ steps.trim.outputs.CUDA_SHORT }} + PYTHON_SHORT: ${{ steps.trim.outputs.PYTHON_SHORT }} + steps: + - name: Trim versions + id: trim + run: | + CUDA_SHORT=$(echo "${{ inputs.CUDA_VER }}" | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/') + PYTHON_SHORT=$(echo "${{ inputs.PYTHON_VER }}" | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/') + + echo "CUDA_SHORT=$CUDA_SHORT" >> $GITHUB_OUTPUT + echo "PYTHON_SHORT=$PYTHON_SHORT" >> $GITHUB_OUTPUT + + test: + strategy: + matrix: + ARCH: ["${{ inputs.ARCHES }}"] + fail-fast: false + runs-on: "linux-${{ matrix.ARCH }}-gpu-a100-latest-1" + needs: prepare + container: + image: "nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ needs.prepare.outputs.CUDA_SHORT }}-py${{ needs.prepare.outputs.PYTHON_SHORT }}" + command: ["/bin/bash", "-c"] + steps: + - name: Checkout code repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Test CLI + run: | + export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" + bash python/libcuopt/libcuopt/tests/test_cli.sh + - name: Test cuopt + run: | + export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" + # Test Vehicle Routing + python -m pytest python/cuopt/cuopt/tests/routing/test_vehicle_routing.py + + # Test Linear Programming + python -m pytest python/cuopt/cuopt/tests/linear_programming/test_lp_solver.py::test_solver + - name: Test cuopt server + run: | + # Test cuopt server + python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py \ No newline at end of file diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index e766e1919d..5d1c87d281 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -114,4 +114,8 @@ ENV LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:/usr/lib/aarch64-linux-gnu:/usr/l 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 +COPY --from=cuda-libs /usr/local/cuda/lib64/libnvJitLink* /usr/local/cuda/lib64/ + +ENV CUOPT_SERVER_PORT=8000 + +ENTRYPOINT ["python", "-m", "cuopt_server.cuopts_service"] \ No newline at end of file From d7c9b1c17528da9f32ec4631d787194382de6203 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 16:00:22 -0500 Subject: [PATCH 055/131] Testing container --- .../workflows/build_test_publish_images.yaml | 107 +++++++++--------- 1 file changed, 54 insertions(+), 53 deletions(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 08bf731dd9..b542b8244b 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -97,62 +97,63 @@ jobs: IMAGE_TAG_PREFIX="$CUOPT_VER" fi echo "IMAGE_TAG_PREFIX=$IMAGE_TAG_PREFIX" >> $GITHUB_OUTPUT - build-images: - name: Build images - needs: compute-matrix - secrets: inherit - 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: ${{ needs.compute-matrix.outputs.CUOPT_VER }} - IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} - build-cuopt-multiarch-manifest: - name: Build cuopt multiarch manifest - needs: build-images - strategy: - matrix: - CUDA_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} - PYTHON_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).python_ver }} - 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_TOKEN }} - - name: Login to NGC - uses: docker/login-action@v3 - with: - registry: "nvcr.io" - username: "$oauthtoken" - password: ${{ secrets.CUOPT_NGC_DOCKER_KEY }} - - name: Trim CUDA and Python versions - id: trim - run: | - echo "CUDA_SHORT=$(echo '${{ matrix.CUDA_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT - echo "PYTHON_SHORT=$(echo '${{ matrix.PYTHON_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT - - name: Create multiarch manifest - shell: bash - env: - CUOPT_VER: ${{ needs.compute-matrix.outputs.CUOPT_VER }} - CUDA_SHORT: ${{ steps.trim.outputs.CUDA_SHORT }} - PYTHON_SHORT: ${{ steps.trim.outputs.PYTHON_SHORT }} - IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} - BUILD_TYPE: ${{ inputs.build_type }} - run: bash ci/docker/create_multiarch_manifest.sh + #build-images: + #name: Build images + #needs: compute-matrix + #secrets: inherit + #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: ${{ needs.compute-matrix.outputs.CUOPT_VER }} + #IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} + + #build-cuopt-multiarch-manifest: + #name: Build cuopt multiarch manifest + #needs: build-images + #strategy: + #matrix: + #CUDA_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} + #PYTHON_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).python_ver }} + #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_TOKEN }} + #- name: Login to NGC + #uses: docker/login-action@v3 + #with: + #registry: "nvcr.io" + #username: "$oauthtoken" + #password: ${{ secrets.CUOPT_NGC_DOCKER_KEY }} + #- name: Trim CUDA and Python versions + #id: trim + #run: | + #echo "CUDA_SHORT=$(echo '${{ matrix.CUDA_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT + #echo "PYTHON_SHORT=$(echo '${{ matrix.PYTHON_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT + #- name: Create multiarch manifest + #shell: bash + #env: + #CUOPT_VER: ${{ needs.compute-matrix.outputs.CUOPT_VER }} + #CUDA_SHORT: ${{ steps.trim.outputs.CUDA_SHORT }} + #PYTHON_SHORT: ${{ steps.trim.outputs.PYTHON_SHORT }} + #IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} + #BUILD_TYPE: ${{ inputs.build_type }} + #run: bash ci/docker/create_multiarch_manifest.sh test-images: - name: Test images for ${inputs.arch} architecture - needs: build-cuopt-multiarch-manifest + name: Test images + #needs: build-cuopt-multiarch-manifest strategy: matrix: CUDA_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} From a41f9a3fb6fcc5c408ef7f07d672efc01ebae5c2 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 16:48:31 -0500 Subject: [PATCH 056/131] update test yaml --- .github/workflows/test_images.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 880d0fdace..2a43030582 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -55,7 +55,6 @@ jobs: needs: prepare container: image: "nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ needs.prepare.outputs.CUDA_SHORT }}-py${{ needs.prepare.outputs.PYTHON_SHORT }}" - command: ["/bin/bash", "-c"] steps: - name: Checkout code repo uses: actions/checkout@v4 From 155310a49b0b6096e313f8e65d092180cc957517 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 16:52:19 -0500 Subject: [PATCH 057/131] update test yaml --- .../workflows/build_test_publish_images.yaml | 2 ++ .github/workflows/test_images.yaml | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index b542b8244b..8a607718c2 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -154,6 +154,8 @@ jobs: test-images: name: Test images #needs: build-cuopt-multiarch-manifest + needs: compute-matrix + secrets: inherit strategy: matrix: CUDA_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 2a43030582..d101f6cf75 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -75,4 +75,20 @@ jobs: - name: Test cuopt server run: | # Test cuopt server - python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py \ No newline at end of file + python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py + - name: Download test data + run: | + bash datasets/linear_programming/download_pdlp_test_dataset.sh + bash datasets/mip/download_miplib_test_dataset.sh + cd datasets + ./get_test_data.sh --solomon + ./get_test_data.sh --tsp + cd - + - name: Pytest cuOpt + run: | + export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" + python -m pytest python/cuopt/cuopt/tests/ + - name: Pytest cuOpt Server + run: | + export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" + python -m pytest python/cuopt_server/cuopt_server/tests/ \ No newline at end of file From b20b3bf93466e55ee4e6bb88bf30f7101d2f9aa4 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 17:04:36 -0500 Subject: [PATCH 058/131] update test yaml --- .github/workflows/test_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index d101f6cf75..2b325180aa 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -49,7 +49,7 @@ jobs: test: strategy: matrix: - ARCH: ["${{ inputs.ARCHES }}"] + ARCH: ${{ fromJSON(inputs.ARCHES) }} fail-fast: false runs-on: "linux-${{ matrix.ARCH }}-gpu-a100-latest-1" needs: prepare From 08364211cef629448e96980c1bae74aa2a1f949c Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 17:06:13 -0500 Subject: [PATCH 059/131] update test yaml --- .github/workflows/test_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 2b325180aa..105e354ed6 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -49,7 +49,7 @@ jobs: test: strategy: matrix: - ARCH: ${{ fromJSON(inputs.ARCHES) }} + ARCH: ${{ fromJson(inputs.ARCHES) }} fail-fast: false runs-on: "linux-${{ matrix.ARCH }}-gpu-a100-latest-1" needs: prepare From e48aa05bc0b07a030e00090a8d9f2c2b68fed882 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 17:08:02 -0500 Subject: [PATCH 060/131] update test yaml --- .github/workflows/test_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 105e354ed6..d101f6cf75 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -49,7 +49,7 @@ jobs: test: strategy: matrix: - ARCH: ${{ fromJson(inputs.ARCHES) }} + ARCH: ["${{ inputs.ARCHES }}"] fail-fast: false runs-on: "linux-${{ matrix.ARCH }}-gpu-a100-latest-1" needs: prepare From 589dfec43a3378ab2b80ae14618b1cf874199879 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 17:11:19 -0500 Subject: [PATCH 061/131] update test yaml --- .github/workflows/test_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index d101f6cf75..e70e5270f7 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -51,7 +51,7 @@ jobs: matrix: ARCH: ["${{ inputs.ARCHES }}"] fail-fast: false - runs-on: "linux-${{ matrix.ARCH }}-gpu-a100-latest-1" + runs-on: "linux-${{ inputs.ARCHES }}-gpu-a100-latest-1" needs: prepare container: image: "nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ needs.prepare.outputs.CUDA_SHORT }}-py${{ needs.prepare.outputs.PYTHON_SHORT }}" From efba520ed0135b6ef7e751232a866d008f35de10 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 17:16:57 -0500 Subject: [PATCH 062/131] update test yaml --- .github/workflows/test_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index e70e5270f7..d101f6cf75 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -51,7 +51,7 @@ jobs: matrix: ARCH: ["${{ inputs.ARCHES }}"] fail-fast: false - runs-on: "linux-${{ inputs.ARCHES }}-gpu-a100-latest-1" + runs-on: "linux-${{ matrix.ARCH }}-gpu-a100-latest-1" needs: prepare container: image: "nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ needs.prepare.outputs.CUDA_SHORT }}-py${{ needs.prepare.outputs.PYTHON_SHORT }}" From a73c8091a764baa81adfee7c5010eb95d6db9b39 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 17:20:57 -0500 Subject: [PATCH 063/131] update test yaml --- .github/workflows/test_images.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index d101f6cf75..9f96181ddd 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -15,7 +15,7 @@ name: Test images on: workflow_call: inputs: - ARCHES: + ARCH: required: true type: string CUDA_VER: @@ -45,13 +45,10 @@ jobs: echo "CUDA_SHORT=$CUDA_SHORT" >> $GITHUB_OUTPUT echo "PYTHON_SHORT=$PYTHON_SHORT" >> $GITHUB_OUTPUT + echo ARCH is ${{ inputs.ARCH }} test: - strategy: - matrix: - ARCH: ["${{ inputs.ARCHES }}"] - fail-fast: false - runs-on: "linux-${{ matrix.ARCH }}-gpu-a100-latest-1" + runs-on: "linux-${{ inputs.ARCH }}-gpu-a100-latest-1" needs: prepare container: image: "nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ needs.prepare.outputs.CUDA_SHORT }}-py${{ needs.prepare.outputs.PYTHON_SHORT }}" From 8ca1e5df8fbd8774ea8c32b553194a1017c30b91 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 17:23:00 -0500 Subject: [PATCH 064/131] update test yaml --- .github/workflows/build_test_publish_images.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 8a607718c2..3f5f3464ef 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -160,10 +160,10 @@ jobs: matrix: CUDA_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} PYTHON_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).python_ver }} - ARCHES: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).arch }} + ARCH: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).arch }} uses: ./.github/workflows/test_images.yaml with: - ARCHES: ${{ matrix.arch }} - CUDA_VER: ${{ matrix.cuda_ver }} - PYTHON_VER: ${{ matrix.python_ver }} + ARCH: ${{ matrix.ARCH }} + CUDA_VER: ${{ matrix.CUDA_VER }} + PYTHON_VER: ${{ matrix.PYTHON_VER }} IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} \ No newline at end of file From ee0236e9269aaedda36022e388097daa2009e82f Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 17:50:05 -0500 Subject: [PATCH 065/131] update test yaml --- .github/workflows/test_images.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 9f96181ddd..4c57aa676b 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -45,13 +45,14 @@ jobs: echo "CUDA_SHORT=$CUDA_SHORT" >> $GITHUB_OUTPUT echo "PYTHON_SHORT=$PYTHON_SHORT" >> $GITHUB_OUTPUT - echo ARCH is ${{ inputs.ARCH }} + echo "ARCH is ${{ inputs.ARCH }}" test: runs-on: "linux-${{ inputs.ARCH }}-gpu-a100-latest-1" needs: prepare container: image: "nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ needs.prepare.outputs.CUDA_SHORT }}-py${{ needs.prepare.outputs.PYTHON_SHORT }}" + options: --user cuopt:cuopt steps: - name: Checkout code repo uses: actions/checkout@v4 From 9034cf36b6e183f231429a35206273dbf95f5832 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 18:02:40 -0500 Subject: [PATCH 066/131] update test yaml --- .github/workflows/test_images.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 4c57aa676b..037c29b67e 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -52,7 +52,7 @@ jobs: needs: prepare container: image: "nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ needs.prepare.outputs.CUDA_SHORT }}-py${{ needs.prepare.outputs.PYTHON_SHORT }}" - options: --user cuopt:cuopt + options: --user root steps: - name: Checkout code repo uses: actions/checkout@v4 @@ -60,10 +60,12 @@ jobs: fetch-depth: 0 - name: Test CLI run: | + su cuopt export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" bash python/libcuopt/libcuopt/tests/test_cli.sh - name: Test cuopt run: | + su cuopt export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" # Test Vehicle Routing python -m pytest python/cuopt/cuopt/tests/routing/test_vehicle_routing.py @@ -72,10 +74,12 @@ jobs: python -m pytest python/cuopt/cuopt/tests/linear_programming/test_lp_solver.py::test_solver - name: Test cuopt server run: | + su cuopt # Test cuopt server python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py - name: Download test data run: | + su cuopt bash datasets/linear_programming/download_pdlp_test_dataset.sh bash datasets/mip/download_miplib_test_dataset.sh cd datasets @@ -84,9 +88,11 @@ jobs: cd - - name: Pytest cuOpt run: | + su cuopt export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" python -m pytest python/cuopt/cuopt/tests/ - name: Pytest cuOpt Server run: | + su cuopt export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" python -m pytest python/cuopt_server/cuopt_server/tests/ \ No newline at end of file From 8fcd63be031dafa0d03917f9342a396260cc34c9 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 7 Jul 2025 18:09:31 -0500 Subject: [PATCH 067/131] update test yaml --- .github/workflows/test_images.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 037c29b67e..b56f767cc1 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -63,6 +63,10 @@ jobs: su cuopt export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" bash python/libcuopt/libcuopt/tests/test_cli.sh + - name: Install pytest + run: | + su cuopt + pip install pytest - name: Test cuopt run: | su cuopt From de306f19bcae1f7edc19e30f5e6635915936b467 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 10:34:14 -0500 Subject: [PATCH 068/131] update test yaml --- .github/workflows/test_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index b56f767cc1..06eb791e72 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -66,7 +66,7 @@ jobs: - name: Install pytest run: | su cuopt - pip install pytest + pip install --user pytest psutil - name: Test cuopt run: | su cuopt From d9a1243b98bb0d67d7bb807f878c95cda8c7c4a5 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 11:01:07 -0500 Subject: [PATCH 069/131] update test yaml --- .github/workflows/test_images.yaml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 06eb791e72..02ba607fff 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -45,7 +45,6 @@ jobs: echo "CUDA_SHORT=$CUDA_SHORT" >> $GITHUB_OUTPUT echo "PYTHON_SHORT=$PYTHON_SHORT" >> $GITHUB_OUTPUT - echo "ARCH is ${{ inputs.ARCH }}" test: runs-on: "linux-${{ inputs.ARCH }}-gpu-a100-latest-1" @@ -58,16 +57,16 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Install pytest + run: | + su cuopt + pip install --user pytest psutil - name: Test CLI run: | su cuopt export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" bash python/libcuopt/libcuopt/tests/test_cli.sh - - name: Install pytest - run: | - su cuopt - pip install --user pytest psutil - - name: Test cuopt + - name: Test cuopt run: | su cuopt export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" @@ -79,8 +78,17 @@ jobs: - name: Test cuopt server run: | su cuopt - # Test cuopt server - python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py + export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" + # Show your Python binary path + which python + + python -m site + python -c "import psutil; print(psutil.__version__)" + + python -m cuopt_server.cuopt_service & + sleep 10 + pkill -f cuopt_server.cuopt_service + #python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py - name: Download test data run: | su cuopt From 5744e7971b9259a9a1ecb07857625932c35a06c5 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 11:02:33 -0500 Subject: [PATCH 070/131] update test yaml --- .github/workflows/test_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 02ba607fff..1730fc2c20 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -66,7 +66,7 @@ jobs: su cuopt export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" bash python/libcuopt/libcuopt/tests/test_cli.sh - - name: Test cuopt + - name: Test cuopt run: | su cuopt export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" From d97d8a80774c2a340b3eec95cc3431a2f0b9fea0 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 11:25:35 -0500 Subject: [PATCH 071/131] update test yaml --- .github/workflows/test_images.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 1730fc2c20..9d310e5cd3 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -57,6 +57,9 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Install dependencies + run: | + apt-get install -y file - name: Install pytest run: | su cuopt @@ -88,7 +91,7 @@ jobs: python -m cuopt_server.cuopt_service & sleep 10 pkill -f cuopt_server.cuopt_service - #python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py + python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py - name: Download test data run: | su cuopt From f965aa8f99de0d46164a08832bff582d90ed4b1f Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 11:56:21 -0500 Subject: [PATCH 072/131] Add debug --- .github/workflows/test_images.yaml | 9 ++- debug_popen.py | 58 +++++++++++++++++++ .../cuopt_server/tests/utils/utils.py | 9 ++- 3 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 debug_popen.py diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 9d310e5cd3..0491e487e2 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -59,7 +59,7 @@ jobs: fetch-depth: 0 - name: Install dependencies run: | - apt-get install -y file + pip install --user psutil - name: Install pytest run: | su cuopt @@ -88,9 +88,14 @@ jobs: python -m site python -c "import psutil; print(psutil.__version__)" - python -m cuopt_server.cuopt_service & + python -m cuopt_server.cuopt_service -p 5555 & sleep 10 pkill -f cuopt_server.cuopt_service + + # Debug Popen directly + echo "=== Debugging Popen ===" + python debug_popen.py + python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py - name: Download test data run: | diff --git a/debug_popen.py b/debug_popen.py new file mode 100644 index 0000000000..fd830fd79d --- /dev/null +++ b/debug_popen.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 + +# SPDX-FileCopyrightText: Copyright (c) 2022-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. + + +import subprocess +import shutil +import sys +import cuopt_server.cuopt_service + +python_path = shutil.which('python') +server_script = cuopt_server.cuopt_service.__file__ + +print(f'python_path: {python_path}') +print(f'server_script: {server_script}') +print(f'sys.executable: {sys.executable}') + +env = { + 'CUOPT_SERVER_IP': '0.0.0.0', + 'CUOPT_SERVER_PORT': '5555', + 'CUOPT_SERVER_LOG_LEVEL': 'debug', +} + +print(f'Environment: {env}') + +try: + proc = subprocess.Popen([python_path, server_script], env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + print(f'Process started with PID: {proc.pid}') + + # Wait a bit and check if process is still running + import time + time.sleep(2) + + if proc.poll() is None: + print('Process is still running') + proc.terminate() + proc.wait() + else: + stdout, stderr = proc.communicate() + print(f'Process exited with code: {proc.returncode}') + print(f'STDOUT: {stdout.decode()}') + print(f'STDERR: {stderr.decode()}') + +except Exception as e: + print(f'Exception: {e}') \ No newline at end of file diff --git a/python/cuopt_server/cuopt_server/tests/utils/utils.py b/python/cuopt_server/cuopt_server/tests/utils/utils.py index 39c292261a..94457133da 100644 --- a/python/cuopt_server/cuopt_server/tests/utils/utils.py +++ b/python/cuopt_server/cuopt_server/tests/utils/utils.py @@ -15,6 +15,7 @@ import os import shutil +import sys import time from subprocess import Popen from typing import Dict, List, Optional @@ -310,7 +311,13 @@ def cuoptproc(request): "CUOPT_SERVER_PORT": "5555", "CUOPT_SERVER_LOG_LEVEL": "debug", } - cuoptmain = Popen([python_path, server_script], env=env) + cuoptmain = Popen( + [python_path, server_script], + env=env, + stderr=sys.stderr, + stdout=sys.stdout, + ) + spinup_wait() def shutdown(): From 78b043eda4d90b77210493e4622a2e54649500e3 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 12:08:30 -0500 Subject: [PATCH 073/131] Add debug --- .github/workflows/test_images.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 0491e487e2..d05b0a1731 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -57,9 +57,6 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Install dependencies - run: | - pip install --user psutil - name: Install pytest run: | su cuopt @@ -91,11 +88,12 @@ jobs: python -m cuopt_server.cuopt_service -p 5555 & sleep 10 pkill -f cuopt_server.cuopt_service - # Debug Popen directly echo "=== Debugging Popen ===" python debug_popen.py - + + ls -l /home/cuopt/.local/lib/python3.12/site-packages/psutil + python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py - name: Download test data run: | From 95bc44928d8df73550d4372a9c297ef4b3ee2f0a Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 13:29:57 -0500 Subject: [PATCH 074/131] fix debug --- debug_popen.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/debug_popen.py b/debug_popen.py index fd830fd79d..7954f382d5 100644 --- a/debug_popen.py +++ b/debug_popen.py @@ -19,6 +19,8 @@ import subprocess import shutil import sys +import os +import site import cuopt_server.cuopt_service python_path = shutil.which('python') @@ -28,11 +30,18 @@ print(f'server_script: {server_script}') print(f'sys.executable: {sys.executable}') -env = { +# Get the user's site-packages directory +user_site_packages = site.getusersitepackages() +print(f'user_site_packages: {user_site_packages}') + +# Set up environment with PYTHONPATH to include user site-packages +env = os.environ.copy() +env.update({ 'CUOPT_SERVER_IP': '0.0.0.0', 'CUOPT_SERVER_PORT': '5555', 'CUOPT_SERVER_LOG_LEVEL': 'debug', -} + 'PYTHONPATH': user_site_packages, +}) print(f'Environment: {env}') From 685eac5e5e93860170d107d1f453e31924bddcbf Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 13:39:38 -0500 Subject: [PATCH 075/131] debug --- debug_popen.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/debug_popen.py b/debug_popen.py index 7954f382d5..14fafe6819 100644 --- a/debug_popen.py +++ b/debug_popen.py @@ -30,17 +30,24 @@ print(f'server_script: {server_script}') print(f'sys.executable: {sys.executable}') -# Get the user's site-packages directory -user_site_packages = site.getusersitepackages() -print(f'user_site_packages: {user_site_packages}') +# Determine the correct site-packages directory +if '/home/cuopt/' in server_script: + # In GitHub Actions environment, the server script is in cuopt user's site-packages + # Extract the site-packages directory from the server script path + cuopt_site_packages = os.path.dirname(os.path.dirname(server_script)) + print(f'Detected cuopt user environment, using: {cuopt_site_packages}') +else: + # In local development environment, use the current environment's site-packages + cuopt_site_packages = os.path.dirname(os.path.dirname(server_script)) + print(f'Using current environment site-packages: {cuopt_site_packages}') -# Set up environment with PYTHONPATH to include user site-packages +# Set up environment with PYTHONPATH to include the correct site-packages env = os.environ.copy() env.update({ 'CUOPT_SERVER_IP': '0.0.0.0', 'CUOPT_SERVER_PORT': '5555', 'CUOPT_SERVER_LOG_LEVEL': 'debug', - 'PYTHONPATH': user_site_packages, + 'PYTHONPATH': cuopt_site_packages, }) print(f'Environment: {env}') From 4a54a31005c96e459e5058bf97b39765a263a070 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 13:56:17 -0500 Subject: [PATCH 076/131] debug --- .github/workflows/test_images.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index d05b0a1731..4cc83d102c 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -75,6 +75,11 @@ jobs: # Test Linear Programming python -m pytest python/cuopt/cuopt/tests/linear_programming/test_lp_solver.py::test_solver + - name: Test cuopt server + run: | + su cuopt + export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" + /bin/bash -c "python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py" - name: Test cuopt server run: | su cuopt From e80e8a327aee56923ecdf16e4b50bd8d4ac08265 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 14:11:37 -0500 Subject: [PATCH 077/131] enable python path --- .../cuopt_server/tests/utils/utils.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/python/cuopt_server/cuopt_server/tests/utils/utils.py b/python/cuopt_server/cuopt_server/tests/utils/utils.py index 94457133da..cdfe854d9d 100644 --- a/python/cuopt_server/cuopt_server/tests/utils/utils.py +++ b/python/cuopt_server/cuopt_server/tests/utils/utils.py @@ -306,11 +306,23 @@ def spinup_wait(): @pytest.fixture(scope="session") def cuoptproc(request): global cuoptmain - env = { + import os + import cuopt_server.cuopt_service + + server_script = cuopt_server.cuopt_service.__file__ + + # Determine the correct site-packages directory for PYTHONPATH + if '/home/cuopt/' in server_script: + cuopt_site_packages = os.path.dirname(os.path.dirname(server_script)) + else: + cuopt_site_packages = os.path.dirname(os.path.dirname(server_script)) + env = os.environ.copy() + env.update({ "CUOPT_SERVER_IP": "0.0.0.0", "CUOPT_SERVER_PORT": "5555", "CUOPT_SERVER_LOG_LEVEL": "debug", - } + "PYTHONPATH": cuopt_site_packages, + }) cuoptmain = Popen( [python_path, server_script], env=env, From d040fc06619c9dbfdfe1d7f886ed4ed261096f4e Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 14:13:17 -0500 Subject: [PATCH 078/131] update workflow --- .github/workflows/test_images.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 4cc83d102c..28f54c5731 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -57,6 +57,9 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Install dependencies + run: | + apt-get install -y file - name: Install pytest run: | su cuopt From f189f594c3d71f88e167c1f86fe5dfb3beee171a Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 14:38:56 -0500 Subject: [PATCH 079/131] update --- .github/workflows/test_images.yaml | 27 +++------ .../cuopt_server/tests/utils/utils.py | 55 ++++++++++++++++++- 2 files changed, 59 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 28f54c5731..ef74c1971d 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -64,6 +64,8 @@ jobs: run: | su cuopt pip install --user pytest psutil + # Verify installation + python -c "import psutil; print(f'psutil {psutil.__version__} installed successfully')" - name: Test CLI run: | su cuopt @@ -82,26 +84,11 @@ jobs: run: | su cuopt export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" - /bin/bash -c "python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py" - - name: Test cuopt server - run: | - su cuopt - export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" - # Show your Python binary path - which python - - python -m site - python -c "import psutil; print(psutil.__version__)" - - python -m cuopt_server.cuopt_service -p 5555 & - sleep 10 - pkill -f cuopt_server.cuopt_service - # Debug Popen directly - echo "=== Debugging Popen ===" - python debug_popen.py - - ls -l /home/cuopt/.local/lib/python3.12/site-packages/psutil - + # Verify psutil is installed and accessible + python -c "import psutil; print(f'psutil version: {psutil.__version__}')" + python -c "import site; print(f'User site packages: {site.getusersitepackages()}')" + + # Run the server tests python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py - name: Download test data run: | diff --git a/python/cuopt_server/cuopt_server/tests/utils/utils.py b/python/cuopt_server/cuopt_server/tests/utils/utils.py index cdfe854d9d..6fdffc8ec4 100644 --- a/python/cuopt_server/cuopt_server/tests/utils/utils.py +++ b/python/cuopt_server/cuopt_server/tests/utils/utils.py @@ -17,6 +17,7 @@ import shutil import sys import time +import subprocess from subprocess import Popen from typing import Dict, List, Optional @@ -298,9 +299,14 @@ def spinup_wait(): try: result = client.get("/cuopt/health") break - except Exception: + except Exception as e: + print(f"Attempt {count}: Failed to connect to server: {e}") time.sleep(1) - assert result.status_code == 200 + + if result is None: + raise AssertionError("Server failed to start within 30 seconds") + + assert result.status_code == 200, f"Server health check failed with status {result.status_code}" @pytest.fixture(scope="session") @@ -308,21 +314,64 @@ def cuoptproc(request): global cuoptmain import os import cuopt_server.cuopt_service + import site server_script = cuopt_server.cuopt_service.__file__ # Determine the correct site-packages directory for PYTHONPATH if '/home/cuopt/' in server_script: cuopt_site_packages = os.path.dirname(os.path.dirname(server_script)) + # Add user's local site-packages directory for psutil + user_site_packages = site.getusersitepackages() + # Also check if there's a .local/lib/python*/site-packages directory + home_dir = os.path.expanduser("~") + # Try to find the correct Python version + import sys + python_version = f"python{sys.version_info.major}.{sys.version_info.minor}" + local_site_packages = os.path.join(home_dir, ".local", "lib", python_version, "site-packages") + if os.path.exists(local_site_packages): + pythonpath = f"{cuopt_site_packages}:{user_site_packages}:{local_site_packages}" + else: + pythonpath = f"{cuopt_site_packages}:{user_site_packages}" else: cuopt_site_packages = os.path.dirname(os.path.dirname(server_script)) + pythonpath = cuopt_site_packages + env = os.environ.copy() env.update({ "CUOPT_SERVER_IP": "0.0.0.0", "CUOPT_SERVER_PORT": "5555", "CUOPT_SERVER_LOG_LEVEL": "debug", - "PYTHONPATH": cuopt_site_packages, + "PYTHONPATH": pythonpath, }) + + print(f"Starting cuopt service with PYTHONPATH: {pythonpath}") + print(f"Python path: {python_path}") + print(f"Server script: {server_script}") + print(f"User site packages: {user_site_packages}") + print(f"Local site packages: {local_site_packages if 'local_site_packages' in locals() else 'Not found'}") + + # Test if psutil can be imported in the target environment + test_env = env.copy() + test_env['PYTHONPATH'] = pythonpath + try: + result = subprocess.run([python_path, '-c', 'import psutil; print("psutil import successful")'], + env=test_env, capture_output=True, text=True, timeout=10) + if result.returncode == 0: + print("psutil import test passed") + else: + print(f"psutil import test failed: {result.stderr}") + # Try to install psutil if it's not found + print("Attempting to install psutil...") + install_result = subprocess.run([python_path, '-m', 'pip', 'install', '--user', 'psutil'], + env=test_env, capture_output=True, text=True, timeout=30) + if install_result.returncode == 0: + print("psutil installation successful") + else: + print(f"psutil installation failed: {install_result.stderr}") + except Exception as e: + print(f"psutil import test exception: {e}") + cuoptmain = Popen( [python_path, server_script], env=env, From ba609c742212411adace016edfeb4cca25d2e43d Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 14:45:56 -0500 Subject: [PATCH 080/131] update --- .../cuopt_server/tests/utils/utils.py | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/python/cuopt_server/cuopt_server/tests/utils/utils.py b/python/cuopt_server/cuopt_server/tests/utils/utils.py index 6fdffc8ec4..04aa444869 100644 --- a/python/cuopt_server/cuopt_server/tests/utils/utils.py +++ b/python/cuopt_server/cuopt_server/tests/utils/utils.py @@ -319,23 +319,19 @@ def cuoptproc(request): server_script = cuopt_server.cuopt_service.__file__ # Determine the correct site-packages directory for PYTHONPATH - if '/home/cuopt/' in server_script: - cuopt_site_packages = os.path.dirname(os.path.dirname(server_script)) - # Add user's local site-packages directory for psutil - user_site_packages = site.getusersitepackages() - # Also check if there's a .local/lib/python*/site-packages directory - home_dir = os.path.expanduser("~") - # Try to find the correct Python version - import sys - python_version = f"python{sys.version_info.major}.{sys.version_info.minor}" - local_site_packages = os.path.join(home_dir, ".local", "lib", python_version, "site-packages") - if os.path.exists(local_site_packages): - pythonpath = f"{cuopt_site_packages}:{user_site_packages}:{local_site_packages}" - else: - pythonpath = f"{cuopt_site_packages}:{user_site_packages}" + user_site_packages = site.getusersitepackages() + home_dir = os.path.expanduser("~") + # Try to find the correct Python version + import sys + python_version = f"python{sys.version_info.major}.{sys.version_info.minor}" + local_site_packages = os.path.join(home_dir, ".local", "lib", python_version, "site-packages") + + cuopt_site_packages = os.path.dirname(os.path.dirname(server_script)) + # Always add user's local site-packages directory for psutil + if os.path.exists(local_site_packages): + pythonpath = f"{cuopt_site_packages}:{user_site_packages}:{local_site_packages}" else: - cuopt_site_packages = os.path.dirname(os.path.dirname(server_script)) - pythonpath = cuopt_site_packages + pythonpath = f"{cuopt_site_packages}:{user_site_packages}" env = os.environ.copy() env.update({ @@ -349,7 +345,7 @@ def cuoptproc(request): print(f"Python path: {python_path}") print(f"Server script: {server_script}") print(f"User site packages: {user_site_packages}") - print(f"Local site packages: {local_site_packages if 'local_site_packages' in locals() else 'Not found'}") + print(f"Local site packages: {local_site_packages if os.path.exists(local_site_packages) else 'Not found'}") # Test if psutil can be imported in the target environment test_env = env.copy() From 9d2001d87f00f2ded2a7e59d317726208eb8bfb5 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 14:59:03 -0500 Subject: [PATCH 081/131] python commit --- python/cuopt_server/cuopt_server/tests/utils/utils.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/python/cuopt_server/cuopt_server/tests/utils/utils.py b/python/cuopt_server/cuopt_server/tests/utils/utils.py index 04aa444869..89cbb95d99 100644 --- a/python/cuopt_server/cuopt_server/tests/utils/utils.py +++ b/python/cuopt_server/cuopt_server/tests/utils/utils.py @@ -313,10 +313,8 @@ def spinup_wait(): def cuoptproc(request): global cuoptmain import os - import cuopt_server.cuopt_service import site - server_script = cuopt_server.cuopt_service.__file__ # Determine the correct site-packages directory for PYTHONPATH user_site_packages = site.getusersitepackages() From 6ee65c3466f52663ec2532dfd27dfa6ec0dbed32 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 15:11:48 -0500 Subject: [PATCH 082/131] change HOME --- .github/workflows/test_images.yaml | 9 +-- .../cuopt_server/tests/utils/utils.py | 72 ++----------------- 2 files changed, 7 insertions(+), 74 deletions(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index ef74c1971d..d3ee60d172 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -63,9 +63,7 @@ jobs: - name: Install pytest run: | su cuopt - pip install --user pytest psutil - # Verify installation - python -c "import psutil; print(f'psutil {psutil.__version__} installed successfully')" + pip install --user pytest - name: Test CLI run: | su cuopt @@ -84,10 +82,7 @@ jobs: run: | su cuopt export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" - # Verify psutil is installed and accessible - python -c "import psutil; print(f'psutil version: {psutil.__version__}')" - python -c "import site; print(f'User site packages: {site.getusersitepackages()}')" - + export HOME=/home/cuopt # Run the server tests python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py - name: Download test data diff --git a/python/cuopt_server/cuopt_server/tests/utils/utils.py b/python/cuopt_server/cuopt_server/tests/utils/utils.py index 89cbb95d99..39c292261a 100644 --- a/python/cuopt_server/cuopt_server/tests/utils/utils.py +++ b/python/cuopt_server/cuopt_server/tests/utils/utils.py @@ -15,9 +15,7 @@ import os import shutil -import sys import time -import subprocess from subprocess import Popen from typing import Dict, List, Optional @@ -299,80 +297,20 @@ def spinup_wait(): try: result = client.get("/cuopt/health") break - except Exception as e: - print(f"Attempt {count}: Failed to connect to server: {e}") + except Exception: time.sleep(1) - - if result is None: - raise AssertionError("Server failed to start within 30 seconds") - - assert result.status_code == 200, f"Server health check failed with status {result.status_code}" + assert result.status_code == 200 @pytest.fixture(scope="session") def cuoptproc(request): global cuoptmain - import os - import site - - - # Determine the correct site-packages directory for PYTHONPATH - user_site_packages = site.getusersitepackages() - home_dir = os.path.expanduser("~") - # Try to find the correct Python version - import sys - python_version = f"python{sys.version_info.major}.{sys.version_info.minor}" - local_site_packages = os.path.join(home_dir, ".local", "lib", python_version, "site-packages") - - cuopt_site_packages = os.path.dirname(os.path.dirname(server_script)) - # Always add user's local site-packages directory for psutil - if os.path.exists(local_site_packages): - pythonpath = f"{cuopt_site_packages}:{user_site_packages}:{local_site_packages}" - else: - pythonpath = f"{cuopt_site_packages}:{user_site_packages}" - - env = os.environ.copy() - env.update({ + env = { "CUOPT_SERVER_IP": "0.0.0.0", "CUOPT_SERVER_PORT": "5555", "CUOPT_SERVER_LOG_LEVEL": "debug", - "PYTHONPATH": pythonpath, - }) - - print(f"Starting cuopt service with PYTHONPATH: {pythonpath}") - print(f"Python path: {python_path}") - print(f"Server script: {server_script}") - print(f"User site packages: {user_site_packages}") - print(f"Local site packages: {local_site_packages if os.path.exists(local_site_packages) else 'Not found'}") - - # Test if psutil can be imported in the target environment - test_env = env.copy() - test_env['PYTHONPATH'] = pythonpath - try: - result = subprocess.run([python_path, '-c', 'import psutil; print("psutil import successful")'], - env=test_env, capture_output=True, text=True, timeout=10) - if result.returncode == 0: - print("psutil import test passed") - else: - print(f"psutil import test failed: {result.stderr}") - # Try to install psutil if it's not found - print("Attempting to install psutil...") - install_result = subprocess.run([python_path, '-m', 'pip', 'install', '--user', 'psutil'], - env=test_env, capture_output=True, text=True, timeout=30) - if install_result.returncode == 0: - print("psutil installation successful") - else: - print(f"psutil installation failed: {install_result.stderr}") - except Exception as e: - print(f"psutil import test exception: {e}") - - cuoptmain = Popen( - [python_path, server_script], - env=env, - stderr=sys.stderr, - stdout=sys.stdout, - ) - + } + cuoptmain = Popen([python_path, server_script], env=env) spinup_wait() def shutdown(): From a51a7f72ad3885ebecf3dc65e9c6747014b53dcd Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 15:31:05 -0500 Subject: [PATCH 083/131] change HOME --- .github/workflows/test_images.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index d3ee60d172..8184f83447 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -63,6 +63,7 @@ jobs: - name: Install pytest run: | su cuopt + export HOME=/home/cuopt pip install --user pytest - name: Test CLI run: | From 20744e88bae8a4102dd4c23ec5696cd36c090466 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 15:43:46 -0500 Subject: [PATCH 084/131] utils --- python/cuopt_server/cuopt_server/tests/utils/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/cuopt_server/cuopt_server/tests/utils/utils.py b/python/cuopt_server/cuopt_server/tests/utils/utils.py index 39c292261a..05df8f1bba 100644 --- a/python/cuopt_server/cuopt_server/tests/utils/utils.py +++ b/python/cuopt_server/cuopt_server/tests/utils/utils.py @@ -310,6 +310,8 @@ def cuoptproc(request): "CUOPT_SERVER_PORT": "5555", "CUOPT_SERVER_LOG_LEVEL": "debug", } + print(f"Starting cuopt service with PYTHONPATH: {python_path}") + print(f"Server script: {server_script}") cuoptmain = Popen([python_path, server_script], env=env) spinup_wait() From 30735543550f7fea1dfc570d4c3e04b1a43923fe Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 15:53:06 -0500 Subject: [PATCH 085/131] update utils --- python/cuopt_server/cuopt_server/tests/utils/utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/cuopt_server/cuopt_server/tests/utils/utils.py b/python/cuopt_server/cuopt_server/tests/utils/utils.py index 05df8f1bba..c036dfc9eb 100644 --- a/python/cuopt_server/cuopt_server/tests/utils/utils.py +++ b/python/cuopt_server/cuopt_server/tests/utils/utils.py @@ -282,7 +282,9 @@ def cuopt_service_sync( # Fixture and client to allow full cuopt service # to run as a separate process for multiple tests cuoptmain = None -server_script = cuopt_service.__file__ +# Use module name instead of file path to ensure we use the installed package +server_script = "-m" +server_module = "cuopt_server.cuopt_service" python_path = shutil.which("python") @@ -311,8 +313,8 @@ def cuoptproc(request): "CUOPT_SERVER_LOG_LEVEL": "debug", } print(f"Starting cuopt service with PYTHONPATH: {python_path}") - print(f"Server script: {server_script}") - cuoptmain = Popen([python_path, server_script], env=env) + print(f"Server module: {server_module}") + cuoptmain = Popen([python_path, server_script, server_module], env=env) spinup_wait() def shutdown(): From bd5a624ff16a5ded004fbadf2c039c27175398a9 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 16:06:19 -0500 Subject: [PATCH 086/131] update utils --- .github/workflows/test_images.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 8184f83447..b1acd8ef67 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -74,6 +74,14 @@ jobs: run: | su cuopt export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" + echo "PYTHONPATH: $PYTHONPATH" + echo "PATH: $PATH" + echo "HOME: $HOME" + echo "USER: $USER" + echo "PWD: $PWD" + echo "CUDA_SHORT: $CUDA_SHORT" + echo "PYTHON_SHORT: $PYTHON_SHORT" + # # Test Vehicle Routing python -m pytest python/cuopt/cuopt/tests/routing/test_vehicle_routing.py @@ -81,11 +89,10 @@ jobs: python -m pytest python/cuopt/cuopt/tests/linear_programming/test_lp_solver.py::test_solver - name: Test cuopt server run: | - su cuopt export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" - export HOME=/home/cuopt # Run the server tests - python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py + su cuopt -c "python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py" + - name: Download test data run: | su cuopt From cdf2e7511236fb3fb5ff8ce82f2c5d6f5b797916 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 16:56:23 -0500 Subject: [PATCH 087/131] new changes --- .github/workflows/test_images.yaml | 51 +----------------------------- ci/docker/test_docker.sh | 42 ++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 50 deletions(-) create mode 100644 ci/docker/test_docker.sh diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index b1acd8ef67..468416ddcf 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -60,55 +60,6 @@ jobs: - name: Install dependencies run: | apt-get install -y file - - name: Install pytest - run: | - su cuopt - export HOME=/home/cuopt - pip install --user pytest - - name: Test CLI - run: | - su cuopt - export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" - bash python/libcuopt/libcuopt/tests/test_cli.sh - name: Test cuopt run: | - su cuopt - export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" - echo "PYTHONPATH: $PYTHONPATH" - echo "PATH: $PATH" - echo "HOME: $HOME" - echo "USER: $USER" - echo "PWD: $PWD" - echo "CUDA_SHORT: $CUDA_SHORT" - echo "PYTHON_SHORT: $PYTHON_SHORT" - # - # Test Vehicle Routing - python -m pytest python/cuopt/cuopt/tests/routing/test_vehicle_routing.py - - # Test Linear Programming - python -m pytest python/cuopt/cuopt/tests/linear_programming/test_lp_solver.py::test_solver - - name: Test cuopt server - run: | - export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" - # Run the server tests - su cuopt -c "python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py" - - - name: Download test data - run: | - su cuopt - bash datasets/linear_programming/download_pdlp_test_dataset.sh - bash datasets/mip/download_miplib_test_dataset.sh - cd datasets - ./get_test_data.sh --solomon - ./get_test_data.sh --tsp - cd - - - name: Pytest cuOpt - run: | - su cuopt - export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" - python -m pytest python/cuopt/cuopt/tests/ - - name: Pytest cuOpt Server - run: | - su cuopt - export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" - python -m pytest python/cuopt_server/cuopt_server/tests/ \ No newline at end of file + su cuopt -c "bash ./ci/docker/test_docker.sh" \ No newline at end of file diff --git a/ci/docker/test_docker.sh b/ci/docker/test_docker.sh new file mode 100644 index 0000000000..1a986a274a --- /dev/null +++ b/ci/docker/test_docker.sh @@ -0,0 +1,42 @@ +#!/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. + +# Set dataset root directory +export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" + +export HOME=/home/cuopt + +# Install dependencies +pip install --user pytest + +# Download test data +bash datasets/linear_programming/download_pdlp_test_dataset.sh +bash datasets/mip/download_miplib_test_dataset.sh +cd datasets && ./get_test_data.sh --solomon && ./get_test_data.sh --tsp && cd - + +# Test CLI +echo "Testing CLI" +bash python/libcuopt/libcuopt/tests/test_cli.sh + +# Test cuopt +echo "Testing cuopt" +RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/routing/test_vehicle_routing.py +RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/linear_programming/test_lp_solver.py::test_solver + +# Test cuopt server +echo "Testing cuopt server" +RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py \ No newline at end of file From bb89f2e3e71bde1be928a3f8bb24dbc7eb9e27ad Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 17:12:45 -0500 Subject: [PATCH 088/131] fix issues --- .github/workflows/test_images.yaml | 2 +- ci/docker/test_docker.sh | 21 ++++++++------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 468416ddcf..aa77a36aa7 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -62,4 +62,4 @@ jobs: apt-get install -y file - name: Test cuopt run: | - su cuopt -c "bash ./ci/docker/test_docker.sh" \ No newline at end of file + bash ./ci/docker/test_docker.sh \ No newline at end of file diff --git a/ci/docker/test_docker.sh b/ci/docker/test_docker.sh index 1a986a274a..b30e380394 100644 --- a/ci/docker/test_docker.sh +++ b/ci/docker/test_docker.sh @@ -15,28 +15,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Set dataset root directory -export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" - -export HOME=/home/cuopt - # Install dependencies -pip install --user pytest +su cuopt -c "pip install --user pytest" # Download test data -bash datasets/linear_programming/download_pdlp_test_dataset.sh -bash datasets/mip/download_miplib_test_dataset.sh -cd datasets && ./get_test_data.sh --solomon && ./get_test_data.sh --tsp && cd - +su cuopt -c "bash datasets/linear_programming/download_pdlp_test_dataset.sh" +su cuopt -c "bash datasets/mip/download_miplib_test_dataset.sh" +su cuopt -c "cd datasets && ./get_test_data.sh --solomon && ./get_test_data.sh --tsp && cd -" # Test CLI echo "Testing CLI" -bash python/libcuopt/libcuopt/tests/test_cli.sh +su cuopt -c "export RAPIDS_DATASET_ROOT_DIR=$(realpath datasets) && bash python/libcuopt/libcuopt/tests/test_cli.sh" # Test cuopt echo "Testing cuopt" -RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/routing/test_vehicle_routing.py -RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/linear_programming/test_lp_solver.py::test_solver +su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/routing/test_vehicle_routing.py" +su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/linear_programming/test_lp_solver.py::test_solver" # Test cuopt server echo "Testing cuopt server" -RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py \ No newline at end of file +su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py" \ No newline at end of file From 67db1aa5e8a42129fccc5f734990251317d9b322 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 17:22:04 -0500 Subject: [PATCH 089/131] fix issues --- ci/docker/test_docker.sh | 6 ++-- .../cuopt_server/tests/utils/utils.py | 30 +++++++++++++++++-- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/ci/docker/test_docker.sh b/ci/docker/test_docker.sh index b30e380394..3d77ddc786 100644 --- a/ci/docker/test_docker.sh +++ b/ci/docker/test_docker.sh @@ -19,9 +19,9 @@ su cuopt -c "pip install --user pytest" # Download test data -su cuopt -c "bash datasets/linear_programming/download_pdlp_test_dataset.sh" -su cuopt -c "bash datasets/mip/download_miplib_test_dataset.sh" -su cuopt -c "cd datasets && ./get_test_data.sh --solomon && ./get_test_data.sh --tsp && cd -" +bash datasets/linear_programming/download_pdlp_test_dataset.sh +bash datasets/mip/download_miplib_test_dataset.sh +cd datasets && ./get_test_data.sh --solomon && ./get_test_data.sh --tsp && cd - # Test CLI echo "Testing CLI" diff --git a/python/cuopt_server/cuopt_server/tests/utils/utils.py b/python/cuopt_server/cuopt_server/tests/utils/utils.py index c036dfc9eb..aafebee0ea 100644 --- a/python/cuopt_server/cuopt_server/tests/utils/utils.py +++ b/python/cuopt_server/cuopt_server/tests/utils/utils.py @@ -14,9 +14,10 @@ # limitations under the License. import os +import signal import shutil import time -from subprocess import Popen +from subprocess import Popen, TimeoutExpired from typing import Dict, List, Optional import pytest @@ -288,6 +289,31 @@ def cuopt_service_sync( python_path = shutil.which("python") +def cleanup_cuopt_process(): + """Clean up the cuopt process if it's still running""" + global cuoptmain + if cuoptmain and cuoptmain.poll() is None: + print("Cleaning up cuopt service...") + cuoptmain.terminate() + try: + cuoptmain.wait(timeout=5) + except TimeoutExpired: + print("Force killing cuopt service...") + cuoptmain.kill() + cuoptmain.wait() + + +def signal_handler(signum, frame): + """Handle interrupt signals to ensure cleanup""" + cleanup_cuopt_process() + exit(1) + + +# Register signal handlers for cleanup +signal.signal(signal.SIGINT, signal_handler) +signal.signal(signal.SIGTERM, signal_handler) + + def spinup_wait(): client = RequestClient() count = 0 @@ -318,7 +344,7 @@ def cuoptproc(request): spinup_wait() def shutdown(): - cuoptmain.wait() + cleanup_cuopt_process() request.addfinalizer(shutdown) From 36ce08f0ac373cf330edfe7cfe01bad564472f70 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 19:19:47 -0500 Subject: [PATCH 090/131] test all --- .github/workflows/test_images.yaml | 2 +- ci/docker/test_docker.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index aa77a36aa7..8b2d859ce0 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -59,7 +59,7 @@ jobs: fetch-depth: 0 - name: Install dependencies run: | - apt-get install -y file + apt-get install -y file bzip2 gcc - name: Test cuopt run: | bash ./ci/docker/test_docker.sh \ No newline at end of file diff --git a/ci/docker/test_docker.sh b/ci/docker/test_docker.sh index 3d77ddc786..6c58bc4d89 100644 --- a/ci/docker/test_docker.sh +++ b/ci/docker/test_docker.sh @@ -31,7 +31,9 @@ su cuopt -c "export RAPIDS_DATASET_ROOT_DIR=$(realpath datasets) && bash python/ echo "Testing cuopt" su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/routing/test_vehicle_routing.py" su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/linear_programming/test_lp_solver.py::test_solver" +su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/" # Test cuopt server echo "Testing cuopt server" -su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py" \ No newline at end of file +su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py" +su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt_server/cuopt_server/tests/" \ No newline at end of file From c444d906fb217b3f19d698385eb647d515be1dbc Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 8 Jul 2025 21:00:38 -0500 Subject: [PATCH 091/131] fix cli test and remove exhaustive testing --- ci/docker/test_docker.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/docker/test_docker.sh b/ci/docker/test_docker.sh index 6c58bc4d89..831db080cf 100644 --- a/ci/docker/test_docker.sh +++ b/ci/docker/test_docker.sh @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -euo pipefail + # Install dependencies su cuopt -c "pip install --user pytest" @@ -25,15 +27,13 @@ cd datasets && ./get_test_data.sh --solomon && ./get_test_data.sh --tsp && cd - # Test CLI echo "Testing CLI" -su cuopt -c "export RAPIDS_DATASET_ROOT_DIR=$(realpath datasets) && bash python/libcuopt/libcuopt/tests/test_cli.sh" +su cuopt -c "export PATH=$PATH:/home/cuopt/.local/bin && export RAPIDS_DATASET_ROOT_DIR=$(realpath datasets) && bash python/libcuopt/libcuopt/tests/test_cli.sh" # Test cuopt echo "Testing cuopt" su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/routing/test_vehicle_routing.py" su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/linear_programming/test_lp_solver.py::test_solver" -su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/" # Test cuopt server echo "Testing cuopt server" -su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py" -su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt_server/cuopt_server/tests/" \ No newline at end of file +su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py" \ No newline at end of file From a15833903fb947f16a73dc48f1a0857fc2d00357 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Wed, 9 Jul 2025 12:19:45 -0500 Subject: [PATCH 092/131] Add fix to testing --- ci/docker/test_docker.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ci/docker/test_docker.sh b/ci/docker/test_docker.sh index 831db080cf..f82016c5e2 100644 --- a/ci/docker/test_docker.sh +++ b/ci/docker/test_docker.sh @@ -18,22 +18,23 @@ set -euo pipefail # Install dependencies -su cuopt -c "pip install --user pytest" +su cuopt -c "pip install --user pytest pexpect" # Download test data bash datasets/linear_programming/download_pdlp_test_dataset.sh bash datasets/mip/download_miplib_test_dataset.sh -cd datasets && ./get_test_data.sh --solomon && ./get_test_data.sh --tsp && cd - +ln -sf "$(pwd)" /home/cuopt/cuopt + + # Test CLI echo "Testing CLI" -su cuopt -c "export PATH=$PATH:/home/cuopt/.local/bin && export RAPIDS_DATASET_ROOT_DIR=$(realpath datasets) && bash python/libcuopt/libcuopt/tests/test_cli.sh" +su - cuopt -c "cd cuopte && export RAPIDS_DATASET_ROOT_DIR=$(realpath datasets) && bash python/libcuopt/libcuopt/tests/test_cli.sh" # Test cuopt echo "Testing cuopt" -su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/routing/test_vehicle_routing.py" -su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/linear_programming/test_lp_solver.py::test_solver" +su - cuopt -c "cd cuopt && RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/" # Test cuopt server echo "Testing cuopt server" -su cuopt -c "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py" \ No newline at end of file +su - cuopt -c "cd cuopt && RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py" \ No newline at end of file From 2d552c930978d600d22f0de3f314ae183f20de4c Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Wed, 9 Jul 2025 13:55:51 -0500 Subject: [PATCH 093/131] enable all the tests --- ci/docker/test_docker.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/ci/docker/test_docker.sh b/ci/docker/test_docker.sh index f82016c5e2..5f028eb641 100644 --- a/ci/docker/test_docker.sh +++ b/ci/docker/test_docker.sh @@ -21,20 +21,25 @@ set -euo pipefail su cuopt -c "pip install --user pytest pexpect" # Download test data -bash datasets/linear_programming/download_pdlp_test_dataset.sh -bash datasets/mip/download_miplib_test_dataset.sh +#bash datasets/linear_programming/download_pdlp_test_dataset.sh +#bash datasets/mip/download_miplib_test_dataset.sh +#cd datasets && ./get_test_data.sh --solomon && ./get_test_data.sh --tsp && cd - + ln -sf "$(pwd)" /home/cuopt/cuopt # Test CLI -echo "Testing CLI" -su - cuopt -c "cd cuopte && export RAPIDS_DATASET_ROOT_DIR=$(realpath datasets) && bash python/libcuopt/libcuopt/tests/test_cli.sh" +echo "----------------- CLI TEST START ---------------" +su - cuopt -c "cd cuopt && export PATH=$PATH:/home/cuopt/.local/bin && export RAPIDS_DATASET_ROOT_DIR=$(realpath datasets) && bash python/libcuopt/libcuopt/tests/test_cli.sh" +echo "----------------- CLI TEST END ---------------" # Test cuopt -echo "Testing cuopt" +echo "----------------- CUOPT TEST START ---------------" su - cuopt -c "cd cuopt && RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/" +echo "----------------- CUOPT TEST END ---------------" # Test cuopt server -echo "Testing cuopt server" -su - cuopt -c "cd cuopt && RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt_server/cuopt_server/tests/test_server.py" \ No newline at end of file +echo "----------------- CUOPT SERVER TEST START ---------------" +su - cuopt -c "cd cuopt && RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt_server/cuopt_server/tests/" +echo "----------------- CUOPT SERVER TEST END ---------------" \ No newline at end of file From a3742bca906ad88913c00f47afe496a4768be0d6 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Wed, 9 Jul 2025 14:50:13 -0500 Subject: [PATCH 094/131] update --- ci/docker/test_docker.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/docker/test_docker.sh b/ci/docker/test_docker.sh index 5f028eb641..f3a1e205f4 100644 --- a/ci/docker/test_docker.sh +++ b/ci/docker/test_docker.sh @@ -21,9 +21,9 @@ set -euo pipefail su cuopt -c "pip install --user pytest pexpect" # Download test data -#bash datasets/linear_programming/download_pdlp_test_dataset.sh -#bash datasets/mip/download_miplib_test_dataset.sh -#cd datasets && ./get_test_data.sh --solomon && ./get_test_data.sh --tsp && cd - +bash datasets/linear_programming/download_pdlp_test_dataset.sh +bash datasets/mip/download_miplib_test_dataset.sh +cd datasets && ./get_test_data.sh --solomon && ./get_test_data.sh --tsp && cd - ln -sf "$(pwd)" /home/cuopt/cuopt From fe4be7f09b1bf8491b41cf53382b9e92a8089633 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Wed, 9 Jul 2025 20:25:42 -0500 Subject: [PATCH 095/131] update --- ci/docker/test_docker.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ci/docker/test_docker.sh b/ci/docker/test_docker.sh index f3a1e205f4..d10c1eaab3 100644 --- a/ci/docker/test_docker.sh +++ b/ci/docker/test_docker.sh @@ -17,6 +17,9 @@ set -euo pipefail +chsh -s /bin/bash cuopt + + # Install dependencies su cuopt -c "pip install --user pytest pexpect" @@ -27,7 +30,7 @@ cd datasets && ./get_test_data.sh --solomon && ./get_test_data.sh --tsp && cd - ln -sf "$(pwd)" /home/cuopt/cuopt - +chmod -R a+w $(pwd) # Test CLI echo "----------------- CLI TEST START ---------------" @@ -36,7 +39,9 @@ echo "----------------- CLI TEST END ---------------" # Test cuopt echo "----------------- CUOPT TEST START ---------------" -su - cuopt -c "cd cuopt && RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/" +# Testing routing and linear programming seperate since running them together will cause the test to fail +su - cuopt -c "cd cuopt && RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/linear_programming/test_lp_solver.py::test_solver" +su - cuopt -c "cd cuopt && RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/routing" echo "----------------- CUOPT TEST END ---------------" # Test cuopt server From 38f2177e14a44fd4a8a0066acab3e9b5dafd0f03 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 10 Jul 2025 09:51:55 -0500 Subject: [PATCH 096/131] Update --- .github/workflows/test_images.yaml | 3 --- ci/docker/test_docker.sh | 32 ++++++++++++++++++++---------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 8b2d859ce0..13de7444c9 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -57,9 +57,6 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Install dependencies - run: | - apt-get install -y file bzip2 gcc - name: Test cuopt run: | bash ./ci/docker/test_docker.sh \ No newline at end of file diff --git a/ci/docker/test_docker.sh b/ci/docker/test_docker.sh index d10c1eaab3..91612dbc89 100644 --- a/ci/docker/test_docker.sh +++ b/ci/docker/test_docker.sh @@ -19,32 +19,44 @@ set -euo pipefail chsh -s /bin/bash cuopt - # Install dependencies -su cuopt -c "pip install --user pytest pexpect" +apt-get install -y file bzip2 gcc # Download test data bash datasets/linear_programming/download_pdlp_test_dataset.sh bash datasets/mip/download_miplib_test_dataset.sh cd datasets && ./get_test_data.sh --solomon && ./get_test_data.sh --tsp && cd - +# Create symlink to cuopt ln -sf "$(pwd)" /home/cuopt/cuopt +# Set permissions since the repo is mounted on root chmod -R a+w $(pwd) -# Test CLI +# Login as cuopt user +su - cuopt + +cd cuopt + +# Install test dependencies +pip install --user pytest pexpect + +# Set environment variables +export PATH=$PATH:/home/cuopt/.local/bin + +export RAPIDS_DATASET_ROOT_DIR=$(realpath datasets) + echo "----------------- CLI TEST START ---------------" -su - cuopt -c "cd cuopt && export PATH=$PATH:/home/cuopt/.local/bin && export RAPIDS_DATASET_ROOT_DIR=$(realpath datasets) && bash python/libcuopt/libcuopt/tests/test_cli.sh" +bash python/libcuopt/libcuopt/tests/test_cli.sh echo "----------------- CLI TEST END ---------------" -# Test cuopt echo "----------------- CUOPT TEST START ---------------" -# Testing routing and linear programming seperate since running them together will cause the test to fail -su - cuopt -c "cd cuopt && RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/linear_programming/test_lp_solver.py::test_solver" -su - cuopt -c "cd cuopt && RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt/cuopt/tests/routing" +# Install test dependencies +python -m pytest python/cuopt/cuopt/tests/linear_programming +python -m pytest python/cuopt/cuopt/tests/routing echo "----------------- CUOPT TEST END ---------------" -# Test cuopt server echo "----------------- CUOPT SERVER TEST START ---------------" -su - cuopt -c "cd cuopt && RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest python/cuopt_server/cuopt_server/tests/" +# Install test dependencies +python -m pytest python/cuopt_server/cuopt_server/tests/ echo "----------------- CUOPT SERVER TEST END ---------------" \ No newline at end of file From 9327151f6fdcf7f84d1810d15e74c32337285d6a Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 10 Jul 2025 09:52:37 -0500 Subject: [PATCH 097/131] change name --- .github/workflows/test_images.yaml | 2 +- ci/docker/{test_docker.sh => test_image.sh} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ci/docker/{test_docker.sh => test_image.sh} (100%) diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index 13de7444c9..d5f52de367 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -59,4 +59,4 @@ jobs: fetch-depth: 0 - name: Test cuopt run: | - bash ./ci/docker/test_docker.sh \ No newline at end of file + bash ./ci/docker/test_image.sh \ No newline at end of file diff --git a/ci/docker/test_docker.sh b/ci/docker/test_image.sh similarity index 100% rename from ci/docker/test_docker.sh rename to ci/docker/test_image.sh From edfd72bc6b84aba2a8fdb3215e166250ab54e226 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 10 Jul 2025 10:00:35 -0500 Subject: [PATCH 098/131] test with complete workflow --- .github/workflows/build_images.yaml | 2 +- .../workflows/build_test_publish_images.yaml | 105 +++++++++--------- ci/docker/Dockerfile | 12 +- 3 files changed, 61 insertions(+), 58 deletions(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index 7d9a5b07da..ed12eb92d1 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -87,7 +87,7 @@ jobs: build-args: | CUDA_VER=${{ inputs.CUDA_VER }} PYTHON_VER=${{ inputs.PYTHON_VER }} - CUOPT_VER=${{ inputs.CUOPT_VER }} + CUOPT_VER=25.8.0a43 tags: nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-py${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }} - name: Push image to NGC diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 3f5f3464ef..89909e13fb 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -98,63 +98,62 @@ jobs: fi echo "IMAGE_TAG_PREFIX=$IMAGE_TAG_PREFIX" >> $GITHUB_OUTPUT - #build-images: - #name: Build images - #needs: compute-matrix - #secrets: inherit - #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: ${{ needs.compute-matrix.outputs.CUOPT_VER }} - #IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} + build-images: + name: Build images + needs: compute-matrix + secrets: inherit + 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: ${{ needs.compute-matrix.outputs.CUOPT_VER }} + IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} - #build-cuopt-multiarch-manifest: - #name: Build cuopt multiarch manifest - #needs: build-images - #strategy: - #matrix: - #CUDA_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} - #PYTHON_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).python_ver }} - #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_TOKEN }} - #- name: Login to NGC - #uses: docker/login-action@v3 - #with: - #registry: "nvcr.io" - #username: "$oauthtoken" - #password: ${{ secrets.CUOPT_NGC_DOCKER_KEY }} - #- name: Trim CUDA and Python versions - #id: trim - #run: | - #echo "CUDA_SHORT=$(echo '${{ matrix.CUDA_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT - #echo "PYTHON_SHORT=$(echo '${{ matrix.PYTHON_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT - #- name: Create multiarch manifest - #shell: bash - #env: - #CUOPT_VER: ${{ needs.compute-matrix.outputs.CUOPT_VER }} - #CUDA_SHORT: ${{ steps.trim.outputs.CUDA_SHORT }} - #PYTHON_SHORT: ${{ steps.trim.outputs.PYTHON_SHORT }} - #IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} - #BUILD_TYPE: ${{ inputs.build_type }} - #run: bash ci/docker/create_multiarch_manifest.sh + build-cuopt-multiarch-manifest: + name: Build cuopt multiarch manifest + needs: build-images + strategy: + matrix: + CUDA_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} + PYTHON_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).python_ver }} + 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_TOKEN }} + - name: Login to NGC + uses: docker/login-action@v3 + with: + registry: "nvcr.io" + username: "$oauthtoken" + password: ${{ secrets.CUOPT_NGC_DOCKER_KEY }} + - name: Trim CUDA and Python versions + id: trim + run: | + echo "CUDA_SHORT=$(echo '${{ matrix.CUDA_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT + echo "PYTHON_SHORT=$(echo '${{ matrix.PYTHON_VER }}' | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_OUTPUT + - name: Create multiarch manifest + shell: bash + env: + CUOPT_VER: ${{ needs.compute-matrix.outputs.CUOPT_VER }} + CUDA_SHORT: ${{ steps.trim.outputs.CUDA_SHORT }} + PYTHON_SHORT: ${{ steps.trim.outputs.PYTHON_SHORT }} + IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} + BUILD_TYPE: ${{ inputs.build_type }} + run: bash ci/docker/create_multiarch_manifest.sh test-images: name: Test images - #needs: build-cuopt-multiarch-manifest - needs: compute-matrix + needs: build-cuopt-multiarch-manifest secrets: inherit strategy: matrix: diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index 5d1c87d281..291939451d 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -108,10 +108,14 @@ 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:-}" +# Set environment variables in .bashrc for all future shells +RUN echo 'export 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"' >> /home/cuopt/.bashrc && \ + echo 'export 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}"' >> /home/cuopt/.bashrc && \ + echo 'export PYTHONPATH="/home/cuopt/.local/lib/python${PYTHON_SHORT_VER}/site-packages:/usr/local/lib/python${PYTHON_SHORT_VER}/site-packages:${PYTHONPATH:-}"' >> /home/cuopt/.bashrc + + +# Create a .bash_profile that sources .bashrc if it exists +RUN echo 'if [ -f ~/.bashrc ]; then . ~/.bashrc; fi' > /home/cuopt/.bash_profile 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/ From d36ffb17ab398e0c814118fb50e0037ff2cfaaee Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 10 Jul 2025 11:32:34 -0500 Subject: [PATCH 099/131] fix issue --- .github/workflows/build_test_publish_images.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 89909e13fb..f5e73f09c5 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -114,7 +114,7 @@ jobs: build-cuopt-multiarch-manifest: name: Build cuopt multiarch manifest - needs: build-images + needs: [build-images, compute-matrix] strategy: matrix: CUDA_VER: ${{ fromJson(needs.compute-matrix.outputs.MATRIX).cuda_ver }} @@ -153,7 +153,7 @@ jobs: test-images: name: Test images - needs: build-cuopt-multiarch-manifest + needs: [build-cuopt-multiarch-manifest, compute-matrix] secrets: inherit strategy: matrix: From 0f0b79770136a419cb2676efa3a0413ef48cfb3a Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 10 Jul 2025 14:32:06 -0500 Subject: [PATCH 100/131] fix testing and docker file --- ci/docker/Dockerfile | 2 +- ci/docker/test_image.sh | 44 ++++++++++++++++------------------------- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index 291939451d..f1a433ecea 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -122,4 +122,4 @@ COPY --from=cuda-libs /usr/local/cuda/lib64/libnvJitLink* /usr/local/cuda/lib64/ ENV CUOPT_SERVER_PORT=8000 -ENTRYPOINT ["python", "-m", "cuopt_server.cuopts_service"] \ No newline at end of file +ENTRYPOINT ["python", "-m", "cuopt_server.cuopt_service"] \ No newline at end of file diff --git a/ci/docker/test_image.sh b/ci/docker/test_image.sh index 91612dbc89..66d797edb7 100644 --- a/ci/docker/test_image.sh +++ b/ci/docker/test_image.sh @@ -33,30 +33,20 @@ ln -sf "$(pwd)" /home/cuopt/cuopt # Set permissions since the repo is mounted on root chmod -R a+w $(pwd) -# Login as cuopt user -su - cuopt - -cd cuopt - -# Install test dependencies -pip install --user pytest pexpect - -# Set environment variables -export PATH=$PATH:/home/cuopt/.local/bin - -export RAPIDS_DATASET_ROOT_DIR=$(realpath datasets) - -echo "----------------- CLI TEST START ---------------" -bash python/libcuopt/libcuopt/tests/test_cli.sh -echo "----------------- CLI TEST END ---------------" - -echo "----------------- CUOPT TEST START ---------------" -# Install test dependencies -python -m pytest python/cuopt/cuopt/tests/linear_programming -python -m pytest python/cuopt/cuopt/tests/routing -echo "----------------- CUOPT TEST END ---------------" - -echo "----------------- CUOPT SERVER TEST START ---------------" -# Install test dependencies -python -m pytest python/cuopt_server/cuopt_server/tests/ -echo "----------------- CUOPT SERVER TEST END ---------------" \ No newline at end of file +# If this script is being run as root, use 'su - cuopt -c ""' to run each command as cuopt. + +# Change to cuopt home directory and then to cuopt repo +su - cuopt -c "cd ~/cuopt && \ + pip install --user pytest pexpect && \ + export PATH=\$PATH:/home/cuopt/.local/bin && \ + export RAPIDS_DATASET_ROOT_DIR=\$(realpath datasets) && \ + echo '----------------- CLI TEST START ---------------' && \ + bash python/libcuopt/libcuopt/tests/test_cli.sh && \ + echo '----------------- CLI TEST END ---------------' && \ + echo '----------------- CUOPT TEST START ---------------' && \ + python -m pytest python/cuopt/cuopt/tests/linear_programming && \ + python -m pytest python/cuopt/cuopt/tests/routing && \ + echo '----------------- CUOPT TEST END ---------------' && \ + echo '----------------- CUOPT SERVER TEST START ---------------' && \ + python -m pytest python/cuopt_server/cuopt_server/tests/ && \ + echo '----------------- CUOPT SERVER TEST END ---------------'" \ No newline at end of file From db00b53a812249c3b60be1156efacead795599c7 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 10 Jul 2025 18:00:36 -0500 Subject: [PATCH 101/131] fix PR --- .github/workflows/build_images.yaml | 2 +- .github/workflows/pr.yaml | 228 +++++++++++++++++++++++++++- ci/docker/Dockerfile | 2 +- 3 files changed, 223 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index ed12eb92d1..7d9a5b07da 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -87,7 +87,7 @@ jobs: build-args: | CUDA_VER=${{ inputs.CUDA_VER }} PYTHON_VER=${{ inputs.PYTHON_VER }} - CUOPT_VER=25.8.0a43 + CUOPT_VER=${{ inputs.CUOPT_VER }} tags: nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-py${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }} - name: Push image to NGC diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index b39dbdd0cc..d21d8e4d3c 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -10,12 +10,226 @@ concurrency: cancel-in-progress: true jobs: - build-images: - uses: ./.github/workflows/build_test_publish_images.yaml + 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: - branch: "branch-25.08" - sha: "e0dc603" - date: "2025-07-03" - build_type: "nightly" - \ No newline at end of file + build_type: pull-request + script: ci/test_self_hosted_service.sh diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index f1a433ecea..e951ddb192 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1.2 -# SPDX-FileCopyrightText: Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# 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"); From 28096a9258f46d31d894a26aa4a951fdaf063812 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 11 Jul 2025 10:33:42 -0500 Subject: [PATCH 102/131] fix style --- python/cuopt_server/cuopt_server/tests/utils/utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python/cuopt_server/cuopt_server/tests/utils/utils.py b/python/cuopt_server/cuopt_server/tests/utils/utils.py index aafebee0ea..a5366d51be 100644 --- a/python/cuopt_server/cuopt_server/tests/utils/utils.py +++ b/python/cuopt_server/cuopt_server/tests/utils/utils.py @@ -14,8 +14,8 @@ # limitations under the License. import os -import signal import shutil +import signal import time from subprocess import Popen, TimeoutExpired from typing import Dict, List, Optional @@ -23,8 +23,6 @@ import pytest import requests -from cuopt_server import cuopt_service - RAPIDS_DATASET_ROOT_DIR = os.getenv("RAPIDS_DATASET_ROOT_DIR") if RAPIDS_DATASET_ROOT_DIR is None: RAPIDS_DATASET_ROOT_DIR = os.path.dirname(os.getcwd()) From 65234a9011687b006313bee9dbfca26007b16204 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 11 Jul 2025 10:43:55 -0500 Subject: [PATCH 103/131] remove debug and update README --- ci/docker/context/README.md | 2 +- debug_popen.py | 74 ------------------------------------- 2 files changed, 1 insertion(+), 75 deletions(-) delete mode 100644 debug_popen.py diff --git a/ci/docker/context/README.md b/ci/docker/context/README.md index c9f038722f..e43a12ebc3 100644 --- a/ci/docker/context/README.md +++ b/ci/docker/context/README.md @@ -1 +1 @@ -Add all the docker file required elements required for the buildx context. \ No newline at end of file +Add all the files and data for the buildx context to this folder like entrypoint script, and others. \ No newline at end of file diff --git a/debug_popen.py b/debug_popen.py deleted file mode 100644 index 14fafe6819..0000000000 --- a/debug_popen.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python3 - -# SPDX-FileCopyrightText: Copyright (c) 2022-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. - - -import subprocess -import shutil -import sys -import os -import site -import cuopt_server.cuopt_service - -python_path = shutil.which('python') -server_script = cuopt_server.cuopt_service.__file__ - -print(f'python_path: {python_path}') -print(f'server_script: {server_script}') -print(f'sys.executable: {sys.executable}') - -# Determine the correct site-packages directory -if '/home/cuopt/' in server_script: - # In GitHub Actions environment, the server script is in cuopt user's site-packages - # Extract the site-packages directory from the server script path - cuopt_site_packages = os.path.dirname(os.path.dirname(server_script)) - print(f'Detected cuopt user environment, using: {cuopt_site_packages}') -else: - # In local development environment, use the current environment's site-packages - cuopt_site_packages = os.path.dirname(os.path.dirname(server_script)) - print(f'Using current environment site-packages: {cuopt_site_packages}') - -# Set up environment with PYTHONPATH to include the correct site-packages -env = os.environ.copy() -env.update({ - 'CUOPT_SERVER_IP': '0.0.0.0', - 'CUOPT_SERVER_PORT': '5555', - 'CUOPT_SERVER_LOG_LEVEL': 'debug', - 'PYTHONPATH': cuopt_site_packages, -}) - -print(f'Environment: {env}') - -try: - proc = subprocess.Popen([python_path, server_script], env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - print(f'Process started with PID: {proc.pid}') - - # Wait a bit and check if process is still running - import time - time.sleep(2) - - if proc.poll() is None: - print('Process is still running') - proc.terminate() - proc.wait() - else: - stdout, stderr = proc.communicate() - print(f'Process exited with code: {proc.returncode}') - print(f'STDOUT: {stdout.decode()}') - print(f'STDERR: {stderr.decode()}') - -except Exception as e: - print(f'Exception: {e}') \ No newline at end of file From f0afd7e87b97a8b90167d5b8f46ab561dfecd245 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 11 Jul 2025 10:49:06 -0500 Subject: [PATCH 104/131] remove stale files and update license header --- .github/workflows/cloud_ci.yaml | 15 ++ .github/workflows/nightly.yaml | 15 ++ .github/workflows/pr.yaml | 15 ++ .../workflows/self_hosted_service_test.yaml | 94 -------- .github/workflows/service_nightly.yaml | 201 ------------------ .github/workflows/test.yaml | 15 ++ .../trigger-breaking-change-alert.yaml | 15 ++ 7 files changed, 75 insertions(+), 295 deletions(-) delete mode 100644 .github/workflows/self_hosted_service_test.yaml delete mode 100644 .github/workflows/service_nightly.yaml diff --git a/.github/workflows/cloud_ci.yaml b/.github/workflows/cloud_ci.yaml index fb63847823..bc1c6c8ec4 100644 --- a/.github/workflows/cloud_ci.yaml +++ b/.github/workflows/cloud_ci.yaml @@ -1,3 +1,18 @@ +# 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. + name: cloud_ci_checker on: push: diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index dfede9601f..87ef0ed13e 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -1,3 +1,18 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-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: Trigger Nightly cuOpt Pipeline on: diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index d21d8e4d3c..f5777e0ad7 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,3 +1,18 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-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: pr on: diff --git a/.github/workflows/self_hosted_service_test.yaml b/.github/workflows/self_hosted_service_test.yaml deleted file mode 100644 index ce98e199e2..0000000000 --- a/.github/workflows/self_hosted_service_test.yaml +++ /dev/null @@ -1,94 +0,0 @@ -name: Test self-hosted service on local-setup - -on: - workflow_call: - inputs: - repo: - type: string - branch: - type: string - date: - type: string - sha: - type: string - build_type: - required: true - type: string - script: - required: true - 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: - cuopt-service: - name: self hosted service test - runs-on: linux-amd64-gpu-l4-latest-1 - strategy: - matrix: - ctk: ["12.8.0"] - linux_ver: ["ubuntu24.04"] - py_ver: ["3.12"] - container: - image: "rapidsai/citestwheel:cuda${{ matrix.ctk }}-${{ matrix.linux_ver}}-py${{ matrix.py_ver }}" - options: "--network-alias cuopt-service" - env: - NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} # GPU jobs must set this container env variable - RAPIDS_BUILD_TYPE: ${{ inputs.build_type }} - CUOPT_CLIENT_ID: ${{ secrets.CUOPT_PRD_TEST_CLIENT_ID }} - CUOPT_CLIENT_SECRET: ${{ secrets.CUOPT_PRD_TEST_SECRET }} - CUOPT_FUNCTION_ID: ${{ secrets.CUOPT_PRD_TEST_FUNCTION_ID }} - GH_TOKEN: ${{ github.token }} - ports: - - "8000:8000" - volumes: - - /tmp/asset_dir/:/tmp/asset_dir/ - - /tmp/response_dir/:/tmp/response_dir/ - steps: - - uses: aws-actions/configure-aws-credentials@v1-node16 - with: - role-to-assume: ${{ vars.AWS_ROLE_ARN }} - aws-region: ${{ vars.AWS_REGION }} - role-duration-seconds: 14400 # 4h - - name: Run nvidia-smi to make sure GPU is working - run: nvidia-smi - - - name: Install private index credentials in cibuildwheel container - run: printf 'machine pypi.k8s.rapids.ai\n\tlogin cibuildwheel\n\tpassword ${{ secrets.RAPIDSAI_PYPI_CI_PASSWORD }}\n' > ~/.netrc - - - name: checkout code repo - uses: actions/checkout@v4 - with: - repository: ${{ inputs.repo }} - ref: ${{ inputs.sha }} - fetch-depth: 0 # unshallow fetch for setuptools-scm - persist-credentials: false - - - name: Standardize repository information - uses: rapidsai/shared-actions/rapids-github-info@main - with: - repo: ${{ inputs.repo }} - branch: ${{ inputs.branch }} - date: ${{ inputs.date }} - sha: ${{ inputs.sha }} - - - name: Run tests - run: ${{ inputs.script }} diff --git a/.github/workflows/service_nightly.yaml b/.github/workflows/service_nightly.yaml deleted file mode 100644 index 5d398ecf07..0000000000 --- a/.github/workflows/service_nightly.yaml +++ /dev/null @@ -1,201 +0,0 @@ -name: Build Managed service docker, deploy and test - -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: - managed-service-nightly-amd: - name: Managed service nightly build for AMD64 architecture - env: - GH_TOKEN: ${{ github.token }} - RAPIDS_BUILD_TYPE: ${{ inputs.build_type }} - RAPIDS_CUDA_VERSION: "12.5.1" - RAPIDS_PY_VERSION: "3.12" - DOCKER_BUILDKIT: 1 - runs-on: "linux-amd64-cpu4" - steps: - - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ vars.AWS_ROLE_ARN }} - aws-region: ${{ vars.AWS_REGION }} - role-duration-seconds: 43200 # 12h - - - name: Checkout code repo - uses: actions/checkout@v4 - with: - ref: ${{ inputs.sha }} - fetch-depth: 0 # unshallow fetch for setuptools-scm - persist-credentials: false - - - name: Standardize repository information - uses: rapidsai/shared-actions/rapids-github-info@main - with: - branch: ${{ inputs.branch }} - date: ${{ inputs.date }} - sha: ${{ inputs.sha }} - - - name: Docker login to nvcr.io - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 - with: - registry: "nvcr.io" - username: "$oauthtoken" - password: ${{ secrets.CUOPT_PRD_NGC_DOCKER_KEY }} - - - name: Install aws and python - run: | - set -x - sudo apt-get update -y && sudo apt-get install -y software-properties-common && sudo add-apt-repository -y ppa:deadsnakes/ppa - sudo apt-get install -y awscli python3.12 - - - name: Install GHA tools - run: | - git clone https://github.com/rapidsai/gha-tools.git -b main /tmp/gha-tools - echo "/tmp/gha-tools/tools" >> "${GITHUB_PATH}" - - - name: Download latest artifacts from S3 - run: | - # make rapids-download-wheels-from-github download everything to the same directory - export RAPIDS_UNZIP_DIR="$(pwd)/wheels" - mkdir "${RAPIDS_UNZIP_DIR}" - - # download latest wheels built from build.yaml - RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" - RAPIDS_PY_WHEEL_NAME="cuopt_mps_parser" rapids-download-wheels-from-github python - RAPIDS_PY_WHEEL_NAME="cuopt_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github python - RAPIDS_PY_WHEEL_NAME="cuopt_server_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github python - RAPIDS_PY_WHEEL_NAME="libcuopt_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github cpp - - - name: Generate git commit file for tracking the container - run: | - bash container-builder/bin/make_git_info.sh ./ - - - name: Build cuopt self hosted service docker image - uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 - with: - context: . - push: true - tags: nvcr.io/j9mrpofbmtxd/test/cuopt:25.08 - file: ci/build-service.Dockerfile - build-args: | - nspect_id="NSPECT-LZ5P-VOVE" - arch=amd - - - name: Push image to prod env - run: | - docker tag nvcr.io/j9mrpofbmtxd/test/cuopt:25.08 nvcr.io/0616513341838337/cuopt:nightly - docker tag nvcr.io/j9mrpofbmtxd/test/cuopt:25.08 nvcr.io/0616513341838337/cuopt:25.08 - - docker push nvcr.io/0616513341838337/cuopt:nightly - docker push nvcr.io/0616513341838337/cuopt:25.08 - - managed-service-nightly-arm: - name: Managed service nightly build for ARM architecture - env: - GH_TOKEN: ${{ github.token }} - RAPIDS_BUILD_TYPE: ${{ inputs.build_type }} - RAPIDS_CUDA_VERSION: "12.5.1" - RAPIDS_PY_VERSION: "3.12" - DOCKER_BUILDKIT: 1 - runs-on: "linux-arm64-cpu4" - steps: - - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ vars.AWS_ROLE_ARN }} - aws-region: ${{ vars.AWS_REGION }} - role-duration-seconds: 43200 # 12h - - - name: Checkout code repo - uses: actions/checkout@v4 - with: - ref: ${{ inputs.sha }} - fetch-depth: 0 # unshallow fetch for setuptools-scm - persist-credentials: false - - - name: Standardize repository information - uses: rapidsai/shared-actions/rapids-github-info@main - with: - branch: ${{ inputs.branch }} - date: ${{ inputs.date }} - sha: ${{ inputs.sha }} - - - name: Docker login to nvcr.io - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 - with: - registry: "nvcr.io" - username: "$oauthtoken" - password: ${{ secrets.CUOPT_PRD_NGC_DOCKER_KEY }} - - - name: Install aws and python - run: | - set -x - sudo apt-get update -y && sudo apt-get install -y software-properties-common && sudo add-apt-repository -y ppa:deadsnakes/ppa - sudo apt-get install -y awscli python3.12 - - - name: Install GHA tools - run: | - git clone https://github.com/rapidsai/gha-tools.git -b main /tmp/gha-tools - echo "/tmp/gha-tools/tools" >> "${GITHUB_PATH}" - - - name: Download latest artifacts from S3 - run: | - # make rapids-download-wheels-from-github download everything to the same directory - export RAPIDS_UNZIP_DIR="$(pwd)/wheels" - mkdir "${RAPIDS_UNZIP_DIR}" - - # download latest wheels built from build.yaml - RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" - RAPIDS_PY_WHEEL_NAME="cuopt_mps_parser" rapids-download-wheels-from-github python - RAPIDS_PY_WHEEL_NAME="cuopt_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github python - RAPIDS_PY_WHEEL_NAME="cuopt_server_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github python - RAPIDS_PY_WHEEL_NAME="libcuopt_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github cpp - - - name: Generate git commit file for tracking the container - run: | - bash container-builder/bin/make_git_info.sh ./ - - - name: Build cuopt self hosted service docker image - uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 - with: - context: . - push: true - tags: nvcr.io/j9mrpofbmtxd/test/cuopt:25.08.arm - file: ci/build-service.Dockerfile - build-args: | - nspect_id="NSPECT-LZ5P-VOVE" - arch=arm - - - name: Push image to prod env - run: | - docker tag nvcr.io/j9mrpofbmtxd/test/cuopt:25.08.arm nvcr.io/0616513341838337/cuopt:nightly.arm - docker tag nvcr.io/j9mrpofbmtxd/test/cuopt:25.08.arm nvcr.io/0616513341838337/cuopt:25.08.arm - - docker push nvcr.io/0616513341838337/cuopt:nightly.arm - docker push nvcr.io/0616513341838337/cuopt:25.08.arm diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 276bede384..6eb322a810 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,3 +1,18 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-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: test on: diff --git a/.github/workflows/trigger-breaking-change-alert.yaml b/.github/workflows/trigger-breaking-change-alert.yaml index 593fcb1086..6c273ac0d4 100644 --- a/.github/workflows/trigger-breaking-change-alert.yaml +++ b/.github/workflows/trigger-breaking-change-alert.yaml @@ -1,3 +1,18 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-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: Trigger Breaking Change Notifications on: From 51f58b156407be4ff1c7a1c45dc7a584690df7fd Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 11 Jul 2025 10:54:07 -0500 Subject: [PATCH 105/131] Add missing file --- .../workflows/self_hosted_service_test.yaml | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 .github/workflows/self_hosted_service_test.yaml diff --git a/.github/workflows/self_hosted_service_test.yaml b/.github/workflows/self_hosted_service_test.yaml new file mode 100644 index 0000000000..ce98e199e2 --- /dev/null +++ b/.github/workflows/self_hosted_service_test.yaml @@ -0,0 +1,94 @@ +name: Test self-hosted service on local-setup + +on: + workflow_call: + inputs: + repo: + type: string + branch: + type: string + date: + type: string + sha: + type: string + build_type: + required: true + type: string + script: + required: true + 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: + cuopt-service: + name: self hosted service test + runs-on: linux-amd64-gpu-l4-latest-1 + strategy: + matrix: + ctk: ["12.8.0"] + linux_ver: ["ubuntu24.04"] + py_ver: ["3.12"] + container: + image: "rapidsai/citestwheel:cuda${{ matrix.ctk }}-${{ matrix.linux_ver}}-py${{ matrix.py_ver }}" + options: "--network-alias cuopt-service" + env: + NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} # GPU jobs must set this container env variable + RAPIDS_BUILD_TYPE: ${{ inputs.build_type }} + CUOPT_CLIENT_ID: ${{ secrets.CUOPT_PRD_TEST_CLIENT_ID }} + CUOPT_CLIENT_SECRET: ${{ secrets.CUOPT_PRD_TEST_SECRET }} + CUOPT_FUNCTION_ID: ${{ secrets.CUOPT_PRD_TEST_FUNCTION_ID }} + GH_TOKEN: ${{ github.token }} + ports: + - "8000:8000" + volumes: + - /tmp/asset_dir/:/tmp/asset_dir/ + - /tmp/response_dir/:/tmp/response_dir/ + steps: + - uses: aws-actions/configure-aws-credentials@v1-node16 + with: + role-to-assume: ${{ vars.AWS_ROLE_ARN }} + aws-region: ${{ vars.AWS_REGION }} + role-duration-seconds: 14400 # 4h + - name: Run nvidia-smi to make sure GPU is working + run: nvidia-smi + + - name: Install private index credentials in cibuildwheel container + run: printf 'machine pypi.k8s.rapids.ai\n\tlogin cibuildwheel\n\tpassword ${{ secrets.RAPIDSAI_PYPI_CI_PASSWORD }}\n' > ~/.netrc + + - name: checkout code repo + uses: actions/checkout@v4 + with: + repository: ${{ inputs.repo }} + ref: ${{ inputs.sha }} + fetch-depth: 0 # unshallow fetch for setuptools-scm + persist-credentials: false + + - name: Standardize repository information + uses: rapidsai/shared-actions/rapids-github-info@main + with: + repo: ${{ inputs.repo }} + branch: ${{ inputs.branch }} + date: ${{ inputs.date }} + sha: ${{ inputs.sha }} + + - name: Run tests + run: ${{ inputs.script }} From 07c6a6816919b09c6a759569c13fbc2a6a731590 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 11 Jul 2025 10:56:05 -0500 Subject: [PATCH 106/131] Update license --- .github/workflows/self_hosted_service_test.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/self_hosted_service_test.yaml b/.github/workflows/self_hosted_service_test.yaml index ce98e199e2..393067fdcd 100644 --- a/.github/workflows/self_hosted_service_test.yaml +++ b/.github/workflows/self_hosted_service_test.yaml @@ -1,3 +1,18 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-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: Test self-hosted service on local-setup on: From 98887c1bf99be2c44c722fba0eaad128e8a70126 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 11 Jul 2025 11:13:15 -0500 Subject: [PATCH 107/131] fix style --- ci/docker/test_image.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/docker/test_image.sh b/ci/docker/test_image.sh index 66d797edb7..3f07056159 100644 --- a/ci/docker/test_image.sh +++ b/ci/docker/test_image.sh @@ -1,4 +1,4 @@ -#!/bin/bash + !/bin/bash # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 @@ -31,7 +31,7 @@ cd datasets && ./get_test_data.sh --solomon && ./get_test_data.sh --tsp && cd - ln -sf "$(pwd)" /home/cuopt/cuopt # Set permissions since the repo is mounted on root -chmod -R a+w $(pwd) +chmod -R a+w "$(pwd)" # If this script is being run as root, use 'su - cuopt -c ""' to run each command as cuopt. From c234a703f7a9819b7b193551f04e58e94f0369f4 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 11 Jul 2025 11:28:35 -0500 Subject: [PATCH 108/131] remove debug --- python/cuopt_server/cuopt_server/tests/utils/utils.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/python/cuopt_server/cuopt_server/tests/utils/utils.py b/python/cuopt_server/cuopt_server/tests/utils/utils.py index a5366d51be..05c5a0968c 100644 --- a/python/cuopt_server/cuopt_server/tests/utils/utils.py +++ b/python/cuopt_server/cuopt_server/tests/utils/utils.py @@ -291,12 +291,10 @@ def cleanup_cuopt_process(): """Clean up the cuopt process if it's still running""" global cuoptmain if cuoptmain and cuoptmain.poll() is None: - print("Cleaning up cuopt service...") cuoptmain.terminate() try: cuoptmain.wait(timeout=5) except TimeoutExpired: - print("Force killing cuopt service...") cuoptmain.kill() cuoptmain.wait() @@ -336,8 +334,6 @@ def cuoptproc(request): "CUOPT_SERVER_PORT": "5555", "CUOPT_SERVER_LOG_LEVEL": "debug", } - print(f"Starting cuopt service with PYTHONPATH: {python_path}") - print(f"Server module: {server_module}") cuoptmain = Popen([python_path, server_script, server_module], env=env) spinup_wait() From 5528353bda777ea3e6dd37fed606f4fd96d4a20f Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 11 Jul 2025 11:30:12 -0500 Subject: [PATCH 109/131] fix style --- ci/docker/test_image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/docker/test_image.sh b/ci/docker/test_image.sh index 3f07056159..2f3b26c159 100644 --- a/ci/docker/test_image.sh +++ b/ci/docker/test_image.sh @@ -1,4 +1,4 @@ - !/bin/bash +#!/bin/bash # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 From cc20c7fc8dabaf43631afba3b76c1d4dc91cbfc0 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 14 Jul 2025 14:26:10 -0500 Subject: [PATCH 110/131] Update docker to accept PYTHON_SHORT_VER arg --- ci/docker/Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index e951ddb192..33c9d3a644 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -27,6 +27,7 @@ FROM nvidia/cuda:${CUDA_VER}-base-ubuntu22.04 AS python-env ARG CUDA_VER ARG CUOPT_VER ARG PYTHON_VER +ARG PYTHON_SHORT_VER RUN apt-get update && apt-get install -y \ wget \ @@ -71,7 +72,7 @@ RUN apt-get purge -y \ 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 +RUN chown -R cuopt:cuopt /usr/local/lib/python${PYTHON_SHORT_VER}/site-packages USER cuopt FROM python-env AS install-env @@ -80,6 +81,7 @@ WORKDIR /home/cuopt ARG cuda-suffix=cu$(echo ${CUDA_VER} | cut -d'.' -f1) ARG CUOPT_VERSION +ARG PYTHON_SHORT_VER ENV PIP_EXTRA_INDEX_URL="https://pypi.nvidia.com https://pypi.anaconda.org/rapidsai-wheels-nightly/simple" @@ -109,8 +111,8 @@ FROM install-env AS cuopt-final ARG PYTHON_SHORT_VER # Set environment variables in .bashrc for all future shells -RUN echo 'export 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"' >> /home/cuopt/.bashrc && \ - echo 'export 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}"' >> /home/cuopt/.bashrc && \ +RUN echo 'export PATH="/usr/local/cuda/bin:/usr/bin:/usr/local/bin:/usr/local/nvidia/bin/:/home/cuopt/.local/lib/python${PYTHON_SHORT_VER}/site-packages/libcuopt/bin/:/home/cuopt/.local/bin:$PATH"' >> /home/cuopt/.bashrc && \ + echo 'export 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/python${PYTHON_SHORT_VER}/site-packages/libcuopt/lib/:/home/cuopt/.local/lib/python${PYTHON_SHORT_VER}/site-packages/rapids_logger/lib64:${LD_LIBRARY_PATH}"' >> /home/cuopt/.bashrc && \ echo 'export PYTHONPATH="/home/cuopt/.local/lib/python${PYTHON_SHORT_VER}/site-packages:/usr/local/lib/python${PYTHON_SHORT_VER}/site-packages:${PYTHONPATH:-}"' >> /home/cuopt/.bashrc From 9248e650333a263de1ad5610ad047ff24ac8089d Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 15 Jul 2025 11:05:30 -0500 Subject: [PATCH 111/131] Address review comments --- .github/workflows/build.yaml | 15 --- .github/workflows/build_images.yaml | 13 ++- .../workflows/build_test_publish_images.yaml | 6 +- .github/workflows/cloud_ci.yaml | 15 --- .github/workflows/nightly.yaml | 15 --- .github/workflows/pr.yaml | 15 --- .../workflows/self_hosted_service_test.yaml | 15 --- .github/workflows/test.yaml | 15 --- .../trigger-breaking-change-alert.yaml | 15 --- ci/docker/Dockerfile | 110 +++++++----------- ci/docker/test_image.sh | 2 +- 11 files changed, 55 insertions(+), 181 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index aea275d432..d755b16c84 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,18 +1,3 @@ -# SPDX-FileCopyrightText: Copyright (c) 2022-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 on: diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index 7d9a5b07da..b9b21f434b 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -24,15 +24,18 @@ on: 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 + LINUX_VER: + required: true + type: string + PYTHON_VER: + required: true + type: string jobs: build: @@ -41,6 +44,7 @@ jobs: ARCH: ["${{ inputs.ARCHES }}"] CUDA_VER: ["${{ inputs.CUDA_VER }}"] PYTHON_VER: ["${{ inputs.PYTHON_VER }}"] + LINUX_VER: ["${{ inputs.LINUX_VER }}"] fail-fast: false runs-on: "linux-${{ matrix.ARCH }}-cpu4" steps: @@ -86,8 +90,9 @@ jobs: pull: true build-args: | CUDA_VER=${{ inputs.CUDA_VER }} - PYTHON_VER=${{ inputs.PYTHON_VER }} + PYTHON_SHORT_VER=${{ steps.trim.outputs.PYTHON_SHORT }} CUOPT_VER=${{ inputs.CUOPT_VER }} + LINUX_VER=${{ inputs.LINUX_VER }} tags: nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-py${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }} - name: Push image to NGC diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index f5e73f09c5..fdf738816d 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -70,7 +70,8 @@ jobs: { "arch": ["amd64", "arm64"], "cuda_ver": ["12.8.0"], - "python_ver": ["3.12.11"] + "python_ver": ["3.12.11"], + "linux_ver": ["22.04"] } EOF ) @@ -108,9 +109,10 @@ jobs: with: ARCHES: ${{ matrix.arch }} CUDA_VER: ${{ matrix.cuda_ver }} - PYTHON_VER: ${{ matrix.python_ver }} CUOPT_VER: ${{ needs.compute-matrix.outputs.CUOPT_VER }} IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} + LINUX_VER: ${{ matrix.linux_ver }} + PYTHON_VER: ${{ matrix.python_ver }} build-cuopt-multiarch-manifest: name: Build cuopt multiarch manifest diff --git a/.github/workflows/cloud_ci.yaml b/.github/workflows/cloud_ci.yaml index bc1c6c8ec4..fb63847823 100644 --- a/.github/workflows/cloud_ci.yaml +++ b/.github/workflows/cloud_ci.yaml @@ -1,18 +1,3 @@ -# 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. - name: cloud_ci_checker on: push: diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 87ef0ed13e..dfede9601f 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -1,18 +1,3 @@ -# SPDX-FileCopyrightText: Copyright (c) 2022-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: Trigger Nightly cuOpt Pipeline on: diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index f5777e0ad7..d21d8e4d3c 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,18 +1,3 @@ -# SPDX-FileCopyrightText: Copyright (c) 2022-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: pr on: diff --git a/.github/workflows/self_hosted_service_test.yaml b/.github/workflows/self_hosted_service_test.yaml index 393067fdcd..ce98e199e2 100644 --- a/.github/workflows/self_hosted_service_test.yaml +++ b/.github/workflows/self_hosted_service_test.yaml @@ -1,18 +1,3 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-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: Test self-hosted service on local-setup on: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6eb322a810..276bede384 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,18 +1,3 @@ -# SPDX-FileCopyrightText: Copyright (c) 2022-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: test on: diff --git a/.github/workflows/trigger-breaking-change-alert.yaml b/.github/workflows/trigger-breaking-change-alert.yaml index 6c273ac0d4..593fcb1086 100644 --- a/.github/workflows/trigger-breaking-change-alert.yaml +++ b/.github/workflows/trigger-breaking-change-alert.yaml @@ -1,18 +1,3 @@ -# SPDX-FileCopyrightText: Copyright (c) 2022-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: Trigger Breaking Change Notifications on: diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index 33c9d3a644..4a95cd17da 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -14,92 +14,64 @@ # 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 +ARG CUDA_VER=unset +ARG CUOPT_VER=unset +ARG PYTHON_SHORT_VER=unset +ARG LINUX_VER=unset -FROM nvidia/cuda:${CUDA_VER}-runtime-ubuntu22.04 AS cuda-libs +FROM nvidia/cuda:${CUDA_VER}-runtime-ubuntu${LINUX_VER} AS cuda-libs # Install cuOpt -FROM nvidia/cuda:${CUDA_VER}-base-ubuntu22.04 AS python-env +FROM nvidia/cuda:${CUDA_VER}-base-ubuntu${LINUX_VER} AS python-env ARG CUDA_VER ARG CUOPT_VER -ARG PYTHON_VER ARG PYTHON_SHORT_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/* +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && \ + apt-get install -y --no-install-recommends software-properties-common && \ + add-apt-repository ppa:deadsnakes/ppa && \ + apt-get install -y --no-install-recommends \ + wget \ + python${PYTHON_SHORT_VER} \ + python${PYTHON_SHORT_VER}-dev \ + python${PYTHON_SHORT_VER}-venv \ + && rm -rf /var/lib/apt/lists/* && \ + python${PYTHON_SHORT_VER} -m ensurepip --upgrade && \ + python${PYTHON_SHORT_VER} -m pip install --upgrade pip + +ENV DEBIAN_FRONTEND="" + +RUN ln -sf /usr/bin/python${PYTHON_SHORT_VER} /usr/bin/python && \ + groupadd -r cuopt && useradd -r -g cuopt cuopt && \ + chown -R cuopt:cuopt /usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages -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/python${PYTHON_SHORT_VER}/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 +ARG CUOPT_VER ARG PYTHON_SHORT_VER -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} && \ +RUN cuda_suffix=cu$(echo ${CUDA_VER} | cut -d'.' -f1) && \ + cuda_major_minor=$(echo ${CUDA_VER} | cut -d'.' -f1-2) && \ + python -m pip install \ + --extra-index-url https://pypi.nvidia.com \ + --extra-index-url https://pypi.anaconda.org/rapidsai-wheels-nightly/simple \ + --user \ + --no-cache-dir \ + "cuopt-server-${cuda_suffix}==${CUOPT_VER}" \ + "cuopt-sh-client==${CUOPT_VER}" \ + "nvidia-cuda-runtime-${cuda_suffix}==${cuda_major_minor}.*" && \ 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 +RUN apt-get update && apt-get install -y --no-install-recommends \ + unzip \ + && rm -rf /var/lib/apt/lists/* USER cuopt @@ -111,9 +83,9 @@ FROM install-env AS cuopt-final ARG PYTHON_SHORT_VER # Set environment variables in .bashrc for all future shells -RUN echo 'export PATH="/usr/local/cuda/bin:/usr/bin:/usr/local/bin:/usr/local/nvidia/bin/:/home/cuopt/.local/lib/python${PYTHON_SHORT_VER}/site-packages/libcuopt/bin/:/home/cuopt/.local/bin:$PATH"' >> /home/cuopt/.bashrc && \ - echo 'export 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/python${PYTHON_SHORT_VER}/site-packages/libcuopt/lib/:/home/cuopt/.local/lib/python${PYTHON_SHORT_VER}/site-packages/rapids_logger/lib64:${LD_LIBRARY_PATH}"' >> /home/cuopt/.bashrc && \ - echo 'export PYTHONPATH="/home/cuopt/.local/lib/python${PYTHON_SHORT_VER}/site-packages:/usr/local/lib/python${PYTHON_SHORT_VER}/site-packages:${PYTHONPATH:-}"' >> /home/cuopt/.bashrc +RUN echo 'export PATH="/usr/local/cuda/bin:/usr/bin:/usr/local/bin:/usr/local/nvidia/bin/:/home/cuopt/.local/lib/python${PYTHON_SHORT_VER}/dist-packages/libcuopt/bin/:/home/cuopt/.local/bin:$PATH"' >> /home/cuopt/.bashrc && \ + echo 'export 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/python${PYTHON_SHORT_VER}/dist-packages/libcuopt/lib/:/home/cuopt/.local/lib/python${PYTHON_SHORT_VER}/dist-packages/rapids_logger/lib64:${LD_LIBRARY_PATH}"' >> /home/cuopt/.bashrc && \ + echo 'export PYTHONPATH="/home/cuopt/.local/lib/python${PYTHON_SHORT_VER}/dist-packages:/usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages:${PYTHONPATH:-}"' >> /home/cuopt/.bashrc # Create a .bash_profile that sources .bashrc if it exists diff --git a/ci/docker/test_image.sh b/ci/docker/test_image.sh index 2f3b26c159..859e5856d8 100644 --- a/ci/docker/test_image.sh +++ b/ci/docker/test_image.sh @@ -20,7 +20,7 @@ set -euo pipefail chsh -s /bin/bash cuopt # Install dependencies -apt-get install -y file bzip2 gcc +apt-get install -y --no-install-recommends file bzip2 gcc # Download test data bash datasets/linear_programming/download_pdlp_test_dataset.sh From 51a4fad03c6bf571d9292e444f94b64e0c18249b Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 15 Jul 2025 11:19:48 -0500 Subject: [PATCH 112/131] test --- .github/workflows/build_images.yaml | 2 +- .github/workflows/pr.yaml | 227 +--------------------------- 2 files changed, 7 insertions(+), 222 deletions(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index b9b21f434b..5e6f38bb1e 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -91,7 +91,7 @@ jobs: build-args: | CUDA_VER=${{ inputs.CUDA_VER }} PYTHON_SHORT_VER=${{ steps.trim.outputs.PYTHON_SHORT }} - CUOPT_VER=${{ inputs.CUOPT_VER }} + CUOPT_VER=25.8.0a49 LINUX_VER=${{ inputs.LINUX_VER }} tags: nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-py${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index d21d8e4d3c..30ae01f9a4 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -10,226 +10,11 @@ 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 + build-images: + uses: ./.github/workflows/build_test_publish_images.yaml 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 + branch: "branch-25.08" + sha: "e0dc603" + date: "2025-07-03" + build_type: "nightly" From c8d3808b4395f003bbf29f142081ed6bdc8cf0dc Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 15 Jul 2025 11:25:52 -0500 Subject: [PATCH 113/131] Add new line --- ci/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index 4a95cd17da..e0602f6988 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -96,4 +96,4 @@ COPY --from=cuda-libs /usr/local/cuda/lib64/libnvJitLink* /usr/local/cuda/lib64/ ENV CUOPT_SERVER_PORT=8000 -ENTRYPOINT ["python", "-m", "cuopt_server.cuopt_service"] \ No newline at end of file +ENTRYPOINT ["python", "-m", "cuopt_server.cuopt_service"] From 45309958ae41ff07d3de3003c17a59bd82416af0 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 15 Jul 2025 11:28:26 -0500 Subject: [PATCH 114/131] fix Docker file --- ci/docker/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index e0602f6988..2f71222b6e 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -44,7 +44,8 @@ RUN apt-get update && \ ENV DEBIAN_FRONTEND="" RUN ln -sf /usr/bin/python${PYTHON_SHORT_VER} /usr/bin/python && \ - groupadd -r cuopt && useradd -r -g cuopt cuopt && \ + groupadd -r cuopt && \ + useradd -r -g cuopt cuopt && \ chown -R cuopt:cuopt /usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages USER cuopt From 81e3c3b7ac854d8e504e421cac40ba71c011d130 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 15 Jul 2025 11:47:20 -0500 Subject: [PATCH 115/131] fix gcc requirement --- ci/docker/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index 2f71222b6e..f3ef050499 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -29,11 +29,15 @@ ARG CUOPT_VER ARG PYTHON_SHORT_VER ENV DEBIAN_FRONTEND=noninteractive + +# gcc is required for building psutils RUN apt-get update && \ apt-get install -y --no-install-recommends software-properties-common && \ add-apt-repository ppa:deadsnakes/ppa && \ apt-get install -y --no-install-recommends \ wget \ + build-essential \ + gcc \ python${PYTHON_SHORT_VER} \ python${PYTHON_SHORT_VER}-dev \ python${PYTHON_SHORT_VER}-venv \ From 757da9c44c8d29f8eb3fcf26681536a6de0f3eaa Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 15 Jul 2025 13:05:18 -0500 Subject: [PATCH 116/131] fix testing --- ci/docker/test_image.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ci/docker/test_image.sh b/ci/docker/test_image.sh index 859e5856d8..93875d1236 100644 --- a/ci/docker/test_image.sh +++ b/ci/docker/test_image.sh @@ -20,8 +20,10 @@ set -euo pipefail chsh -s /bin/bash cuopt # Install dependencies -apt-get install -y --no-install-recommends file bzip2 gcc - +apt-get update +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends file bzip2 gcc +apt-get clean +rm -rf /var/lib/apt/lists/* # Download test data bash datasets/linear_programming/download_pdlp_test_dataset.sh bash datasets/mip/download_miplib_test_dataset.sh From 0949da0b64a457f7889f7f80db09d0c584b2718c Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 15 Jul 2025 14:24:52 -0500 Subject: [PATCH 117/131] revert cahnges to pr --- .github/workflows/pr.yaml | 227 +++++++++++++++++++++++++++++++++++++- 1 file changed, 221 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 30ae01f9a4..d21d8e4d3c 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -10,11 +10,226 @@ concurrency: cancel-in-progress: true jobs: - build-images: - uses: ./.github/workflows/build_test_publish_images.yaml + 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: - branch: "branch-25.08" - sha: "e0dc603" - date: "2025-07-03" - build_type: "nightly" + build_type: pull-request + script: ci/test_self_hosted_service.sh From 9f9a322d52d6413024fa935bdcafef487bd727e8 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 18 Jul 2025 12:10:35 -0500 Subject: [PATCH 118/131] style --- .github/workflows/build_images.yaml | 4 ++-- .github/workflows/build_test_publish_images.yaml | 6 +++--- .github/workflows/test_images.yaml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index 5e6f38bb1e..d2e82fb18e 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -31,7 +31,7 @@ on: required: true type: string LINUX_VER: - required: true + required: true type: string PYTHON_VER: required: true @@ -101,4 +101,4 @@ jobs: 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 }} - + diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index fdf738816d..f66b41d0f6 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -14,7 +14,7 @@ # limitations under the License. name: Build, Test and Publish cuopt images - + on: workflow_call: inputs: @@ -126,7 +126,7 @@ jobs: - name: Checkout code repo uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 0 - name: Login to DockerHub uses: docker/login-action@v3 with: @@ -167,4 +167,4 @@ jobs: ARCH: ${{ matrix.ARCH }} CUDA_VER: ${{ matrix.CUDA_VER }} PYTHON_VER: ${{ matrix.PYTHON_VER }} - IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} \ No newline at end of file + IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }} diff --git a/.github/workflows/test_images.yaml b/.github/workflows/test_images.yaml index d5f52de367..24e669bf7e 100644 --- a/.github/workflows/test_images.yaml +++ b/.github/workflows/test_images.yaml @@ -59,4 +59,4 @@ jobs: fetch-depth: 0 - name: Test cuopt run: | - bash ./ci/docker/test_image.sh \ No newline at end of file + bash ./ci/docker/test_image.sh From 454b6e7c27c11ca0b39d2e5a244e68fcc0228fc8 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 18 Jul 2025 14:27:39 -0500 Subject: [PATCH 119/131] fix style --- .github/workflows/build_images.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index d2e82fb18e..fa314b5229 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -99,6 +99,3 @@ jobs: run: | 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 }} 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 }} - - - From b1de01bdfe7628e09085c91cb9a7ccf2691ea072 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 21 Jul 2025 11:59:44 -0500 Subject: [PATCH 120/131] update --- ci/docker/README.md | 13 +++++++++++++ ci/docker/context/README.md | 1 - ci/docker/test_image.sh | 39 +++++++++++++++++++++---------------- 3 files changed, 35 insertions(+), 18 deletions(-) create mode 100644 ci/docker/README.md delete mode 100644 ci/docker/context/README.md diff --git a/ci/docker/README.md b/ci/docker/README.md new file mode 100644 index 0000000000..0645da0722 --- /dev/null +++ b/ci/docker/README.md @@ -0,0 +1,13 @@ +# Container Image build and test suite + +## context + +Add all the files and data for the buildx context to ``context`` folder like entrypoint script, and others. + +## test + +To test the container image, run the [test_image.sh](test_image.sh) script as shown below from the latest github repo: + +```bash +docker run -it --rm --gpus all -u root --volume $PWD:/repo -w /repo --entrypoint "/bin/bash" nvidia/cuopt:[TAG] ./ci/docker/test_image.sh +``` \ No newline at end of file diff --git a/ci/docker/context/README.md b/ci/docker/context/README.md deleted file mode 100644 index e43a12ebc3..0000000000 --- a/ci/docker/context/README.md +++ /dev/null @@ -1 +0,0 @@ -Add all the files and data for the buildx context to this folder like entrypoint script, and others. \ No newline at end of file diff --git a/ci/docker/test_image.sh b/ci/docker/test_image.sh index 93875d1236..fa7af2f6ff 100644 --- a/ci/docker/test_image.sh +++ b/ci/docker/test_image.sh @@ -22,12 +22,14 @@ chsh -s /bin/bash cuopt # Install dependencies apt-get update DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends file bzip2 gcc -apt-get clean -rm -rf /var/lib/apt/lists/* + # Download test data bash datasets/linear_programming/download_pdlp_test_dataset.sh bash datasets/mip/download_miplib_test_dataset.sh -cd datasets && ./get_test_data.sh --solomon && ./get_test_data.sh --tsp && cd - +pushd ./datasets +./get_test_data.sh --solomon +./get_test_data.sh --tsp +popd # Create symlink to cuopt ln -sf "$(pwd)" /home/cuopt/cuopt @@ -38,17 +40,20 @@ chmod -R a+w "$(pwd)" # If this script is being run as root, use 'su - cuopt -c ""' to run each command as cuopt. # Change to cuopt home directory and then to cuopt repo -su - cuopt -c "cd ~/cuopt && \ - pip install --user pytest pexpect && \ - export PATH=\$PATH:/home/cuopt/.local/bin && \ - export RAPIDS_DATASET_ROOT_DIR=\$(realpath datasets) && \ - echo '----------------- CLI TEST START ---------------' && \ - bash python/libcuopt/libcuopt/tests/test_cli.sh && \ - echo '----------------- CLI TEST END ---------------' && \ - echo '----------------- CUOPT TEST START ---------------' && \ - python -m pytest python/cuopt/cuopt/tests/linear_programming && \ - python -m pytest python/cuopt/cuopt/tests/routing && \ - echo '----------------- CUOPT TEST END ---------------' && \ - echo '----------------- CUOPT SERVER TEST START ---------------' && \ - python -m pytest python/cuopt_server/cuopt_server/tests/ && \ - echo '----------------- CUOPT SERVER TEST END ---------------'" \ No newline at end of file +cat > /home/cuopt/test.sh < Date: Tue, 22 Jul 2025 11:00:31 -0500 Subject: [PATCH 121/131] Polish and remove gcc at the end --- ci/docker/Dockerfile | 20 +++++++------------- ci/test_wheel_cuopt.sh | 20 ++++++++++++++++---- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index f3ef050499..ce7875d8fc 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -31,12 +31,11 @@ ARG PYTHON_SHORT_VER ENV DEBIAN_FRONTEND=noninteractive # gcc is required for building psutils -RUN apt-get update && \ - apt-get install -y --no-install-recommends software-properties-common && \ +RUN apt-get update && apt-get install -y --no-install-recommends build-essential software-properties-common && \ add-apt-repository ppa:deadsnakes/ppa && \ apt-get install -y --no-install-recommends \ wget \ - build-essential \ + unzip \ gcc \ python${PYTHON_SHORT_VER} \ python${PYTHON_SHORT_VER}-dev \ @@ -52,6 +51,8 @@ RUN ln -sf /usr/bin/python${PYTHON_SHORT_VER} /usr/bin/python && \ useradd -r -g cuopt cuopt && \ chown -R cuopt:cuopt /usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages +RUN apt-get purge -y gcc && rm -rf /var/lib/apt/lists/* + USER cuopt FROM python-env AS install-env @@ -72,13 +73,6 @@ RUN cuda_suffix=cu$(echo ${CUDA_VER} | cut -d'.' -f1) && \ "cuopt-sh-client==${CUOPT_VER}" \ "nvidia-cuda-runtime-${cuda_suffix}==${cuda_major_minor}.*" && \ python -m pip list -USER root - -RUN apt-get update && apt-get install -y --no-install-recommends \ - unzip \ - && rm -rf /var/lib/apt/lists/* - -USER cuopt COPY ./LICENSE /home/cuopt/LICENSE COPY ./VERSION /home/cuopt/VERSION @@ -99,6 +93,6 @@ RUN echo 'if [ -f ~/.bashrc ]; then . ~/.bashrc; fi' > /home/cuopt/.bash_profile 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/ -ENV CUOPT_SERVER_PORT=8000 - -ENTRYPOINT ["python", "-m", "cuopt_server.cuopt_service"] +# Use a shell as entrypoint to handle both service and interactive modes +ENTRYPOINT ["/bin/bash", "-c"] +CMD ["python -m cuopt_server.cuopt_service"] diff --git a/ci/test_wheel_cuopt.sh b/ci/test_wheel_cuopt.sh index 3c78c29f0a..2987b318c7 100755 --- a/ci/test_wheel_cuopt.sh +++ b/ci/test_wheel_cuopt.sh @@ -17,6 +17,8 @@ set -euo pipefail +# sets up a constraints file for 'pip' and puts its location in an exported variable PIP_EXPORT, +# so those constraints will affect all future 'pip install' calls source rapids-init-pip # Download the packages built in the previous step @@ -25,12 +27,19 @@ CUOPT_MPS_PARSER_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="cuopt_mps_parser" rapids-dow CUOPT_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="cuopt_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github python) LIBCUOPT_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libcuopt_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github cpp) -# echo to expand wildcard before adding `[extra]` requires for pip +# update pip constraints.txt to ensure all future 'pip install' (including those in ci/thirdparty-testing) +# use these wheels for cuopt packages +cat > "${PIP_CONSTRAINT}" < Date: Tue, 22 Jul 2025 11:49:28 -0500 Subject: [PATCH 122/131] add third party license to container --- .github/workflows/build_images.yaml | 1 + ci/docker/Dockerfile | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index fa314b5229..83325eeb2b 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -61,6 +61,7 @@ jobs: run: | cp ./LICENSE ./ci/docker/context/LICENSE cp ./VERSION ./ci/docker/context/VERSION + cp ./thirdparty/THIRD_PARTY_LICENSES ./ci/docker/context/THIRD_PARTY_LICENSES - name: Login to NGC uses: docker/login-action@v3 with: diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index ce7875d8fc..ad3c886807 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -76,6 +76,7 @@ RUN cuda_suffix=cu$(echo ${CUDA_VER} | cut -d'.' -f1) && \ COPY ./LICENSE /home/cuopt/LICENSE COPY ./VERSION /home/cuopt/VERSION +COPY ./THIRD_PARTY_LICENSES /home/cuopt/THIRD_PARTY_LICENSES FROM install-env AS cuopt-final From 7219e468e945b1720924bafaa5ff466500b11871 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 22 Jul 2025 14:26:36 -0500 Subject: [PATCH 123/131] remove unwated changes --- ci/test_wheel_cuopt.sh | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/ci/test_wheel_cuopt.sh b/ci/test_wheel_cuopt.sh index 2987b318c7..3c78c29f0a 100755 --- a/ci/test_wheel_cuopt.sh +++ b/ci/test_wheel_cuopt.sh @@ -17,8 +17,6 @@ set -euo pipefail -# sets up a constraints file for 'pip' and puts its location in an exported variable PIP_EXPORT, -# so those constraints will affect all future 'pip install' calls source rapids-init-pip # Download the packages built in the previous step @@ -27,19 +25,12 @@ CUOPT_MPS_PARSER_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="cuopt_mps_parser" rapids-dow CUOPT_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="cuopt_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github python) LIBCUOPT_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libcuopt_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github cpp) -# update pip constraints.txt to ensure all future 'pip install' (including those in ci/thirdparty-testing) -# use these wheels for cuopt packages -cat > "${PIP_CONSTRAINT}" < Date: Thu, 24 Jul 2025 09:42:24 -0500 Subject: [PATCH 124/131] accept matrix data as input in workflow --- .../workflows/build_test_publish_images.yaml | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index f66b41d0f6..c25aec06ed 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -26,6 +26,23 @@ on: type: string build_type: type: string + arch: + type: string + default: '["amd64", "arm64"]' + description: 'JSON array of architectures to build for' + cuda_ver: + type: string + default: '["12.8.0"]' + description: 'JSON array of CUDA versions to build for' + python_ver: + type: string + default: '["3.12.11"]' + description: 'JSON array of Python versions to build for' + linux_ver: + type: string + default: '["22.04"]' + description: 'JSON array of Linux versions to build for' + defaults: run: @@ -68,10 +85,10 @@ jobs: run: | MATRIX=$(jq -c '.' < Date: Thu, 24 Jul 2025 10:46:08 -0500 Subject: [PATCH 125/131] address review comments and testing --- .../workflows/build_test_publish_images.yaml | 12 +- .github/workflows/pr.yaml | 227 +----------------- ci/docker/Dockerfile | 3 +- 3 files changed, 12 insertions(+), 230 deletions(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index c25aec06ed..1d1fc4bb5d 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -104,15 +104,13 @@ jobs: 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') + # Remove starting 0s from version 25.08.0a18 -> 25.8.0a18 + CUOPT_VER=$(echo "$ver" | sed -E 's/\.0+([0-9])/\.\1/g') echo "CUOPT_VER=$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 + if rapids-is-release-build; then IMAGE_TAG_PREFIX="$CUOPT_VER" + else + IMAGE_TAG_PREFIX=$(echo "$CUOPT_VER" | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+)a.*/\1a/') fi echo "IMAGE_TAG_PREFIX=$IMAGE_TAG_PREFIX" >> $GITHUB_OUTPUT diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 52d6d4dc1a..cc982d92b2 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -25,226 +25,11 @@ 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 + build-images: + uses: ./.github/workflows/build_test_publish_images.yaml 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 + branch: "branch-25.08" + sha: "ea05ba1" + date: "2025-07-23" + build_type: "nightly" \ No newline at end of file diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index ad3c886807..07cf60aa36 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -84,8 +84,7 @@ ARG PYTHON_SHORT_VER # Set environment variables in .bashrc for all future shells RUN echo 'export PATH="/usr/local/cuda/bin:/usr/bin:/usr/local/bin:/usr/local/nvidia/bin/:/home/cuopt/.local/lib/python${PYTHON_SHORT_VER}/dist-packages/libcuopt/bin/:/home/cuopt/.local/bin:$PATH"' >> /home/cuopt/.bashrc && \ - echo 'export 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/python${PYTHON_SHORT_VER}/dist-packages/libcuopt/lib/:/home/cuopt/.local/lib/python${PYTHON_SHORT_VER}/dist-packages/rapids_logger/lib64:${LD_LIBRARY_PATH}"' >> /home/cuopt/.bashrc && \ - echo 'export PYTHONPATH="/home/cuopt/.local/lib/python${PYTHON_SHORT_VER}/dist-packages:/usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages:${PYTHONPATH:-}"' >> /home/cuopt/.bashrc + echo 'export 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/python${PYTHON_SHORT_VER}/dist-packages/libcuopt/lib/:/home/cuopt/.local/lib/python${PYTHON_SHORT_VER}/dist-packages/rapids_logger/lib64:${LD_LIBRARY_PATH}"' >> /home/cuopt/.bashrc # Create a .bash_profile that sources .bashrc if it exists From f530e5f46599be703108848683521236a4e34347 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 24 Jul 2025 11:08:30 -0500 Subject: [PATCH 126/131] add docker contex folder --- ci/docker/context/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 ci/docker/context/README.md diff --git a/ci/docker/context/README.md b/ci/docker/context/README.md new file mode 100644 index 0000000000..84191ae9ef --- /dev/null +++ b/ci/docker/context/README.md @@ -0,0 +1 @@ +Place holder for docker context. \ No newline at end of file From f1bdf170cbe27cf6220b4ffa59b22bed1ad1c6c3 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 24 Jul 2025 11:34:23 -0500 Subject: [PATCH 127/131] move gcc purge down --- ci/docker/Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index 07cf60aa36..7810aa4de1 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -51,8 +51,6 @@ RUN ln -sf /usr/bin/python${PYTHON_SHORT_VER} /usr/bin/python && \ useradd -r -g cuopt cuopt && \ chown -R cuopt:cuopt /usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages -RUN apt-get purge -y gcc && rm -rf /var/lib/apt/lists/* - USER cuopt FROM python-env AS install-env @@ -74,6 +72,13 @@ RUN cuda_suffix=cu$(echo ${CUDA_VER} | cut -d'.' -f1) && \ "nvidia-cuda-runtime-${cuda_suffix}==${cuda_major_minor}.*" && \ python -m pip list +USER root + +# Remove gcc to save space, gcc was required for building psutils +RUN apt-get purge -y gcc && rm -rf /var/lib/apt/lists/* + +USER cuopt + COPY ./LICENSE /home/cuopt/LICENSE COPY ./VERSION /home/cuopt/VERSION COPY ./THIRD_PARTY_LICENSES /home/cuopt/THIRD_PARTY_LICENSES From 3d3c84da595814e4824b92eab32b929eb5831ffa Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 24 Jul 2025 12:53:25 -0500 Subject: [PATCH 128/131] revert testing --- .github/workflows/build_images.yaml | 2 +- .github/workflows/pr.yaml | 230 +++++++++++++++++++++++++++- 2 files changed, 225 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_images.yaml b/.github/workflows/build_images.yaml index 83325eeb2b..7964272644 100644 --- a/.github/workflows/build_images.yaml +++ b/.github/workflows/build_images.yaml @@ -92,7 +92,7 @@ jobs: build-args: | CUDA_VER=${{ inputs.CUDA_VER }} PYTHON_SHORT_VER=${{ steps.trim.outputs.PYTHON_SHORT }} - CUOPT_VER=25.8.0a49 + CUOPT_VER=${{ inputs.CUOPT_VER }} LINUX_VER=${{ inputs.LINUX_VER }} tags: nvidia/cuopt:${{ inputs.IMAGE_TAG_PREFIX }}-cuda${{ steps.trim.outputs.CUDA_SHORT }}-py${{ steps.trim.outputs.PYTHON_SHORT }}-${{ matrix.ARCH }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index cc982d92b2..7ee94cfb24 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -25,11 +25,229 @@ concurrency: cancel-in-progress: true jobs: - build-images: - uses: ./.github/workflows/build_test_publish_images.yaml + pr-builder: + needs: + - changed-files + - checks + - conda-cpp-build + - conda-cpp-tests + - conda-python-build + - conda-python-tests + - docs-build + - 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: conda-python-build + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-25.08 + with: + build_type: pull-request + node_type: "gpu-l4-latest-1" + arch: "amd64" + file_to_upload: "docs/cuopt/build/html/" + artifact-name: "cuopt_docs" + container_image: "rapidsai/ci-conda:25.08-latest" + 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: - branch: "branch-25.08" - sha: "ea05ba1" - date: "2025-07-23" - build_type: "nightly" \ No newline at end of file + build_type: pull-request + script: ci/test_self_hosted_service.sh From 1fe2e090ca12a702e45a936ac82b7e117ac74ca1 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 24 Jul 2025 13:16:41 -0500 Subject: [PATCH 129/131] fix style --- .github/workflows/build_test_publish_images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 1d1fc4bb5d..52a48f358f 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -42,7 +42,7 @@ on: type: string default: '["22.04"]' description: 'JSON array of Linux versions to build for' - + defaults: run: From 97512f1d12cd47819b4b3ef6d656a5d7e3c9a120 Mon Sep 17 00:00:00 2001 From: Ramakrishnap <42624703+rgsl888prabhu@users.noreply.github.com> Date: Thu, 24 Jul 2025 16:42:17 -0500 Subject: [PATCH 130/131] Update test_image.sh --- ci/docker/test_image.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/docker/test_image.sh b/ci/docker/test_image.sh index fa7af2f6ff..1a3272cdca 100644 --- a/ci/docker/test_image.sh +++ b/ci/docker/test_image.sh @@ -21,7 +21,7 @@ chsh -s /bin/bash cuopt # Install dependencies apt-get update -DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends file bzip2 gcc +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends file bzip2 # Download test data bash datasets/linear_programming/download_pdlp_test_dataset.sh @@ -56,4 +56,4 @@ echo '----------------- CUOPT SERVER TEST START ---------------' python -m pytest python/cuopt_server/cuopt_server/tests/ echo '----------------- CUOPT SERVER TEST END ---------------' EOF -su - cuopt -c "bash ~/test.sh" \ No newline at end of file +su - cuopt -c "bash ~/test.sh" From 027574154d8263828d214447da2c2d5fbb60b790 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 25 Jul 2025 09:17:23 -0500 Subject: [PATCH 131/131] address review comments --- .github/workflows/build_test_publish_images.yaml | 2 +- ci/docker/test_image.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_test_publish_images.yaml b/.github/workflows/build_test_publish_images.yaml index 52a48f358f..aaac5991e0 100644 --- a/.github/workflows/build_test_publish_images.yaml +++ b/.github/workflows/build_test_publish_images.yaml @@ -67,7 +67,7 @@ jobs: compute-matrix: runs-on: ubuntu-latest container: - image: rapidsai/ci-conda:latest + image: rapidsai/ci-conda:25.08-latest outputs: MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }} CUOPT_VER: ${{ steps.compute-cuopt-ver.outputs.CUOPT_VER }} diff --git a/ci/docker/test_image.sh b/ci/docker/test_image.sh index fa7af2f6ff..1a3272cdca 100644 --- a/ci/docker/test_image.sh +++ b/ci/docker/test_image.sh @@ -21,7 +21,7 @@ chsh -s /bin/bash cuopt # Install dependencies apt-get update -DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends file bzip2 gcc +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends file bzip2 # Download test data bash datasets/linear_programming/download_pdlp_test_dataset.sh @@ -56,4 +56,4 @@ echo '----------------- CUOPT SERVER TEST START ---------------' python -m pytest python/cuopt_server/cuopt_server/tests/ echo '----------------- CUOPT SERVER TEST END ---------------' EOF -su - cuopt -c "bash ~/test.sh" \ No newline at end of file +su - cuopt -c "bash ~/test.sh"