forked from carla-simulator/scenario_runner
-
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
10 changed files
with
190 additions
and
20 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,59 @@ | ||
name: Docker | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
|
||
clean-up: | ||
name: Clean up | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Clean up | ||
run: rm -rf * | ||
|
||
create-image: | ||
name: Create docker image | ||
runs-on: ubuntu-latest | ||
needs: clean-up | ||
env: | ||
IMAGE_TAG_SUFFIX: "" | ||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
name: Checkout repository | ||
with: | ||
path: carla-scenario-runner | ||
submodules: true | ||
|
||
- uses: docker/login-action@v3 | ||
name: Login to Docker Hub | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- uses: robinraju/[email protected] | ||
name: Download PythonAPI | ||
with: | ||
repository: carla-compose/carla-simulator | ||
latest: true | ||
fileName: PythonAPI.tar.gz | ||
extract: true | ||
out-file-path: . | ||
|
||
- name: Remove PythonAPI.tar.gz | ||
run: rm PythonAPI.tar.gz | ||
|
||
- 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/build-push-action@v5 | ||
name: Build and push | ||
with: | ||
push: true | ||
file: carla-scenario-runner/docker/Dockerfile | ||
tags: rwthika/carla-scenario-runner:latest${{env.IMAGE_TAG_SUFFIX}} | ||
no-cache: true | ||
context: . |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
HOST = https://carla-releases.s3.eu-west-3.amazonaws.com/Linux | ||
RELEASE=CARLA_0.9.13 | ||
RELEASE=CARLA_0.9.15 |
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,13 @@ | ||
## Latest : 1.0.0 | ||
|
||
## 1.0.0 - Initial Release | ||
|
||
### Major changes | ||
|
||
* Created GitHub workflow and Dockerfile to automatically build Docker images | ||
* Update to [CARLA 0.9.15](https://carla.org/2023/11/10/release-0.9.15/) | ||
* Update to Ubuntu 22.04 and Python 3.10 including corresponding pip versions | ||
|
||
### Minor changes | ||
|
||
* Small fix related to CARLA autopilot |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
ARG UBUNTU_VERSION="22.04" | ||
|
||
|
||
############ dependencies ############ | ||
FROM "ubuntu:${UBUNTU_VERSION}" | ||
|
||
USER root | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
ARG CARLA_API_PATH=/opt/carla/PythonAPI | ||
ARG SCENARIO_RUNNER_PATH=/opt/carla/carla-scenario-runner | ||
|
||
# Install essentials | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
libpng16-16 \ | ||
libtiff5 \ | ||
libjpeg8 \ | ||
build-essential \ | ||
wget \ | ||
git \ | ||
libxerces-c-dev \ | ||
python3-pip \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pip3 install --upgrade pip | ||
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10 | ||
|
||
# Install carla-scenario-runner | ||
COPY ./carla-scenario-runner $SCENARIO_RUNNER_PATH | ||
RUN pip3 install -r $SCENARIO_RUNNER_PATH/requirements.txt | ||
|
||
# Move over PythonAPI | ||
COPY ./artifacts/PythonAPI ${CARLA_API_PATH} | ||
|
||
# Recursively install PythonAPI requirements, keep version of first occurrence | ||
RUN cat $(find ${CARLA_API_PATH} -type f -name "requirements.txt") > /tmp/requirements_raw.txt \ | ||
&& awk -F '==' '{print $1}' /tmp/requirements_raw.txt | awk '!visited[$1]++' > /tmp/requirements.txt \ | ||
&& pip3 install -r /tmp/requirements.txt | ||
|
||
# Create script that adds API to pythonpath and make .bashrc source it | ||
RUN echo "export PYTHONPATH=\$PYTHONPATH:$CARLA_API_PATH/carla/dist/$(ls $CARLA_API_PATH/carla/dist | grep py$(python --version | awk -F'[ .]' '{print $2"."$3}').)" >> /setup_carla_env.sh; \ | ||
echo "export PYTHONPATH=\$PYTHONPATH:$CARLA_API_PATH/carla/agents" >> /setup_carla_env.sh; \ | ||
echo "export PYTHONPATH=\$PYTHONPATH:$CARLA_API_PATH/carla" >> /setup_carla_env.sh; \ | ||
echo "export CARLA_API_PATH=$CARLA_API_PATH" >> /setup_carla_env.sh; \ | ||
echo "source /setup_carla_env.sh" >> ~/.bashrc | ||
|
||
# Needed for (pygame based) scripts that have a GUI | ||
ENV SDL_VIDEODRIVER=x11 | ||
|
||
USER root | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
ARG WORKSPACE=${SCENARIO_RUNNER_PATH} | ||
ENV WORKSPACE=${WORKSPACE} | ||
WORKDIR ${WORKSPACE} | ||
|
||
# Set entrypoint | ||
COPY ./carla-scenario-runner/docker/entrypoint.sh / | ||
ENTRYPOINT [ "/entrypoint.sh" ] | ||
|
||
CMD [ "python3", "scenario_runner.py", "--help" ] |
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,8 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# source CARLA environment setup script | ||
source /setup_carla_env.sh | ||
|
||
# run the actual command | ||
exec "$@" |
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 |
---|---|---|
@@ -1,14 +1,15 @@ | ||
py-trees==0.8.3 | ||
numpy==1.18.4; python_version >= '3.0' | ||
networkx==2.2 | ||
Shapely==1.7.1 | ||
psutil | ||
xmlschema==1.0.18 | ||
ephem | ||
tabulate | ||
opencv-python==4.2.0.32 | ||
matplotlib | ||
six | ||
simple-watchdog-timer | ||
antlr4-python3-runtime==4.10 | ||
graphviz | ||
# Update all versions to be compatible with Ubuntu 22.04, Python 3.10.6, ROS Humble (at 2023-07-24) | ||
py-trees==0.8.3 # newest version (2.2.3) is not compatible | ||
numpy==1.21.5 | ||
networkx==3.1 | ||
shapely==2.0.1 | ||
psutil==5.9.0 | ||
xmlschema==2.3.1 | ||
ephem==4.1.4 | ||
tabulate==0.9.0 | ||
opencv-python==4.8.0.74 | ||
matplotlib==3.7.2 | ||
six==1.16.0 | ||
simple-watchdog-timer==0.1.1 | ||
antlr4-python3-runtime==4.13.1 | ||
graphviz==0.20.1 |
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