forked from carla-simulator/carla
-
Notifications
You must be signed in to change notification settings - Fork 0
197 lines (165 loc) · 5.63 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
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
194
195
196
197
name: Docker
on: [push, pull_request]
jobs:
# set up
clean-up:
name: Clean up
runs-on: self-hosted
steps:
- name: Clean up
run: rm -rf *
# create carla-prerequisites image
create-carla-prerequisites-image:
name: Create carla-prerequisites image
runs-on: self-hosted
needs: clean-up
steps:
- uses: docker/build-push-action@v5
name: Build image
with:
file: Util/Docker/Prerequisites.Dockerfile
tags: carla-prerequisites
no-cache: true
build-args: |
EPIC_USER=${{ secrets.EPIC_USER }}
EPIC_PASS=${{ secrets.EPIC_PASS }}
# create and push carla-source image
create-carla-source-image:
name: Create carla-source image
runs-on: self-hosted
needs: create-carla-prerequisites-image
env:
IMAGE_TAG_SUFFIX: ""
steps:
- name: Set image tag
run: |
echo "IMAGE_TAG_SUFFIX=_$(echo '${{ github.ref_name }}' | tr / -)_ci" >> $GITHUB_ENV
if: github.ref_name != github.event.repository.default_branch
- uses: actions/checkout@v3
name: Checkout repository
with:
submodules: true
- uses: docker/login-action@v3
name: Login to Docker Hub
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/build-push-action@v5
name: Build and push image
with:
file: Util/Docker/Carla.Dockerfile
tags: rwthika/carla-simulator:source${{env.IMAGE_TAG_SUFFIX}}
no-cache: true
push: false
context: .
# provide artifacts and releases
provide-artifacts:
name: Provide carla artifacts
runs-on: self-hosted
needs: create-carla-source-image
env:
IMAGE_TAG_SUFFIX: ""
steps:
- name: Set image tag
run: |
echo "IMAGE_TAG_SUFFIX=_$(echo '${{ github.ref_name }}' | tr / -)_ci" >> $GITHUB_ENV
if: github.ref_name != github.event.repository.default_branch
# provide carla-package
- uses: shrink/actions-docker-extract@v3
name: Extract carla-package
with:
image: rwthika/carla-simulator:source${{env.IMAGE_TAG_SUFFIX}}
path: home/carla/carla/Dist
destination: artifacts/
# provide carla-python-api
- uses: shrink/actions-docker-extract@v3
name: Extract carla-python-api
id: extract_python_api
with:
image: rwthika/carla-simulator:source${{env.IMAGE_TAG_SUFFIX}}
path: home/carla/carla/PythonAPI
destination: artifacts/
# create archive for release
- name: Create archive
if: startsWith(github.ref, 'refs/tags')
run: tar -czvf artifacts/PythonAPI.tar.gz artifacts/PythonAPI
# provide release
- uses: ncipollo/release-action@v1
name: Create Release
if: startsWith(github.ref, 'refs/tags')
with:
allowUpdates: true
tag: ${{ github.ref_name }}
commit: ${{ github.sha }}
artifacts: artifacts/PythonAPI.tar.gz
token: ${{ secrets.PAT }}
# create carla client image
create-carla-client-image:
name: Create carla client image
runs-on: self-hosted
needs: provide-artifacts
env:
IMAGE_TAG_SUFFIX: ""
steps:
- name: Set image tag
run: |
echo "IMAGE_TAG_SUFFIX=_$(echo '${{ github.ref_name }}' | tr / -)_ci" >> $GITHUB_ENV
if: github.ref_name != github.event.repository.default_branch
- uses: docker/login-action@v3
name: Login to Docker Hub
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/build-push-action@v5
name: Build and push image
with:
file: Util/Docker/client/Client.Dockerfile
tags: rwthika/carla-simulator:client${{env.IMAGE_TAG_SUFFIX}}
no-cache: true
build-args: |
UBUNTU_VERSION=22.04
context: .
push: true
# create vulkan-base for carla server image
create-vulkan-base-image:
name: Create vulkan-base image
runs-on: self-hosted
needs: create-carla-client-image
steps:
- uses: docker/build-push-action@v5
name: Build image
with:
file: Util/Docker/vulkan-base/Vulkan.Dockerfile
tags: vulkan-base
no-cache: true
build-args: |
BASE_DIST=ubuntu22.04
CUDA_VERSION=12.2.0
context: Util/Docker/vulkan-base
# create and push carla server image
create-carla-server-image:
name: Create carla server image
runs-on: self-hosted
needs: create-vulkan-base-image
env:
IMAGE_TAG_SUFFIX: ""
steps:
- name: Set image tag
run: |
echo "IMAGE_TAG_SUFFIX=_$(echo '${{ github.ref_name }}' | tr / -)_ci" >> $GITHUB_ENV
if: github.ref_name != github.event.repository.default_branch
- uses: docker/login-action@v3
name: Login to Docker Hub
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract artifact
run: mkdir -p build && tar -xvzf artifacts/Dist/*.tar.gz -C build
- uses: docker/build-push-action@v5
name: Build and push
with:
file: build/Dockerfile
tags: rwthika/carla-simulator:server${{env.IMAGE_TAG_SUFFIX}}
no-cache: true
context: build
push: true