From: Martin Quinson Date: Tue, 18 Sep 2018 12:40:21 +0000 (+0200) Subject: dockerfiles: install our files under /source/ and refresh images X-Git-Tag: v3_21~84 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2cfe340b9729c7ee55cf813f6a36f15dc918696b?hp=2ad1267f6cbefcc4424910b060cc87fb39c7add6 dockerfiles: install our files under /source/ and refresh images --- diff --git a/docs/source/tuto_s4u.rst b/docs/source/tuto_s4u.rst index 8acbbb2cc8..5fc672cd8c 100644 --- a/docs/source/tuto_s4u.rst +++ b/docs/source/tuto_s4u.rst @@ -301,18 +301,18 @@ image. Once you `installed Docker itself .. code-block:: shell docker pull simgrid/tuto-s4u - docker run -it --rm --name simgrid --volume ~/simgrid-tutorial:/src/tutorial simgrid/tuto-s4u bash + docker run -it --rm --name simgrid --volume ~/simgrid-tutorial:/source/tutorial simgrid/tuto-s4u bash This will start a new container with all you need to take this tutorial, and create a ``simgrid-tutorial`` directory in your home on -your host machine that will be visible as ``/src/tutorial`` within the +your host machine that will be visible as ``/source/tutorial`` within the container. You can then edit the files you want with your favorite editor in ``~/simgrid-tutorial``, and compile them within the container to enjoy the provided dependencies. .. warning:: - Any change to the container out of ``/src/tutorial`` will be lost + Any change to the container out of ``/source/tutorial`` will be lost when you log out of the container, so don't edit the other files! All needed dependencies are already installed in this container @@ -320,14 +320,14 @@ All needed dependencies are already installed in this container optional in this tutorial, it is not installed to reduce the image size. -The code template is available under ``/src/simgrid-template-s4u`` in +The code template is available under ``/source/simgrid-template-s4u`` in the image. You should copy it to your working directory when you first log in: .. code-block:: shell - cp -r /src/simgrid-template-s4u/* /src/tutorial - cd /src/tutorial + cp -r /source/simgrid-template-s4u/* /source/tutorial + cd /source/tutorial Using your Computer Natively ............................ diff --git a/docs/source/tuto_smpi.rst b/docs/source/tuto_smpi.rst index 3af0229128..05847208f4 100644 --- a/docs/source/tuto_smpi.rst +++ b/docs/source/tuto_smpi.rst @@ -246,33 +246,35 @@ image. Once you `installed Docker itself .. code-block:: shell docker pull simgrid/tuto-smpi - docker run -it --rm --name simgrid --volume ~/smpi-tutorial:/src/tutorial simgrid/tuto-smpi bash + docker run -it --rm --name simgrid --volume ~/smpi-tutorial:/source/tutorial simgrid/tuto-smpi bash This will start a new container with all you need to take this tutorial, and create a ``smpi-tutorial`` directory in your home on -your host machine that will be visible as ``/src/tutorial`` within the +your host machine that will be visible as ``/source/tutorial`` within the container. You can then edit the files you want with your favorite editor in ``~/smpi-tutorial``, and compile them within the container to enjoy the provided dependencies. .. warning:: - Any change to the container out of ``/src/tutorial`` will be lost + Any change to the container out of ``/source/tutorial`` will be lost when you log out of the container, so don't edit the other files! All needed dependencies are already installed in this container -(SimGrid, a C/C++ compiler, a Fortran compiler, make, pajeng and -R). Vite being only optional in this tutorial, it is not installed to -reduce the image size. +(SimGrid, the C/C++/Fortran compilers, make, pajeng and R). Vite being +only optional in this tutorial, it is not installed to reduce the +image size. -The code template is available under ``/src/simgrid-template-smpi`` in -the image. You should copy it to your working directory when you first -log in: +The container also include the example platform files from the +previous section as well as the source code of the NAS Parallel +Benchmarks. These files are available under +``/source/simgrid-template-smpi`` in the image. You should copy it to +your working directory when you first log in: .. code-block:: shell - cp -r /src/simgrid-template-smpi/* /src/tutorial - cd /src/tutorial + cp -r /source/simgrid-template-smpi/* /source/tutorial + cd /source/tutorial Using your Computer Natively ............................ diff --git a/tools/docker/Dockerfile.stable b/tools/docker/Dockerfile.stable index 3d35303280..1b8cd235ed 100644 --- a/tools/docker/Dockerfile.stable +++ b/tools/docker/Dockerfile.stable @@ -6,8 +6,8 @@ ARG DLURL # - Install SimGrid's dependencies # - Compile and install SimGrid itself RUN echo "DOWNLOAD_URL: ${DLURL}" && \ - apt update && apt install -y wget && \ - mkdir /src && cd /src && \ + apt update && apt upgrade -y && apt install -y wget && \ + mkdir /source && cd /source && \ wget https://framagit.org/${DLURL} && \ tar xf SimGrid-* && rm SimGrid-*tar.gz && \ cd SimGrid-* && \ diff --git a/tools/docker/Dockerfile.tuto-s4u b/tools/docker/Dockerfile.tuto-s4u index 777897c4cf..305d0c3bc9 100644 --- a/tools/docker/Dockerfile.tuto-s4u +++ b/tools/docker/Dockerfile.tuto-s4u @@ -3,6 +3,6 @@ FROM simgrid/unstable # - Clone simgrid-template-s4u, as it is needed by the tutorial RUN apt install -y pajeng r-base r-cran-ggplot2 r-cran-dplyr cmake g++ git && \ - cd /src && \ + cd /source && \ git clone --depth=1 https://framagit.org/simgrid/simgrid-template-s4u.git simgrid-template-s4u.git && \ apt autoremove -y && apt clean && apt autoclean \ No newline at end of file diff --git a/tools/docker/Dockerfile.tuto-smpi b/tools/docker/Dockerfile.tuto-smpi new file mode 100644 index 0000000000..546a7c54e3 --- /dev/null +++ b/tools/docker/Dockerfile.tuto-smpi @@ -0,0 +1,8 @@ +# Base image +FROM simgrid/unstable + +# - Clone simgrid-template-smpi, as it is needed by the tutorial +RUN apt update && apt install -y pajeng r-base r-cran-ggplot2 r-cran-dplyr build-essential g++ gfortran git && \ + cd /source && \ + git clone --depth=1 https://framagit.org/simgrid/simgrid-template-smpi.git simgrid-template-smpi.git && \ + apt autoremove -y && apt clean && apt autoclean \ No newline at end of file diff --git a/tools/docker/Dockerfile.unstable b/tools/docker/Dockerfile.unstable index 0262d918b1..6d32dfc369 100644 --- a/tools/docker/Dockerfile.unstable +++ b/tools/docker/Dockerfile.unstable @@ -4,9 +4,9 @@ FROM debian:testing # - Install SimGrid's dependencies # - Compile and install SimGrid itself. Clean the tree. # - Remove everything that was installed, and re-install what's needed by the SimGrid libraries before the Gran Final Cleanup -RUN apt update && \ +RUN apt update && apt -y upgrade && \ apt install -y g++ gcc git valgrind default-jdk gfortran libboost-dev libboost-all-dev cmake dpkg-dev && \ - mkdir /src/ && cd /src && git clone --depth=1 https://framagit.org/simgrid/simgrid.git simgrid.git && \ + mkdir /source/ && cd /source && git clone --depth=1 https://framagit.org/simgrid/simgrid.git simgrid.git && \ cd simgrid.git && \ cmake -DCMAKE_INSTALL_PREFIX=/usr/ -Denable_documentation=OFF -Denable_java=ON -Denable_smpi=ON -Denable_compile_optimizations=ON . && \ make -j4 install && \ diff --git a/tools/docker/Makefile b/tools/docker/Makefile index e189fc9cb4..b82cfc725e 100644 --- a/tools/docker/Makefile +++ b/tools/docker/Makefile @@ -4,6 +4,7 @@ default: @echo " make stable -> build the latest stable version of SimGrid (with SMPI w/o MC)" @echo " make unstable -> build the git version of SimGrid (with SMPI, w/o MC)" @echo " make tuto-s4u -> build all what you need to take the S4U tutorial" + @echo " make tuto-smpi -> build all what you need to take the SMPI tutorial" @echo " make push -> push all images to the cloud" @echo "All our images are based on debian:testing" @echo "Also possible: DOCKER_EXTRA=--no-cache make unstable" @@ -33,15 +34,30 @@ build-deps: $(DOCKER_EXTRA) \ . | tee > build-deps.log +build-deps-stable: + docker build -f Dockerfile.build-deps-stable \ + -t simgrid/build-deps-stable:latest \ + -t simgrid/build-deps-stable:$$(date --iso-8601) \ + $(DOCKER_EXTRA) \ + . | tee > build-deps-stable.log + tuto-s4u: docker build -f Dockerfile.tuto-s4u \ -t simgrid/tuto-s4u:latest \ -t simgrid/tuto-s4u:$$(date --iso-8601) \ $(DOCKER_EXTRA) \ - . | tee > tuto.log + . | tee > tuto-s4u.log + +tuto-smpi: + docker build -f Dockerfile.tuto-smpi \ + -t simgrid/tuto-smpi:latest \ + -t simgrid/tuto-smpi:$$(date --iso-8601) \ + $(DOCKER_EXTRA) \ + . | tee > tuto-smpi.log push: docker push simgrid/build-deps docker push simgrid/stable docker push simgrid/unstable docker push simgrid/tuto-s4u + docker push simgrid/tuto-smpi