Build Managed service docker, deploy and test #59
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
| 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 |