Skip to content

Commit

Permalink
add webknossos-connect to setup (#3913)
Browse files Browse the repository at this point in the history
* add wk-connect to the setup

* add connect datastore in initialData and test db

* pretty

* upgrade wk-connect

* update backend snapshots

* insert connect-datastore based on insertLocalConnectDatastore conf

* update Changelog
  • Loading branch information
jstriebel authored Mar 25, 2019
1 parent d823a91 commit 972d6d2
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md).
- The mapping selection dropbown is now sorted alphabetically. [#3864](https://github.com/scalableminds/webknossos/pull/3864)
- The HTML template now includes SEO tags for demo instances and hides internal instances from search engines.
- A maximize-button was added to the viewports in the annotation view. Maximization can also be toggled with the `.` shortcut. [#3876](https://github.com/scalableminds/webknossos/pull/3876)
- [webknossos-connect](https://github.com/scalableminds/webknossos-connect) now starts with webKnossos on local and development instances by default. [#3913](https://github.com/scalableminds/webknossos/pull/3913)

### Changed
- Improved the flight mode performance for tracings with very large trees (>80.000 nodes). [#3880](https://github.com/scalableminds/webknossos/pull/3880)
Expand Down
11 changes: 11 additions & 0 deletions app/controllers/InitialDataController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ Samplecountry
for {
_ <- insertLocalDataStoreIfEnabled
_ <- insertLocalTracingStoreIfEnabled
_ <- insertConnectDataStoreIfEnabled
_ <- assertInitialDataEnabled
_ <- assertNoOrganizationsPresent
_ <- insertOrganization
Expand Down Expand Up @@ -211,6 +212,16 @@ Samplecountry
}
} else Fox.successful(())

def insertConnectDataStoreIfEnabled: Fox[Any] =
if (conf.Application.insertLocalConnectDatastore) {
dataStoreDAO.findOneByName("connect").futureBox.map { maybeStore =>
if (maybeStore.isEmpty) {
logger.info("inserting connect datastore")
dataStoreDAO.insertOne(DataStore("connect", "http://localhost:8000", "secret-key", isConnector = true))
}
}
} else Fox.successful(())

def insertLocalTracingStoreIfEnabled: Fox[Any] =
if (conf.Tracingstore.enabled) {
tracingStoreDAO.findOneByName("localhost").futureBox.map { maybeStore =>
Expand Down
14 changes: 13 additions & 1 deletion app/utils/WkConf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class WkConf @Inject()(configuration: Configuration) extends ConfigReader {
object Application {

val insertInitialData = get[Boolean]("application.insertInitialData")
val insertLocalConnectDatastore = get[Boolean]("application.insertLocalConnectDatastore")
val title = get[String]("application.title")

object Authentication {
Expand Down Expand Up @@ -125,5 +126,16 @@ class WkConf @Inject()(configuration: Configuration) extends ConfigReader {
}

val children =
List(Application, Http, Mail, WebKnossos, Datastore, User, Braintracing, Features, Silhouette, Airbrake, Google)
List(Application,
Http,
Mail,
WebKnossos,
Datastore,
Tracingstore,
User,
Braintracing,
Features,
Silhouette,
Airbrake,
Google)
}
1 change: 1 addition & 0 deletions conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ braintracing {

application {
insertInitialData = true
insertLocalConnectDatastore = true
authentication {
enableDevAutoLogin = false
enableDevAutoAdmin = false
Expand Down
1 change: 1 addition & 0 deletions conf/connect/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
datasets.json
7 changes: 7 additions & 0 deletions conf/connect/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"server": {"host": "0.0.0.0", "port": 8000, "url": "http://localhost:8000"},
"datastore": {"name": "connect", "key": "secret-key"},
"webknossos": {"url": "http://localhost:9000"},
"backends": {"neuroglancer": {}},
"datasets_path": "data/datasets.json"
}
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ services:
- "fossildb-persisted:fossildb"
- "postgres-persisted:postgres"
- redis
- webknossos-connect
depends_on:
postgres-persisted:
condition: service_healthy
fossildb-persisted:
condition: service_healthy
webknossos-connect:
condition: service_healthy
command:
- -Dconfig.file=conf/application.conf
- -Djava.net.preferIPv4Stack=true
Expand Down Expand Up @@ -122,11 +125,14 @@ services:
- "fossildb-dev:fossildb"
- "postgres-dev:postgres"
- redis
- webknossos-connect
depends_on:
postgres-dev:
condition: service_healthy
fossildb-dev:
condition: service_healthy
webknossos-connect:
condition: service_healthy
environment:
- POSTGRES_URL=jdbc:postgresql://postgres/webknossos
command:
Expand Down Expand Up @@ -166,11 +172,14 @@ services:
- postgres
- fossildb
- redis
- webknossos-connect
depends_on:
postgres:
condition: service_healthy
fossildb:
condition: service_healthy
webknossos-connect:
condition: service_healthy
environment:
- POSTGRES_URL=jdbc:postgresql://postgres/webknossos_testing
command:
Expand All @@ -195,6 +204,13 @@ services:
- ".:/home/pptruser/webknossos"
user: ${USER_UID:-1000}:${USER_GID:-1000}

# webKnossos-connect
webknossos-connect:
image: scalableminds/webknossos-connect:master__190
volumes:
- "./conf/connect:/app/data"
network_mode: host

# Postgres
postgres:
image: postgres:10-alpine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ Generated by [AVA](https://ava.li).
## misc-datastores

[
{
isConnector: true,
isForeign: false,
isScratch: false,
name: 'connect',
url: 'http://localhost:8000',
},
{
isConnector: false,
isForeign: false,
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions test/db/dataStores.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
name,url,key,isScratch,isDeleted,isForeign,isConnector
'localhost','http://localhost:9000','something-secure',f,f,f,f
'connect','http://localhost:8000','secret-key',f,f,f,t
4 changes: 4 additions & 0 deletions tools/proxy/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ const processes = {
shell: true,
},
),
connect: spawnIfNotSpecified("noConnect", "docker-compose run --rm webknossos-connect", [], {
cwd: ROOT,
shell: true,
}),
};

function spawnIfNotSpecified(keyword, command, args, options) {
Expand Down

0 comments on commit 972d6d2

Please sign in to comment.