Skip to content

Commit

Permalink
Docker: Make build more quiet and resilient
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Apr 25, 2019
1 parent e4148ef commit 165051c
Show file tree
Hide file tree
Showing 13 changed files with 86 additions and 45 deletions.
13 changes: 9 additions & 4 deletions tools/docker/scripts/install_aiida.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# author: Ole Schuett

# install Ubuntu packages
apt-get update
apt-get update -qq
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true
apt-get install -y --no-install-recommends \
apt-get install -qq --no-install-recommends \
build-essential \
python-setuptools \
python-wheel \
Expand All @@ -19,7 +19,7 @@ apt-get install -y --no-install-recommends \
rm -rf /var/lib/apt/lists/*

# install python packages
pip install flake8 aiida ase
pip install --quiet flake8 aiida ase

# create ubuntu user with sudo powers
adduser --disabled-password --gecos "" ubuntu
Expand All @@ -34,7 +34,12 @@ ln -vs /opt/cp2k-toolchain/install/arch/local* .

# pre-build cp2k
cd /workspace/cp2k
make -j VERSION=pdbg
echo -n "Warming cache by trying to compile... "
if make -j VERSION=pdbg &> /dev/null ; then
echo "done."
else
echo "failed."
fi
rm -rf lib exe

#EOF
15 changes: 10 additions & 5 deletions tools/docker/scripts/install_ase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# author: Ole Schuett

# install python packages
apt-get update
apt-get install -y --no-install-recommends \
apt-get update -qq
apt-get install -qq --no-install-recommends \
python3 \
python3-dev \
python3-pip \
Expand All @@ -14,10 +14,10 @@ apt-get install -y --no-install-recommends \
rm -rf /var/lib/apt/lists/*

# install python packages
pip3 install numpy scipy matplotlib flask
pip3 install --quiet numpy scipy matplotlib flask

# clone ase reprository
git clone --depth=1 --single-branch -b master https://gitlab.com/ase/ase.git /opt/ase
git clone --quiet --depth=1 --single-branch -b master https://gitlab.com/ase/ase.git /opt/ase

# shellcheck disable=SC1091
source /opt/cp2k-toolchain/install/setup
Expand All @@ -28,7 +28,12 @@ ln -vs /opt/cp2k-toolchain/install/arch/local* .

# pre-build cp2k
cd /workspace/cp2k
make -j VERSION=pdbg
echo -n "Warming cache by trying to compile... "
if make -j VERSION=pdbg &> /dev/null ; then
echo "done."
else
echo "failed."
fi
rm -rf lib exe

#EOF
7 changes: 4 additions & 3 deletions tools/docker/scripts/install_basics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# author: Ole Schuett

# install Ubuntu packages
apt-get update
apt-get install -y --no-install-recommends \
apt-get update -qq
apt-get install -qq --no-install-recommends \
autoconf \
autogen \
automake \
Expand All @@ -21,9 +21,10 @@ apt-get install -y --no-install-recommends \
rsync \
unzip \
wget

rm -rf /var/lib/apt/lists/*

# clone cp2k repository
git clone --recursive --depth=1 --single-branch -b master https://github.com/cp2k/cp2k.git /workspace/cp2k
git clone --quiet --recursive --depth=1 --single-branch -b master https://github.com/cp2k/cp2k.git /workspace/cp2k

#EOF
8 changes: 7 additions & 1 deletion tools/docker/scripts/install_conventions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ ln -vs /opt/cp2k-toolchain/install/arch/local* .

# pre-build cp2k
cd /workspace/cp2k/tools/conventions
./test_conventions.sh
echo -n "Warming cache by trying run test_conventions.sh... "
if ./test_conventions.sh &> /dev/null ; then
echo "done."
else
echo "failed."
fi

rm -rf ../lib/ ../exe/

#EOF
11 changes: 8 additions & 3 deletions tools/docker/scripts/install_formatting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
# author: Ole Schuett

# install Ubuntu packages
apt-get update
apt-get install -y --no-install-recommends libfindbin-libs-perl
apt-get update -qq
apt-get install -qq --no-install-recommends libfindbin-libs-perl
rm -rf /var/lib/apt/lists/*

# pre-run prettify
cd /workspace/cp2k
make -j 16 pretty
echo -n "Warming cache by trying to run make pretty... "
if make -j 16 pretty &> /dev/null ; then
echo "done."
else
echo "failed."
fi

#EOF
15 changes: 10 additions & 5 deletions tools/docker/scripts/install_i-pi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
# author: Ole Schuett

# install Ubuntu packages
apt-get update
apt-get install -y --no-install-recommends \
apt-get update -qq
apt-get install -qq --no-install-recommends \
python \
python-pip \
python-wheel \
python-setuptools
rm -rf /var/lib/apt/lists/*

# install python packages
pip install numpy
pip install --quiet numpy

# clone i-pi repository
git clone --depth=1 --single-branch -b master https://github.com/i-pi/i-pi.git /opt/i-pi
git clone --quiet --depth=1 --single-branch -b master https://github.com/i-pi/i-pi.git /opt/i-pi

# shellcheck disable=SC1091
source /opt/cp2k-toolchain/install/setup
Expand All @@ -26,7 +26,12 @@ ln -vs /opt/cp2k-toolchain/install/arch/local* .

# pre-build cp2k
cd /workspace/cp2k
make -j VERSION=pdbg
echo -n "Warming cache by trying to compile... "
if make -j VERSION=pdbg &> /dev/null ; then
echo "done."
else
echo "failed."
fi
rm -rf lib exe

#EOF
13 changes: 9 additions & 4 deletions tools/docker/scripts/install_manual.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# author: Ole Schuett

# install Ubuntu packages
apt-get update
apt-get install -y --no-install-recommends \
default-jre-headless \
apt-get update -qq
apt-get install -qq --no-install-recommends \
default-jre-headless \
libsaxonhe-java
rm -rf /var/lib/apt/lists/*

Expand All @@ -18,7 +18,12 @@ ln -vs /opt/cp2k-toolchain/install/arch/local* .

# pre-build cp2k
cd /workspace/cp2k
make -j VERSION=psmp
echo -n "Warming cache by trying to compile... "
if make -j VERSION=psmp &> /dev/null ; then
echo "done."
else
echo "failed."
fi
rm -rf lib exe

#EOF
16 changes: 9 additions & 7 deletions tools/docker/scripts/install_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# author: Ole Schuett

# install Ubuntu packages
apt-get update
apt-get install -y --no-install-recommends \
apt-get update -qq
apt-get install -qq --no-install-recommends \
python \
python3 \
python-pip \
Expand All @@ -19,17 +19,19 @@ apt-get install -y --no-install-recommends \
rm -rf /var/lib/apt/lists/*

# install python packages
pip install numpy matplotlib requests
pip3 install numpy matplotlib requests
pip install --quiet numpy matplotlib requests
pip3 install --quiet numpy matplotlib requests

# install python2.6
echo "Building Python-2.6.9... "
cd /tmp
wget -q https://www.python.org/ftp/python/2.6.9/Python-2.6.9.tgz
echo "7277b1285d8a82f374ef6ebaac85b003266f7939b3f2a24a3af52f9523ac94db Python-2.6.9.tgz" | sha256sum --check
tar -xzf Python-2.6.9.tgz
pushd Python-2.6.9
./configure
make -j
make install
./configure > /tmp/python2.6.9_configure.log
make -j > /tmp/python2.6.9_make.log
make install > /tmp/python2.6.9_install.log
popd
rm -rf Python-2.6.9*

Expand Down
2 changes: 1 addition & 1 deletion tools/docker/scripts/install_regtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ source /opt/cp2k-toolchain/install/setup

# pre-build cp2k
cd /workspace/cp2k
echo -n "Trying to compile... "
echo -n "Warming cache by trying to compile... "
if make -j ARCH="${ARCH}" VERSION="${VERSION}" &> /dev/null ; then
echo "done."
else
Expand Down
17 changes: 12 additions & 5 deletions tools/docker/scripts/install_scaling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# author: Ole Schuett

# install numpy
apt-get update
apt-get install -y --no-install-recommends python-numpy
apt-get update -qq
apt-get install -qq --no-install-recommends python-numpy
rm -rf /var/lib/apt/lists/*

# setup arch files
Expand All @@ -16,9 +16,16 @@ source /opt/cp2k-toolchain/install/setup

# pre-build cp2k
cd /workspace/cp2k
make -j VERSION="popt" cp2k
make -j VERSION="psmp" cp2k
make -j VERSION="ssmp" cp2k
echo -n "Warming cache by trying to compile... "
if make -j VERSION="popt" cp2k &> /dev/null && \
make -j VERSION="psmp" cp2k &> /dev/null && \
make -j VERSION="ssmp" cp2k &> /dev/null ; then
echo "done."
else
echo "failed."
fi


rm -rf lib exe

#EOF
4 changes: 2 additions & 2 deletions tools/docker/scripts/install_ubuntu_toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ fi
GCC_VERSION=$1

# install Ubuntu packages
apt-get update
apt-get install -y --no-install-recommends \
apt-get update -qq
apt-get install -qq --no-install-recommends \
gcc-${GCC_VERSION} \
g++-${GCC_VERSION} \
gfortran-${GCC_VERSION} \
Expand Down
6 changes: 3 additions & 3 deletions tools/docker/scripts/test_aiida.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ chmod +x /usr/bin/cp2k

echo -e "\n========== Installing AiiDA-CP2K plugin =========="
cd /opt/
git clone https://github.com/cp2k/aiida-cp2k.git
pip install ./aiida-cp2k/[pre-commit]
git clone --quiet https://github.com/cp2k/aiida-cp2k.git
pip install --quiet ./aiida-cp2k/[pre-commit]

# workaround for dependency chain in 1.0.0b1
pip install 'topika==0.1.3'
pip install --quiet 'topika==0.1.3'

echo -e "\n========== Configuring AiiDA =========="
for i in $(dirname "$(which mpirun)")/* ; do ln -sf "$i" /usr/bin/; done
Expand Down
4 changes: 2 additions & 2 deletions tools/docker/scripts/test_i-pi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ make -j VERSION=pdbg cp2k

echo -e "\n========== Installing i-Pi =========="
cd /opt/i-pi
git pull
pip install .
git pull --quiet
pip install --quiet .

echo -e "\n========== Running i-Pi Tests =========="

Expand Down

0 comments on commit 165051c

Please sign in to comment.