Skip to content

Commit

Permalink
Merge pull request #90 from usdot-fhwa-stol/hotfix/mvn_build_environment
Browse files Browse the repository at this point in the history
Merge hotfix to master for release 1.0.1
  • Loading branch information
kjrush authored Oct 12, 2022
2 parents 9076936 + 0f219dc commit ab27829
Show file tree
Hide file tree
Showing 15 changed files with 577 additions and 915 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CARLA_*.tar.gz
131 changes: 23 additions & 108 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,126 +18,41 @@ MAINTAINER Leidos, Inc.
LABEL Description="Dockerised Simulation of Carla_Sumo_Mosaic"

ENV SUMO_HOME /usr/share/sumo
ENV SUMO_USER carla_sumo_mosaic


ENV CARLA_HOME /CARLA_0.9.10/
RUN export CARLA_HOME

RUN apt-get update && \
apt-get install -y openjdk-8-jdk && \
apt-get install -y ant && \
apt-get clean && \
rm -rf /var/lib/apt/lists/ && \
rm -rf /var/cache/oracle-jdk8-installer;
ENV SUMO_USER carma

ARG VERSION
ARG VCS_REF
ARG BUILD_DATE

LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.name="carma-simulation"
LABEL org.label-schema.description="XIL Simulation environment for evaluation and testing of the CARMA Platform"
LABEL org.label-schema.vendor="Leidos"
LABEL org.label-schema.version=${VERSION}
LABEL org.label-schema.url="https://highways.dot.gov/research/research-programs/operations/CARMA"
LABEL org.label-schema.vcs-url="https://github.com/usdot-fhwa-stol/carma-simulation/"
LABEL org.label-schema.vcs-ref=${VCS_REF}
LABEL org.label-schema.build-date=${BUILD_DATE}

ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
RUN export JAVA_HOME

RUN apt-get -y update

RUN apt-get install x11-xserver-utils dconf-editor dbus-x11 -y

RUN apt-get update && apt-get upgrade -y && apt-get clean

# Python package management and basic dependencies
RUN apt-get install -y curl python3.7 python3.7-dev python3.7-distutils

# Register the version in alternatives
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1

# Set python 3 as the default python
RUN update-alternatives --set python /usr/bin/python3.7

RUN curl -s https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python get-pip.py --force-reinstall && \
rm get-pip.py

RUN pip3.7 install lxml

# Dependencies for glvnd and X11.
RUN apt-get update \
&& apt-get install -y -qq --no-install-recommends \
libglvnd0 \
libgl1 \
libglx0 \
libegl1 \
libxext6 \
libx11-6 \
&& rm -rf /var/lib/apt/lists/*

# Env vars for the nvidia-container-runtime.
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute

RUN apt-get update && \
apt-get install -y software-properties-common && \
rm -rf /var/lib/apt/lists/*

# Install python3.6 for NS-3 installation
RUN add-apt-repository ppa:deadsnakes/ppa && \
apt update && \
apt install python3.6

# Install other dependencies
RUN apt-get update && \
apt-get install -y g++ gcc unzip tar python3-dev && \
apt-get install -y autoconf automake libtool curl make && \
apt-get install -y libxml2 libsqlite3-dev && \
apt-get install -y libxml2-dev

RUN \
apt-get update && \
apt-get install -y --allow-unauthenticated \
build-essential \
pkg-config \
lbzip2 \
libprotobuf-dev \
libsqlite3-dev \
protobuf-compiler \
patch \
rsync \
wget

# Install vim as text editor
RUN apt-get install -y vim

RUN apt-get install -y nano

RUN apt-get install -y xterm

RUN apt install -y default-jdk

# Install SUMO
RUN add-apt-repository ppa:sumo/stable

RUN apt-get update

RUN apt-get install -y \
sumo \
sumo-tools \
sumo-doc

RUN adduser $SUMO_USER --disabled-password

# Enable sudo
RUN apt-get update && apt-get install -y sudo

RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN adduser $SUMO_USER sudo --disabled-password

COPY co-simulation/traci_update/connection.py ./usr/share/sumo/tools/traci/
COPY co-simulation/traci_update/constants.py ./usr/share/sumo/tools/traci/
COPY co-simulation/traci_update/main.py ./usr/share/sumo/tools/traci/

RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> \
/etc/sudoers


### Docker (Optional) ###
# RUN apt-get update && \
# apt-get -qy full-upgrade && \
# apt-get install -qy curl && \
# apt-get install -qy curl && \
# curl -sSL https://get.docker.com/ | sh
COPY --chown=carma:carma . /home/carma/src
USER carma
WORKDIR /home/carma/src
COPY --chown=carma:carma docker/env.sh /home/carma/.base-image/
RUN docker/install.sh

# RUN adduser $SUMO_USER docker --disabled-password
ENTRYPOINT [ "/home/carma/src/docker/entrypoint.sh" ]
CMD [ "mosaic.sh", "-s", "HelloWorld" ]
159 changes: 0 additions & 159 deletions Instruction/Build Docker Image Instruction/README.md

This file was deleted.

Loading

0 comments on commit ab27829

Please sign in to comment.