-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Datastore+Tracingstore Standalone Deployment Templates (#3424)
* update datastore+tracingstore standalone deployment templates * Update docker-compose.yml
- Loading branch information
Showing
10 changed files
with
205 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Deployment | ||
|
||
## Requirements | ||
* Linux (we have good experiences with Ubuntu and Debian, but others should work as well) | ||
* a recent versions of docker & docker-compose | ||
* Public domain name with SSL certificate | ||
|
||
## Prepare file system | ||
webKnossos expects the following file structure: | ||
``` | ||
docker-compose.yml | ||
fossildb/ | ||
data/ | ||
backup/ | ||
config/ | ||
tmp/ | ||
``` | ||
Ensure that all those directories have the correct access rights. | ||
|
||
## Add the `deployment` files | ||
Copy the files from the `deployment` folder to `/usr/lib/webknossos-tracingstore` and customize the files in the `config` subfolder. | ||
|
||
## Manage the webknossos-tracingstore service | ||
Depending on you Linux distribution, the service unit file should be linked to `/lib/systemd/system/webknossos-tracingstore.service` or `/usr/lib/systemd/system/webknossos-tracingstore.service`. | ||
Usage: | ||
|
||
``` | ||
# Reload configuration | ||
systemctl daemon-reload | ||
# Enable for auto-start | ||
systemctl enable webknossos-tracingstore | ||
systemctl start webknossos-tracingstore | ||
systemctl stop webknossos-tracingstore | ||
``` | ||
|
||
## Using a cluster proxy/firewall for HTTP(S) routing | ||
If your cluster enviroment has a firewall that supports HTTP(S) routing, you can expose the tracingstore directly on Port 80. | ||
|
||
## Using nginx for HTTP(S) routing | ||
Nginx is a high performance HTTP server that allows for proxing HTTP(S) request. This is useful, because the tracingstore doesn't support HTTPS by itself. So, you can put the nginx in front of the tracingstore to accept HTTPS requests from the outside and route them as regular HTTP requests to the tracingstore. | ||
|
||
[DigitalOcean has a great tutorial for setting up nginx](https://www.digitalocean.com/community/tutorials/understanding-nginx-http-proxying-load-balancing-buffering-and-caching). | ||
|
||
We use the free and automatad [Letsencrypt](https://letsencrypt.org/) service for our SSL certificates. [Tutorial: Setting up Letsencrypt with nginx](https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04). | ||
|
||
Example configuration: | ||
``` | ||
upstream webknossos-tracingstore-0 { | ||
server localhost:9090; | ||
} | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
server_name tracingstore-0.mylab.com; | ||
# For Letsencrypt | ||
location ~ /.well-known/ { | ||
root /usr/share/nginx/html; | ||
allow all; | ||
break; | ||
} | ||
return 301 https://$server_name$request_uri; | ||
} | ||
server { | ||
listen 443 ssl; | ||
listen [::]:443 ssl; | ||
server_name tracingstore-0.mylab.com; | ||
access_log /var/log/nginx/tracingstore-0.mylab.com.access.log; | ||
error_log /var/log/nginx/tracingstore-0.mylab.com.error.log debug; | ||
rewrite_log on; | ||
# For Letsencrypt | ||
location ~ /.well-known/ { | ||
root /usr/share/nginx/html; | ||
allow all; | ||
} | ||
ssl on; | ||
ssl_certificate /etc/letsencrypt/live/tracingstore-0.mylab.com/fullchain.pem; | ||
ssl_certificate_key /etc/letsencrypt/live/tracingstore-0.mylab.com/privkey.pem; | ||
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; | ||
ssl_ciphers HIGH:!aNULL:!MD5; | ||
client_max_body_size 0; | ||
location / { | ||
proxy_pass http://webknossos-tracingstore-0; | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
DATASTORE_TAG=master | ||
DATASTORE_PORT=9090 | ||
DATASTORE_DEBUG_PORT=5011 | ||
|
||
FOSSILDB_TAG=master | ||
FOSSILDB_PORT=7155 | ||
|
||
USER_UID=1000 | ||
USER_GID=1000 | ||
USER_GROUP_1=nogroup |
26 changes: 26 additions & 0 deletions
26
webknossos-tracingstore/deployment/config/tracingstore-docker.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
include "standalone-tracingstore.conf" | ||
|
||
######################################################################### | ||
# Do not change the ports, they are only used inside the containers. # | ||
# To change the ports on the host, change them in the environment file. # | ||
######################################################################### | ||
|
||
http { | ||
uri = "localhost" # TODO | ||
port = 9090 | ||
} | ||
|
||
tracingstore { | ||
key = "70d1" # TODO | ||
name = "mytracingstore" # TODO | ||
|
||
oxalis { | ||
uri = "localhost:9000" # TODO | ||
secured = false # TODO | ||
} | ||
|
||
fossildb { | ||
address = "fossildb" | ||
port = 7155 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
version: '2.1' | ||
|
||
services: | ||
webknossos-tracingstore: | ||
image: scalableminds/webknossos-tracingstore:${DATASTORE_TAG} | ||
entrypoint: bin/webknossos-tracingstore | ||
command: | ||
- -J-Xmx20G | ||
- -J-Xms1G | ||
- -J-XX:+UseG1GC | ||
- -jvm-debug | ||
- "5011" | ||
- -Dconfig.file=conf/docker.conf | ||
- $DATASTORE_ARGS_1 | ||
- $DATASTORE_ARGS_2 | ||
links: | ||
- fossildb | ||
ports: | ||
- $TRACINGSTORE_PORT:9090 | ||
- $TRACINGSTORE_DEBUG_PORT:5011 | ||
user: $USER_UID:$USER_GID | ||
group_add: | ||
- $USER_GROUP_1 | ||
- $USER_GROUP_2 | ||
volumes: | ||
- ./tmp:/tmp | ||
- ./config/tracingstore-docker.conf:/srv/webknossos-tracingstore/conf/docker.conf | ||
environment: | ||
- NEW_RELIC_LICENSE_KEY | ||
- NEW_RELIC_APP_NAME | ||
|
||
fossildb: | ||
image: scalableminds/fossildb:${FOSSILDB_TAG} | ||
command: | ||
- fossildb | ||
- -c | ||
- skeletons,skeletonUpdates,volumes,volumeData,volumeUpdates | ||
ports: | ||
- $FOSSILDB_PORT:7155 | ||
user: $USER_UID:$USER_GID | ||
group_add: | ||
- $USER_GROUP_1 | ||
volumes: | ||
- "./fossildb/data:/fossildb/data" | ||
- "./fossildb/backup:/fossildb/backup" | ||
|
||
fossildb-backup: | ||
image: scalableminds/fossildb-client:${FOSSILDB_TAG} | ||
command: | ||
- fossildb | ||
- backup | ||
links: | ||
- fossildb |
14 changes: 14 additions & 0 deletions
14
webknossos-tracingstore/deployment/webknossos-tracingstore.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=webKnossos tracingstore | ||
Requires=docker.service | ||
After=docker.service | ||
|
||
[Service] | ||
Restart=always | ||
RestartSec=3 | ||
WorkingDirectory=/usr/lib/webknossos-tracingstore | ||
EnvironmentFile=/usr/lib/webknossos-tracingstore/config/environment | ||
ExecStart=/usr/local/bin/docker-compose up --force-recreate --abort-on-container-exit -t 2 fossildb webknossos-tracingstore | ||
|
||
[Install] | ||
WantedBy=default.target |