Skip to content
This repository has been archived by the owner on Aug 16, 2019. It is now read-only.

Commit

Permalink
Update docker base image to python 3.6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondEhlers committed Dec 15, 2018
1 parent d967dda commit 358fed1
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
34 changes: 18 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
language: python
matrix:
include:
# In addition to the base python version, we need the full python version to identify the docker images.
# It is defined as the DOCKER_PYTHON_VERSION because it may not be the same version as point release as
# used on Travis (ie 2.7.14 on Travis vs 2.7.15 in the docker image as of Sept 2018).
# In addition to the base python version, we need the full python version to identify the docker
# images. It is defined as the DOCKER_PYTHON_VERSION because it may not be the same version as point
# release as used on Travis (ie 2.7.14 on Travis vs 2.7.15 in the docker image as of Sept 2018).
- python: 2.7
env: DOCKER_PYTHON_VERSION=2.7.15
# 3.7 doesn't run flake8 or a number of other packages cleanly at the moment (as of Sept 2018).
- python: 3.6
env: DOCKER_PYTHON_VERSION=3.6.6
env: DOCKER_PYTHON_VERSION=3.6.7
sudo: required
services:
- docker
Expand All @@ -22,17 +22,17 @@ install: pip install --upgrade -e .[tests,dev,docs]
before_script:
# Runs the tests in a docker container. Necessary because we can't install ROOT easily here.
# Further, we run in the tests directory to avoid any possible config.yaml interfering with the tests.
# Since we mount the Travis overwatch directory inside of the container, the results should still be available
# even after this docker container has stopped
# To use codecov, we first retrieve the variables necessary to pass to the container (via codecov), and then we
# send the results from inside the container to codecov. If we try to send afterwards from outside the container,
# the paths will be wrong and the coverage report will fail!
# Since we mount the Travis overwatch directory inside of the container, the results should still be
# available even after this docker container has stopped
# To use codecov, we first retrieve the variables necessary to pass to the container (via codecov),
# and then we send the results from inside the container to codecov. If we try to send afterwards from
# outside the container, the paths will be wrong and the coverage report will fail!
- ci_env=`bash <(curl -s https://codecov.io/env)`
# Needs to run as root so that it can successfully write back into the travis environment.
- docker run --user root -v ${PWD}:/opt/overwatch $ci_env rehlers/overwatch:latest-py${DOCKER_PYTHON_VERSION} /bin/bash -c "pip install --user --upgrade -e .[tests,dev,docs]; cd tests; pytest -l -vv --cov=overwatch --cov-branch --durations=5 . && bash <(curl -s https://codecov.io/bash)"
# Install polymer and jsRoot so it they will be avialable and included in a built package
# We can't easily install nodejs to install polymer and jsRoot, so instead, we extract it from the docker image.
# Yes, it's super hacky, but it seems to work, so why not?
# We can't easily install nodejs to install polymer and jsRoot, so instead, we extract it from the
# docker image. Yes, it's super hacky, but it seems to work, so why not?
- docker run --user root -v ${PWD}/overwatch/webApp/static/:/opt/extractJS rehlers/overwatch:latest-py${DOCKER_PYTHON_VERSION} /bin/bash -c "cd overwatch/webApp/static && cp -r bower_components /opt/extractJS/. && cp -r jsRoot /opt/extractJS/."
script:
# Since we ran the tests above, we don't need to run them here.
Expand All @@ -41,14 +41,16 @@ script:
# Check that the docs build successfully
- pushd doc && make html && popd
after_success:
# This will work for both tags and standard buidls. The build is performed for PRs, but it won't be deplyoed.
# First, determine the Overwatch branch. If ${TRAVIS_BRANCH} is the same as ${TRAVIS_TAG}, then means that we're
# working with a tag and we should use the master branch (which won't be available under $TRAVIS_BRANCH because
# the branch is not available when building a tag). Otherwise, we just use $TRAVIS_BRANCH
# This will work for both tags and standard buidls. The build is performed for PRs, but it won't be
# deplyoed. First, determine the Overwatch branch. If ${TRAVIS_BRANCH} is the same as ${TRAVIS_TAG},
# then means that we're working with a tag and we should use the master branch (which won't be
# available under $TRAVIS_BRANCH because the branch is not available when building a tag). Otherwise,
# we just use $TRAVIS_BRANCH
- if [[ ${TRAVIS_BRANCH} == ${TRAVIS_TAG} ]]; then OVERWATCH_BRANCH="master"; else OVERWATCH_BRANCH=${TRAVIS_BRANCH}; fi
# NOTE: To be clear about what is done here, we set PYTHON_VERSION in the docker build to the variable
# ${DOCKER_PYTHON_VERSION}.
# NOTE: For an unclear reason, the docker build exit code doesn't seem to always propagate to fully propagate to Travis.
# NOTE: For an unclear reason, the docker build exit code doesn't seem to always propagate to fully
# propagate to Travis.
- pushd docker && docker build --build-arg PYTHON_VERSION=${DOCKER_PYTHON_VERSION} --build-arg OVERWATCH_BRANCH=${OVERWATCH_BRANCH} -f Dockerfile -t "${DOCKER_USERNAME}/overwatch:${TRAVIS_TAG:-latest}-py${DOCKER_PYTHON_VERSION}" . && popd
# Print out to see if we've build it as expected.
- docker images
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ that you will likely want to use this image interactively (-it) and may want to
are done (--rm). If the data is in a folder called `data`, it should look something like:

