Skip to content

Commit 8be21c1

Browse files
youtalkChgygLinSakodaShintaro
authored
feat: upstream to origin (#124)
* chore(docker): remove `/autoware/log` after `colcon build` (autowarefoundation#5329) * chore(.github): always run `Show disk space` (autowarefoundation#5354) always show disk space Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp> * build(autoware.repos): remove ament_cmake fork repository (autowarefoundation#5360) Signed-off-by: Chengyong Lin <stclin@qq.com> * fix: remove `ndt_omp` (autowarefoundation#5390) Removed ndt_omp Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp> * fix: change the organization of `awsim_sensor_kit_launch` from RobotecAI to tier4 (autowarefoundation#5403) Fixed organization of `awsim_sensor_kit_launch` from RobotecAI to tier4 Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp> * chore(.devcontainer): rename `.devcontainer` directories (autowarefoundation#5407) rename .devcontainer dirs Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp> * feat(docker): integrate `cuda`/`no-cuda` jobs into single job (autowarefoundation#5363) --------- Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp> Signed-off-by: Chengyong Lin <stclin@qq.com> Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp> Co-authored-by: chgyg <99009754+ChgygLin@users.noreply.github.com> Co-authored-by: SakodaShintaro <rgbygscrsedppbwg@gmail.com> Co-authored-by: SakodaShintaro <shintaro.sakoda@tier4.jp>
1 parent b664726 commit 8be21c1

File tree

13 files changed

+688
-418
lines changed

13 files changed

+688
-418
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: docker-build-and-push-cuda
2+
description: Workflow do build and push CUDA images to registry.
3+
4+
inputs:
5+
platform:
6+
description: ""
7+
required: true
8+
bake-target:
9+
description: ""
10+
required: true
11+
build-args:
12+
description: ""
13+
required: false
14+
dockerhub-token:
15+
description: ""
16+
required: true
17+
18+
runs:
19+
using: composite
20+
steps:
21+
- name: Setup Docker Buildx
22+
uses: docker/setup-buildx-action@v3
23+
24+
- name: Restore ccache
25+
uses: actions/cache/restore@v4
26+
with:
27+
path: |
28+
root-ccache
29+
key: ccache-${{ inputs.platform }}-${{ hashFiles('src/**/*.cpp') }}
30+
restore-keys: |
31+
ccache-${{ inputs.platform }}-
32+
33+
- name: Restore apt-get
34+
uses: actions/cache/restore@v4
35+
with:
36+
path: |
37+
var-cache-apt
38+
key: apt-get-${{ inputs.platform }}-${{ hashFiles('src/**/package.xml') }}
39+
restore-keys: |
40+
apt-get-${{ inputs.platform }}-
41+
42+
- name: Inject cache into docker
43+
uses: reproducible-containers/buildkit-cache-dance@v3.1.2
44+
with:
45+
cache-map: |
46+
{
47+
"root-ccache": "/root/.ccache",
48+
"var-cache-apt": "/var/cache/apt"
49+
}
50+
skip-extraction: true
51+
52+
- name: Get current date
53+
id: date
54+
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
55+
shell: bash
56+
57+
- name: Docker meta for autoware:universe-sensing-perception-devel-cuda
58+
id: meta-universe-sensing-perception-devel-cuda
59+
uses: docker/metadata-action@v5
60+
with:
61+
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
62+
tags: |
63+
type=raw,value=universe-sensing-perception-devel-cuda-${{ inputs.platform }}
64+
type=raw,value=universe-sensing-perception-devel-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }}
65+
bake-target: docker-metadata-action-universe-sensing-perception-devel-cuda
66+
flavor: |
67+
latest=false
68+
69+
- name: Docker meta for autoware:universe-sensing-perception-cuda
70+
id: meta-universe-sensing-perception-cuda
71+
uses: docker/metadata-action@v5
72+
with:
73+
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
74+
tags: |
75+
type=raw,value=universe-sensing-perception-cuda-${{ inputs.platform }}
76+
type=raw,value=universe-sensing-perception-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }}
77+
bake-target: docker-metadata-action-universe-sensing-perception-cuda
78+
flavor: |
79+
latest=false
80+
81+
- name: Docker meta for autoware:universe-devel-cuda
82+
id: meta-universe-devel-cuda
83+
uses: docker/metadata-action@v5
84+
with:
85+
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
86+
tags: |
87+
type=raw,value=universe-devel-cuda-${{ inputs.platform }}
88+
type=raw,value=universe-devel-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }}
89+
bake-target: docker-metadata-action-universe-devel-cuda
90+
flavor: |
91+
latest=false
92+
93+
- name: Docker meta for autoware:universe-cuda
94+
id: meta-universe-cuda
95+
uses: docker/metadata-action@v5
96+
with:
97+
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
98+
tags: |
99+
type=raw,value=universe-cuda-${{ inputs.platform }}
100+
type=raw,value=universe-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }}
101+
bake-target: docker-metadata-action-universe-cuda
102+
flavor: |
103+
latest=auto
104+
105+
- name: Login to Docker Hub
106+
uses: docker/login-action@v3
107+
with:
108+
username: ${{ github.repository_owner }}
109+
password: ${{ inputs.dockerhub-token }}
110+
111+
- name: Build and Push to GitHub Container Registry
112+
uses: docker/bake-action@v5
113+
with:
114+
push: true
115+
files: |
116+
docker/docker-bake-cuda.hcl
117+
${{ steps.meta-universe-sensing-perception-devel-cuda.outputs.bake-file }}
118+
${{ steps.meta-universe-sensing-perception-cuda.outputs.bake-file }}
119+
${{ steps.meta-universe-devel-cuda.outputs.bake-file }}
120+
${{ steps.meta-universe-cuda.outputs.bake-file }}
121+
provenance: false
122+
set: |
123+
${{ inputs.build-args }}

