-
Notifications
You must be signed in to change notification settings - Fork 1
193 lines (177 loc) · 7.16 KB
/
docker-build-opengl.yaml
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: Build OpenGL-supported Docker Images
on:
push:
branches: [ main ]
tags:
- '*'
pull_request:
branches: [ main ]
schedule:
- cron: '30 2 * * 0,2,4,6'
workflow_dispatch:
jobs:
build-amd64:
runs-on:
- lcas
- cuda
strategy:
matrix:
include:
# - base_image: ubuntu:jammy
# ros_distro: humble
# push_tag: jammy-humble
# - base_image: nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
# ros_distro: humble
# push_tag: jammy-humble-cuda11.8-opengl
# - base_image: nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
# ros_distro: humble
# push_tag: jammy-humble-cuda12.1-opengl
- base_image: nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04
ros_distro: humble
push_tag: jammy-humble-cuda12.2-opengl
- base_image: nvidia/cuda:12.6.2-cudnn-devel-ubuntu22.04
ros_distro: humble
push_tag: jammy-humble-cuda12.6-opengl
- base_image: nvidia/cuda:12.6.3-cudnn-devel-ubuntu24.04
ros_distro: rolling
push_tag: noble-rolling-cuda12.6-opengl
steps:
- name: Node Js
uses: actions/setup-node@v4
with:
node-version: "^16.13.0 || >=18.0.0"
- uses: actions/checkout@v3
- name: What
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Docker Login LCAS
# You may pin to the exact commit or the version.
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v3
with:
# Server address of Docker registry. If not set then will default to Docker Hub
registry: lcas.lincoln.ac.uk
# Username used to log against the Docker registry
username: ${{ secrets.LCAS_REGISTRY_PUSHER }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.LCAS_REGISTRY_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
flavor: |
latest=false
labels: |
org.opencontainers.image.description=L-CAS ROS2 Docker Image with virtual X11 embedded (flavour: ${{ matrix.push_tag }})
org.opencontainers.image.authors=L-CAS Team
# list of Docker images to use as base name for tags
images: |
lcas.lincoln.ac.uk/lcas/ros
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=${{ matrix.push_tag }}-staging
type=raw,enable=${{ github.event_name != 'pull_request' }},value=${{ matrix.push_tag }}
type=raw,enable=${{ github.event_name != 'pull_request' }},value=${{ matrix.push_tag }}-amd64
type=ref,enable=${{ github.event_name != 'pull_request' }},event=branch,prefix=${{ matrix.push_tag }}-
type=semver,pattern={{version}},prefix=${{ matrix.push_tag }}-
type=semver,pattern={{major}}.{{minor}},prefix=${{ matrix.push_tag }}-
type=semver,pattern={{major}},prefix=${{ matrix.push_tag }}-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker Image
uses: docker/build-push-action@v6
with:
context: .
file: ./nvidia.dockerfile
platforms: linux/amd64
push: true
load: true
cache-from: type=local,src=/tmp/cache
cache-to: type=local,src=/tmp/cache
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BASE_IMAGE=${{ matrix.base_image }}
BRANCH=${{ env.BRANCH }}
ROS_DISTRO=${{ matrix.ros_distro }}
build-arm64:
runs-on:
- lcas-runc
- runc
strategy:
matrix:
include:
# - base_image: ubuntu:jammy
# ros_distro: humble
# push_tag: jammy-humble-arm64
# - base_image: nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
# ros_distro: humble
# push_tag: jammy-humble-cuda11.8-opengl-arm64
# - base_image: nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
# ros_distro: humble
# push_tag: jammy-humble-cuda12.1-opengl-arm64
- base_image: nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04
ros_distro: humble
push_tag: jammy-humble-cuda12.2-opengl-arm64
- base_image: nvidia/cuda:12.6.2-cudnn-devel-ubuntu22.04
ros_distro: humble
push_tag: jammy-humble-cuda12.6-opengl-arm64
- base_image: nvidia/cuda:12.6.3-cudnn-devel-ubuntu24.04
ros_distro: rolling
push_tag: noble-rolling-cuda12.6-opengl-arm64
steps:
- name: Node Js
uses: actions/setup-node@v4
with:
node-version: "^16.13.0 || >=18.0.0"
- uses: actions/checkout@v3
- name: What
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Docker Login LCAS
# You may pin to the exact commit or the version.
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v3
with:
# Server address of Docker registry. If not set then will default to Docker Hub
registry: lcas.lincoln.ac.uk
# Username used to log against the Docker registry
username: ${{ secrets.LCAS_REGISTRY_PUSHER }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.LCAS_REGISTRY_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
flavor: |
latest=false
labels: |
org.opencontainers.image.description=L-CAS ROS2 Docker Image with virtual X11 embedded (flavour: ${{ matrix.push_tag }})
org.opencontainers.image.authors=L-CAS Team
# list of Docker images to use as base name for tags
images: |
lcas.lincoln.ac.uk/lcas/ros
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=${{ matrix.push_tag }}-staging
type=raw,enable=${{ github.event_name != 'pull_request' }},value=${{ matrix.push_tag }}
type=ref,enable=${{ github.event_name != 'pull_request' }},event=branch,prefix=${{ matrix.push_tag }}-
type=semver,pattern={{version}},prefix=${{ matrix.push_tag }}-
type=semver,pattern={{major}}.{{minor}},prefix=${{ matrix.push_tag }}-
type=semver,pattern={{major}},prefix=${{ matrix.push_tag }}-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker Image
uses: docker/build-push-action@v6
with:
context: .
file: ./nvidia.dockerfile
platforms: linux/arm64
push: true
load: true
cache-from: type=local,src=/tmp/cache
cache-to: type=local,src=/tmp/cache
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BASE_IMAGE=${{ matrix.base_image }}
BRANCH=${{ env.BRANCH }}
ROS_DISTRO=${{ matrix.ros_distro }}