Skip to content
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

Fix docker uid/gid + binaryData permissions. Persist postgres db #3428

Merged
merged 11 commits into from
Nov 12, 2018
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ binaryData
tracingData/
backup/
./data/
fossildb-dev/
boot/
.idea/
.tmp/
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md).
### Fixed

- Fixed a bug where the initial onboarding setup failed if automatic initial data was disabled. [#3421](https://github.com/scalableminds/webknossos/pull/3421)
- Fixed a permission issue in the try setup
- Fixed a bug where the guessed bounding box for datasets that do not start at (0,0,0) was too large [#3437](https://github.com/scalableminds/webknossos/pull/3437)
- Fixed a bug where dataset list refresh failed when datasets for non-existing organizations were reported. [#3438](https://github.com/scalableminds/webknossos/pull/3438)
- Fixed a bug where the form values when editing TaskTypes were missing [#3451](https://github.com/scalableminds/webknossos/pull/3451)
Expand Down
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ COPY target/universal/stage .
RUN addgroup --system --gid 999 webknossos \
&& adduser --system --uid 999 --ingroup webknossos webknossos \
&& mkdir disk \
&& chown -R webknossos .
&& chown -R webknossos . \
&& chmod go+x bin/webknossos \
&& chmod go+w .



USER webknossos

Expand Down
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# webKnossos
Cellular-resolution connectomics is currently substantially limited by the throughput and efficiency of data analysis.
Current solutions require an efficient integration of automated image analysis with massive manual data annotation.
To scale such annotation efforts it is decisive to be able to crowd source data analysis online.
Cellular-resolution connectomics is currently substantially limited by the throughput and efficiency of data analysis.
Current solutions require an efficient integration of automated image analysis with massive manual data annotation.
To scale such annotation efforts it is decisive to be able to crowd source data analysis online.
Here we present **webKnossos**.

> Boergens, Berning, Bocklisch, Bräunlein, Drawitsch, Frohnhofen, Herold, Otto, Rzepka, Werkmeister, Werner, Wiese, Wissler and Helmstaedter
webKnossos: efficient online 3D data annotation for connectomics.
> Boergens, Berning, Bocklisch, Bräunlein, Drawitsch, Frohnhofen, Herold, Otto, Rzepka, Werkmeister, Werner, Wiese, Wissler and Helmstaedter
webKnossos: efficient online 3D data annotation for connectomics.
[Nature Methods (2017) DOI:10.1038/NMETH.4331.](https://www.nature.com/articles/nmeth.4331)

![webKnossos logo](https://webknossos.brain.mpg.de/assets/images/oxalis.svg)
Expand All @@ -32,16 +32,18 @@ webKnossos: efficient online 3D data annotation for connectomics.

## Development setup
### Docker
This is the fastest way to try webKnossos.
Docker CE 17+ and Docker Compose 1.18+ is required.
This is only recommended for testing.
This is the fastest way to try webKnossos.
Docker CE 17+ and Docker Compose 1.18+ is required.
This is only recommended for testing.
[For production](https://github.com/scalableminds/webknossos/wiki/Production-setup), a more elaborate setup with persistent file mounts and HTTPS reverse proxy is recommended.

```bash
docker-compose pull webknossos
docker-compose up webknossos
./start-docker.sh
```

See the [wiki](https://github.com/scalableminds/webknossos/wiki/Try-setup) for instructions on updating this try setup.


### Dependencies

* [Oracle JDK 8+](http://www.oracle.com/technetwork/java/javase/downloads/index.html) or [Open JDK 8+](http://openjdk.java.net/) (full JDK, JRE is not enough)
Expand Down Expand Up @@ -124,18 +126,18 @@ See: http://www.scala-sbt.org/release/docs/Getting-Started/Setup.html
```bash
sbt run
```
Will fetch all Scala, Java and node dependencies and run the application on Port 9000.
Will fetch all Scala, Java and node dependencies and run the application on Port 9000.
Make sure that the PostgreSQL service is running before you start sbt.

### Run on a remote machine
```bash
sbt "run -Dhttp.uri=http://<remote address>:9000"
```
Will fetch all Scala, Java and node dependencies and run the application on Port 9000.
Will fetch all Scala, Java and node dependencies and run the application on Port 9000.
Make sure that the PostgreSQL service is running before you start sbt.

Make sure to open port `9000` in your firewall.
This is only recommended for development purposes.
Make sure to open port `9000` in your firewall.
This is only recommended for development purposes.
See below for a recommended production setup.

## Production setup
Expand Down Expand Up @@ -173,7 +175,7 @@ Contact us at [[email protected]](mailto:[email protected]).

### Thanks
* [CircleCI](https://circleci.com/gh/scalableminds/webknossos) for letting us run builds and tests on their CI
* [Browser Stack](https://www.browserstack.com/) for letting us test WebKnossos on a variety of different devices
* [Browser Stack](https://www.browserstack.com/) for letting us test WebKnossos on a variety of different devices
<a href="https://www.browserstack.com/"><img src="https://p14.zdusercontent.com/attachment/1015988/wustfygoUpQ0faC7tIiaOpJUM?token=eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0..TpDEVjDPeSTDWdmL0pu6Mw.pdawodFlbAuP4ZbKn5Ucpyq69pCh3bUXv_XH_yJk7CdAzi6IIi7Az6VWriflXVKOyTWtqA8JkxqPu11s9R56jC2I5JwCc1DJILtD_j9fT4rAIth-hvnST0eA_LqBdXpRYKMHtxookA-dZ9pbvHBTFb-JG2PEKl1IXZCw5GlIRgW2Oxieg9xXtFpBN7R6_Q5yRiwuviemrK0ide1ygC8HTMDgdgdbCLuhHDDeNyluU7tR9kVtV7KZDsVd2WIBId-fSyzInofDhlk196_fHwR0WQd1pN7GDVIdfRhxTTTNWTw.g0PCM6T1kBG7AtBwKZmfzQ" width=100 alt="Browserstack Logo"></a>

# License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
START TRANSACTION;

DROP VIEW webknossos.taskTypes_;
ALTER TABLE webknossos.taskTypes DROP COLUMN recommendedConfiguration JSONB;
ALTER TABLE webknossos.taskTypes DROP COLUMN recommendedConfiguration;
jstriebel marked this conversation as resolved.
Show resolved Hide resolved


CREATE VIEW webknossos.taskTypes_ AS SELECT * FROM webknossos.taskTypes WHERE NOT isDeleted;
Expand Down
41 changes: 32 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ services:
ports:
- "9000:9000"
links:
- fossildb
- postgres
- fossildb-persisted
- postgres-persisted
command:
- -Djava.io.tmpdir=disk
- -Dconfig.file=conf/application.conf
- -Djava.net.preferIPv4Stack=true
- -Dhttp.address=0.0.0.0
Expand All @@ -21,10 +20,12 @@ services:
# the following lines disable the integrated datastore:
# - -Dplay.modules.enabled-="com.scalableminds.webknossos.datastore.DataStoreModule"
# - -Ddatastore.enabled=false
# - -Dplay.http.router="noDS.Routes"
volumes:
- ./binaryData:/srv/webknossos/binaryData
environment:
- POSTGRES_URL=jdbc:postgresql://postgres/webknossos
user: ${USER_UID:-1000}:${USER_GID:-1000}

webknossos-datastore:
build: webknossos-datastore
Expand Down Expand Up @@ -168,6 +169,12 @@ services:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres

postgres-persisted:
extends:
service: postgres
volumes:
- "./pg/db:/var/lib/postgresql/data/"

jstriebel marked this conversation as resolved.
Show resolved Hide resolved
postgres-dev:
extends:
service: postgres
Expand All @@ -178,25 +185,41 @@ services:

psql:
extends: postgres
command: psql -h postgres -U postgres webknossos
command: psql -h postgres-persisted -U postgres webknossos
links:
- postgres
- postgres-persisted
environment:
PGPASSWORD: postgres
volumes:
- ./conf/evolutions/:/evolutions/

drop-db:
extends: postgres
command: psql -h postgres-persisted -U postgres postgres -c "DROP DATABASE webknossos"
links:
- postgres-persisted
environment:
PGPASSWORD: postgres


fossildb:
image: scalableminds/fossildb:master__337
command:
- fossildb
- -c
- skeletons,skeletonUpdates,volumes,volumeData
- skeletons,skeletonUpdates,volumes,volumeData,volumeUpdates
user: ${USER_UID:-fossildb}:${USER_GID:-fossildb}

fossildb-dev:
fossildb-persisted:
extends:
service: fossildb
ports:
- "7155:7155"
volumes:
- "./fossildb/data:/fossildb/data"
- "./fossildb/backup:/fossildb/backup"

fossildb-dev:
extends:
service: fossildb
volumes:
- "./fossildb-dev/data:/fossildb/data"
- "./fossildb-dev/backup:/fossildb/backup"
4 changes: 4 additions & 0 deletions start-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -Eeuo pipefail

USER_UID=$(id -u) USER_GID=$(id -g) docker-compose up webknossos