From a7afb94a61b85f46e5105f607dc673c5b9745e8c Mon Sep 17 00:00:00 2001 From: Huckleberry Febbo Date: Mon, 18 Jun 2018 19:25:19 -0400 Subject: [PATCH] reduced the size of the Dockerfile and updated docs. Currently, Chrono is not in Dockerfile. --- README.md | 7 +++++-- docker/Dockerfile | 23 +++++++++++++++-------- docker/README.md | 10 ++++++---- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 954a4b5b..d11028e9 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,9 @@ git clone https://github.com/JuliaMPC/MAVs ``` Then follow the [Docker instructions](https://github.com/JuliaMPC/MAVs/tree/master/docker#mavs-docker). +* Note: currently, the entire repo is cloned twice (once by the above command and once by the Docker file). +* In the future this software may be configured to save space and only cloned once + After this, to test the software: ### Mitigate this issue Something like this may appear: @@ -36,10 +39,10 @@ While [this issue](https://github.com/jdlangs/RobotOS.jl/issues/45) needs to be ``` sudo rm -r /home/mavs/.julia/.cache ``` -This issue happens frequently, so just run the avove command each time after ``run.sh`` is ran. +This issue happens frequently, so just run the above command is there is a cache error from julia. Then rerun. ### Run some of the system demos -The demos are included in the documetnation, for instance try [demoA](https://juliampc.github.io/AVExamples.jl/latest/demos/system/demoA.html). +The demos are included in the documentation, for instance try [demoA](https://juliampc.github.io/AVExamples.jl/latest/demos/system/demoA.html). ## Requirements diff --git a/docker/Dockerfile b/docker/Dockerfile index 21ec9b12..8dd2f326 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -24,10 +24,16 @@ RUN echo "deb http://packages.osrfoundation.org/gazebo/ubuntu `lsb_release -cs` ros-kinetic-hector-slam \ ros-kinetic-joy \ ros-kinetic-perception-pcl \ + ros-kinetic-velodyne-description \ # for obstacle_detector libarmadillo-dev \ && apt-get clean +# Install Julia and setup environment +RUN sudo wget https://julialang-s3.julialang.org/bin/linux/x64/0.6/julia-0.6.2-linux-x86_64.tar.gz \ + && sudo tar -xvf julia-0.6.2-linux-x86_64.tar.gz -C /opt + #TODO, delete julia .tar file + # Add basic user ENV USERNAME mavs ENV PULSE_SERVER /run/pulse/native @@ -51,18 +57,19 @@ RUN echo "source /opt/ros/kinetic/setup.bash" >> /home/$USERNAME/.bashrc && \ # Change user USER mavs +RUN echo 4 +RUN /opt/julia-d386e40c17/bin/julia -e 'Pkg.add("MichiganAutonomousVehicles")' RUN git clone -b master https://github.com/JuliaMPC/MAVs /home/$USERNAME/MAVs -RUN echo 3 - RUN /bin/bash -c 'source /opt/ros/kinetic/setup.bash; cd /home/$USERNAME/MAVs/ros/src; catkin_init_workspace; cd ..; catkin_make' -RUN echo "source /home/$USERNAME/MAVs/ros/devel/setup.bash" >> /home/$USERNAME/.bashrc +RUN echo "source /home/$USERNAME/MAVs/ros/devel/setup.bash" >> /home/$USERNAME/.bashrc && \ + echo 'alias julia='/opt/julia-d386e40c17/bin/julia'' >> ~/.bashrc && \ + echo 'export PATH="$PATH:/opt/julia-d386e40c17/bin"' >> ~/.bashrc -#RUN echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc \ - #&& /bin/bash -c 'cd /home/$USERNAME/MAVs/ros/src; cd .. \ - #rosdep install --from-paths src --ignore-src --rosdistro kinetic -y \ - #catkin_make' \ - #&& echo "source /home/$USERNAME/MAVs/ros/devel/setup.bash" >> /home/$USERNAME/.bashrc + +# RUN sudo rm -r /home/mavs/.julia/.cache # Default CMD CMD ["/bin/bash"] + +#CMD ["/bin/bash", "bash -c '[ -d /home/mavs/.julia/.cache] && sudo rm -rf /home/mavs/.julia/.cache'"] diff --git a/docker/README.md b/docker/README.md index 28d68018..0481bdb9 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,13 +1,15 @@ # MAVs Docker -Assuming the NVIDIA drivers and Docker and nvidia-docker are properly -installed. -[Docker installation](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/) +## Requirements +Tested on Ubuntu Xenial (16.04) -[nvidia-docker installation](https://github.com/NVIDIA/nvidia-docker) +* An X server +* [Docker](https://www.docker.com/get-docker) +* [nvidia-docker](https://github.com/NVIDIA/nvidia-docker/wiki/Installation) ## How to build + ``` $ cd MAVs/docker $ sh build.sh