diff --git a/docker/runner/README.md b/docker/runner/README.md index 49c72eaec63e6c5e86744e4cd5dda4f23738a1f5..5b05a4e267b81d54a679b6a230ca133e5fb4f384 100644 --- a/docker/runner/README.md +++ b/docker/runner/README.md @@ -9,42 +9,42 @@ You need to configure a few things using some environment variables. Environment variables: -* PORTAL_DB_URL: JDBC URL to connect to the portal database, for example "jdbc:postgresql://db:5432/portal" -* PORTAL_DB_SCHEMA: Database schema, default value is "public" +* PORTAL_DB_URL: JDBC URL to connect to the portal database, for example "jdbc:postgresql://db:5432/portal". +* PORTAL_DB_SCHEMA: Database schema, default value is "public". * PORTAL_DB_SERVER: optional, address of the portal database server, for example DB_SERVER="db:5432". Used to wait for the database to be up and running. -* PORTAL_DB_USER: User to use when connecting to the portal database -* PORTAL_DB_PASSWORD: Password to use when connecting to the portal database +* PORTAL_DB_USER: User to use when connecting to the portal database. +* PORTAL_DB_PASSWORD: Password to use when connecting to the portal database. -* META_DB_URL: JDBC URL to connect to the metadata database -* META_DB_SCHEMA: Database schema, default value is "public" +* META_DB_URL: JDBC URL to connect to the metadata database. +* META_DB_SCHEMA: Database schema, default value is "public". * META_DB_SERVER: optional, address of the metadata database server. Used to wait for the database to be up and running. -* META_DB_USER: User to use when connecting to the metadata database -* META_DB_PASSWORD: Password to use when connecting to the metadata database +* META_DB_USER: User to use when connecting to the metadata database. +* META_DB_PASSWORD: Password to use when connecting to the metadata database. -* FEATURES_DB_URL: JDBC URL to connect to the features database -* FEATURES_DB_SCHEMA: Database schema, default value is "public" +* FEATURES_DB_URL: JDBC URL to connect to the features database. +* FEATURES_DB_SCHEMA: Database schema, default value is "public". * FEATURES_DB_SERVER: optional, address of the features database server. Used to wait for the database to be up and running. -* FEATURES_DB_USER: User to use when connecting to the features database -* FEATURES_DB_PASSWORD: Password to use when connecting to the features database -* FEATURES_DB_MAIN_TABLE: Table that contains the scientific data to use, default value is adni_merge +* FEATURES_DB_USER: User to use when connecting to the features database. +* FEATURES_DB_PASSWORD: Password to use when connecting to the features database. +* FEATURES_DB_MAIN_TABLE: Table that contains the scientific data to use, default value is "features". -* CONTEXT_PATH: context path appended to all services running in this container. Default to "/services" +* CONTEXT_PATH: context path appended to all services running in this container. Default to "/services". * AUTHENTICATION: 0 to disable authentication or 1 to enable authentication. -* CLIENT_ID: required when authentication is turned on, client ID for the [OpenID server of HBP](https://services.humanbrainproject.eu/oidc/) -* CLIENT_SECRET: required when authentication is turned on, client secret for the [OpenID server of HBP](https://services.humanbrainproject.eu/oidc/) -* TOKEN_URI: default to "https://services.humanbrainproject.eu/oidc/token" -* AUTH_URI: default to "https://services.humanbrainproject.eu/oidc/authorize" -* USER_INFO_URI: default to "https://services.humanbrainproject.eu/oidc/userinfo" +* CLIENT_ID: required when authentication is turned on, client ID for the [OpenID server of HBP](https://services.humanbrainproject.eu/oidc/). +* CLIENT_SECRET: required when authentication is turned on, client secret for the [OpenID server of HBP](https://services.humanbrainproject.eu/oidc/). +* TOKEN_URI: default to "https://services.humanbrainproject.eu/oidc/token". +* AUTH_URI: default to "https://services.humanbrainproject.eu/oidc/authorize". +* USER_INFO_URI: default to "https://services.humanbrainproject.eu/oidc/userinfo". -* FRONTEND_LOGIN_URL: URL to redirect to when login is required. Default to "http://frontend/services/login/hbp" -* FRONTEND_AFTER_LOGIN_URL: URL to redirect after login. Default to "http://frontend/home" -* FRONTEND_AFTER_LOGOUT_URL: URL to redirect to after logout. Default to "http://frontend/services/login/hbp" +* FRONTEND_LOGIN_URL: URL to redirect to when login is required. Default to "http://frontend/services/login/hbp". +* FRONTEND_AFTER_LOGIN_URL: URL to redirect after login. Default to "http://frontend/home". +* FRONTEND_AFTER_LOGOUT_URL: URL to redirect to after logout. Default to "http://frontend/services/login/hbp". * WOKEN_URL: URL to woken machine learning server. * EXAREME_URL: URL to Exareme server. -* LOGGING_LEVEL_WEB: log level for the web layer of the application. Default to "DEBUG" -* LOGGING_LEVEL_HIBERNATE: log level for the Hibernate layer of the application. Default to "DEBUG" +* LOGGING_LEVEL_WEB: log level for the web layer of the application. Default to "DEBUG". +* LOGGING_LEVEL_HIBERNATE: log level for the Hibernate layer of the application. Default to "DEBUG". -* SESSION_TIMEOUT: Timeout in milliseconds for session expiration. Default to 2592000 +* SESSION_TIMEOUT: Timeout in milliseconds for session expiration. Default to 2592000. diff --git a/docker/runner/config/application.tmpl b/docker/runner/config/application.tmpl index ac7ed4cefba925d6255a1a71ff319d93476ec79d..e864d400e027438e9bc5507fb9d9da4e36e639d2 100644 --- a/docker/runner/config/application.tmpl +++ b/docker/runner/config/application.tmpl @@ -17,7 +17,7 @@ spring: featuresDatasource: url: {{ default .Env.FEATURES_DB_URL "jdbc:postgresql://172.22.0.1:5433/features" }} schema: {{ default .Env.FEATURES_DB_SCHEMA "public" }} - main-table: {{ default .Env.FEATURES_DB_MAIN_TABLE "adni_merge" }} + main-table: {{ default .Env.FEATURES_DB_MAIN_TABLE "features" }} username: {{ default .Env.FEATURES_DB_USER "postgres" }} password: {{ .Env.FEATURES_DB_PASSWORD }} driver-class-name: org.postgresql.Driver diff --git a/src/main/java/eu/hbp/mip/configuration/PersistenceConfiguration.java b/src/main/java/eu/hbp/mip/configuration/PersistenceConfiguration.java index 804444e0ee2f2b368771a7298fc6ab2ac56d9bc8..eb783e67547dd34fd65aa17c95d894c6af4f2c51 100644 --- a/src/main/java/eu/hbp/mip/configuration/PersistenceConfiguration.java +++ b/src/main/java/eu/hbp/mip/configuration/PersistenceConfiguration.java @@ -26,7 +26,7 @@ import javax.sql.DataSource; @EntityScan(basePackages = "eu.hbp.mip.model") public class PersistenceConfiguration { - @Value("#{'${spring.featuresDatasource.main-table:adni_merge}'}") + @Value("#{'${spring.featuresDatasource.main-table:features}'}") private String featuresMainTable; @Primary diff --git a/tests/features-db/sql/create.sql b/tests/features-db/sql/create.sql new file mode 100644 index 0000000000000000000000000000000000000000..8bcd548a449e67a90429d0efc59d8fdd8ed713a8 --- /dev/null +++ b/tests/features-db/sql/create.sql @@ -0,0 +1,15 @@ +SET datestyle to 'European'; + +CREATE TABLE IF NOT EXISTS FEATURES +( + tv1 char(256), + tv2 numeric, + tv3 numeric, + + CONSTRAINT pk_features PRIMARY KEY (tv2) +) +WITH ( + OIDS=FALSE +); + +COPY FEATURES FROM '/docker-entrypoint-initdb.d/values.csv' CSV HEADER; diff --git a/tests/science-db/sql/ipv6_listen.sh b/tests/features-db/sql/ipv6_listen.sh similarity index 100% rename from tests/science-db/sql/ipv6_listen.sh rename to tests/features-db/sql/ipv6_listen.sh diff --git a/tests/science-db/sql/values.csv b/tests/features-db/sql/values.csv similarity index 100% rename from tests/science-db/sql/values.csv rename to tests/features-db/sql/values.csv diff --git a/tests/meta-db/sql/create.sql b/tests/meta-db/sql/create.sql index e26dbdc686e0c1e23fc67a94b0345b5f221c54b6..eb69c50a09e8d6fc4acc17f6845e5cd2cf286979 100644 --- a/tests/meta-db/sql/create.sql +++ b/tests/meta-db/sql/create.sql @@ -6,7 +6,7 @@ CREATE TABLE IF NOT EXISTS meta_variables ( hierarchy json NOT NULL ); INSERT INTO meta_variables (source, hierarchy) VALUES ( - 'adni', + 'features', ' { "code": "root", diff --git a/tests/science-db/sql/create.sql b/tests/science-db/sql/create.sql deleted file mode 100644 index dead7023115fb9dbf6efb436df6ed194df105539..0000000000000000000000000000000000000000 --- a/tests/science-db/sql/create.sql +++ /dev/null @@ -1,15 +0,0 @@ -SET datestyle to 'European'; - -CREATE TABLE IF NOT EXISTS ADNI_MERGE -( - tv1 char(256), - tv2 numeric, - tv3 numeric, - - CONSTRAINT pk_adni_merge PRIMARY KEY (tv2) -) -WITH ( - OIDS=FALSE -); - -COPY ADNI_MERGE FROM '/docker-entrypoint-initdb.d/values.csv' CSV HEADER;