forked from carla-simulator/carla
-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (119 loc) · 3.76 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
name: Docker
on: [push, pull_request]
jobs:
# clean 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
steps:
- 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: cgellerac/carla-simulator:source
no-cache: true
push: true
context: .
# provide artifacts and releases
provide-artifacts:
name: Provide carla artifacts
runs-on: self-hosted
needs: create-carla-source-image
steps:
# provide carla-package
- uses: shrink/actions-docker-extract@v3
name: Extract carla-package
with:
image: cgellerac/carla-simulator:source
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: cgellerac/carla-simulator:source
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 vulkan-base for carla release
create-vulkan-base-image:
name: Create vulkan-base image
runs-on: self-hosted
needs: clean-up
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
# create and push carla image
create-carla-image:
name: Create carla image
runs-on: self-hosted
needs: [provide-artifacts, create-vulkan-base-image]
steps:
- 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: cgellerac/carla-simulator
no-cache: true
context: build
push: true