-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test and document Docker deployments on user workstations #836
Comments
There is an issue with deploying on MacOS. Here is the environment:
I clone the github repo, pull the images and deploy the web app. The unix
It will take several more minutes to load initial data into the default database and run all the tests. The log output may be monitored with
The local stoqs web app is now available at https://localhost. Note that you'll need to enter a security exception in your bowser to open the page:
However, a problem arises when we try and restart our docker containers. The problem on the Mac is related to how the postgres data volumes are mounted in the container and the permissions needed inside the container. The details are spelled out in the next Comment on this Issue. |
With
The
and with the postgis database container not running the whole STOQS app does not work. We do not encounter this problem when deploying on Linux servers or workstations. |
There seems to be some hope in setting the user of the postgis container using --user option as documented for the postgres image. Maybe with this we can match the user id of the Mac host with the user id in the postgis container. |
Here are the steps to test various settings to get STOQS to work in Docker on a Mac:
In $STOQS_HOME/docker edit the
where
The log window will show the services restarting and instead of seeing something like repeated
You'll see successful database connection log messages and eventually a running web service at https://localhost. One can iterate on these steps making edits to the files that compose the STOQS application and monitoring the log output until the configuration is successful. |
With the PR #838 I'm able to run and restart my Docker containers on MacOS. Here are the diffs of the files that need to be changed following cloning the repository on MacOS: git diff
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index 7d23d994..f171564f 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -19,7 +19,7 @@ services:
ports:
- "${STOQS_PGHOST_PORT}:5432"
# Set user for deployment on MacOS, assign HOST_ID=<result of `id -u`> in your .env file
- ##user: ${HOST_UID}
+ user: ${HOST_UID}
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- STOQSADM_PASSWORD=${STOQSADM_PASSWORD}
diff docker/template.env docker/.env
16c16
< STOQS_HOME=/vagrant/dev/stoqsgit
---
> STOQS_HOME=/Users/mccann/GitHub/stoqsgit
19c19
< ##HOST_UID=
---
> HOST_UID=399
43c43
< ##CAMPAIGNS_MODULE=stoqs/mbari_campaigns.py
---
> CAMPAIGNS_MODULE=stoqs/mbari_campaigns.py |
This is the result from running this test on a custom desktop workstation OS: Ubuntu 18.04.1 The only thing I did differently from above was I ran docker-compose up without the -d switch to measure the time it took to create the databases, I had to manually exit out with CTRL+C once I saw NGINX was running so this time may be slightly increased from actual run time. mkdir /tmp/git
cd /tmp/git
time git clone https://github.com/stoqs/stoqs.git stoqsgit
Cloning into 'stoqsgit'...
remote: Enumerating objects: 1081, done.
remote: Counting objects: 100% (1081/1081), done.
remote: Compressing objects: 100% (144/144), done.
remote: Total 58937 (delta 985), reused 1020 (delta 937), pack-reused 57856
Receiving objects: 100% (58937/58937), 197.46 MiB | 8.42 MiB/s, done.
Resolving deltas: 100% (44845/44845), done.
Checking out files: 100% (26469/26469), done.
real 0m26.103s
user 0m9.998s
sys 0m3.263s
# Created STOQS_HOME variable
export STOQS_HOME=/tmp/git/stoqsgit
cd $STOQS_HOME/docker
# Setup .env set STOQS_HOME directory and uncommented CAMPAIGNS_MODULE
cp template.env .env
vi .env
# Output omitted
time docker-compose pull
# Output omitted
real 5m6.275s
user 0m1.388s
sys 0m0.160s
time docker-compose up
# Output omitted
real 6m31.452s
user 0m2.609s
sys 0m0.893s |
Deploying STOQS in production on Linux based hosted servers is documented in the README.md. (These are the instructions followed to deploy MBARI's public STOQS server).
In order to better support use and understanding of oceanographic data we'd also like to provide instructions for scientists to operate with STOQS installed on their own workstations. This would give them the ability to load databases, and perform data science operations, and generate visualizations on their own campaign data.
The workstation installation instructions need to be tested on MacOS, Windows, and Linux.
The text was updated successfully, but these errors were encountered: