From 770c2c7e22fd03a25a27acae49aca2f850baae67 Mon Sep 17 00:00:00 2001 From: Jamie Hewland Date: Fri, 5 Aug 2016 10:57:27 +0200 Subject: [PATCH 1/2] Revert "Add updating Dockerfile version to version bumping script." This reverts commit 43980e4bd2437e7c2174780802a7e2ddece22b2c. --- utils/bump-version.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/bump-version.sh b/utils/bump-version.sh index 1077a827b..fa0bba486 100755 --- a/utils/bump-version.sh +++ b/utils/bump-version.sh @@ -22,4 +22,3 @@ inplace_sed "s/\(__version__[ ]*=[ ]*[\"']\)\(.*\)\([\"'].*\)/\1${VER}\3/" vumi/ inplace_sed "s/\(version[ ]*=[ ]*[\"']\)\(.*\)\([\"'].*\)/\1${VER}\3/" setup.py inplace_sed "s/^\(release[ ]*=[ ]*[\"']\)\(.*\)\([\"'].*\)/\1${VER}\3/" docs/conf.py inplace_sed "s/^\(version[ ]*=[ ]*[\"']\)\(.*\)\([\"'].*\)/\1${SHORT_VER}\3/" docs/conf.py -inplace_sed "s/^\(ENV [ ]*VUMI_VERSION [ ]*\"\)\([^\"]*\)\(\".*\)/\1${VER}\3/" docker/Dockerfile From 0a1d98250c0773cba7dbec71f80b31495bf05c81 Mon Sep 17 00:00:00 2001 From: Jamie Hewland Date: Fri, 5 Aug 2016 11:00:11 +0200 Subject: [PATCH 2/2] Remove Docker stuff --- docker/Dockerfile | 10 ------- docker/README.md | 60 --------------------------------------- docker/vumi-entrypoint.sh | 29 ------------------- 3 files changed, 99 deletions(-) delete mode 100644 docker/Dockerfile delete mode 100644 docker/README.md delete mode 100755 docker/vumi-entrypoint.sh diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index f9b3efb33..000000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM praekeltfoundation/python-base -MAINTAINER Praekelt Foundation - -ENV VUMI_VERSION "0.6.10" -RUN pip install vumi==$VUMI_VERSION - -COPY ./vumi-entrypoint.sh /app/vumi-entrypoint.sh -WORKDIR /app - -CMD ["/app/vumi-entrypoint.sh"] diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index cfa6ba571..000000000 --- a/docker/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# Vumi Docker image -Documentation for Vumi is available online at http://vumi.readthedocs.org/ and in the `docs` directory of the repository. - -## Usage -The Docker image provides an entrypoint for Vumi that allows the configuration of Vumi workers via environment variables. - -### Environment variables -#### Basic options: -* `TWISTD_COMMAND`: the command to pass to `twistd` (default: `vumi_worker`) -* `WORKER_CLASS`: the Vumi worker class to use -* `CONFIG_FILE`: the path to the YAML configuration file to use -* `SENTRY_DSN`: the Sentry DSN to use for reporting errors - -#### AMQP options: -AMQP/RabbitMQ options can be set via environment variables. At a minimum, the `AMQP_HOST` variable must be set or else none of the other AMQP variables will take effect. -* `AMQP_HOST`: the address for the RabbitMQ server -* `AMQP_PORT`: the port for the RabbitMQ server (default: `5672`) -* `AMQP_VHOST`: the name of the RabbitMQ vhost to use (default: `/`) -* `AMQP_USERNAME`: the username to authenticate with RabbitMQ (default: `guest`) -* `AMQP_PASSWORD`: the password to authenticate with RabbitMQ (default: `guest`) - -#### `VUMI_OPT_` options -Additional options can be passed to Vumi via variables that start with `VUMI_OPT_`. These variables will be converted to `--set-option` CLI options. For example, the environment variable `VUMI_OPT_BUCKET=1` will result in the CLI option `--set-option=bucket:1`. - -### `/app` directory -The `/app` directory is created and set as the current working directory. This is the directory where the files (e.g. YAML config) for your application should be put. - -### Examples -Running a built-in worker class without a config file: -```shell -docker run --rm -it \ - -e WORKER_CLASS=vumi.blinkenlights.MetricTimeBucket \ - -e AMQP_HOST=rabbitmq.service.consul \ - -e VUMI_OPT_BUCKETS=3 \ - -e VUMI_OPT_BUCKET_SIZE=10 \ - praekeltfoundation/vumi -``` - -Dockerfile for an image with an external worker class and a config file: -```dockerfile -FROM praekeltfoundation/vumi -RUN pip install vumi-http-api -COPY ./my-config.yaml /app/my-config.yaml -ENV WORKER_CLASS="vumi_http_api.VumiApiWorker" \ - CONFIG_FILE="my-config.yaml" \ - AMQP_HOST="rabbitmq.service.consul" -EXPOSE 8000 -``` - -Dockerfile for an image with custom arguments: -```dockerfile -FROM praekeltfoundation/vumi -RUN pip install go-metrics-api -COPY ./my-config.yaml /app/my-config.yaml -ENV TWISTD_COMMAND="cyclone" -EXPOSE 8000 -CMD ["--app", "go_metrics.server.MetricsApi", \ - "--port", "8000", \ - "--app-opts", "my-config.yaml"] -``` diff --git a/docker/vumi-entrypoint.sh b/docker/vumi-entrypoint.sh deleted file mode 100755 index fb601354e..000000000 --- a/docker/vumi-entrypoint.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -set -e - -TWISTD_COMMAND="${TWISTD_COMMAND:-vumi_worker}" - -WORKER_CLASS_OPT="${WORKER_CLASS:+--worker-class $WORKER_CLASS}" -CONFIG_OPT="${CONFIG_FILE:+--config $CONFIG_FILE}" - -AMQP_OPTS="" -if [[ -n "$AMQP_HOST" ]]; then - AMQP_OPTS="--hostname $AMQP_HOST \ - --port ${AMQP_PORT:-5672} \ - --vhost ${AMQP_VHOST:-/} \ - --username ${AMQP_USERNAME:-guest} \ - --password ${AMQP_PASSWORD:-guest}" -fi - -SENTRY_OPT="${SENTRY_DSN:+--sentry $SENTRY_DSN}" - -SET_OPTS=$(env | grep ^VUMI_OPT_ | sed -e 's/^VUMI_OPT_//' -e 's/=/ /' | awk '{printf("%s=%s:%s ", "--set-option", tolower($1), $2);}') - -exec twistd --nodaemon \ - $TWISTD_COMMAND \ - $WORKER_CLASS_OPT \ - $CONFIG_OPT \ - $AMQP_OPTS \ - $SENTRY_OPT \ - $SET_OPTS \ - "$@"