From 682aab0b30e479ea4e826f0636340bb100b36c0a Mon Sep 17 00:00:00 2001 From: drebs Date: Tue, 26 Jul 2016 13:44:50 -0300 Subject: [test] add custom couchdb docker image --- scripts/docker/Makefile | 6 +++--- scripts/docker/README.md | 14 +++++++++----- scripts/docker/couchdb/Dockerfile | 3 +++ scripts/docker/couchdb/Makefile | 4 ++++ scripts/docker/couchdb/README.rst | 12 ++++++++++++ scripts/docker/couchdb/local.ini | 2 ++ 6 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 scripts/docker/couchdb/Dockerfile create mode 100644 scripts/docker/couchdb/Makefile create mode 100644 scripts/docker/couchdb/README.rst create mode 100644 scripts/docker/couchdb/local.ini (limited to 'scripts') diff --git a/scripts/docker/Makefile b/scripts/docker/Makefile index 4b4d4496..1bb57757 100644 --- a/scripts/docker/Makefile +++ b/scripts/docker/Makefile @@ -33,7 +33,7 @@ soledad-image: docker build -t $(IMAGE_NAME) . couchdb-image: - docker pull couchdb + (cd couchdb/ && make) ################################################## # Run a Soledad Server inside a docker container # @@ -77,7 +77,7 @@ run-client-bootstrap: run-tox: name=$$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 5 | head -n 1); \ - docker run -d --name $${name} couchdb; \ + docker run -d --name $${name} leap/couchdb; \ docker run -t -i \ --memory="$(MEMORY)" \ --env="SOLEDAD_REMOTE=$(SOLEDAD_REMOTE)" \ @@ -93,7 +93,7 @@ run-tox: run-perf: name=$$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 5 | head -n 1); \ - docker run -d --name $${name} couchdb; \ + docker run -d --name $${name} leap/couchdb; \ docker run -t -i \ --memory="$(MEMORY)" \ --env="SOLEDAD_REMOTE=$(SOLEDAD_REMOTE)" \ diff --git a/scripts/docker/README.md b/scripts/docker/README.md index fda1c04a..97b39f87 100644 --- a/scripts/docker/README.md +++ b/scripts/docker/README.md @@ -11,16 +11,20 @@ Check the `Dockerfile` for the steps for creating the docker image. Check the `Makefile` for the rules for running containers. -Check the `helper/` directory for scripts that help running tests. - Installation ------------ -0. update and install 1. Install docker for your system: https://docs.docker.com/ -2. Build the image by running `make` -3. Use one of the scripts in the `helper/` directory +2. Build images by running `make` +3. Execute `make run-tox` and `make run-perf` to run tox tests and perf tests, + respectivelly. +4. You may want to pass some variables to the `make` command to control + parameters of execution, for example: + + make run-perf SOLEDAD_PRELOAD_NUM=500 + + See more variables below. Environment variables for docker containers diff --git a/scripts/docker/couchdb/Dockerfile b/scripts/docker/couchdb/Dockerfile new file mode 100644 index 00000000..03448da5 --- /dev/null +++ b/scripts/docker/couchdb/Dockerfile @@ -0,0 +1,3 @@ +FROM couchdb:latest + +COPY local.ini /usr/local/etc/couchdb/ diff --git a/scripts/docker/couchdb/Makefile b/scripts/docker/couchdb/Makefile new file mode 100644 index 00000000..cf3ac966 --- /dev/null +++ b/scripts/docker/couchdb/Makefile @@ -0,0 +1,4 @@ +IMAGE_NAME ?= leap/couchdb + +image: + docker build -t $(IMAGE_NAME) . diff --git a/scripts/docker/couchdb/README.rst b/scripts/docker/couchdb/README.rst new file mode 100644 index 00000000..31a791a8 --- /dev/null +++ b/scripts/docker/couchdb/README.rst @@ -0,0 +1,12 @@ +Couchdb Docker image +==================== + +This directory contains rules to build a custom couchdb docker image to be +provided as backend to soledad server. + +Type `make` to build the image. + +Differences between this image and the official one: + + - add the "nodelay" socket option on the httpd section of the config file + (see: https://leap.se/code/issues/8264). diff --git a/scripts/docker/couchdb/local.ini b/scripts/docker/couchdb/local.ini new file mode 100644 index 00000000..3650e0ed --- /dev/null +++ b/scripts/docker/couchdb/local.ini @@ -0,0 +1,2 @@ +[httpd] +socket_options = [{recbuf, 262144}, {sndbuf, 262144}, {nodelay, true}] -- cgit v1.2.3