diff --git a/docker-compose.yml b/docker-compose.yml index ebf80daf..63544d6b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.7' services: ego-api: - image: "overture/ego:3.1.0" + image: "overture/ego:5.3.0" environment: SERVER_PORT: 8080 SPRING_DATASOURCE_URL: jdbc:postgresql://ego-postgres:5432/ego?stringtype=unspecified @@ -9,16 +9,21 @@ services: SPRING_DATASOURCE_PASSWORD: password SPRING_FLYWAY_ENABLED: "true" SPRING_FLYWAY_LOCATIONS: "classpath:flyway/sql,classpath:db/migration" - SPRING_PROFILES: demo, auth + SPRING_PROFILES_ACTIVE: demo, auth expose: - "8080" ports: - "9082:8080" - command: java -jar /srv/ego/install/ego.jar depends_on: - ego-postgres + healthcheck: + test: "wget --no-verbose --tries=1 --spider wget --no-verbose --tries=1 --spider http://ego-api:8080/actuator/health || exit 1" + interval: 20s + timeout: 15s + retries: 5 + start_period: 30s ego-postgres: - image: postgres:9.5 + image: postgres:11.1 environment: - POSTGRES_DB=ego - POSTGRES_PASSWORD=password @@ -61,9 +66,11 @@ services: S3_ACCESSKEY: minio S3_SECRETKEY: minio123 S3_SIGV4ENABLED: "true" + SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_PUBLICKEYLOCATION: http://ego-api:8080/oauth/token/public_key AUTH_SERVER_URL: http://ego-api:8080/o/check_api_key/ AUTH_SERVER_TOKENNAME: apiKey AUTH_SERVER_CLIENTID: score + AUTH_SERVER_PROVIDER: ego AUTH_SERVER_CLIENTSECRET: scoresecret AUTH_SERVER_SCOPE_STUDY_PREFIX: score. AUTH_SERVER_SCOPE_UPLOAD_SUFFIX: .WRITE @@ -107,7 +114,7 @@ services: command: bin/score-client user: "$MY_UID:$MY_GID" song-db: - image: "postgres:9.6" + image: "postgres:11.1" environment: POSTGRES_DB: song POSTGRES_USER: postgres @@ -118,6 +125,11 @@ services: - "12345:5432" volumes: - "./docker/song-db-init:/docker-entrypoint-initdb.d" + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U postgres" ] + interval: 15s + timeout: 15s + retries: 5 aws-cli: image: "mesosphere/aws-cli:latest" environment: @@ -127,11 +139,11 @@ services: volumes: - "./docker/object-storage-init/data/oicr.icgc.test/data:/score-data:ro" song-server: - image: overture/song-server:4.2.2 + image: overture/song-server:5.1.1 environment: SERVER_PORT: 8080 SPRING_PROFILES_ACTIVE: "prod,secure,default" - AUTH_SERVER_URL: http://ego-api:8080/o/check_token/ + AUTH_SERVER_INTROSPECTIONURI: http://ego-api:8080/o/check_api_key AUTH_SERVER_CLIENTID: song AUTH_SERVER_CLIENTSECRET: songsecret AUTH_SERVER_SCOPE_STUDY_PREFIX: song. @@ -146,11 +158,14 @@ services: SPRING_DATASOURCE_URL: jdbc:postgresql://song-db/song?stringtype=unspecified SPRING_FLYWAY_ENABLED: "true" SPRING_FLYWAY_LOCATIONS: "classpath:db/migration" + SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_PUBLICKEYLOCATION: http://ego-api:8080/oauth/token/public_key ports: - "8080:8080" depends_on: - - song-db - - ego-api + song-db: + condition: service_healthy + ego-api: + condition: service_healthy volumes: - "./docker/scratch/song-server-logs:/opt/dcc/server_logs" diff --git a/docker/ego-init/init.sql b/docker/ego-init/init.sql index d2ad8b74..1907b6ac 100644 --- a/docker/ego-init/init.sql +++ b/docker/ego-init/init.sql @@ -294,6 +294,8 @@ ALTER TABLE public.userpermission OWNER TO postgres; -- COPY public.egoapplication (name, clientid, clientsecret, redirecturi, description, status, id, type) FROM stdin; +song song songsecret http://example.com song-to-score APPROVED 77f1ef78-7495-4b4a-982a-6b9532dc69fb CLIENT +score score scoresecret http://example.com score APPROVED 8b573f1b-fbf8-413b-af5d-c17fd75aa00e CLIENT \. diff --git a/score-client/src/main/java/bio/overture/score/client/config/ProfileConfig.java b/score-client/src/main/java/bio/overture/score/client/config/ProfileConfig.java index 4495b64a..f47e19a3 100644 --- a/score-client/src/main/java/bio/overture/score/client/config/ProfileConfig.java +++ b/score-client/src/main/java/bio/overture/score/client/config/ProfileConfig.java @@ -1,6 +1,5 @@ package bio.overture.score.client.config; -import bio.overture.score.client.exception.NotRetryableException; import bio.overture.score.core.model.StorageProfiles; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; @@ -54,8 +53,8 @@ private String getStorageProfile() { .exchange(endpoint + "/profile", HttpMethod.GET, defaultEntity(), String.class) .getBody(); return storageProfile; - } catch (NotRetryableException nre) { - log.error("received exception when getting profiles: " + nre.getMessage()); + } catch (Exception e) { + log.error("received exception when getting profiles: " + e.getMessage()); } return StorageProfiles.getProfileValue(defaultProfile); } diff --git a/score-client/src/main/resources/application.yml b/score-client/src/main/resources/application.yml index 331e3612..dfb27361 100644 --- a/score-client/src/main/resources/application.yml +++ b/score-client/src/main/resources/application.yml @@ -86,7 +86,10 @@ defaultProfile: collaboratory # Profile - "kf" ############################################################################### -spring.profiles: kf +spring: + config: + activate: + on-profile: kf # Storage server storage: @@ -103,7 +106,10 @@ client: # Profile - "oicr" ############################################################################### -spring.profiles: oicr +spring: + config: + activate: + on-profile: oicr # uses storage.url and client.ssl.custom define in common @@ -114,7 +120,10 @@ spring.profiles: oicr # Profile - "debug" ############################################################################### -spring.profiles: debug +spring: + config: + activate: + on-profile: debug logging: level: