Commit 50a3cf85 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Merge branch 'master' into binary_IO at M7 level

Implement the container images and documentation at the level of M7.00 release
parents dfe9251b 56528161
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -3,4 +3,3 @@ build/cluster/*
build/sphere/*
build/trapping/*
doc/build/*
+4 −2
Original line number Diff line number Diff line
@@ -30,7 +30,8 @@ building_stage:
      paths:
         - build/cluster/*
         - build/sphere/*
         #- build/trapping/*
         - build/trapping/*
         - doc/build/*
      exclude:
         - ".git*"
         - ".git/**/*"
@@ -45,7 +46,8 @@ building_stage:
      - cat /etc/os-release
      - cd src
      - echo "Running make ..."
      - make
      - make -j
      - make docs -j && make -C ../doc/build/latex -j

running_stage:
   stage: run
+8 −8
Original line number Diff line number Diff line
@@ -13,15 +13,15 @@ This section describes the use of the pre-existing programs, once the binaries h
### cluster

1. cd to the `build/cluster` folder.
2. Run `edfb`:
2. Run `edfb_clu`:
   
   > ./edfb
   > ./edfb_clu
   
3. Run `clu`:
   
   > ./clu
   
*NOTE:* both `edfb` and `clu` expect an input which is assumed to be in a folder named `../../test_data/cluster/` (i.e. two levels above the current execution path)
*NOTE:* both `edfb_clu` and `clu` expect an input which is assumed to be in a folder named `../../test_data/cluster/` (i.e. two levels above the current execution path)

4. Run `np_cluster`:

@@ -31,22 +31,22 @@ This section describes the use of the pre-existing programs, once the binaries h

5. Check the consistency between the output files (the default output file for the *FORTRAN* code is named `OCLU`, while the corresponding *C++* output has the default name of `c_OCLU`).

The default behaviour of `np_cluster` is to take the same input files as `edfb` and `clu` and to write the output in the current folder. If needed, different input and output paths can be given as command-line arguments:
The default behaviour of `np_cluster` is to take the same input files as `edfb_clu` and `clu` and to write the output in the current folder. If needed, different input and output paths can be given as command-line arguments:

   > ./np_cluster PATH_TO_DEDFB PATH_TO_DCLU OUTPUT_PATH

### sphere

1. cd to the `build/sphere` folder.
2. Run `edfb`:
2. Run `edfb_sph`:

   > ./edfb
   > ./edfb_sph
   
3. Run `sph`:

   > ./sph
   
*NOTE:* both `edfb` and `sph` expect an input which is assumed to be in a folder named `../../test_data/sphere/` (i.e. two levels above the current execution path)
*NOTE:* both `edfb_sph` and `sph` expect an input which is assumed to be in a folder named `../../test_data/sphere/` (i.e. two levels above the current execution path)

4. Run `np_sphere`:

@@ -56,7 +56,7 @@ The default behaviour of `np_cluster` is to take the same input files as `edfb`

5. Check the consistency between the output files (the default output file for the *FORTRAN* code is named `OSPH`, while the corresponding *C++* output has the default name of `c_OSPH`).

The default behaviour of `np_sphere` is to take the same input files as `edfb` and `sph` and to write the output in the current folder. If needed, different input and output paths can be given as command-line arguments:
The default behaviour of `np_sphere` is to take the same input files as `edfb_sph` and `sph` and to write the output in the current folder. If needed, different input and output paths can be given as command-line arguments:

   > ./np_sphere PATH_TO_DEDFB PATH_TO_DSPH OUTPUT_PATH

+58 −0
Original line number Diff line number Diff line
# syntax=docker/dockerfile:1

FROM debian:bookworm-slim AS np-tmcode-dev
WORKDIR /root

