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.
add create-carla-client-image workflow job
- Loading branch information
Showing
3 changed files
with
99 additions
and
6 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
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,54 @@ | ||
ARG UBUNTU_VERSION="22.04" | ||
|
||
FROM "ubuntu:${UBUNTU_VERSION}" as dependencies | ||
|
||
USER root | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
ARG CARLA_API_PATH=/opt/carla/PythonAPI | ||
|
||
# Install essentials | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
fontconfig \ | ||
x11-apps \ | ||
python3-pip \ | ||
libomp5 \ | ||
libjpeg-turbo8 libtiff-dev \ | ||
libgeos-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pip3 install --upgrade pip | ||
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10 | ||
|
||
# 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=${CARLA_API_PATH} | ||
ENV WORKSPACE=${WORKSPACE} | ||
WORKDIR ${WORKSPACE} | ||
|
||
# Set entrypoint | ||
COPY ./Util/Docker/client/entrypoint.sh / | ||
ENTRYPOINT [ "/entrypoint.sh" ] | ||
|
||
CMD [ "python3", "util/test_connection.py" ] |
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 "$@" |