```bash
$ docker run -it --rm -v data:/overwatch/data rehlers/overwatch:latest-py3.6.6 /bin/bash
$ docker run -it --rm -v data:/overwatch/data rehlers/overwatch:latest-py3.6.7 /bin/bash
```

### Installation only for running Overwatch
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ RUN mkdir -p ${SCRATCH}/root && cd ${SCRATCH}/root \
&& git clone https://github.com/root-project/root.git src \
&& cd src && git checkout tags/v6-10-08 && cd .. \
&& mkdir build && cd build \
&& ${SCRATCH}/buildScripts/buildRoot.sh ../src /opt/root ${PYTHON_VERSION} \
&& ${SCRATCH}/buildScripts/buildRoot.sh ../src /opt/root \
&& make -j2 install \
&& rm -r ${SCRATCH}/root
# Remove src and build files to keep container size down (since we can't cache the build process
Expand Down
4 changes: 2 additions & 2 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Overwatch).

The base image contains software which is heavy and/or unlikely to change, such as ROOT, XRootD, etc. It is
build via the `Dockerfile.build` file. Each new version of the build tag will be of the form
`overwatch-base:py3.6.6` (for python 3.6.6). Note that the base image is far too heavy to be built on Travis
`overwatch-base:py3.6.7` (for python 3.6.7). Note that the base image is far too heavy to be built on Travis
(for example, ROOT will often take hours to compile), so the base image must be built on another system (such
as a developer's laptop), and then pushed to docker hub. Once updated, the standard image will use this new
base image.
Expand Down Expand Up @@ -98,7 +98,7 @@ this is our external facing server, so this defaults to `0.0.0.0`.
`OVERWATCH_EXECUTABLES` is not set, then run (for example):

```bash
$ docker run --rm -it -v ${PWD}/data:/opt/overwatch/data -v ${PWD}/overwatch:/opt/overwatch/overwatch -v ${PWD}/exec:/opt/overwatch/exec -e config -e gridCert -e gridKey rehlers/overwatch:latest-py3.6.6 /bin/bash
$ docker run --rm -it -v ${PWD}/data:/opt/overwatch/data -v ${PWD}/overwatch:/opt/overwatch/overwatch -v ${PWD}/exec:/opt/overwatch/exec -e config -e gridCert -e gridKey rehlers/overwatch:latest-py3.6.7 /bin/bash
# In the container (note that a python socket exception is expected)
$ overwatchDeploy -e config
# Now everything should be all set!
Expand Down

0 comments on commit 358fed1

Please sign in to comment.