|
15 | 15 | name: Nightly Tests |
16 | 16 |
|
17 | 17 | on: |
18 | | - push: |
19 | | - branches: ["develop"] |
20 | 18 | workflow_dispatch: |
21 | 19 | schedule: # Schedule the job run at 12AM PST daily. |
22 | 20 | - cron: '0 8 * * *' |
23 | 21 |
|
| 22 | +permissions: |
| 23 | + contents: read |
24 | 24 |
|
25 | 25 | env: |
26 | 26 | CLUSTER_NETWORK_ARGUMENTS: "--network=${{secrets.NETWORK_NAME}} --subnetwork=${{secrets.SUBNETWORK_NAME}}" |
@@ -230,3 +230,181 @@ jobs: |
230 | 230 | - name: Delete the RayCluster-enabled XPK cluster |
231 | 231 | if: always() |
232 | 232 | run: python xpk.py cluster delete --cluster $TPU_CLUSTER_NAME --zone=us-central2-b |
| 233 | + |
| 234 | + set-variables: |
| 235 | + runs-on: [ubuntu-22.04] |
| 236 | + concurrency: |
| 237 | + group: set-variables-${{ github.event.number}} |
| 238 | + cancel-in-progress: true |
| 239 | + outputs: |
| 240 | + cluster-name: ${{ steps.set-cluster-name.outputs.cluster-name }} |
| 241 | + cluster-name-dws: ${{ steps.set-cluster-name-dws.outputs.cluster-name-dws }} |
| 242 | + group-name: ${{ steps.set-group-name.outputs.group-name }} |
| 243 | + zone: ${{ steps.set-zone.outputs.zone }} |
| 244 | + tpu-type: ${{ steps.set-tpu-type.outputs.tpu-type }} |
| 245 | + tpu-type-topology: ${{ steps.set-tpu-type-topology.outputs.tpu-type-topology }} |
| 246 | + location: ${{steps.set-location.outputs.location}} |
| 247 | + run-id: ${{steps.set-run-id.outputs.run-id}} |
| 248 | + steps: |
| 249 | + - name: set run-id |
| 250 | + id: set-run-id |
| 251 | + run: | |
| 252 | + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then |
| 253 | + RUN_ID="dispatch" |
| 254 | + elif [ "${{ github.ref }}" == "refs/heads/main" ]; then |
| 255 | + RUN_ID="main" |
| 256 | + elif [ "${{ github.ref }}" == "refs/heads/develop" ]; then |
| 257 | + RUN_ID="develop" |
| 258 | + else |
| 259 | + RUN_ID="${{ github.event.number }}" |
| 260 | + fi |
| 261 | + echo run-id=$RUN_ID >> $GITHUB_OUTPUT |
| 262 | + - name: set cluster-name |
| 263 | + id: set-cluster-name |
| 264 | + run: | |
| 265 | + echo cluster-name=build-xpk-2-nodepools-${{steps.set-run-id.outputs.run-id}} >> $GITHUB_OUTPUT |
| 266 | + - name: set cluster-name-dws |
| 267 | + id: set-cluster-name-dws |
| 268 | + run: | |
| 269 | + echo cluster-name-dws=build-xpk-2-nodepools-dws-${{steps.set-run-id.outputs.run-id}} >> $GITHUB_OUTPUT |
| 270 | + - name: set group-name |
| 271 | + id: set-group-name |
| 272 | + run: | |
| 273 | + echo group-name=xpk-${{steps.set-run-id.outputs.run-id}} >> $GITHUB_OUTPUT |
| 274 | + - name: set zone |
| 275 | + id: set-zone |
| 276 | + run: | |
| 277 | + echo zone=us-central2-b >> $GITHUB_OUTPUT |
| 278 | + - name: set tpu-type |
| 279 | + id: set-tpu-type |
| 280 | + run: | |
| 281 | + echo tpu-type=v4-8 >> $GITHUB_OUTPUT |
| 282 | + - name: set tpu-type-topology |
| 283 | + id: set-tpu-type-topology |
| 284 | + run: | |
| 285 | + echo tpu-type-topology=v4-2x2x1 >> $GITHUB_OUTPUT |
| 286 | + - name: set location |
| 287 | + id: set-location |
| 288 | + run: | |
| 289 | + echo location=us-central2 >> $GITHUB_OUTPUT |
| 290 | + install-dependencies: |
| 291 | + needs: [set-variables] |
| 292 | + runs-on: ubuntu-22.04 |
| 293 | + strategy: |
| 294 | + matrix: |
| 295 | + python-version: ["3.10", "3.11"] |
| 296 | + steps: |
| 297 | + - uses: actions/checkout@v4 |
| 298 | + - uses: google-github-actions/setup-gcloud@v2 |
| 299 | + with: |
| 300 | + version: '>= 363.0.0' |
| 301 | + install_components: 'beta, gke-gcloud-auth-plugin' |
| 302 | + - uses: actions/setup-python@v5 |
| 303 | + with: |
| 304 | + python-version: ${{ matrix.python-version }} |
| 305 | + - name: Check if cache exists |
| 306 | + id: check-cache |
| 307 | + uses: actions/cache@v3 |
| 308 | + with: |
| 309 | + path: | |
| 310 | + usr/local/bin/ |
| 311 | + ~/.cache/pip |
| 312 | + ${{env.pythonLocation}} |
| 313 | + key: xpk-deps-${{ matrix.python-version }}-${{github.run_id}}-${{github.run_attempt}} |
| 314 | + lookup-only: true |
| 315 | + - name: install dependencies |
| 316 | + if : steps.check-cache.outputs.cache-hit != 'true' |
| 317 | + run: make install-dev && cp ./bin/kubectl-kueue /usr/local/bin/kubectl-kueue && cp ./bin/kubectl-kjob /usr/local/bin/kubectl-kjob |
| 318 | + - name: Cache dependencies |
| 319 | + if : steps.check-cache.outputs.cache-hit != 'true' |
| 320 | + uses: actions/cache/save@v3 |
| 321 | + with: |
| 322 | + path: | |
| 323 | + /usr/local/bin/kubectl-kueue |
| 324 | + /usr/local/bin/kubectl-kjob |
| 325 | + ~/.cache/pip |
| 326 | + ${{env.pythonLocation}} |
| 327 | + key: xpk-deps-${{ matrix.python-version }}-${{github.run_id}}-${{github.run_attempt}} |
| 328 | + run-integration-tests: |
| 329 | + needs: [install-dependencies, set-variables] |
| 330 | + uses: ./.github/workflows/reusable_integration_tests.yaml |
| 331 | + with: |
| 332 | + run-id: '${{needs.set-variables.outputs.run-id}}' |
| 333 | + concurrency: # We support one build or nightly test to run at a time currently. |
| 334 | + group: integration-tests-${{needs.set-variables.outputs.run-id}} |
| 335 | + cancel-in-progress: true |
| 336 | + secrets: inherit |
| 337 | + cluster-private: |
| 338 | + needs: [run-integration-tests, set-variables] |
| 339 | + uses: ./.github/workflows/reusable_cluster_private.yaml |
| 340 | + concurrency: # We support one build or nightly test to run at a time currently. |
| 341 | + group: cluster-private-${{needs.set-variables.outputs.run-id}} |
| 342 | + cancel-in-progress: true |
| 343 | + with: |
| 344 | + run-id: '${{needs.set-variables.outputs.run-id}}' |
| 345 | + cluster-name: '${{needs.set-variables.outputs.cluster-name}}' |
| 346 | + tpu-type: '${{needs.set-variables.outputs.tpu-type-topology || inputs.tpu-type}}' |
| 347 | + zone: '${{needs.set-variables.outputs.zone}}' |
| 348 | + location: '${{needs.set-variables.outputs.location}}' |
| 349 | + secrets: inherit |
| 350 | + cluster-create: |
| 351 | + needs: [run-integration-tests, set-variables] |
| 352 | + concurrency: # We support one build or nightly test to run at a time currently. |
| 353 | + group: cluster-create-${{needs.set-variables.outputs.run-id}} |
| 354 | + cancel-in-progress: true |
| 355 | + uses: ./.github/workflows/reusable_cluster_create.yaml |
| 356 | + with: |
| 357 | + cluster-name-dws: '${{needs.set-variables.outputs.cluster-name-dws}}' |
| 358 | + cluster-name: '${{needs.set-variables.outputs.cluster-name}}' |
| 359 | + tpu-type: '${{needs.set-variables.outputs.tpu-type-topology || inputs.tpu-type}}' |
| 360 | + zone: '${{needs.set-variables.outputs.zone}}' |
| 361 | + location: '${{needs.set-variables.outputs.location}}' |
| 362 | + run-id: '${{needs.set-variables.outputs.run-id}}' |
| 363 | + secrets: inherit |
| 364 | + workloads-tests: |
| 365 | + needs: [cluster-create, set-variables] |
| 366 | + uses: ./.github/workflows/reusable_workload_tests.yaml |
| 367 | + concurrency: # We support one build or nightly test to run at a time currently. |
| 368 | + group: workload-tests-${{needs.set-variables.outputs.run-id}} |
| 369 | + cancel-in-progress: true |
| 370 | + with: |
| 371 | + cluster-name: ${{needs.set-variables.outputs.cluster-name}} |
| 372 | + cluster-name-dws: '${{needs.set-variables.outputs.cluster-name-dws}}' |
| 373 | + tpu-type: ${{needs.set-variables.outputs.tpu-type}} |
| 374 | + tpu-type-topology: ${{needs.set-variables.outputs.tpu-type-topology}} |
| 375 | + zone: ${{needs.set-variables.outputs.zone}} |
| 376 | + run-id: '${{needs.set-variables.outputs.run-id}}' |
| 377 | + secrets: inherit |
| 378 | + batch-tests: |
| 379 | + needs: [cluster-create, set-variables] |
| 380 | + uses: ./.github/workflows/reusable_batch_tests.yaml |
| 381 | + concurrency: # We support one build or nightly test to run at a time currently. |
| 382 | + group: batch-tests-${{needs.set-variables.outputs.run-id}} |
| 383 | + cancel-in-progress: true |
| 384 | + with: |
| 385 | + cluster-name: ${{needs.set-variables.outputs.cluster-name}} |
| 386 | + zone: ${{needs.set-variables.outputs.zone}} |
| 387 | + run-id: ${{needs.set-variables.outputs.run-id}} |
| 388 | + secrets: inherit |
| 389 | + storage-tests: |
| 390 | + needs: [cluster-create, set-variables, batch-tests, workloads-tests] |
| 391 | + uses: ./.github/workflows/reusable_storage_tests.yaml |
| 392 | + concurrency: # We support one build or nightly test to run at a time currently. |
| 393 | + group: storage-tests-${{needs.set-variables.outputs.run-id}} |
| 394 | + cancel-in-progress: true |
| 395 | + with: |
| 396 | + cluster-name: ${{needs.set-variables.outputs.cluster-name}} |
| 397 | + tpu-type: ${{needs.set-variables.outputs.tpu-type}} |
| 398 | + zone: ${{needs.set-variables.outputs.zone}} |
| 399 | + run-id: ${{needs.set-variables.outputs.run-id}} |
| 400 | + secrets: inherit |
| 401 | + cluster-delete: |
| 402 | + if: always() |
| 403 | + needs: [set-variables, storage-tests] |
| 404 | + uses: ./.github/workflows/reusable_cluster_delete.yaml |
| 405 | + with: |
| 406 | + cluster-name-dws: ${{needs.set-variables.outputs.cluster-name-dws}} |
| 407 | + cluster-name: ${{needs.set-variables.outputs.cluster-name}} |
| 408 | + run-id: ${{needs.set-variables.outputs.run-id}} |
| 409 | + zone: ${{needs.set-variables.outputs.zone}} |
| 410 | + secrets: inherit |
0 commit comments