Merge branch 'add_lean_ci_option' of github.com:rgsl888prabhu/cuopt_p… #1508
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: Copyright (c) 2021-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: | |
| push: | |
| branches: | |
| - "pull-request/[0-9]+" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| # Set to 'true' for lean CI (amd64, latest Python/CUDA only) or 'false' for full CI (all platforms) | |
| LEAN_CI: 'true' | |
| jobs: | |
| pr-builder: | |
| needs: | |
| - compute-matrix-filters | |
| - changed-files | |
| - checks | |
| - conda-cpp-build | |
| - conda-cpp-tests | |
| - conda-python-build | |
| - conda-python-tests | |
| - docs-build | |
| - wheel-build-libcuopt | |
| - 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@main | |
| compute-matrix-filters: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| conda_lean_filter: ${{ steps.set-filters.outputs.conda_lean_filter }} | |
| conda_test_filter: ${{ steps.set-filters.outputs.conda_test_filter }} | |
| wheel_lean_filter: ${{ steps.set-filters.outputs.wheel_lean_filter }} | |
| mps_parser_filter: ${{ steps.set-filters.outputs.mps_parser_filter }} | |
| libcuopt_filter: ${{ steps.set-filters.outputs.libcuopt_filter }} | |
| cuopt_server_filter: ${{ steps.set-filters.outputs.cuopt_server_filter }} | |
| cuopt_sh_client_filter: ${{ steps.set-filters.outputs.cuopt_sh_client_filter }} | |
| steps: | |
| - name: Set matrix filters | |
| id: set-filters | |
| run: | | |
| if [ "${{ env.LEAN_CI }}" == "true" ]; then | |
| echo "conda_lean_filter=[map(select(.ARCH == \"amd64\" and .PY_VER == \"3.10\")) | max_by(.CUDA_VER | split(\".\") | map(tonumber))]" >> $GITHUB_OUTPUT | |
| echo "conda_test_filter=[map(select(.ARCH == \"amd64\" and .PY_VER == \"3.13\")) | max_by(.CUDA_VER | split(\".\") | map(tonumber))]" >> $GITHUB_OUTPUT | |
| echo "wheel_lean_filter=[map(select(.ARCH == \"amd64\" and .PY_VER == \"3.12\")) | max_by(.CUDA_VER | split(\".\") | map(tonumber))]" >> $GITHUB_OUTPUT | |
| echo "mps_parser_filter=[map(select(.ARCH == \"amd64\" and .PY_VER == \"3.12\")) | max_by(.CUDA_VER | split(\".\") | map(tonumber))]" >> $GITHUB_OUTPUT | |
| echo "libcuopt_filter=[map(select(.ARCH == \"amd64\" and .PY_VER == \"3.12\")) | max_by(.CUDA_VER | split(\".\") | map(tonumber))]" >> $GITHUB_OUTPUT | |
| echo "cuopt_server_filter=[map(select(.ARCH == \"amd64\" and .PY_VER == \"3.12\")) | max_by(.CUDA_VER | split(\".\") | map(tonumber))]" >> $GITHUB_OUTPUT | |
| echo "cuopt_sh_client_filter=[map(select(.ARCH == \"amd64\" and .PY_VER == \"3.12\")) | max_by(.CUDA_VER | split(\".\") | map(tonumber))]" >> $GITHUB_OUTPUT | |
| else | |
| echo "conda_lean_filter=." >> $GITHUB_OUTPUT | |
| echo "conda_test_filter=." >> $GITHUB_OUTPUT | |
| echo "wheel_lean_filter=." >> $GITHUB_OUTPUT | |
| echo "mps_parser_filter=group_by([.ARCH, (.PY_VER |split(\".\") | map(tonumber))])|map(max_by([(.CUDA_VER|split(\".\")|map(tonumber))]))" >> $GITHUB_OUTPUT | |
| echo "libcuopt_filter=group_by([.ARCH, (.CUDA_VER|split(\".\")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(\".\")|map(tonumber)))" >> $GITHUB_OUTPUT | |
| echo "cuopt_server_filter=map(select(.ARCH == \"amd64\")) | group_by(.CUDA_VER|split(\".\")|map(tonumber)|.[0]) | map(max_by([(.PY_VER|split(\".\")|map(tonumber)), (.CUDA_VER|split(\".\")|map(tonumber))]))" >> $GITHUB_OUTPUT | |
| echo "cuopt_sh_client_filter=[map(select(.ARCH == \"amd64\")) | min_by((.PY_VER | split(\".\") | map(tonumber)), (.CUDA_VER | split(\".\") | map(-tonumber)))]" >> $GITHUB_OUTPUT | |
| fi | |
| changed-files: | |
| secrets: inherit | |
| uses: rapidsai/shared-workflows/.github/workflows/changed-files.yaml@main | |
| 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@main | |
| with: | |
| enable_check_generated_files: false | |
| conda-cpp-build: | |
| needs: [checks, compute-matrix-filters] | |
| secrets: inherit | |
| uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@main | |
| with: | |
| build_type: pull-request | |
| script: ci/build_cpp.sh | |
| matrix_filter: ${{ needs.compute-matrix-filters.outputs.conda_lean_filter }} | |
| conda-cpp-tests: | |
| needs: [conda-cpp-build, changed-files, compute-matrix-filters] | |
| secrets: inherit | |
| uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@main | |
| #if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp | |
| with: | |
| build_type: pull-request | |
| script: ci/test_cpp.sh | |
| matrix_filter: ${{ needs.compute-matrix-filters.outputs.conda_test_filter }} | |
| conda-python-build: | |
| needs: [conda-cpp-build, compute-matrix-filters] | |
| secrets: inherit | |
| uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@main | |
| with: | |
| build_type: pull-request | |
| script: ci/build_python.sh | |
| matrix_filter: ${{ needs.compute-matrix-filters.outputs.conda_test_filter }} | |
| conda-python-tests: | |
| needs: [conda-python-build, changed-files, compute-matrix-filters] | |
| secrets: inherit | |
| uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@main | |
| #if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python | |
| with: | |
| run_codecov: false | |
| build_type: pull-request | |
| script: ci/test_python.sh | |
| matrix_filter: ${{ needs.compute-matrix-filters.outputs.conda_test_filter }} | |
| docs-build: | |
| needs: conda-python-build | |
| secrets: inherit | |
| uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@main | |
| 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.12-latest" | |
| script: "ci/build_docs.sh" | |
| wheel-build-cuopt-mps-parser: | |
| needs: compute-matrix-filters | |
| secrets: inherit | |
| uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main | |
| 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 | |
| # need 1 build per Python version and arch (but CUDA version doesn't matter so choose the latest) | |
| matrix_filter: ${{ needs.compute-matrix-filters.outputs.mps_parser_filter }} | |
| wheel-build-libcuopt: | |
| needs: [wheel-build-cuopt-mps-parser, compute-matrix-filters] | |
| secrets: inherit | |
| uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main | |
| with: | |
| # build for every combination of arch and CUDA version, but only for the latest Python | |
| matrix_filter: ${{ needs.compute-matrix-filters.outputs.libcuopt_filter }} | |
| 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, compute-matrix-filters] | |
| secrets: inherit | |
| uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main | |
| with: | |
| build_type: pull-request | |
| script: ci/build_wheel_cuopt.sh | |
| package-name: cuopt | |
| package-type: python | |
| matrix_filter: ${{ needs.compute-matrix-filters.outputs.wheel_lean_filter }} | |
| wheel-tests-cuopt: | |
| needs: [wheel-build-cuopt, wheel-build-cuopt-mps-parser, wheel-build-cuopt-sh-client, changed-files, compute-matrix-filters] | |
| secrets: inherit | |
| uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@main | |
| #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: ${{ needs.compute-matrix-filters.outputs.wheel_lean_filter }} | |
| wheel-build-cuopt-server: | |
| needs: [checks, compute-matrix-filters] | |
| secrets: inherit | |
| uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main | |
| with: | |
| build_type: pull-request | |
| script: ci/build_wheel_cuopt_server.sh | |
| package-name: cuopt_server | |
| package-type: python | |
| pure-wheel: true | |
| # Only need 1 package per CUDA major version. This selects "ARCH=amd64 + the latest supported Python, 1 job per major CUDA version". | |
| matrix_filter: ${{ needs.compute-matrix-filters.outputs.cuopt_server_filter }} | |
| wheel-build-cuopt-sh-client: | |
| needs: compute-matrix-filters | |
| secrets: inherit | |
| uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main | |
| with: | |
| build_type: pull-request | |
| script: ci/build_wheel_cuopt_sh_client.sh | |
| package-name: cuopt_sh_client | |
| package-type: python | |
| append-cuda-suffix: false | |
| pure-wheel: true | |
| # only need 1 build (noarch package): this selects amd64, oldest-supported Python, latest-supported CUDA | |
| matrix_filter: ${{ needs.compute-matrix-filters.outputs.cuopt_sh_client_filter }} | |
| wheel-tests-cuopt-server: | |
| needs: [wheel-build-cuopt, wheel-build-cuopt-server, changed-files, compute-matrix-filters] | |
| secrets: inherit | |
| uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@main | |
| #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: ${{ needs.compute-matrix-filters.outputs.wheel_lean_filter }} | |
| test-self-hosted-server: | |
| needs: [wheel-build-cuopt, 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 |