# make sure the debian bullseye us up to date, install needed packages
RUN DEBIAN_FRONTEND=noninteractive apt update && DEBIAN_FRONTEND=noninteractive apt -y upgrade
# install packages needed to build binaries
RUN DEBIAN_FRONTEND=noninteractive apt -y install g++ gfortran make gcc-offload-nvptx libhdf5-dev 
# install packages needed to run python scripts for checks
RUN DEBIAN_FRONTEND=noninteractive apt -y install python3 python-is-python3 python3-regex
# install packages needed to run doxygen to create html docs
RUN DEBIAN_FRONTEND=noninteractive apt -y install doxygen
# install packages needed to run pdflatex to create pdf docs
RUN DEBIAN_FRONTEND=noninteractive apt -y install texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-font-utils
# clean up apt lists
RUN rm -rf /var/lib/apt/lists/*


# create the container on which the gitlab pipeline runs, making sure to squash
# all layers to save space
FROM scratch AS np-tmcode
COPY --from=np-tmcode-dev / /


# create the container actually containing the code
FROM np-tmcode-dev AS np-tmcode-run-dev
WORKDIR /root
#  copy the parent dir to a temporary dir in the container, so we can compile everything
ADD src /root/np-tmcode/src
ADD doc /root/np-tmcode/doc
ADD build /root/np-tmcode/build
ADD test_data /root/np-tmcode/test_data
RUN cd np-tmcode/src && make wipe && make -j && cd ../doc/src && doxygen config.dox && cd ../build/latex && make -j


# create the container on which the np-tmcode is installed, restarting from
# a minimal distro and adding strictly only the needed runtime
FROM  debian:bookworm-slim AS np-tmcode-run-minimal
WORKDIR /root
# install the strictly needed runtime libraries needed to run the executables
# and the python check scripts
RUN DEBIAN_FRONTEND=noninteractive apt update && DEBIAN_FRONTEND=noninteractive apt upgrade && DEBIAN_FRONTEND=noninteractive apt -y install libgfortran5 libgcc-s1 libhdf5-103-1 libstdc++6 libssl3 libcurl4 libsz2 zlib1g libnghttp2-14 libidn2-0 librtmp1 libssh2-1 libpsl5 libgssapi-krb5-2 libldap-2.5-0 libzstd1 libbrotli1 libaec0 libunistring2 libgmp10 libkrb5-3 libk5crypto3 libcom-err2 libkrb5support0 libsasl2-2 libp11-kit0 libtasn1-6 libkeyutils1 libffi8 python3 python-is-python3 python3-regex hdf5-tools && rm -rf /var/lib/apt/lists/*
COPY --from=np-tmcode-run-dev /root /root
# remove everything which is not needed to run the codes
RUN cd /root/np-tmcode && find build -name "*.o" -exec rm -v \{\} \; && find build -name "*.gcno" -exec rm -v \{\} \; && cd src && rm -rvf cluster libnptm trapping include sphere Makefile make.inc README.md && cd .. && rm -rvf containers && cd doc && rm -rvf src && cd build/latex && rm -rvf *.tex *.out *.sty *.ind *.log *.toc *.ilg *.idx *.aux *.eps Makefile class*.pdf
# move the installed software to /usr/local
RUN mv /root/np-tmcode /usr/local


# create the container on which the np-tmcode is installed,
# squashing all layers from previous stage
FROM scratch  AS np-tmcode-run
WORKDIR /root

COPY --from=np-tmcode-run-minimal / /

+12 −0
Original line number Diff line number Diff line
# Docker support for the NP-TMcode project

This Dockerfile allows to create mainly:

- the np-tmcode image that is used by the gitlab pipeline runner to test compile and execution of requested merges
- the np-tmcode-run image, that contains only the pre-built executables, python test scripts, compiled documentation, and the minimal runtime to run them

In order for the docker build to correctly set the context, so that it can access the directories containing source codes, docker build must be invoked from this directory as:

   > docker build -f Dockerfile ../.. --target \<image name\>

where `<image name>` is either `np-tmcode` or `np-tmcode-run`. One may also add the docker build option `-t tagname` to specify the `tagname` the built image should have in his/her registry.
 No newline at end of file
Loading