-
-
Notifications
You must be signed in to change notification settings - Fork 57
157 lines (141 loc) · 5.67 KB
/
docker.yml
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
name: Docker
on:
push:
branches:
- master
jobs:
docker:
name: Docker
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- ubuntu: 20.04
python: 3.9
label: 3.9
- ubuntu: 22.04
python: 3
label: "3.10"
# Start a local registry to which we will push trame-common, so that
# docker buildx may access it in later steps.
services:
registry:
image: registry
ports:
- 5000:5000
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
# To emulate other architectures
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
# For multi-platform builds
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
driver-opts: network=host
- name: Create month stamp
run: echo "MONTH_STAMP=$(date +%Y-%m)" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build common
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
context: docker
file: docker/Dockerfile.common
build-args: |
BASE_IMAGE=ubuntu:${{ matrix.config.ubuntu }}
push: true
tags: localhost:5000/trame-common-ubuntu${{ matrix.config.ubuntu }}
- name: Build common (glvnd)
uses: docker/build-push-action@v2
with:
context: docker
file: docker/Dockerfile.common
build-args: |
BASE_IMAGE=nvidia/opengl:1.2-glvnd-devel-ubuntu${{ matrix.config.ubuntu }}
push: true
tags: localhost:5000/trame-common-glvnd-ubuntu${{ matrix.config.ubuntu }}
- name: Build common (cuda)
uses: docker/build-push-action@v2
with:
context: docker
file: docker/Dockerfile.common
build-args: |
BASE_IMAGE=nvidia/cuda:12.2.0-runtime-ubuntu${{ matrix.config.ubuntu }}
push: true
tags: localhost:5000/trame-common-cuda-ubuntu${{ matrix.config.ubuntu }}
- name: Build and push (py${{ matrix.config.label }}-pip)
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
context: docker
file: docker/Dockerfile.pip
build-args: |
BASE_IMAGE=localhost:5000/trame-common-ubuntu${{ matrix.config.ubuntu }}
PYTHON_VERSION=${{ matrix.config.python }}
push: true
tags: |
kitware/trame:py${{ matrix.config.label }}
kitware/trame:py${{ matrix.config.label }}-ubuntu${{ matrix.config.ubuntu }}
kitware/trame:py${{ matrix.config.label }}-${{ env.MONTH_STAMP }}
- name: Build and push (pip py${{ matrix.config.label }}-glvnd)
uses: docker/build-push-action@v2
with:
context: docker
file: docker/Dockerfile.pip
build-args: |
BASE_IMAGE=localhost:5000/trame-common-glvnd-ubuntu${{ matrix.config.ubuntu }}
PYTHON_VERSION=${{ matrix.config.python }}
push: true
tags: |
kitware/trame:py${{ matrix.config.label }}-glvnd
kitware/trame:py${{ matrix.config.label }}-1.2-glvnd-runtime-ubuntu${{ matrix.config.ubuntu }}
kitware/trame:py${{ matrix.config.label }}-glvnd-${{ env.MONTH_STAMP }}
- name: Build and push (pip py${{ matrix.config.label }}-cuda)
uses: docker/build-push-action@v2
with:
context: docker
file: docker/Dockerfile.pip
build-args: |
BASE_IMAGE=localhost:5000/trame-common-cuda-ubuntu${{ matrix.config.ubuntu }}
PYTHON_VERSION=${{ matrix.config.python }}
push: true
tags: |
kitware/trame:py${{ matrix.config.label }}-cuda
kitware/trame:py${{ matrix.config.label }}-12.2.0-cuda-runtime-ubuntu${{ matrix.config.ubuntu }}
kitware/trame:py${{ matrix.config.label }}-cuda-${{ env.MONTH_STAMP }}
- name: Build and push (py${{ matrix.config.label }}-conda)
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
context: docker
file: docker/Dockerfile.conda
build-args: |
BASE_IMAGE=localhost:5000/trame-common-ubuntu${{ matrix.config.ubuntu }}
PYTHON_VERSION=${{ matrix.config.label }}
push: true
tags: |
kitware/trame:py${{ matrix.config.label }}-conda
kitware/trame:py${{ matrix.config.label }}-conda-ubuntu${{ matrix.config.ubuntu }}
kitware/trame:py${{ matrix.config.label }}-conda-${{ env.MONTH_STAMP }}
- name: Build and push (py${{ matrix.config.label }}-conda-glvnd)
uses: docker/build-push-action@v2
with:
context: docker
file: docker/Dockerfile.conda
build-args: |
BASE_IMAGE=localhost:5000/trame-common-glvnd-ubuntu${{ matrix.config.ubuntu }}
PYTHON_VERSION=${{ matrix.config.label }}
push: true
tags: |
kitware/trame:py${{ matrix.config.label }}-conda-glvnd
kitware/trame:py${{ matrix.config.label }}-conda-1.2-glvnd-runtime-ubuntu${{ matrix.config.ubuntu }}
kitware/trame:py${{ matrix.config.label }}-conda-glvnd-${{ env.MONTH_STAMP }}