|
| 1 | +name: Test self-hosted service on local-setup |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + repo: |
| 7 | + type: string |
| 8 | + branch: |
| 9 | + type: string |
| 10 | + date: |
| 11 | + type: string |
| 12 | + sha: |
| 13 | + type: string |
| 14 | + build_type: |
| 15 | + required: true |
| 16 | + type: string |
| 17 | + script: |
| 18 | + required: true |
| 19 | + type: string |
| 20 | + |
| 21 | +defaults: |
| 22 | + run: |
| 23 | + shell: bash |
| 24 | + |
| 25 | +permissions: |
| 26 | + actions: read |
| 27 | + checks: none |
| 28 | + contents: read |
| 29 | + deployments: none |
| 30 | + discussions: none |
| 31 | + id-token: write |
| 32 | + issues: none |
| 33 | + packages: read |
| 34 | + pages: none |
| 35 | + pull-requests: read |
| 36 | + repository-projects: none |
| 37 | + security-events: none |
| 38 | + statuses: none |
| 39 | + |
| 40 | + |
| 41 | +jobs: |
| 42 | + cuopt-service: |
| 43 | + name: self hosted service test |
| 44 | + runs-on: linux-amd64-gpu-l4-latest-1 |
| 45 | + strategy: |
| 46 | + matrix: |
| 47 | + ctk: ["12.8.0"] |
| 48 | + linux_ver: ["ubuntu24.04"] |
| 49 | + py_ver: ["3.12"] |
| 50 | + container: |
| 51 | + image: "rapidsai/citestwheel:cuda${{ matrix.ctk }}-${{ matrix.linux_ver}}-py${{ matrix.py_ver }}" |
| 52 | + options: "--network-alias cuopt-service" |
| 53 | + env: |
| 54 | + NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} # GPU jobs must set this container env variable |
| 55 | + RAPIDS_BUILD_TYPE: ${{ inputs.build_type }} |
| 56 | + CUOPT_CLIENT_ID: ${{ secrets.CUOPT_PRD_TEST_CLIENT_ID }} |
| 57 | + CUOPT_CLIENT_SECRET: ${{ secrets.CUOPT_PRD_TEST_SECRET }} |
| 58 | + CUOPT_FUNCTION_ID: ${{ secrets.CUOPT_PRD_TEST_FUNCTION_ID }} |
| 59 | + GH_TOKEN: ${{ github.token }} |
| 60 | + ports: |
| 61 | + - "8000:8000" |
| 62 | + volumes: |
| 63 | + - /tmp/asset_dir/:/tmp/asset_dir/ |
| 64 | + - /tmp/response_dir/:/tmp/response_dir/ |
| 65 | + steps: |
| 66 | + - uses: aws-actions/configure-aws-credentials@v1-node16 |
| 67 | + with: |
| 68 | + role-to-assume: ${{ vars.AWS_ROLE_ARN }} |
| 69 | + aws-region: ${{ vars.AWS_REGION }} |
| 70 | + role-duration-seconds: 14400 # 4h |
| 71 | + - name: Run nvidia-smi to make sure GPU is working |
| 72 | + run: nvidia-smi |
| 73 | + |
| 74 | + - name: Install private index credentials in cibuildwheel container |
| 75 | + run: printf 'machine pypi.k8s.rapids.ai\n\tlogin cibuildwheel\n\tpassword ${{ secrets.RAPIDSAI_PYPI_CI_PASSWORD }}\n' > ~/.netrc |
| 76 | + |
| 77 | + - name: checkout code repo |
| 78 | + uses: actions/checkout@v4 |
| 79 | + with: |
| 80 | + repository: ${{ inputs.repo }} |
| 81 | + ref: ${{ inputs.sha }} |
| 82 | + fetch-depth: 0 # unshallow fetch for setuptools-scm |
| 83 | + persist-credentials: false |
| 84 | + |
| 85 | + - name: Standardize repository information |
| 86 | + uses: rapidsai/shared-actions/rapids-github-info@main |
| 87 | + with: |
| 88 | + repo: ${{ inputs.repo }} |
| 89 | + branch: ${{ inputs.branch }} |
| 90 | + date: ${{ inputs.date }} |
| 91 | + sha: ${{ inputs.sha }} |
| 92 | + |
| 93 | + - name: Run tests |
| 94 | + run: ${{ inputs.script }} |
0 commit comments