.github/actions/docker-build-and-push/action.yaml

+26-34
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: docker-build-and-push
22
description: ""
33

44
inputs:
5-
name:
6-
description: ""
7-
required: true
85
platform:
96
description: ""
107
required: true
@@ -14,9 +11,6 @@ inputs:
1411
build-args:
1512
description: ""
1613
required: false
17-
tag-suffix:
18-
description: ""
19-
required: false
2014
dockerhub-token:
2115
description: ""
2216
required: true
@@ -45,19 +39,17 @@ runs:
4539
with:
4640
path: |
4741
root-ccache
48-
key: ccache-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('src/**/*.cpp') }}
42+
key: ccache-${{ inputs.platform }}-${{ hashFiles('src/**/*.cpp') }}
4943
restore-keys: |
50-
ccache-${{ inputs.platform }}-${{ inputs.name }}-
5144
ccache-${{ inputs.platform }}-
5245
5346
- name: Restore apt-get
5447
uses: actions/cache/restore@v4
5548
with:
5649
path: |
5750
var-cache-apt
58-
key: apt-get-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('src/**/package.xml') }}
51+
key: apt-get-${{ inputs.platform }}-${{ hashFiles('src/**/package.xml') }}
5952
restore-keys: |
60-
apt-get-${{ inputs.platform }}-${{ inputs.name }}-
6153
apt-get-${{ inputs.platform }}-
6254
6355
- name: Inject cache into docker
@@ -81,8 +73,8 @@ runs:
8173
with:
8274
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
8375
tags: |
84-
type=raw,value=base${{ inputs.tag-suffix }}-${{ inputs.platform }}
85-
type=raw,value=base${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}-${{ inputs.platform }}
76+
type=raw,value=base-${{ inputs.platform }}
77+
type=raw,value=base-${{ steps.date.outputs.date }}-${{ inputs.platform }}
8678
bake-target: docker-metadata-action-base
8779
flavor: |
8880
latest=false
@@ -93,8 +85,8 @@ runs:
9385
with:
9486
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
9587
tags: |
96-
type=raw,value=core-devel${{ inputs.tag-suffix }}-${{ inputs.platform }}
97-
type=raw,value=core-devel${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}-${{ inputs.platform }}
88+
type=raw,value=core-devel-${{ inputs.platform }}
89+
type=raw,value=core-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }}
9890
bake-target: docker-metadata-action-core-devel
9991
flavor: |
10092
latest=false
@@ -105,8 +97,8 @@ runs:
10597
with:
10698
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
10799
tags: |
108-
type=raw,value=universe-sensing-perception-devel${{ inputs.tag-suffix }}-${{ inputs.platform }}
109-
type=raw,value=universe-sensing-perception-devel${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}-${{ inputs.platform }}
100+
type=raw,value=universe-sensing-perception-devel-${{ inputs.platform }}
101+
type=raw,value=universe-sensing-perception-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }}
110102
bake-target: docker-metadata-action-universe-sensing-perception-devel
111103
flavor: |
112104
latest=false
@@ -117,8 +109,8 @@ runs:
117109
with:
118110
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
119111
tags: |
120-
type=raw,value=universe-sensing-perception${{ inputs.tag-suffix }}-${{ inputs.platform }}
121-
type=raw,value=universe-sensing-perception${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}-${{ inputs.platform }}
112+
type=raw,value=universe-sensing-perception-${{ inputs.platform }}
113+
type=raw,value=universe-sensing-perception-${{ steps.date.outputs.date }}-${{ inputs.platform }}
122114
bake-target: docker-metadata-action-universe-sensing-perception
123115
flavor: |
124116
latest=false
@@ -129,8 +121,8 @@ runs:
129121
with:
130122
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
131123
tags: |
132-
type=raw,value=universe-localization-mapping-devel${{ inputs.tag-suffix }}-${{ inputs.platform }}
133-
type=raw,value=universe-localization-mapping-devel${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}-${{ inputs.platform }}
124+
type=raw,value=universe-localization-mapping-devel-${{ inputs.platform }}
125+
type=raw,value=universe-localization-mapping-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }}
134126
bake-target: docker-metadata-action-universe-localization-mapping-devel
135127
flavor: |
136128
latest=false
@@ -141,8 +133,8 @@ runs:
141133
with:
142134
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
143135
tags: |
144-
type=raw,value=universe-localization-mapping${{ inputs.tag-suffix }}-${{ inputs.platform }}
145-
type=raw,value=universe-localization-mapping${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}-${{ inputs.platform }}
136+
type=raw,value=universe-localization-mapping-${{ inputs.platform }}
137+
type=raw,value=universe-localization-mapping-${{ steps.date.outputs.date }}-${{ inputs.platform }}
146138
bake-target: docker-metadata-action-universe-localization-mapping
147139
flavor: |
148140
latest=false
@@ -153,8 +145,8 @@ runs:
153145
with:
154146
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
155147
tags: |
156-
type=raw,value=universe-planning-control-devel${{ inputs.tag-suffix }}-${{ inputs.platform }}
157-
type=raw,value=universe-planning-control-devel${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}-${{ inputs.platform }}
148+
type=raw,value=universe-planning-control-devel-${{ inputs.platform }}
149+
type=raw,value=universe-planning-control-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }}
158150
bake-target: docker-metadata-action-universe-planning-control-devel
159151
flavor: |
160152
latest=false
@@ -165,8 +157,8 @@ runs:
165157
with:
166158
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
167159
tags: |
168-
type=raw,value=universe-planning-control${{ inputs.tag-suffix }}-${{ inputs.platform }}
169-
type=raw,value=universe-planning-control${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}-${{ inputs.platform }}
160+
type=raw,value=universe-planning-control-${{ inputs.platform }}
161+
type=raw,value=universe-planning-control-${{ steps.date.outputs.date }}-${{ inputs.platform }}
170162
bake-target: docker-metadata-action-universe-planning-control
171163
flavor: |
172164
latest=false
@@ -177,8 +169,8 @@ runs:
177169
with:
178170
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
179171
tags: |
180-
type=raw,value=universe-vehicle-system-devel${{ inputs.tag-suffix }}-${{ inputs.platform }}
181-
type=raw,value=universe-vehicle-system-devel${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}-${{ inputs.platform }}
172+
type=raw,value=universe-vehicle-system-devel-${{ inputs.platform }}
173+
type=raw,value=universe-vehicle-system-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }}
182174
bake-target: docker-metadata-action-universe-vehicle-system-devel
183175
flavor: |
184176
latest=false
@@ -189,8 +181,8 @@ runs:
189181
with:
190182
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
191183
tags: |
192-
type=raw,value=universe-vehicle-system${{ inputs.tag-suffix }}-${{ inputs.platform }}
193-
type=raw,value=universe-vehicle-system${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}-${{ inputs.platform }}
184+
type=raw,value=universe-vehicle-system-${{ inputs.platform }}
185+
type=raw,value=universe-vehicle-system-${{ steps.date.outputs.date }}-${{ inputs.platform }}
194186
bake-target: docker-metadata-action-universe-vehicle-system
195187
flavor: |
196188
latest=false
@@ -201,8 +193,8 @@ runs:
201193
with:
202194
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
203195
tags: |
204-
type=raw,value=universe-devel${{ inputs.tag-suffix }}-${{ inputs.platform }}
205-
type=raw,value=universe-devel${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}-${{ inputs.platform }}
196+
type=raw,value=universe-devel-${{ inputs.platform }}
197+
type=raw,value=universe-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }}
206198
bake-target: docker-metadata-action-universe-devel
207199
flavor: |
208200
latest=false
@@ -213,8 +205,8 @@ runs:
213205
with:
214206
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
215207
tags: |
216-
type=raw,value=universe${{ inputs.tag-suffix }}-${{ inputs.platform }}
217-
type=raw,value=universe${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}-${{ inputs.platform }}
208+
type=raw,value=universe-${{ inputs.platform }}
209+
type=raw,value=universe-${{ steps.date.outputs.date }}-${{ inputs.platform }}
218210
bake-target: docker-metadata-action-universe
219211
flavor: |
220212
latest=auto

