Skip to content
Permalink
Browse files

Merge b6fe8ec into 5461777

  • Loading branch information...
megies committed Aug 1, 2016
2 parents 5461777 + b6fe8ec commit 3c837db95b2aedb95d64728018b7b0a8bc14897e
@@ -8,5 +8,6 @@ RUN yum -y upgrade || true
RUN yum install -y gcc numpy scipy python-matplotlib python-sqlalchemy python-lxml python-mock python-basemap python-basemap-data python-pip python-requests python-decorator
RUN easy_install -U setuptools pip
RUN pip install flake8 future
RUN pip install https://github.com/Damgaard/PyImgur/archive/9ebd8bed9b3d0ae2797950876f5c1e64a560f7d8.zip
# Force agg.
RUN mkdir -p /root/.matplotlib && echo "backend: agg" > /root/.matplotlib/matplotlibrc
@@ -6,4 +6,5 @@ MAINTAINER Lion Krischer
RUN apt-get update && apt-get upgrade || true
RUN apt-get -y install python-numpy python-scipy python-matplotlib python-sqlalchemy python-lxml python-mock python-mpltoolkits.basemap python-mpltoolkits.basemap-data python-pip ttf-bitstream-vera python-decorator python-requests
RUN pip install flake8 future
RUN pip install https://github.com/Damgaard/PyImgur/archive/9ebd8bed9b3d0ae2797950876f5c1e64a560f7d8.zip
RUN echo "backend: agg" > /etc/matplotlibrc
@@ -6,4 +6,5 @@ MAINTAINER Lion Krischer
RUN apt-get update && apt-get upgrade || true
RUN apt-get -y install python-numpy python-scipy python-matplotlib python-sqlalchemy python-lxml python-mock python-mpltoolkits.basemap python-mpltoolkits.basemap-data python-pip ttf-bitstream-vera python-decorator python-requests
RUN pip install flake8 future
RUN pip install https://github.com/Damgaard/PyImgur/archive/9ebd8bed9b3d0ae2797950876f5c1e64a560f7d8.zip
RUN echo "backend: agg" > /etc/matplotlibrc
@@ -6,3 +6,4 @@ MAINTAINER Lion Krischer
RUN apt-get update && apt-get upgrade || true
RUN apt-get -y install python-numpy python-scipy python-matplotlib python-sqlalchemy python-lxml python-mock python-mpltoolkits.basemap python-mpltoolkits.basemap-data python-pip python-tornado ttf-bitstream-vera python-decorator python-requests
RUN pip install flake8 future
RUN pip install https://github.com/Damgaard/PyImgur/archive/9ebd8bed9b3d0ae2797950876f5c1e64a560f7d8.zip
@@ -6,3 +6,4 @@ MAINTAINER Lion Krischer
RUN yum -y upgrade || true
RUN yum install -y gcc numpy scipy python-matplotlib python-sqlalchemy python-lxml python-mock python-basemap python-basemap-data python-tornado python-pip python-decorator python-requests
RUN pip install flake8 future
RUN pip install https://github.com/Damgaard/PyImgur/archive/9ebd8bed9b3d0ae2797950876f5c1e64a560f7d8.zip
@@ -5,3 +5,4 @@ MAINTAINER Lion Krischer
# Can fail on occasion.
RUN dnf -y upgrade || true
RUN dnf install -y gcc redhat-rpm-config numpy scipy python-matplotlib python-sqlalchemy python-lxml python-mock python-basemap python-basemap-data python-tornado python-pip python-decorator python-requests python-flake8 python-future
RUN pip install https://github.com/Damgaard/PyImgur/archive/9ebd8bed9b3d0ae2797950876f5c1e64a560f7d8.zip
@@ -7,3 +7,4 @@ RUN zypper --non-interactive --no-gpg-checks refresh
RUN zypper --non-interactive update
RUN zypper --non-interactive install gcc python-devel python-numpy python-scipy python-matplotlib python-SQLAlchemy python-lxml python-mock python-pip python-tornado python-requests python-decorator python-flake8 python-basemap python-basemap-data python-nose ca-certificates-mozilla
RUN pip install future
RUN pip install https://github.com/Damgaard/PyImgur/archive/9ebd8bed9b3d0ae2797950876f5c1e64a560f7d8.zip
@@ -7,4 +7,5 @@ RUN zypper --non-interactive --no-gpg-checks refresh
RUN zypper --non-interactive update
RUN zypper --non-interactive install gcc python-devel python-numpy python-scipy python-matplotlib python-SQLAlchemy python-lxml python-mock python-pip python-tornado python-requests python-decorator python-flake8 python-basemap python-basemap-data python-nose
RUN pip install --index-url=http://pypi.python.org/simple/ --trusted-host pypi.python.org future
RUN pip install https://github.com/Damgaard/PyImgur/archive/9ebd8bed9b3d0ae2797950876f5c1e64a560f7d8.zip
RUN zypper --non-interactive install ca-certificates-mozilla
@@ -6,4 +6,5 @@ MAINTAINER Lion Krischer
RUN apt-get update && apt-get upgrade || true
RUN apt-get -y install python-numpy python-scipy python-matplotlib python-sqlalchemy python-lxml python-mock python-mpltoolkits.basemap python-mpltoolkits.basemap-data python-pip python-tornado ttf-bitstream-vera python-decorator python-requests
RUN pip install flake8 future
RUN pip install https://github.com/Damgaard/PyImgur/archive/9ebd8bed9b3d0ae2797950876f5c1e64a560f7d8.zip
RUN echo "backend: agg" > /etc/matplotlibrc
@@ -6,3 +6,4 @@ MAINTAINER Lion Krischer
RUN apt-get update && apt-get upgrade || true
RUN apt-get -y install python-numpy python-scipy python-matplotlib python-sqlalchemy python-lxml python-mock python-mpltoolkits.basemap python-mpltoolkits.basemap-data python-pip python-tornado ttf-bitstream-vera python-requests python-decorator
RUN pip install flake8 future
RUN pip install https://github.com/Damgaard/PyImgur/archive/9ebd8bed9b3d0ae2797950876f5c1e64a560f7d8.zip
@@ -6,3 +6,4 @@ MAINTAINER Lion Krischer
RUN apt-get update && apt-get upgrade || true
RUN apt-get -y install python-numpy python-scipy python-matplotlib python-sqlalchemy python-lxml python-mock python-mpltoolkits.basemap python-mpltoolkits.basemap-data python-pip python-tornado ttf-bitstream-vera
RUN pip install flake8 future
RUN pip install https://github.com/Damgaard/PyImgur/archive/9ebd8bed9b3d0ae2797950876f5c1e64a560f7d8.zip
@@ -1,4 +1,16 @@
#!/bin/bash

