From f321ea07b9571a2f0a935a6173cd13eed33501cc Mon Sep 17 00:00:00 2001 From: yaskoo Date: Fri, 10 May 2019 16:54:57 +0300 Subject: [PATCH] add deployment requirements to readme * add necessary information for deploy preparations to readme * add service dependency variables in compose file and dependency wait script * fix wso2is image to not use internal addresses for resource download github: #2 --- 0-wait-dependencies.sh | 14 ++++++++ README.md | 34 +++++++++++++++--- docker-stack.yml | 18 +++++++--- docker/sep-wso2is/Dockerfile | 6 ++-- .../patch0009/javax.cache.wso2-4.2.0.jar | Bin 0 -> 80322 bytes ...rg.wso2.carbon.identity.sso.saml-4.2.3.jar | Bin 0 -> 1048591 bytes 6 files changed, 61 insertions(+), 11 deletions(-) create mode 100755 0-wait-dependencies.sh create mode 100644 docker/sep-wso2is/patch0009/javax.cache.wso2-4.2.0.jar create mode 100644 docker/sep-wso2is/patch0009/org.wso2.carbon.identity.sso.saml-4.2.3.jar diff --git a/0-wait-dependencies.sh b/0-wait-dependencies.sh new file mode 100755 index 00000000..9f52b19d --- /dev/null +++ b/0-wait-dependencies.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env sh + +set -e + +if [ -n "$SERVICE_DEPENDENCIES" ]; then + + for dep in $SERVICE_DEPENDENCIES; do + + host="$(echo $dep | cut -d':' -f1)" + port="$(echo $dep | cut -d':' -f2)" + + wait-for-service.sh -h $host -p $port + done +fi diff --git a/README.md b/README.md index 7fd72cec..794a738f 100644 --- a/README.md +++ b/README.md @@ -27,18 +27,42 @@ To build all artefacts and docker images run: ./build.sh ``` -# Deploying +# Deployment -Deployment is achieve using a docker compose file. For it to work a docker swarm needs to be initialized and all required nodes to be joined in the swarm. +Deployment is achieved using a docker compose file. For it to work a docker swarm needs to be initialized and all required nodes to be joined in the swarm. Note that images need to be in a docker registry (so that docker can pull them) or to be present on all machines. -There is also a proxy service (nginx) that is used for ssl termination and to proxy most services through a single address. It requires the `NGINX_SERVER_NAME` to be set to the public hostname of the machine running it. You can either `export` it beforehand or pass it in when deploying. - For ssl to work the certificate and public key must be placed inside `/etc/sep/keystores` and be named nginx.crt and nginx.key. Also for graphdb to work you need to place your license file in `/etc/sep/licenses/graphdb.license`. +## Service placement +The compose file uses docker's placement constraints. These are labels added to a service to constrain where it could be deployed. +Before deploying you need to set the appropriate node labels to the nodes in your swarm. + +To do that - on the master node execute `docker node update --label-add