.github/actions/docker-build/action.yaml

+9-16
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: docker-build
22
description: ""
33

44
inputs:
5-
name:
6-
description: ""
7-
required: true
85
platform:
96
description: ""
107
required: true
@@ -39,48 +36,44 @@ runs:
3936

4037
- name: Cache ccache
4138
uses: actions/cache@v4
42-
if: ${{ inputs.name == 'no-cuda' && github.ref == 'refs/heads/main' }}
39+
if: ${{ github.ref == 'refs/heads/main' }}
4340
id: cache-ccache
4441
with:
4542
path: |
4643
root-ccache
47-
key: ccache-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('src/**/*.cpp') }}
44+
key: ccache-${{ inputs.platform }}-${{ hashFiles('src/**/*.cpp') }}
4845
restore-keys: |
49-
ccache-${{ inputs.platform }}-${{ inputs.name }}-
5046
ccache-${{ inputs.platform }}-
5147
5248
- name: Cache apt-get
5349
uses: actions/cache@v4
54-
if: ${{ inputs.name == 'no-cuda' && github.ref == 'refs/heads/main' }}
50+
if: ${{ github.ref == 'refs/heads/main' }}
5551
id: cache-apt-get
5652
with:
5753
path: |
5854
var-cache-apt
59-
key: apt-get-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('src/**/package.xml') }}
55+
key: apt-get-${{ inputs.platform }}-${{ hashFiles('src/**/package.xml') }}
6056
restore-keys: |
61-
apt-get-${{ inputs.platform }}-${{ inputs.name }}-
6257
apt-get-${{ inputs.platform }}-
6358
6459
- name: Restore ccache
6560
uses: actions/cache/restore@v4
66-
if: ${{ inputs.name != 'no-cuda' || github.ref != 'refs/heads/main' }}
61+
if: ${{ github.ref != 'refs/heads/main' }}
6762
with:
6863
path: |
6964
root-ccache
70-
key: ccache-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('src/**/*.cpp') }}
65+
key: ccache-${{ inputs.platform }}-${{ hashFiles('src/**/*.cpp') }}
7166
restore-keys: |
72-
ccache-${{ inputs.platform }}-${{ inputs.name }}-
7367
ccache-${{ inputs.platform }}-
7468
7569
- name: Restore apt-get
7670
uses: actions/cache/restore@v4
77-
if: ${{ inputs.name != 'no-cuda' || github.ref != 'refs/heads/main' }}
71+
if: ${{ github.ref != 'refs/heads/main' }}
7872
with:
7973
path: |
8074
var-cache-apt
81-
key: apt-get-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('src/**/package.xml') }}
75+
key: apt-get-${{ inputs.platform }}-${{ hashFiles('src/**/package.xml') }}
8276
restore-keys: |
83-
apt-get-${{ inputs.platform }}-${{ inputs.name }}-
8477
apt-get-${{ inputs.platform }}-
8578
8679
- name: Inject cache into docker
@@ -106,4 +99,4 @@ runs:
10699
context: .
107100
push: false
108101
build-args: ${{ inputs.build-args }}
109-
cache-from: type=registry,ref=${{ github.repository }}-buildcache:${{ inputs.name }}-${{ inputs.platform }}-${{ inputs.cache-tag-suffix }}
102+
cache-from: type=registry,ref=${{ github.repository }}-buildcache:${{ inputs.platform }}-${{ inputs.cache-tag-suffix }}

0 commit comments

Comments
 (0)