From 0d6ef35c7cd9a7c7bc36983a9ac03485f0062fab Mon Sep 17 00:00:00 2001 From: Andrew Reiter Date: Wed, 26 Jul 2023 14:19:19 -0400 Subject: [PATCH] Split independent builds into parallel jobs --- .github/workflows/ci.yml | 63 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3726b7b2..5152adda7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,9 +15,9 @@ env: PYTHON_VERSION: 3.9 jobs: - multi_arch_build: + amd64_build: runs-on: ubuntu-latest - name: Image Build + name: AMD64 Build steps: - name: Check out code uses: actions/checkout@v3 @@ -26,8 +26,6 @@ jobs: uses: ./.github/actions/setup with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # The majority of users running arm64 are rpi users, so the rpi - # build should be the primary arm64 image - name: Build and push amd64 standard build uses: docker/build-push-action@v4 with: @@ -49,6 +47,17 @@ jobs: set: | tensorrt.tags=ghcr.io/${{ steps.setup.outputs.lowercase-repo }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}-tensorrt *.cache-from=type=gha + arm64_build: + runs-on: ubuntu-latest + name: ARM Build + steps: + - name: Check out code + uses: actions/checkout@v3 + - name: Set up QEMU and Buildx + id: setup + uses: ./.github/actions/setup + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build and push arm64 standard build uses: docker/build-push-action@v4 with: @@ -70,6 +79,17 @@ jobs: set: | rpi.tags=ghcr.io/${{ steps.setup.outputs.lowercase-repo }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}-rpi *.cache-from=type=gha + jetson_jp4_build: + runs-on: ubuntu-latest + name: Jetson Jetpack 4 + steps: + - name: Check out code + uses: actions/checkout@v3 + - name: Set up QEMU and Buildx + id: setup + uses: ./.github/actions/setup + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build and push TensorRT (Jetson, Jetpack 4) env: ARCH: arm64 @@ -84,6 +104,17 @@ jobs: set: | tensorrt.tags=ghcr.io/${{ steps.setup.outputs.lowercase-repo }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}-tensorrt-jp4 *.cache-from=type=gha + jetson_jp5_build: + runs-on: ubuntu-latest + name: Jetson Jetpack 5 + steps: + - name: Check out code + uses: actions/checkout@v3 + - name: Set up QEMU and Buildx + id: setup + uses: ./.github/actions/setup + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build and push TensorRT (Jetson, Jetpack 5) env: ARCH: arm64 @@ -98,8 +129,28 @@ jobs: set: | tensorrt.tags=ghcr.io/${{ steps.setup.outputs.lowercase-repo }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}-tensorrt-jp5 *.cache-from=type=gha - - name: Assemble and push default build - uses: int128/docker-manifest-create-action@v1 + # The majority of users running arm64 are rpi users, so the rpi + # build should be the primary arm64 image + assemble_default_build: + runs-on: ubuntu-latest + name: Assemble and push default build + needs: + - amd64_build + - arm64_build + steps: + - id: lowercaseRepo + uses: ASzc/change-string-case-action@v5 + with: + string: ${{ github.repository }} + - name: Log in to the Container registry + uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Create short sha + run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV + - uses: int128/docker-manifest-create-action@v1 with: tags: ghcr.io/${{ steps.setup.outputs.lowercase-repo }}:${{ github.ref_name }}-${{ env.SHORT_SHA }} suffixes: |