DATETIME=$(date -u +"%Y-%m-%dT%H-%M-%SZ")
LOG_DIR_BASE=logs/$DATETIME
mkdir -p $LOG_DIR_BASE

# all output to log file
exec > $LOG_DIR_BASE/docker.log 2>&1

# remove log directories older than 14 days (to avoid cluttering with GB of
# data on buildbots that are run regularly)
find logs/2[0-9][0-9][0-9]-[01][0-9]-[0-3][0-9]T[012][0-9]-[0-5][0-9]-[0-5][0-9]Z -type d -not -newermt `date --date='14 days ago' --rfc-3339=date` -exec rm -rf {} \;

OBSPY_PATH=$(dirname $(dirname $(pwd)))

# Remove all test images stored locally. Otherwise they'll end up on the
@@ -10,7 +22,6 @@ rm -rf $OBSPY_PATH/obspy/station/tests/images/testrun
DOCKERFILE_FOLDER=base_images
TEMP_PATH=temp
NEW_OBSPY_PATH=$TEMP_PATH/obspy
DATETIME=$(date -u +"%Y-%m-%dT%H-%M-%SZ")

# Determine the docker binary name. The official debian packages use docker.io
# for the binary's name due to some legacy docker package.
@@ -20,7 +31,6 @@ DOCKER=`which docker.io || which docker`
# file.
python -c "import obspy"


