|
| 1 | +name: Build gpubench only |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths: |
| 6 | + - 'images/jail/gpubench/**' |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + packages: write |
| 11 | + attestations: write |
| 12 | + id-token: write |
| 13 | + |
| 14 | +jobs: |
| 15 | + pre-build: |
| 16 | + runs-on: self-hosted |
| 17 | + |
| 18 | + outputs: |
| 19 | + UNSTABLE: ${{ steps.set-env.outputs.unstable }} |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Harden Runner |
| 23 | + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 |
| 24 | + with: |
| 25 | + egress-policy: audit |
| 26 | + |
| 27 | + - name: Set environment to global output variables based on branch |
| 28 | + id: set-env |
| 29 | + run: | |
| 30 | + if [ "${{ github.ref }}" == "refs/heads/main" ]; then |
| 31 | + echo "unstable=false" >> $GITHUB_OUTPUT |
| 32 | + else |
| 33 | + echo "unstable=true" >> $GITHUB_OUTPUT |
| 34 | + fi |
| 35 | +
|
| 36 | + - name: Print UNSTABLE from output |
| 37 | + run: | |
| 38 | + echo "Branch is - ${{ github.ref }}" |
| 39 | + echo "UNSTABLE - ${{ steps.set-env.outputs.unstable }}" |
| 40 | + gpubench_only: |
| 41 | + runs-on: self-hosted |
| 42 | + needs: pre-build |
| 43 | + |
| 44 | + steps: |
| 45 | + - name: Harden Runner |
| 46 | + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 |
| 47 | + with: |
| 48 | + egress-policy: audit |
| 49 | + |
| 50 | + - name: Checkout repository |
| 51 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 52 | + |
| 53 | + - name: Install GO |
| 54 | + uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 |
| 55 | + with: |
| 56 | + go-version-file: 'go.mod' |
| 57 | + |
| 58 | + - name: Debug vars |
| 59 | + run: | |
| 60 | + echo "UNSTABLE - is ${{ needs.pre-build.outputs.unstable }}" |
| 61 | + make get-version UNSTABLE=${{ needs.pre-build.outputs.unstable }} |
| 62 | +
|
| 63 | + - name: Check if version synced |
| 64 | + run: make test-version-sync |
| 65 | + |
| 66 | + - name: Set up Docker Buildx |
| 67 | + uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 |
| 68 | + |
| 69 | + - name: Log in to the Github Container registry |
| 70 | + uses: docker/login-action@7ca345011ac4304463197fac0e56eab1bc7e6af0 |
| 71 | + with: |
| 72 | + registry: ghcr.io |
| 73 | + username: ${{ github.actor }} |
| 74 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 75 | + |
| 76 | + - name: Run gpu bench tests |
| 77 | + run: | |
| 78 | + UNSTABLE=${{ needs.pre-build.outputs.unstable }} |
| 79 | + IMAGE_VERSION=$(make get-image-version UNSTABLE=${UNSTABLE}) |
| 80 | + VERSION=$(make get-version UNSTABLE=${UNSTABLE}) |
| 81 | + OPERATOR_IMAGE_TAG=$(make get-operator-tag-version UNSTABLE=${UNSTABLE}) |
| 82 | +
|
| 83 | + echo "Running gpubench tests" |
| 84 | + cd ./images/jail/gpubench/ |
| 85 | + go test |
| 86 | + cd - |
| 87 | +
|
| 88 | + echo "Removing previous jail rootfs tar archive" |
| 89 | + rm -rf images/jail_rootfs.tar |
| 90 | +
|
| 91 | + echo "Building tarball for jail" |
| 92 | + make docker-build UNSTABLE="${UNSTABLE}" IMAGE_NAME=jail DOCKERFILE=jail/jail.dockerfile DOCKER_OUTPUT="--output type=tar,dest=jail_rootfs.tar" |
0 commit comments