diff --git a/doc/DEPLOYMENT.md b/doc/DEPLOYMENT.md index 600d091e..8cc93263 100644 --- a/doc/DEPLOYMENT.md +++ b/doc/DEPLOYMENT.md @@ -1,6 +1,6 @@ # Deployment -So you've got STF running via `stf local` and now you'd like to deploy it to real servers. While there are of course various ways to set everything up, this document will focus on a [systemd](http://www.freedesktop.org/wiki/Software/systemd/) + [Docker](https://www.docker.com/) deployment. Even if you've got a different setup, you should be able to use the configuration files as a rough guide. You can also check some [Setup Examples](https://github.com/openstf/setup-examples) which uses [Vagrant](https://www.vagrantup.com/) and [Virtual Box](https://www.virtualbox.org/) to create a virtual setup. But before going there, it is highly recommended that you read this document thoroughly. +So you've got STF running via `stf local` and now you'd like to deploy it to real servers. While there are of course various ways to set everything up, this document will focus on a [systemd](http://www.freedesktop.org/wiki/Software/systemd/) + [Docker](https://www.docker.com/) deployment. Even if you've got a different setup, you should be able to use the configuration files as a rough guide. You can also check some [Setup Examples](https://github.com/devicefarmer/setup-examples) which uses [Vagrant](https://www.vagrantup.com/) and [Virtual Box](https://www.virtualbox.org/) to create a virtual setup. But before going there, it is highly recommended that you read this document thoroughly. STF consists of multiple independent processes communicating via [ZeroMQ](http://zeromq.org/) and [Protocol Buffers](https://github.com/google/protobuf). We call each process a "unit" to match systemd terminology. @@ -18,7 +18,7 @@ For this example deployment, the following assumptions will be made. You will ne * You have [Docker](https://www.docker.com/) running on each host * Each host has an `/etc/environment` (a la [CoreOS](https://coreos.com/)) file with `COREOS_PRIVATE_IPV4=MACHINE_IP_HERE`. This is used to load the machine IP address in configuration files. - You can create the file yourself or alternatively replace `${COREOS_PRIVATE_IPV4}` manually as required. -* You're deploying [openstf/stf:latest](https://registry.hub.docker.com/u/openstf/stf/). There's also a fixed tag for each release if you're feeling less adventurous. +* You're deploying [devicefarmer/stf:latest](https://registry.hub.docker.com/u/devicefarmer/stf/). There's also a fixed tag for each release if you're feeling less adventurous. * You want to access the app at https://stf.example.org/. Change to the actual URL you want to use. * You have RethinkDB running on `rethinkdb.stf.example.org`. Change to the actual address/IP where required. - You may also use SRV records by giving the url in `srv+tcp://rethinkdb-28015.skydns.stf.example.org` format. @@ -76,7 +76,7 @@ These external units are required for the actual STF units to work. You need to have a single `adbd.service` unit running on each host where you have devices connected. -The docker container comes with a default, insecure ADB key for convenience purposes, so that you won't have to accept a new ADB key on your devices each time the unit restarts. This is insecure because anyone in possession of the insecure key will then be able to access your device without any prompt, assuming they have physical access to it. This may or may not be a problem for you. See [sorccu/adb](https://registry.hub.docker.com/u/sorccu/adb/) for more information if you'd like to provide your own keys. +The docker container comes with a default, insecure ADB key for convenience purposes, so that you won't have to accept a new ADB key on your devices each time the unit restarts. This is insecure because anyone in possession of the insecure key will then be able to access your device without any prompt, assuming they have physical access to it. This may or may not be a problem for you. See [devicefarmer/adb](https://registry.hub.docker.com/u/devicefarmer/adb/) for more information if you'd like to provide your own keys. ```ini [Unit] @@ -88,7 +88,7 @@ Requires=docker.service TimeoutStartSec=0 Restart=always RestartSec=3 -ExecStartPre=/usr/bin/docker pull sorccu/adb:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/adb:latest ExecStartPre=-/usr/bin/docker kill %p ExecStartPre=-/usr/bin/docker rm %p ExecStart=/usr/bin/docker run --rm \ @@ -96,7 +96,7 @@ ExecStart=/usr/bin/docker run --rm \ --privileged \ -p 5037:5037 \ -v /dev/bus/usb:/dev/bus/usb \ - sorccu/adb:latest + devicefarmer/adb:latest ExecStop=/usr/bin/docker exec %p adb kill-server ``` @@ -168,7 +168,7 @@ Requires=docker.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/ambassador:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/ambassador:latest ExecStartPre=-/usr/bin/docker kill %p ExecStartPre=-/usr/bin/docker rm %p ExecStart=/usr/bin/docker run --rm \ @@ -176,7 +176,7 @@ ExecStart=/usr/bin/docker run --rm \ -e "AUTHKEY=YOUR_RETHINKDB_AUTH_KEY_HERE_IF_ANY" \ -p 28015 \ -e RETHINKDB_PORT_28015_TCP=tcp://rethinkdb.stf.example.org:28015 \ - openstf/ambassador:latest + devicefarmer/ambassador:latest ExecStop=-/usr/bin/docker stop -t 10 %p ``` @@ -202,7 +202,7 @@ BindsTo=rethinkdb-proxy-28015.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p-%i ExecStartPre=-/usr/bin/docker rm %p-%i ExecStart=/usr/bin/docker run --rm \ @@ -210,7 +210,7 @@ ExecStart=/usr/bin/docker run --rm \ --link rethinkdb-proxy-28015:rethinkdb \ -e "SECRET=YOUR_SESSION_SECRET_HERE" \ -p %i:3000 \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf app --port 3000 \ --auth-url https://stf.example.org/auth/mock/ \ --websocket-url wss://stf.example.org/ @@ -241,14 +241,14 @@ Requires=docker.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p-%i ExecStartPre=-/usr/bin/docker rm %p-%i ExecStart=/usr/bin/docker run --rm \ --name %p-%i \ -e "SECRET=YOUR_SESSION_SECRET_HERE" \ -p %i:3000 \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf auth-mock --port 3000 \ --app-url https://stf.example.org/ ExecStop=-/usr/bin/docker stop -t 10 %p-%i @@ -274,7 +274,7 @@ Requires=docker.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p-%i ExecStartPre=-/usr/bin/docker rm %p-%i ExecStart=/usr/bin/docker run --rm \ @@ -288,7 +288,7 @@ ExecStart=/usr/bin/docker run --rm \ -e "OAUTH_CALLBACK_URL=https://stf.example.org/auth/oauth/callback" \ -e "OAUTH_SCOPE=openid email" \ -p %i:3000 \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf auth-oauth2 --port 3000 \ --app-url https://stf.example.org/ ExecStop=-/usr/bin/docker stop -t 10 %p-%i @@ -318,7 +318,7 @@ Requires=docker.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p-%i ExecStartPre=-/usr/bin/docker rm %p-%i ExecStart=/usr/bin/docker run --rm \ @@ -329,7 +329,7 @@ ExecStart=/usr/bin/docker run --rm \ -e "SAML_ID_PROVIDER_ISSUER=YOUR_ID_PROVIDER_ISSUER" \ -e "SAML_ID_PROVIDER_CERT_PATH=/etc/id_provider.cert" \ -p %i:3000 \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf auth-saml2 --port 3000 \ --app-url https://stf.example.org/ ExecStop=-/usr/bin/docker stop -t 10 %p-%i @@ -356,7 +356,7 @@ BindsTo=rethinkdb-proxy-28015.service [Service] EnvironmentFile=/etc/environment Type=oneshot -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p ExecStartPre=-/usr/bin/docker rm %p ExecStart=/usr/bin/docker run --rm \ @@ -365,7 +365,7 @@ ExecStart=/usr/bin/docker run --rm \ -e "STF_ROOT_GROUP_NAME=YOUR_ROOT_GROUP_NAME_HERE" \ -e "STF_ADMIN_NAME=YOUR_ADMIN_NAME_HERE" \ -e "STF_ADMIN_EMAIL=YOUR_ADMIN_EMAIL_HERE" \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf migrate ``` @@ -387,13 +387,13 @@ BindsTo=rethinkdb-proxy-28015.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p-%i ExecStartPre=-/usr/bin/docker rm %p-%i ExecStart=/usr/bin/docker run --rm \ --name %p-%i \ --link rethinkdb-proxy-28015:rethinkdb \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf processor %p-%i \ --connect-app-dealer tcp://appside.stf.example.org:7160 \ --connect-dev-dealer tcp://devside.stf.example.org:7260 @@ -427,14 +427,14 @@ EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always RestartSec=3 -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p-%i ExecStartPre=-/usr/bin/docker rm %p-%i ExecStart=/usr/bin/docker run --rm \ --name %p-%i \ --link adbd:adbd \ -p 15000-25000:15000-25000 \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf provider \ --name "%H/%i" \ --connect-sub tcp://devside.stf.example.org:7250 \ @@ -467,13 +467,13 @@ BindsTo=rethinkdb-proxy-28015.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p ExecStartPre=-/usr/bin/docker rm %p ExecStart=/usr/bin/docker run --rm \ --name %p \ --link rethinkdb-proxy-28015:rethinkdb \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf reaper dev \ --connect-push tcp://devside.stf.example.org:7270 \ --connect-sub tcp://appside.stf.example.org:7150 \ @@ -499,13 +499,13 @@ Requires=docker.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p-%i ExecStartPre=-/usr/bin/docker rm %p-%i ExecStart=/usr/bin/docker run --rm \ --name %p-%i \ -p %i:3000 \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf storage-plugin-apk --port 3000 \ --storage-url https://stf.example.org/ ExecStop=-/usr/bin/docker stop -t 10 %p-%i @@ -529,13 +529,13 @@ Requires=docker.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p-%i ExecStartPre=-/usr/bin/docker rm %p-%i ExecStart=/usr/bin/docker run --rm \ --name %p-%i \ -p %i:3000 \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf storage-plugin-image --port 3000 \ --storage-url https://stf.example.org/ ExecStop=-/usr/bin/docker stop -t 10 %p-%i @@ -555,7 +555,7 @@ Requires=docker.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p-%i ExecStartPre=-/usr/bin/docker rm %p-%i ExecStartPre=/bin/mkdir -p /mnt/storage @@ -564,7 +564,7 @@ ExecStart=/usr/bin/docker run --rm \ --name %p-%i \ -v /mnt/storage:/data \ -p %i:3000 \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf storage-temp --port 3000 \ --save-dir /data ExecStop=-/usr/bin/docker stop -t 10 %p-%i @@ -588,13 +588,13 @@ Requires=docker.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p ExecStartPre=-/usr/bin/docker rm %p ExecStart=/usr/bin/docker run --rm \ --name %p \ --net host \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf triproxy app \ --bind-pub "tcp://*:7150" \ --bind-dealer "tcp://*:7160" \ @@ -620,13 +620,13 @@ Requires=docker.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p ExecStartPre=-/usr/bin/docker rm %p ExecStart=/usr/bin/docker run --rm \ --name %p \ --net host \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf triproxy dev \ --bind-pub "tcp://*:7250" \ --bind-dealer "tcp://*:7260" \ @@ -654,7 +654,7 @@ BindsTo=rethinkdb-proxy-28015.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p-%i ExecStartPre=-/usr/bin/docker rm %p-%i ExecStart=/usr/bin/docker run --rm \ @@ -662,7 +662,7 @@ ExecStart=/usr/bin/docker run --rm \ --link rethinkdb-proxy-28015:rethinkdb \ -e "SECRET=YOUR_SESSION_SECRET_HERE" \ -p %i:3000 \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf websocket --port 3000 \ --storage-url https://stf.example.org/ \ --connect-sub tcp://appside.stf.example.org:7150 \ @@ -688,7 +688,7 @@ BindsTo=rethinkdb-proxy-28015.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p-%i ExecStartPre=-/usr/bin/docker rm %p-%i ExecStart=/usr/bin/docker run --rm \ @@ -696,7 +696,7 @@ ExecStart=/usr/bin/docker run --rm \ --link rethinkdb-proxy-28015:rethinkdb \ -e "SECRET=YOUR_SESSION_SECRET_HERE" \ -p %i:3000 \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf api --port 3000 \ --connect-sub tcp://appside.stf.example.org:7150 \ --connect-push tcp://appside.stf.example.org:7170 \ @@ -731,14 +731,14 @@ BindsTo=rethinkdb-proxy-28015.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p ExecStartPre=-/usr/bin/docker rm %p ExecStart=/usr/bin/docker run --rm \ --name %p \ --link rethinkdb-proxy-28015:rethinkdb \ -e "SECRET=YOUR_SESSION_SECRET_HERE" \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf groups-engine \ --connect-sub tcp://appside.stf.example.org:7150 \ --connect-push tcp://appside.stf.example.org:7170 \ @@ -769,13 +769,13 @@ BindsTo=rethinkdb-proxy-28015.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p ExecStartPre=-/usr/bin/docker rm %p ExecStart=/usr/bin/docker run --rm \ --name %p \ --link rethinkdb-proxy-28015:rethinkdb \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf log-rethinkdb \ --connect-sub tcp://appside.stf.example.org:7150 ExecStop=-/usr/bin/docker stop -t 10 %p @@ -799,14 +799,14 @@ BindsTo=docker.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p ExecStartPre=-/usr/bin/docker rm %p ExecStart=/usr/bin/docker run --rm \ --name %p \ -e "HIPCHAT_TOKEN=YOUR_HIPCHAT_TOKEN_HERE" \ -e "HIPCHAT_ROOM=YOUR_HIPCHAT_ROOM_HERE" \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf notify-hipchat \ --connect-sub tcp://appside.stf.example.org:7150 ExecStop=-/usr/bin/docker stop -t 10 %p @@ -828,14 +828,14 @@ BindsTo=docker.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p ExecStartPre=-/usr/bin/docker rm %p ExecStart=/usr/bin/docker run --rm \ --name %p \ -e "SLACK_TOKEN=YOUR_SLACK_TOKEN_HERE" \ -e "SLACK_CHANNEL=YOUR_SLACK_CHANNEL_HERE" \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf notify-slack \ --connect-sub tcp://appside.stf.example.org:7150 ExecStop=-/usr/bin/docker stop -t 10 %p @@ -859,13 +859,13 @@ Requires=docker.service EnvironmentFile=/etc/environment TimeoutStartSec=0 Restart=always -ExecStartPre=/usr/bin/docker pull openstf/stf:latest +ExecStartPre=/usr/bin/docker pull devicefarmer/stf:latest ExecStartPre=-/usr/bin/docker kill %p-%i ExecStartPre=-/usr/bin/docker rm %p-%i ExecStart=/usr/bin/docker run --rm \ --name %p-%i \ -p %i:3000 \ - openstf/stf:latest \ + devicefarmer/stf:latest \ stf storage-s3 --port 3000 \ --bucket YOUR_S3_BUCKET_NAME_HERE \ --profile YOUR_AWS_CREDENTIALS_PROFILE \