# Create temporary folder.
rm -rf $TEMP_PATH
mkdir -p $TEMP_PATH
@@ -50,6 +60,8 @@ else
echo "Bad value for OBSPY_DOCKER_TEST_SOURCE_TREE: $OBSPY_DOCKER_TEST_SOURCE_TREE"
exit 1
fi
FULL_VERSION=`cat $NEW_OBSPY_PATH/obspy/RELEASE-VERSION`
COMMIT=`cd $OBSPY_PATH && git log -1 --pretty=format:%H`


# Copy the install script.
@@ -86,7 +98,7 @@ run_tests_on_image () {
sed 's/{{IMAGE_NAME}}/'$image_name'/g' scripts/Dockerfile_run_tests.tmpl > $TEMP_PATH/Dockerfile

# Where to save the logs, and a random ID for the containers.
LOG_DIR=logs/$DATETIME/$image_name
LOG_DIR=${LOG_DIR_BASE}/$image_name
mkdir -p $LOG_DIR
ID=$RANDOM-$RANDOM-$RANDOM

@@ -96,6 +108,8 @@ run_tests_on_image () {

$DOCKER cp $ID:/INSTALL_LOG.txt $LOG_DIR
$DOCKER cp $ID:/TEST_LOG.txt $LOG_DIR
$DOCKER cp $ID:/failure $LOG_DIR
$DOCKER cp $ID:/success $LOG_DIR

$DOCKER cp $ID:/obspy/obspy/imaging/tests/images/testrun $LOG_DIR/imaging_testrun
$DOCKER cp $ID:/obspy/obspy/core/tests/images/testrun $LOG_DIR/core_testrun
@@ -143,4 +157,28 @@ for image_name in $($DOCKER images | grep obspy | awk '{print $2}'); do
run_tests_on_image $image_name;
done

# set commit status
# helper function to determine overall success/failure across all images
# env variable OBSPY_COMMIT_STATUS_TOKEN has to be set for authorization
overall_status() {
ls ${LOG_DIR_BASE}/*/failure 2>&1 > /dev/null && return 1
ls ${LOG_DIR_BASE}/*/success 2>&1 > /dev/null && return 0
return 1
}
# encode parameter part of the URL, using requests as it is installed anyway..
# (since we use python to import obspy to generate RELEASE-VERSION above)
# it's just looking up the correct quoting function from urllib depending on
# py2/3 and works with requests >= 1.0 (which is from 2012)
FULL_VERSION_URLENCODED=`python -c "from requests.compat import quote; print(quote(\"${FULL_VERSION}\"))"`
COMMIT_STATUS_TARGET_URL="http://tests.obspy.org/?version=${FULL_VERSION_URLENCODED}"
if overall_status ;
then
COMMIT_STATUS=success
COMMIT_STATUS_DESCRIPTION="Docker tests succeeded:"
else
COMMIT_STATUS=failed
COMMIT_STATUS_DESCRIPTION="Docker tests failed:"
fi
curl -H "Content-Type: application/json" -H "Authorization: token ${OBSPY_COMMIT_STATUS_TOKEN}" --request POST --data "{\"state\": \"${COMMIT_STATUS}\", \"context\": \"docker-testbot\", \"description\": \"${COMMIT_STATUS_DESCRIPTION}\", \"target_url\": \"${COMMIT_STATUS_TARGET_URL}\"}" https://api.github.com/repos/obspy/obspy/statuses/${COMMIT}

rm -rf $TEMP_PATH
@@ -16,13 +16,15 @@ fi

cd

obspy-runtests -r --keep-images --node=docker-$(cat /container_name.txt) > /TEST_LOG.txt 2>&1
obspy-runtests -r --keep-images --no-flake8 --node=docker-$(cat /container_name.txt) > /TEST_LOG.txt 2>&1


if [ $? != 0 ]; then
echo -e "${red}Tests failed!${no_color}"
touch /failure
else
echo -e "${green}Tests successful!${no_color}"
touch /success
fi

echo "Done with everything!"

0 comments on commit 3c837db

Please sign in to comment.
You can’t perform that action at this time.