-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathbuild-visionpilot-container.yaml
More file actions
119 lines (104 loc) · 3.97 KB
/
build-visionpilot-container.yaml
File metadata and controls
119 lines (104 loc) · 3.97 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
112
113
114
115
116
117
118
119
name: Build VisionPilot Container
env:
DEFAULT_ONNXRUNTIME_VERSION: "1.22.0"
on:
workflow_dispatch:
inputs:
onnxruntime-version:
description: "ONNX Runtime version"
required: true
default: "1.22.0"
push:
branches:
- main
paths:
- 'Models/**'
- 'Modules/**'
- 'VisionPilot/**'
permissions:
contents: read
packages: write
attestations: write
id-token: write
jobs:
build:
strategy:
matrix:
platform: [amd64, arm64]
include:
- platform: amd64
runner: ubuntu-22.04
arch-platform: linux/amd64
arch: x64
- platform: arm64
runner: ubuntu-22.04-arm
arch-platform: linux/arm64
arch: aarch64
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get current date
id: date
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Set git config
uses: autowarefoundation/autoware-github-actions/set-git-config@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Build VisionPilot container
uses: docker/build-push-action@v5
with:
platforms: ${{ matrix.arch-platform }}
context: .
file: ./Modules/SDV/OpenADKit/Docker/Dockerfile
build-args: |
ARCH=${{ matrix.arch }}
ONNXRUNTIME_VERSION=${{ inputs.onnxruntime-version || env.DEFAULT_ONNXRUNTIME_VERSION }}
push: true
provenance: false
cache-from: type=gha,scope=${{ matrix.platform }}
cache-to: type=gha,mode=max,scope=${{ matrix.platform }}
tags: |
ghcr.io/${{ github.repository_owner }}/visionpilot:${{ github.sha }}-${{ matrix.platform }}
ghcr.io/${{ github.repository_owner }}/visionpilot:${{ steps.date.outputs.date }}-${{ matrix.platform }}
manifest:
needs: build
runs-on: ubuntu-22.04
steps:
- name: Set git config
uses: autowarefoundation/autoware-github-actions/set-git-config@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Get current date
id: date
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Create and push multi-arch manifest
run: |
docker manifest create ghcr.io/${{ github.repository_owner }}/visionpilot:${{ github.sha }} \
ghcr.io/${{ github.repository_owner }}/visionpilot:${{ github.sha }}-amd64 \
ghcr.io/${{ github.repository_owner }}/visionpilot:${{ github.sha }}-arm64
docker manifest push ghcr.io/${{ github.repository_owner }}/visionpilot:${{ github.sha }}
docker manifest create ghcr.io/${{ github.repository_owner }}/visionpilot:${{ steps.date.outputs.date }} \
ghcr.io/${{ github.repository_owner }}/visionpilot:${{ steps.date.outputs.date }}-amd64 \
ghcr.io/${{ github.repository_owner }}/visionpilot:${{ steps.date.outputs.date }}-arm64
docker manifest push ghcr.io/${{ github.repository_owner }}/visionpilot:${{ steps.date.outputs.date }}
docker manifest create ghcr.io/${{ github.repository_owner }}/visionpilot:latest \
ghcr.io/${{ github.repository_owner }}/visionpilot:${{ github.sha }}-amd64 \
ghcr.io/${{ github.repository_owner }}/visionpilot:${{ github.sha }}-arm64
docker manifest push ghcr.io/${{ github.repository_owner }}/visionpilot:latest