|
15 | 15 | secrets:
|
16 | 16 | PERSONAL_ACCESS_TOKEN_FOR_TRIGGERING_TORCHPRIME:
|
17 | 17 | required: true
|
| 18 | + GCLOUD_SERVICE_KEY: |
| 19 | + required: true |
18 | 20 | jobs:
|
19 | 21 | torchprime-e2e-test:
|
20 | 22 | name: Run torchprime E2E tests
|
21 | 23 | timeout-minutes: ${{ inputs.timeout-minutes }}
|
22 | 24 | runs-on: ubuntu-22.04
|
23 | 25 | steps:
|
| 26 | + - name: Use Docker in rootless mode |
| 27 | + if: inputs.has_code_changes == 'true' |
| 28 | + |
| 29 | + - name: Add user to docker group |
| 30 | + if: inputs.has_code_changes == 'true' |
| 31 | + run: | |
| 32 | + sudo usermod -aG docker $USER |
| 33 | + newgrp docker |
| 34 | + shell: bash |
| 35 | + # Googlers: if this fails, follow http://shortn/_61iSj31q1b to debug. |
| 36 | + - uses: google-github-actions/auth@v2 |
| 37 | + if: inputs.has_code_changes == 'true' |
| 38 | + with: |
| 39 | + credentials_json: '${{ secrets.GCLOUD_SERVICE_KEY }}' |
| 40 | + - uses: google-github-actions/setup-gcloud@v2 |
| 41 | + if: inputs.has_code_changes == 'true' |
| 42 | + with: |
| 43 | + version: '>= 363.0.0' |
| 44 | + install_components: 'beta,gke-gcloud-auth-plugin' |
| 45 | + - name: Verify GCP setup |
| 46 | + if: inputs.has_code_changes == 'true' |
| 47 | + run: gcloud info |
| 48 | + shell: bash |
| 49 | + - name: Authenticate Docker |
| 50 | + if: inputs.has_code_changes == 'true' |
| 51 | + run: gcloud auth configure-docker --quiet |
| 52 | + shell: bash |
| 53 | + - name: Activate SA credentials |
| 54 | + if: inputs.has_code_changes == 'true' |
| 55 | + run: gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS |
| 56 | + shell: bash |
24 | 57 | - name: Checkout actions
|
25 | 58 | if: inputs.has_code_changes == 'true'
|
26 | 59 | uses: actions/checkout@v4
|
27 | 60 | with:
|
28 | 61 | sparse-checkout: |
|
29 | 62 | .github/workflows/setup
|
30 | 63 | path: .actions
|
| 64 | + # Build a docker image for torchprime E2E test |
| 65 | + # First download the torch-xla-wheels |
| 66 | + - name: Fetch wheels |
| 67 | + if: inputs.has_code_changes == 'true' |
| 68 | + uses: actions/download-artifact@v4 |
| 69 | + with: |
| 70 | + name: torch-xla-wheels |
| 71 | + path: /tmp/wheels/ |
| 72 | + # Then run docker to install them and push a docker |
| 73 | + - name: Build and push docker image |
| 74 | + if: inputs.has_code_changes == 'true' |
| 75 | + run: | |
| 76 | + . ./infra/ansible/build_for_torchprime.sh |
| 77 | + env: |
| 78 | + XLA_WHEELS_PATH: /tmp/wheels/ |
| 79 | + DOCKER_IMAGE_NAME: torch-xla-torchprime-ci |
| 80 | + DOCKER_IMAGE_TAG: latest |
| 81 | + DOCKER_ORG: pytorch |
| 82 | + # Trigger torchprime E2E test workflow |
31 | 83 | - uses: convictional/[email protected]
|
| 84 | + if: inputs.has_code_changes == 'true' |
32 | 85 | with:
|
33 | 86 | owner: AI-Hypercomputer
|
34 | 87 | repo: torchprime
|
35 | 88 | github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN_FOR_TRIGGERING_TORCHPRIME }}
|
36 | 89 | workflow_file_name: e2e_test.yml
|
| 90 | + wait_interval: 60 |
37 | 91 | ref: yifeit/torchprime-ci
|
0 commit comments