forked from carla-simulator/carla
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
501 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 | ||
context: . | ||
push: true | ||
|
||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
## Latest : 1.0.0 | ||
|
||
## 1.0.0 - Initial Release | ||
|
||
### Major changes | ||
|
||
* Created GitHub workflow and Dockerfile to automatically build Docker images | ||
* Update to Ubuntu 22.04 and Python 3.10 for prerequisites image | ||
* Update to Ubuntu 22.04 and Python 3.10 for release image | ||
* Created `vulkan-base` Dockerfile to replace discontinued `nvidia/vulkan` images used for the release image | ||
* Created `client` Dockerfile to provide PythonAPI client image | ||
* Added health check to release image | ||
|
||
### Minor changes | ||
|
||
* Added `ping.py` script to PythonAPI to enable health checks | ||
* Fix [aria2](https://aria2.github.io/) related issue | ||
* Fix fbx sdk download by using `curl` instead of `wget` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/usr/bin/env python | ||
|
||
# Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de | ||
# Barcelona (UAB). | ||
# | ||
# This work is licensed under the terms of the MIT license. | ||
# For a copy, see <https://opensource.org/licenses/MIT>. | ||
|
||
"""Performs a single connection check to the simulator.""" | ||
|
||
import glob | ||
import os | ||
import sys | ||
|
||
try: | ||
os.chdir(os.path.dirname(__file__)) | ||
sys.path.append(glob.glob('../carla/dist/carla-*%d.%d-%s.egg' % ( | ||
sys.version_info.major, | ||
sys.version_info.minor, | ||
'win-amd64' if os.name == 'nt' else 'linux-x86_64'))[0]) | ||
except IndexError: | ||
pass | ||
|
||
|
||
import carla | ||
|
||
import argparse | ||
|
||
|
||
def main(): | ||
argparser = argparse.ArgumentParser( | ||
description=__doc__) | ||
argparser.add_argument( | ||
'--host', | ||
metavar='H', | ||
default='127.0.0.1', | ||
help='IP of the host server (default: 127.0.0.1)') | ||
argparser.add_argument( | ||
'-p', '--port', | ||
metavar='P', | ||
default=2000, | ||
type=int, | ||
help='TCP port to listen to (default: 2000)') | ||
argparser.add_argument( | ||
'--timeout', | ||
metavar='T', | ||
default=1.0, | ||
type=float, | ||
help='time-out in seconds (default: 1)') | ||
args = argparser.parse_args() | ||
|
||
try: | ||
client = carla.Client(args.host, args.port) | ||
except RuntimeError: | ||
print('IP/Hostname %s could not be resolved' % (args.host)) | ||
return 1 | ||
|
||
client.set_timeout(args.timeout) | ||
|
||
try: | ||
print('CARLA %s connected at %s:%d.' % (client.get_server_version(), args.host, args.port)) | ||
return 0 | ||
except RuntimeError: | ||
print('Failed to connect to %s:%d before time-out of %d second(s).' % (args.host, args.port, args.timeout)) | ||
return 1 | ||
|
||
|
||
if __name__ == '__main__': | ||
|
||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.