From 396139276df04b74e0af152bbb7b7a99cb66a7fe Mon Sep 17 00:00:00 2001 From: James Hanna Date: Tue, 5 Jun 2018 20:33:29 +0100 Subject: [PATCH] travis docker build and updated docs --- .travis.yml | 23 ++++++++++++++++--- README.md | 2 +- docker/README.md | 59 ++++++++++++++++-------------------------------- 3 files changed, 40 insertions(+), 44 deletions(-) diff --git a/.travis.yml b/.travis.yml index a35ad68..71f0e6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,8 +24,8 @@ script: - cp makefile.in makefile - make jupyterq - echo "Preparing version $TRAVIS_BRANCH-$TRAVIS_COMMIT" -- zip -r jupyterq_$TRAVIS_OS_NAME-$TRAVIS_BRANCH.zip jupyterq*.q install.sh README.md LICENSE kxpy kernelspec importmatplotlib.q matplotlibexample.p kdb+Notebooks.ipynb m64/jupyterq.so l64/jupyterq.so || true -- echo "Packaged as jupyterq_$TRAVIS_OS_NAME-$TRAVIS_BRANCH.zip" +- tar czf jupyterq_$TRAVIS_OS_NAME-$TRAVIS_BRANCH.tgz jupyterq*.q install.sh README.md LICENSE kxpy kernelspec importmatplotlib.q matplotlibexample.p kdb+Notebooks.ipynb [ml]64/jupyterq.so +- echo "Packaged as jupyterq_$TRAVIS_OS_NAME-$TRAVIS_BRANCH.tgz" - mkdir -p $HOME/q - export QHOME=$HOME/q # can't test install.sh without q so use make install @@ -34,10 +34,27 @@ deploy: provider: releases api_key: "$GITHUB_APIKEY" file_glob: true - file: jupyter*.zip + file: jupyterq_$TRAVIS_OS_NAME-$TRAVIS_BRANCH.tgz skip_cleanup: true on: tags: true +jobs: + include: + - stage: docker + sudo: required + services: + - docker + script: + - docker build -t kxsys/jupyterq:latest -f docker/Dockerfile . + - docker tag kxsys/jupyterq:latest kxsys/jupyterq:$TRAVIS_BRANCH + deploy: + provider: script + script: + - echo $DOCKER_PASSWORD|docker login --username $DOCKER_USERNAME --password-stdin && docker push kxsys/jupyterq:latest && docker push kxsys/jupyterq:$TRAVIS_BRANCH + skip_cleanup: true + on: + tags: true + condition: $TRAVIS_BRANCH =~ ^[0-9]+\. notifications: slack: secure: "meErDcQPK9d3tJswHJSazBgTAF5j79P803LaB9OkctNixSV38efmXIiQzzgZ/+3xpybw8O7TCx7dcE3mq87J/p1iJAWSCY5xc5F3ouI0U7JyjJX464Im0aibYFhZrYr8ygEIl4yMqGn70Zh/sZ72Z/FdBlml0Xo558ax9zaQJFtBKeBXIqRhAQ78O6OxiPJ1koDURHIOdD/IU5Q8euYGtToR/B1YEwXjpPhJ9zfbaBXYJR8CM82zCULv/cgeNQ2wiXgS+pBW6RcbGKLhxUhIjb24FwECtrDJlUXlvWVnAE510sItWO2JAuEMnARCmtDHKq641Lpb+WeNGkr7SfaX3466hRIP/wmIQtBPnaNaY7jTzg4x8RXWQrSn7StBnDjk6fP4x801viwY70LnPEr0EoA8XR6wWwtNna31+K++UwyjKBACoKZPgj3Y9mVsDSugs4qvwOmpwCMbtQwS81YiZKLbiehj9iEUrLhZ6yhP8cXILrov3lTiKy0feDCUAREghRM6wP+ZUQiwmgpEDtXWseDEqlSkMdV4fQ19C58md0RykLKLB3P7AJMDnybqN9zkpnqPg6QHWnvPfhB6VA3OZ2Vi9ZIkxSRS/y6WT/UtDMQd1H5mWCcEkN3FzY5u1htBX6XODy5IWAwF5LDCDrY1tleNm1umH0Oh5eE89acBCMk=" diff --git a/README.md b/README.md index 4355d09..a6d1a47 100755 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ For subsequent runs, you will not be prompted to redo the license setup when cal docker start -ai myjupyterq -**N.B.** [instructions regarding headless/presets are available](https://github.com/KxSystems/embedPy#headlesspresets) +**N.B.** [instructions regarding headless/presets are available](https://github.com/KxSystems/embedPy/docker/README.md#headlesspresets) **N.B.** [build instructions for the image are available](docker/README.md) diff --git a/docker/README.md b/docker/README.md index a3777d3..5953c35 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,13 +1,6 @@ -This project builds the Docker image. +The instructions below are for building your own Docker image. A prebuilt Docker image is available on Docker Cloud, if you only want to run the jupyterq image then install Docker and [read the instructions on the main page](../README.md#docker) on how to do this. -## Related Links - - * [Docker](https://docker.com) - * [`Dockerfile`](https://docs.docker.com/engine/reference/builder/) - * [Automated Builds](https://docs.docker.com/docker-cloud/builds/automated-build/) - * [Advanced options for Autobuild and Autotest](https://docs.docker.com/docker-cloud/builds/advanced/) - -# Preflight +## Preflight You will need [Docker installed](https://www.docker.com/community-edition) on your workstation; make sure it is a recent version. @@ -15,49 +8,35 @@ Check out a copy of the project with: git clone https://github.com/KxSystems/jupyterq.git -# Deploy +## Building -[Docker Cloud](https://cloud.docker.com/) is configured to monitor when tags of the format `/^[0-9.]+/` are added to the [GitHub hosted project](https://github.com/KxSystems/jupyterq), a corresponding Docker image file is generated and made available. +To build the project locally you run: -This is all done server side as the resulting image is north of 2.5GB and uploading that sort of thing is likely to prompt the network team to Release the Kraken! + docker build -t jupyterq -f docker/Dockerfile . -To do a deploy, you simply tag and push your releases as usual: +Once built, you should have a local `jupyterq` image, you can run the following to use it: - git push - git tag 0.7 - git push --tag + docker run -it jupyterq -## First Time Configuration - 1. Log into [Docker Cloud](https://cloud.docker.com/) - 1. Create the new repository called `jupyterq` - 1. Go to the 'Builds' tab - 1. Set the 'Source Repository' to the GitHub account 'KxSystems' and project `jupyterq` - 1. Set the 'Build Rules' to: - * **Source Type:** Tag - * **Source:** `/^[0-9.]+/` - * **Docker Tag:** `{sourceref}` - * **Dockerfile location:** `docker/Dockerfile` - * **Build Context:** `/` - * **Autobuild:** enabled - * **Build Caching:** disabled (Docker Cloud is *really* buggy, `nocache=1` as a build env may help) - 1. Click on the 'Save' button +**N.B.** if you wish to use an alternative source for [embedPy](https://github.com/KxSystems/embedPy) then you can append `--build-arg embedpy_img=embedpy` to your argument list. -If you prefer to not have Docker Cloud build on every tag push, you can alternatively: +Other build arguments are supported and you should browse the `Dockerfile` to see what they are. - 1. Under 'Build Rules' disable 'Autobuild' - 1. Click on 'Save' - 1. At the bottom of the configuration page under 'Build triggers', create a URL that you can use to fire off a build +# Deploy -You should now be able to call `curl` on the supplied URL to trigger the build, sparing you from having to log in to click a button. +[travisCI](https://travis-ci.org/) is configured to monitor when tags of the format `/^[0-9]+\./` are added to the [GitHub hosted project](https://github.com/KxSystems/jupyterq), a corresponding Docker image is generated and made available on [Docker Cloud](https://cloud.docker.com/) -# Build +This is all done server side as the resulting image is large. -To build locally the project you run: +To do a deploy, you simply tag and push your releases as usual: - docker build -t jupyterq -f docker/Dockerfile . + git push + git tag 0.7 + git push --tag -**N.B.** if you wish to use an alternative source for [embedPy](https://github.com/KxSystems/embedPy) then you can append `--build-arg embedpy_img=embedpy` to your argument list. -Other build arguments are supported and you should browse the `Dockerfile` to see what they are, but note for Docker Cloud you will need to make sure they are also explicitly exported in [`docker/hooks/build`](hooks/build) too. +## Related Links + * [Docker](https://docker.com) + * [`Dockerfile`](https://docs.docker.com/engine/reference/builder/)