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

add webknossos-connect to setup #3913

Merged
merged 10 commits into from
Mar 25, 2019
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracingstore was missing here before

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"
jstriebel marked this conversation as resolved.
Show resolved Hide resolved
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,
}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@philippotto If I remember correctly, you start the different parts manually sometimes. Does this break anything for you? (sbt run won’t start webknossos-connect)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be ok for me :)

};

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