fix simulator CI (#2159)

* pull image for cache

* typo

* cleanup dockerfile

* typo

* add pr trigger

* colon?
pull/2160/head
Adeeb Shihadeh 5 years ago committed by GitHub
parent b857f65de8
commit 4cbf965165
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      .github/workflows/sim_tests.yaml
  2. 45
      tools/sim/Dockerfile.sim

@ -1,14 +1,14 @@
name: simulator name: simulator
on: on:
schedule: push:
- cron: '0 * * * *' pull_request:
jobs: jobs:
docker_build: docker_build:
name: build container name: build container
runs-on: ubuntu-16.04 runs-on: ubuntu-16.04
timeout-minutes: 50 timeout-minutes: 50
if: github.event_name == 'schedule' && github.repository == 'commaai/openpilot' if: github.repository == 'commaai/openpilot'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
@ -16,8 +16,10 @@ jobs:
lfs: true lfs: true
- name: Docker build - name: Docker build
run: | run: |
docker pull commaai/openpilot-sim:latest || true
tools/sim/build_container.sh tools/sim/build_container.sh
- name: Push to dockerhub - name: Push to dockerhub
if: github.ref == 'refs/heads/master'
run: | run: |
docker login -u wmelching -p ${{ secrets.COMMA_DOCKERHUB_TOKEN }} docker login -u wmelching -p ${{ secrets.COMMA_DOCKERHUB_TOKEN }}
docker tag commaai/openpilot-sim docker.io/commaai/openpilot-sim:latest docker tag commaai/openpilot-sim docker.io/commaai/openpilot-sim:latest

@ -1,10 +1,5 @@
FROM commaai/openpilot-base:latest FROM commaai/openpilot-base:latest
#Carla
COPY ./tools/sim/install_carla.sh /tmp
RUN /tmp/install_carla.sh
#Intel openCL- run openCL on CPU
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
apt-utils \ apt-utils \
unzip \ unzip \
@ -15,7 +10,6 @@ RUN apt-get update && apt-get install -y \
beignet-opencl-icd \ beignet-opencl-icd \
alien \ alien \
clinfo \
dbus \ dbus \
gcc-arm-none-eabi \ gcc-arm-none-eabi \
tmux \ tmux \
@ -30,44 +24,32 @@ RUN apt-get update && apt-get install -y \
libpng16-16 \ libpng16-16 \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Intel OpenCL driver
ARG INTEL_DRIVER=opencl_runtime_16.1.1_x64_ubuntu_6.4.0.25.tgz ARG INTEL_DRIVER=opencl_runtime_16.1.1_x64_ubuntu_6.4.0.25.tgz
ARG INTEL_DRIVER_URL=http://registrationcenter-download.intel.com/akdlm/irc_nas/9019 ARG INTEL_DRIVER_URL=http://registrationcenter-download.intel.com/akdlm/irc_nas/9019
RUN mkdir -p /tmp/opencl-driver-intel RUN mkdir -p /tmp/opencl-driver-intel
WORKDIR /tmp/opencl-driver-intel WORKDIR /tmp/opencl-driver-intel
RUN echo INTEL_DRIVER is $INTEL_DRIVER; \ RUN echo INTEL_DRIVER is $INTEL_DRIVER; \
curl -O $INTEL_DRIVER_URL/$INTEL_DRIVER; \ curl -O $INTEL_DRIVER_URL/$INTEL_DRIVER; \
if echo $INTEL_DRIVER | grep -q "[.]zip$"; then \ tar -xzf $INTEL_DRIVER; \
unzip $INTEL_DRIVER; \ for i in $(basename $INTEL_DRIVER .tgz)/rpm/*.rpm; do alien --to-deb $i; done; \
mkdir fakeroot; \ dpkg -i *.deb; \
for f in intel-opencl-*.tar.xz; do tar -C fakeroot -Jxvf $f; done; \ rm -rf $INTEL_DRIVER $(basename $INTEL_DRIVER .tgz) *.deb; \
cp -R fakeroot/* /; \ mkdir -p /etc/OpenCL/vendors; \
ldconfig; \ echo /opt/intel/*/lib64/libintelocl.so > /etc/OpenCL/vendors/intel.icd; \
else \
tar -xzf $INTEL_DRIVER; \
for i in $(basename $INTEL_DRIVER .tgz)/rpm/*.rpm; do alien --to-deb $i; done; \
dpkg -i *.deb; \
rm -rf $INTEL_DRIVER $(basename $INTEL_DRIVER .tgz) *.deb; \
mkdir -p /etc/OpenCL/vendors; \
echo /opt/intel/*/lib64/libintelocl.so > /etc/OpenCL/vendors/intel.icd; \
fi; \
rm -rf /tmp/opencl-driver-intel; rm -rf /tmp/opencl-driver-intel;
# Open[GL,CL] for gpu
#Open[GL,CL] for gpu
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES},display ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES},display
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
mesa-utils \ mesa-utils \
ocl-icd-libopencl1 \ ocl-icd-libopencl1 \
clinfo && \ && rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists/*
RUN mkdir -p /etc/OpenCL/vendors && \ RUN mkdir -p /etc/OpenCL/vendors && \
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
ENV NVIDIA_VISIBLE_DEVICES all ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,display ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,display
#Python
ENV PYTHONPATH $HOME/openpilot:${PYTHONPATH}
RUN dbus-uuidgen > /etc/machine-id RUN dbus-uuidgen > /etc/machine-id
# we can apt-get after moving to a newer ubuntu # we can apt-get after moving to a newer ubuntu
@ -80,10 +62,15 @@ RUN git clone --branch="0.1.1" https://github.com/NVIDIA/libglvnd.git . && \
ENV LD_LIBRARY_PATH /usr/local/lib/x86_64-linux-gnu:/usr/local/lib/i386-linux-gnu${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} ENV LD_LIBRARY_PATH /usr/local/lib/x86_64-linux-gnu:/usr/local/lib/i386-linux-gnu${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
# CARLA python api
COPY ./tools/sim/install_carla.sh /tmp
RUN /tmp/install_carla.sh
# get same tmux config used on NEOS for debugging # get same tmux config used on NEOS for debugging
RUN cd $HOME && \ RUN cd $HOME && \
wget https://raw.githubusercontent.com/commaai/eon-neos-builder/master/devices/eon/home/.tmux.conf wget https://raw.githubusercontent.com/commaai/eon-neos-builder/master/devices/eon/home/.tmux.conf
ENV PYTHONPATH $HOME/openpilot:${PYTHONPATH}
RUN mkdir -p $HOME/openpilot RUN mkdir -p $HOME/openpilot
COPY SConstruct $HOME/openpilot/ COPY SConstruct $HOME/openpilot/

Loading…
Cancel
Save