1
0
mirror of https://github.com/mveril/qp-demo synced 2024-12-22 12:23:49 +01:00

Update version to 2.2.2 Ubuntu 24.04

This commit is contained in:
Mickaël Véril 2024-06-01 14:31:00 +02:00
parent fed70ff484
commit e61a9d831d

View File

@ -1,28 +1,38 @@
# For help about how Dockerfiles work, see https://docs.docker.com/engine/reference/builder # For help about how Dockerfiles work, see https://docs.docker.com/engine/reference/builder
ARG UBUNTU_VERSION=20.04 ARG UBUNTU_VERSION=24.04
FROM ubuntu:${UBUNTU_VERSION} AS builder FROM ubuntu:${UBUNTU_VERSION} AS builder
# Build argument (can be changed at build time
# This argument define timezone for tzdata requierd by qp_run # Build argument (can be changed at build time)
# This argument defines the timezone for tzdata required by qp_run
ARG tz=Etc/UTC ARG tz=Etc/UTC
# Install all requierd packages
# Install all required packages
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
# Git for download quantum package git \
git \ curl wget python3 gfortran gcc g++ build-essential unzip liblapack-dev pkg-config autoconf zlib1g zlib1g-dev libgmp-dev libzmq3-dev bzip2 ninja-build libhdf5-dev hdf5-tools file
# All necessary packages to compile and run quantum package
curl wget python gfortran gcc g++ build-essential unzip liblapack-dev pkg-config autoconf zlib1g zlib1g-dev libgmp-dev
# Add user and switch to this user # Add user and switch to this user
RUN adduser --disabled-password --gecos '' builder RUN adduser --disabled-password --gecos '' builder
USER builder USER builder
# I don't know why but the USER environment variable is not set so I set it because it's requested for ninja
# I don't know why but the USER environment variable is not set so I set it because it's required for ninja
ENV USER=builder ENV USER=builder
# Go to home # Go to home
WORKDIR /home/builder WORKDIR /home/builder
# Download quantum package # Download quantum package
RUN git clone --depth 1 --branch 2.1.2 https://github.com/QuantumPackage/qp2 RUN git clone --depth 1 --branch v2.2.2 https://github.com/QuantumPackage/qp2
# Go to quantum package # Go to quantum package
WORKDIR /home/builder/qp2 WORKDIR /home/builder/qp2
# Configure # Configure
RUN ./configure -i all -c config/gfortran_avx.cfg RUN ./configure -i trexio ; ./configure -i f77zmq ; \
./configure -i ocaml ; ./configure -i docopt ;\
./configure -i resultsFile
RUN ./configure -c config/gfortran_avx.cfg
# source don't work with /bin/sh (used by the run command so I use bash) # source don't work with /bin/sh (used by the run command so I use bash)
# Compile the code to a static build # Compile the code to a static build
RUN ["/bin/bash", "-c", "source quantum_package.rc ; qp export_as_tgz"] RUN ["/bin/bash", "-c", "source quantum_package.rc ; qp export_as_tgz"]
@ -35,42 +45,50 @@ RUN tar -xf quantum_package_static.tar.gz
# This image is based from Ubuntu LTS # This image is based from Ubuntu LTS
FROM ubuntu:${UBUNTU_VERSION} FROM ubuntu:${UBUNTU_VERSION}
LABEL version="2.1.2" \ LABEL version="2.2.2" \
maintainer.name="Mickaël Véril" \ maintainer.name="Mickaël Véril" \
quantum_package.author.name="Anthony Scemama" \ quantum_package.author.name="Anthony Scemama" \
quantum_package.url="https://quantumpackage.github.io/qp2" \ quantum_package.url="https://quantumpackage.github.io/qp2" \
quantum_package.repo="https://github.com/QuantumPackage/qp2" \ quantum_package.repo="https://github.com/QuantumPackage/qp2" \
quantum_package.demo.repo="https://github.com/mveril/qp-demo" \ quantum_package.demo.repo="https://github.com/mveril/qp-demo" \
laboratory.name="Laboratoire de Chimie et Physique Quantique (LCPQ)" \ laboratory.name="Laboratoire de Chimie et Physique Quantique (LCPQ)" \
laboratory.url="http://www.lcpq.ups-tlse.fr/" laboratory.url="http://www.lcpq.ups-tlse.fr/"
# Build argument (can be changed at build time
# This argument define the user name # Build argument (can be changed at build time)
# This argument defines the user name
ARG user=user ARG user=user
# This argument define timezone for tzdata requierd by qp_run # This argument defines the timezone for tzdata required by qp_run
ARG tz=Etc/UTC ARG tz=Etc/UTC
# Unminimize and install all requierd packages
# Unminimize and install all required packages
RUN yes | unminimize && apt-get update && \ RUN yes | unminimize && apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \ DEBIAN_FRONTEND=noninteractive apt-get install -y \
python htop vim emacs-nox screen tmux less wget curl tzdata man manpages-posix lsb-release \ python3 htop vim emacs-nox screen tmux less wget curl tzdata man manpages-posix lsb-release hdf5-tools \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Reconfigure tzdata with the good timezone
# Reconfigure tzdata with the correct timezone
RUN echo $tz > /etc/timezone && rm -rf /etc/localtime && echo "set mouse=" > ~/.vimrc RUN echo $tz > /etc/timezone && rm -rf /etc/localtime && echo "set mouse=" > ~/.vimrc
RUN dpkg-reconfigure -f noninteractive tzdata RUN dpkg-reconfigure -f noninteractive tzdata
# Add user and switch to this user # Add user and switch to this user
RUN adduser --disabled-password --gecos '' $user RUN adduser --disabled-password --gecos '' $user
USER $user USER $user
# I don't know why but the USER environment variable is not set so I set it because it's requested for ninja
# I don't know why but the USER environment variable is not set so I set it because it's required for ninja
ENV USER=$user ENV USER=$user
# Go to home # Go to home
WORKDIR /home/$user WORKDIR /home/$user
# Copy examples # Copy examples
COPY --chown=$user examples examples COPY --chown=$user examples examples
# Copy unpacked QP2 static # Copy unpacked QP2 static
COPY --from=unpack --chown=$user /tmp/quantum_package_static qp2 COPY --from=unpack --chown=$user /tmp/quantum_package_static qp2
# Prepare tmux and screen to use QPSH # Prepare tmux and screen to use QPSH
RUN echo "set -g default-command /home/$user/qp2/bin/qpsh" >> .tmux.conf RUN echo "set -g default-command /home/$user/qp2/bin/qpsh" >> .tmux.conf
RUN echo "shell \"/home/$user/qp2/bin/qpsh\"" >> .screenrc RUN echo "shell \"/home/$user/qp2/bin/qpsh\"" >> .screenrc
# start a qp shell when run
# Start a qp shell when run
CMD ["./qp2/bin/qpsh"] CMD ["./qp2/bin/qpsh"]