-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker local testing of 4 distributions.
- Loading branch information
1 parent
2148f68
commit de1d3ff
Showing
13 changed files
with
272 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Docker enabled testing | ||
|
||
This directory contains scripts to run the IOR benchmark testing in various Docker images. | ||
This allows for testing several distributions on a developer machine. | ||
|
||
To setup your test systems run: | ||
./prepare.sh | ||
|
||
To run all tests for all variants use | ||
./run-all-tests.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM centos:6 | ||
|
||
WORKDIR /data | ||
RUN yum install -y mpich openmpi git pkg-config nano gcc bzip2 patch gcc-c++ make mpich-devel openmpi-devel | ||
RUN yum install -y sudo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
BUILD="$1" | ||
if [[ $UID == 0 ]]; then | ||
groupadd -g $3 testuser | ||
useradd -r -u $2 -g testuser testuser | ||
sudo -u testuser $0 $1 | ||
exit $? | ||
fi | ||
|
||
ERROR=0 | ||
|
||
function runTest(){ | ||
P=$PATH | ||
FLAVOR="$1" | ||
MPI_DIR="$2" | ||
export IOR_MPIRUN="$3" | ||
|
||
echo $FLAVOR in $BUILD/$FLAVOR | ||
export PATH=$MPI_DIR/bin:$PATH | ||
mkdir -p $BUILD/$FLAVOR | ||
|
||
pushd $BUILD/$FLAVOR > /dev/null | ||
/data/configure || exit 1 | ||
make || exit 1 | ||
|
||
cd /data/ | ||
export IOR_EXEC=$BUILD/$FLAVOR/src/ior | ||
export IOR_OUT=$BUILD/$FLAVOR/test | ||
./testing/basic-tests.sh | ||
|
||
ERROR=$(($ERROR + $?)) | ||
popd > /dev/null | ||
PATH=$P | ||
} | ||
|
||
|
||
runTest openmpi /usr/lib64/openmpi/ "mpiexec -n" | ||
export MPI_ARGS="" | ||
runTest mpich /usr/lib64/mpich "mpiexec -n" | ||
|
||
#kill -9 %1 | ||
|
||
exit $ERROR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM centos:7 | ||
|
||
WORKDIR /data | ||
RUN yum install -y mpich openmpi git pkg-config nano gcc bzip2 patch gcc-c++ make mpich-devel openmpi-devel | ||
RUN yum install -y sudo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
BUILD="$1" | ||
|
||
if [[ $UID == 0 ]]; then | ||
groupadd -g $3 testuser | ||
useradd -r -u $2 -g testuser testuser | ||
sudo -u testuser $0 $1 | ||
exit $? | ||
fi | ||
|
||
ERROR=0 | ||
|
||
function runTest(){ | ||
P=$PATH | ||
FLAVOR="$1" | ||
MPI_DIR="$2" | ||
|
||
echo $FLAVOR in $BUILD/$FLAVOR | ||
mkdir -p $BUILD/$FLAVOR | ||
|
||
pushd $BUILD/$FLAVOR > /dev/null | ||
|
||
export PATH=$MPI_DIR/bin:$PATH | ||
/data/configure || exit 1 | ||
make || exit 1 | ||
|
||
cd /data/ | ||
export IOR_EXEC=$BUILD/$FLAVOR/src/ior | ||
export IOR_OUT=$BUILD/$FLAVOR/test | ||
./testing/basic-tests.sh | ||
|
||
ERROR=$(($ERROR + $?)) | ||
popd > /dev/null | ||
PATH=$P | ||
} | ||
|
||
|
||
runTest openmpi /usr/lib64/openmpi/ | ||
runTest mpich /usr/lib64/mpich | ||
|
||
exit $ERROR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
echo "Checking docker" | ||
docker ps | ||
if [ $? != 0 ] ; then | ||
echo "Error, cannot run docker commands" | ||
groups |grep docker || echo "You are not in the docker group !" | ||
exit 1 | ||
fi | ||
|
||
echo "Building docker containers" | ||
|
||
for IMAGE in $(find -type d | cut -b 3- |grep -v "^$") ; do | ||
docker build -t hpc/ior:$IMAGE $IMAGE | ||
if [ $? != 0 ] ; then | ||
echo "Error building image $IMAGE" | ||
exit 1 | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
|
||
# This script runs the testscript for all supported docker images | ||
|
||
TARGET=../../build-docker | ||
mkdir -p $TARGET | ||
|
||
ARGS="$@" | ||
GID=$(id -g $USER) | ||
OPT="-it --rm -v $PWD/../../:/data/" | ||
ERROR=0 | ||
VERBOSE=0 | ||
|
||
set -- `getopt -u -l "clean" -l verbose -o "" -- "$ARGS"` | ||
test $# -lt 1 && exit 1 | ||
while test $# -gt 0 | ||
do | ||
case "$1" in | ||
--clean) echo "Cleaning build dirs!"; rm -rf $TARGET/* ;; | ||
--verbose) VERBOSE=1 ;; | ||
--) ;; | ||
*) echo "Unknown option $1"; exit 1;; | ||
esac | ||
shift | ||
done | ||
|
||
for IMAGE in $(find -type d | cut -b 3- |grep -v "^$") ; do | ||
echo "RUNNING $IMAGE" | ||
mkdir -p $TARGET/$IMAGE | ||
WHAT="docker run $OPT -h $IMAGE hpc/ior:$IMAGE /data/testing/docker/$IMAGE/run-test.sh /data/build-docker/$IMAGE $UID $GID" | ||
if [[ $VERBOSE == 1 ]] ; then | ||
echo $WHAT | ||
fi | ||
$WHAT 2>$TARGET/$IMAGE/LastTest.log 1>&2 | ||
ERR=$? | ||
ERROR=$(($ERROR+$ERR)) | ||
if [[ $ERR != 0 ]]; then | ||
echo $WHAT | ||
echo "Error, see $TARGET/$IMAGE/LastTest.log" | ||
fi | ||
done | ||
|
||
if [[ $ERROR != 0 ]] ; then | ||
echo "Errors occured!" | ||
else | ||
echo "OK: all tests passed!" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM ubuntu:14.04 | ||
|
||
WORKDIR /data | ||
RUN apt-get update | ||
RUN apt-get install -y libopenmpi-dev openmpi-bin mpich git pkg-config gcc-4.7 nano make | ||
RUN apt-get install -y sudo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
BUILD="$1" | ||
if [[ $UID == 0 ]]; then | ||
groupadd -g $3 testuser | ||
useradd -r -u $2 -g testuser testuser | ||
sudo -u testuser $0 $1 | ||
exit $? | ||
fi | ||
ERROR=0 | ||
|
||
function runTest(){ | ||
FLAVOR="$1" | ||
MPI_DIR="$2" | ||
echo $FLAVOR in $BUILD/$FLAVOR | ||
update-alternatives --set mpi $MPI_DIR | ||
mkdir -p $BUILD/$FLAVOR | ||
|
||
pushd $BUILD/$FLAVOR > /dev/null | ||
/data/configure || exit 1 | ||
make || exit 1 | ||
|
||
#define the alias | ||
ln -sf $(which mpiexec.$FLAVOR) /usr/bin/mpiexec | ||
|
||
cd /data/ | ||
export IOR_EXEC=$BUILD/$FLAVOR/src/ior | ||
export IOR_OUT=$BUILD/$FLAVOR/test | ||
./testing/basic-tests.sh | ||
|
||
ERROR=$(($ERROR + $?)) | ||
popd > /dev/null | ||
} | ||
|
||
runTest openmpi /usr/lib/openmpi/include | ||
runTest mpich /usr/include/mpich | ||
|
||
exit $ERROR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM ubuntu:16.04 | ||
|
||
WORKDIR /data | ||
RUN apt-get update | ||
RUN apt-get install -y libopenmpi-dev openmpi-bin mpich git pkg-config gcc-5 gcc-4.8 nano | ||
RUN apt-get install -y sudo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
BUILD="$1" | ||
if [[ $UID == 0 ]]; then | ||
groupadd -g $3 testuser | ||
useradd -r -u $2 -g testuser testuser | ||
sudo -u testuser $0 $1 | ||
exit $? | ||
fi | ||
groupadd -g $3 testuser | ||
useradd -r -u $2 -g testuser testuser | ||
|
||
ERROR=0 | ||
|
||
function runTest(){ | ||
FLAVOR="$1" | ||
MPI_DIR="$2" | ||
export IOR_MPIRUN="$3" | ||
echo $FLAVOR in $BUILD/$FLAVOR | ||
update-alternatives --set mpi $MPI_DIR | ||
mkdir -p $BUILD/$FLAVOR | ||
|
||
pushd $BUILD/$FLAVOR > /dev/null | ||
/data/configure || exit 1 | ||
make || exit 1 | ||
|
||
#define the alias | ||
ln -sf $(which mpiexec.$FLAVOR) /usr/bin/mpiexec | ||
|
||
cd /data/ | ||
export IOR_EXEC=$BUILD/$FLAVOR/src/ior | ||
export IOR_OUT=$BUILD/$FLAVOR/test | ||
|
||
./testing/basic-tests.sh | ||
|
||
ERROR=$(($ERROR + $?)) | ||
popd > /dev/null | ||
} | ||
|
||
export MPI_ARGS="" | ||
runTest openmpi /usr/lib/openmpi/include "mpiexec -n" | ||
runTest mpich /usr/include/mpich "mpiexec -n" | ||
|
||
exit $ERROR |