-
Notifications
You must be signed in to change notification settings - Fork 6
111 lines (107 loc) · 3.95 KB
/
Copy pathpublish.yml
File metadata and controls
111 lines (107 loc) · 3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
on:
release:
types: [published]
env:
DOCKER_TAG: ghcr.io/${{ github.repository }}
VERSION: ${{ github.ref_name }}
jobs:
validate-tag: # Make sure the tag we're publishing looks like semantic versioning
runs-on: ubuntu-latest
steps:
- name: Validate tag format
run: |
TAG="${{ github.event.release.tag_name }}"
echo "Validating tag: '$TAG'"
if [[ $TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]*)?$ ]]; then
echo "Tag matches semver."
else
echo "Error: tag does not match semver."
exit 1
fi
container: # Upload the docker image to the Github Container Registry
needs: [validate-tag]
strategy:
matrix:
build_target:
- docker_suffix: jetpack5
dockerfile: Dockerfile.triton-jetpack-focal
build_args:
runs_on: buildjet-8vcpu-ubuntu-2204-arm
platform: linux/arm64
- docker_suffix: jetpack6
dockerfile: Dockerfile.nvcr-triton-containers
build_args: JETPACK=1
runs_on: buildjet-8vcpu-ubuntu-2204-arm
platform: linux/arm64
- docker_suffix: cuda12_arm
dockerfile: Dockerfile.nvcr-triton-containers
build_args:
runs_on: buildjet-8vcpu-ubuntu-2204-arm
platform: linux/arm64
- docker_suffix: cuda12_amd64
dockerfile: Dockerfile.nvcr-triton-containers
build_args:
runs_on: buildjet-8vcpu-ubuntu-2204
platform: linux/amd64
runs-on: ${{ matrix.build_target.runs_on }}
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
username: viambuild
password: ${{ secrets.DOCKER_PUBLIC_READONLY_PAT }}
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v4
with:
tags: ${{ env.DOCKER_TAG }}/${{ matrix.build_target.docker_suffix}}:${{ env.VERSION }},${{ env.DOCKER_TAG }}/${{ matrix.build_target.docker_suffix}}:latest
pull: true
platforms: ${{ matrix.build_target.platform }}
push: ${{ github.event_name == 'release' }}
file: etc/docker/${{ matrix.build_target.dockerfile }}
build-args: ${{ matrix.build_target.build_args }}
module: # Upload the module to the Viam modular registry
needs: [validate-tag, container]
strategy:
# Until Viam's tags get priorities, it is very important to deploy the Jetpack versions
# *before* the CUDA versions. Otherwise, a Jetpack machine will use the CUDA version of the
# module because it can (which will work, but miss out on the Jetpack-specific features). So,
# remove the parallelization and do these uploads in order until tag priorities are supported
# (see APP-6759).
max-parallel: 1
matrix:
platform:
- arch: arm64
docker_suffix: jetpack5
tags: "jetpack:5"
- arch: arm64
docker_suffix: jetpack6
tags: "jetpack:6"
- arch: arm64
docker_suffix: cuda12_arm
tags: "cuda:true"
- arch: amd64
docker_suffix: cuda12_amd64
tags: "cuda:true"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: build
run: |
TAG=${{ env.DOCKER_TAG }}/${{ matrix.platform.docker_suffix }}:$VERSION make -f Makefile.module module.tar.gz
- uses: viamrobotics/upload-module@v1
if: github.event_name == 'release'
with:
module-path: module.tar.gz
platform: linux/${{ matrix.platform.arch }}
version: ${{ env.VERSION }}
key-id: ${{ secrets.viam_key_id }}
key-value: ${{ secrets.viam_key_value }}
tags: ${{ matrix.platform.tags }}