diff --git a/.gitignore b/.gitignore index 8cf66168eb..00d66de3ed 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ bundles/ .hg/ .git/ vendor/pkg/ +pyenv diff --git a/hack/infrastructure/docker-ci/Dockerfile b/hack/infrastructure/docker-ci/Dockerfile index 3f6c34441d..d894330ffa 100644 --- a/hack/infrastructure/docker-ci/Dockerfile +++ b/hack/infrastructure/docker-ci/Dockerfile @@ -1,6 +1,6 @@ -# VERSION: 0.22 -# DOCKER-VERSION 0.6.3 -# AUTHOR: Daniel Mizyrycki +# VERSION: 0.25 +# DOCKER-VERSION 0.6.6 +# AUTHOR: Daniel Mizyrycki # DESCRIPTION: Deploy docker-ci on Digital Ocean # COMMENTS: # CONFIG_JSON is an environment variable json string loaded as: diff --git a/hack/infrastructure/docker-ci/VERSION b/hack/infrastructure/docker-ci/VERSION new file mode 100644 index 0000000000..0bfccb0804 --- /dev/null +++ b/hack/infrastructure/docker-ci/VERSION @@ -0,0 +1 @@ +0.4.5 diff --git a/hack/infrastructure/docker-ci/deployment.py b/hack/infrastructure/docker-ci/deployment.py index ee000eb7ba..c04219d523 100755 --- a/hack/infrastructure/docker-ci/deployment.py +++ b/hack/infrastructure/docker-ci/deployment.py @@ -32,7 +32,7 @@ DOCKER_CI_PATH = '/docker-ci' CFG_PATH = '{}/buildbot'.format(DOCKER_CI_PATH) -class digital_ocean(): +class DigitalOcean(): def __init__(self, key, client): '''Set default API parameters''' @@ -62,7 +62,7 @@ def json_fmt(data): return json.dumps(data, sort_keys = True, indent = 2) -do = digital_ocean(env['DO_API_KEY'], env['DO_CLIENT_ID']) +do = DigitalOcean(env['DO_API_KEY'], env['DO_CLIENT_ID']) # Get DROPLET_NAME data data = do.droplet_data(DROPLET_NAME) @@ -147,9 +147,6 @@ sudo('curl -s https://phantomjs.googlecode.com/files/' 'phantomjs-1.9.1-linux-x86_64.tar.bz2 | tar jx -C /usr/bin' ' --strip-components=2 phantomjs-1.9.1-linux-x86_64/bin/phantomjs') -# Preventively reboot docker-ci daily -sudo('ln -s /sbin/reboot /etc/cron.daily') - # Build docker-ci containers sudo('cd {}; docker build -t docker .'.format(DOCKER_PATH)) sudo('cd {}; docker build -t docker-ci .'.format(DOCKER_CI_PATH)) @@ -169,3 +166,6 @@ sudo('{0}/setup.sh root {0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10}' env['SMTP_PWD'], env['EMAIL_RCP'], env['REGISTRY_USER'], env['REGISTRY_PWD'], env['REGISTRY_BUCKET'], env['REGISTRY_ACCESS_KEY'], env['REGISTRY_SECRET_KEY'])) + +# Preventively reboot docker-ci daily +sudo('ln -s /sbin/reboot /etc/cron.daily') diff --git a/hack/infrastructure/docker-ci/docker-test/Dockerfile b/hack/infrastructure/docker-ci/docker-test/Dockerfile index 229d696b87..0f3a63f5f1 100644 --- a/hack/infrastructure/docker-ci/docker-test/Dockerfile +++ b/hack/infrastructure/docker-ci/docker-test/Dockerfile @@ -1,6 +1,6 @@ -# VERSION: 0.3 -# DOCKER-VERSION 0.6.3 -# AUTHOR: Daniel Mizyrycki +# VERSION: 0.4 +# DOCKER-VERSION 0.6.6 +# AUTHOR: Daniel Mizyrycki # DESCRIPTION: Testing docker PRs and commits on top of master using # REFERENCES: This code reuses the excellent implementation of # Docker in Docker made by Jerome Petazzoni. @@ -15,13 +15,9 @@ # TO_RUN: docker run -privileged test_docker hack/dind test_docker.sh [commit] [repo] [branch] from docker -maintainer Daniel Mizyrycki +maintainer Daniel Mizyrycki -#### FIXME. Temporarily install docker and dind with proper apparmor handling -run wget -q -O /go/src/github.com/dotcloud/docker/hack/dind http://raw.github.com/jpetazzo/docker/escape-apparmor-confinement/hack/dind -run chmod +x /go/src/github.com/dotcloud/docker/hack/dind - -# Setup go to the PATH. Extracted from /Dockerfile +# Setup go in PATH. Extracted from /Dockerfile env PATH /usr/local/go/bin:$PATH # Add test_docker.sh diff --git a/hack/infrastructure/docker-ci/docker-test/test_docker.sh b/hack/infrastructure/docker-ci/docker-test/test_docker.sh index c8cfe147e6..cf8fdb90bb 100755 --- a/hack/infrastructure/docker-ci/docker-test/test_docker.sh +++ b/hack/infrastructure/docker-ci/docker-test/test_docker.sh @@ -8,6 +8,10 @@ BRANCH=${3-master} # Compute test paths DOCKER_PATH=/go/src/github.com/dotcloud/docker +# Timestamp +echo +date; echo + # Fetch latest master cd / rm -rf /go @@ -16,13 +20,13 @@ cd $DOCKER_PATH # Merge commit git fetch -q "$REPO" "$BRANCH" -git merge --no-edit $COMMIT || exit 1 +git merge --no-edit $COMMIT || exit 255 # Test commit ./hack/make.sh test; exit_status=$? # Display load if test fails -if [ $exit_status -eq 1 ] ; then +if [ $exit_status -ne 0 ] ; then uptime; echo; free fi diff --git a/hack/infrastructure/docker-ci/functionaltests/test_registry.sh b/hack/infrastructure/docker-ci/functionaltests/test_registry.sh index d175f66d16..58642529cc 100755 --- a/hack/infrastructure/docker-ci/functionaltests/test_registry.sh +++ b/hack/infrastructure/docker-ci/functionaltests/test_registry.sh @@ -8,6 +8,7 @@ rm -rf docker-registry # Setup the environment export SETTINGS_FLAVOR=test export DOCKER_REGISTRY_CONFIG=config_test.yml +export PYTHONPATH=$(pwd)/docker-registry/test # Get latest docker registry git clone -q https://github.com/dotcloud/docker-registry.git @@ -21,7 +22,6 @@ pip install -q tox # Run registry tests tox || exit 1 -export PYTHONPATH=$(pwd)/docker-registry python -m unittest discover -p s3.py -s test || exit 1 python -m unittest discover -p workflow.py -s test diff --git a/hack/infrastructure/docker-ci/nightlyrelease/Dockerfile b/hack/infrastructure/docker-ci/nightlyrelease/Dockerfile index 6762cb4686..2100a9e8e9 100644 --- a/hack/infrastructure/docker-ci/nightlyrelease/Dockerfile +++ b/hack/infrastructure/docker-ci/nightlyrelease/Dockerfile @@ -1,6 +1,6 @@ -# VERSION: 1.5 -# DOCKER-VERSION 0.6.4 -# AUTHOR: Daniel Mizyrycki +# VERSION: 1.6 +# DOCKER-VERSION 0.6.6 +# AUTHOR: Daniel Mizyrycki # DESCRIPTION: Build docker nightly release using Docker in Docker. # REFERENCES: This code reuses the excellent implementation of docker in docker # made by Jerome Petazzoni. https://github.com/jpetazzo/dind @@ -13,7 +13,7 @@ # TO_RELEASE: docker run -i -t -privileged -e AWS_S3_BUCKET="test.docker.io" dockerbuilder hack/dind dockerbuild.sh from docker -maintainer Daniel Mizyrycki +maintainer Daniel Mizyrycki # Add docker dependencies and downloading packages run echo 'deb http://archive.ubuntu.com/ubuntu precise main universe' > /etc/apt/sources.list @@ -22,11 +22,6 @@ run apt-get update; apt-get install -y -q wget python2.7 # Add production docker binary run wget -q -O /usr/bin/docker http://get.docker.io/builds/Linux/x86_64/docker-latest; chmod +x /usr/bin/docker -#### FIXME. Temporarily install docker and dind with proper apparmor handling -run wget -q -O /usr/bin/docker http://test.docker.io/test/docker; chmod +x /usr/bin/docker -run wget -q -O /go/src/github.com/dotcloud/docker/hack/dind http://raw.github.com/jpetazzo/docker/escape-apparmor-confinement/hack/dind -run chmod +x /go/src/github.com/dotcloud/docker/hack/dind - # Add proto docker builder add ./dockerbuild.sh /usr/bin/dockerbuild.sh run chmod +x /usr/bin/dockerbuild.sh diff --git a/hack/infrastructure/docker-ci/nightlyrelease/dockerbuild.sh b/hack/infrastructure/docker-ci/nightlyrelease/dockerbuild.sh index 457db3f889..80caaec25e 100644 --- a/hack/infrastructure/docker-ci/nightlyrelease/dockerbuild.sh +++ b/hack/infrastructure/docker-ci/nightlyrelease/dockerbuild.sh @@ -34,7 +34,7 @@ exit_status=$? # Display load if test fails set -x -if [ $exit_status -eq 1 ] ; then +if [ $exit_status -ne 0 ] ; then uptime; echo; free exit 1 fi diff --git a/hack/infrastructure/docker-ci/registry-coverage/Dockerfile b/hack/infrastructure/docker-ci/registry-coverage/Dockerfile index 59c914fb2b..e544645b67 100644 --- a/hack/infrastructure/docker-ci/registry-coverage/Dockerfile +++ b/hack/infrastructure/docker-ci/registry-coverage/Dockerfile @@ -11,7 +11,7 @@ maintainer Daniel Mizyrycki # Add registry_coverager.sh and dependencies run pip install coverage flask pyyaml requests simplejson python-glanceclient \ - blinker redis gevent + blinker redis boto gevent rsa mock add registry_coverage.sh /usr/bin/registry_coverage.sh run chmod +x /usr/bin/registry_coverage.sh diff --git a/hack/infrastructure/docker-ci/registry-coverage/registry_coverage.sh b/hack/infrastructure/docker-ci/registry-coverage/registry_coverage.sh index e9f0172651..e16cea8e3c 100755 --- a/hack/infrastructure/docker-ci/registry-coverage/registry_coverage.sh +++ b/hack/infrastructure/docker-ci/registry-coverage/registry_coverage.sh @@ -2,8 +2,11 @@ set -x -# Compute test paths +# Setup the environment REGISTRY_PATH=/data/docker-registry +export SETTINGS_FLAVOR=test +export DOCKER_REGISTRY_CONFIG=config_test.yml +export PYTHONPATH=$REGISTRY_PATH/test # Fetch latest docker-registry master rm -rf $REGISTRY_PATH @@ -11,8 +14,5 @@ git clone https://github.com/dotcloud/docker-registry -b master $REGISTRY_PATH cd $REGISTRY_PATH # Generate coverage -export SETTINGS_FLAVOR=test -export DOCKER_REGISTRY_CONFIG=config_test.yml - coverage run -m unittest discover test || exit 1 coverage report --include='./*' --omit='./test/*' diff --git a/hack/infrastructure/docker-ci/report/deployment.py b/hack/infrastructure/docker-ci/report/deployment.py index d5efb4a960..5b2eaf3cab 100755 --- a/hack/infrastructure/docker-ci/report/deployment.py +++ b/hack/infrastructure/docker-ci/report/deployment.py @@ -34,7 +34,7 @@ env['DOCKER_CI_KEY'] = open(env['DOCKER_CI_KEY_PATH']).read() DROPLET_NAME = env.get('DROPLET_NAME','report') TIMEOUT = 120 # Seconds before timeout droplet creation -IMAGE_ID = 894856 # Docker on Ubuntu 13.04 +IMAGE_ID = 1004145 # Docker on Ubuntu 13.04 REGION_ID = 4 # New York 2 SIZE_ID = 66 # memory 512MB DO_IMAGE_USER = 'root' # Image user on Digital Ocean