Skip to content

Commit

Permalink
Merge pull request #120 from overture-stack/rc/0.14.0
Browse files Browse the repository at this point in the history
Release 0.14.0
refactor to run in server mode with custom domain
fix port -1 in ego and song swaggers
upgrade maestro to fix the elasticsearch exception
fix ego health check in server mode
  • Loading branch information
blabadi authored Mar 15, 2021
2 parents 8099627 + 9de4dde commit 24919b4
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 26 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ docker exec -it $(docker service ps ego-db --no-trunc --format '{{ .Name }}.{{.I
11. Run `make start-transfer-shell`. This will automatically run the `genomic-transfer-helper` and load the contents of `jwt.txt` as the JWT to allow authorized access to song and score.
12. Once logged into the container, you can use the score and song clients. Run `./song-client/bin/sing ping` and `curl $(curl -sL http://score-api:8080/download/ping)` to do a health check.

## Gateway
The gateway is based on nginx.
the config template file is under ./nginx/path-based, there is also a docker file
tagging the gateway is done in Jenkinsfile, it will always have a new tag with the same version as the dms version.

## Tips
### Checking for OOM messages when a container/service is killed
Sometimes, if the reserved/limit memory is too low, a container will get killed by the kernel. To find out if this is the case, run
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>bio.overture</groupId>
<artifactId>dms</artifactId>
<version>0.13.1</version>
<version>0.14.0</version>
<name>dms</name>
<description>Overture Data Management System</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ public DmsConfig buildDmsConfig() {
.getAnswer();

GatewayConfig gatewayConfig = null;
URL dmsGatewayUrl = new URL("http://localhost:80");
URL dmsGatewayUrl;
int gatewayPort = 80;
if (clusterRunMode == SERVER) {
dmsGatewayUrl =
questionFactory
.newUrlSingleQuestion("What is the base DMS Gateway URL (example: dms.cancercollaboratory.org)?",
.newUrlSingleQuestion("What is the base DMS Gateway URL (example: http://dms.cancercollaboratory.org)?",
false,
null
).getAnswer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,8 @@ public void waitForEgoApiHealthy(ClusterRunModes clusterRunMode, EgoConfig egoCo
.restClientFactory(basicRestClientFactory)
.build();

EgoClient egoClient = null;
if (clusterRunMode == LOCAL) {
egoClient =
EgoClient egoClient =
egoClientFactory2.buildNoAuthEgoClient(getLocalEgoApiUrl(egoConfig.getApi()).toString());
} else if (clusterRunMode == SERVER) {
egoClient = egoClientFactory2.buildNoAuthEgoClient(egoConfig.getApi().getUrl().toString());
} else {
throw buildIllegalStateException(
"The clusterRunMode '%s' could not be processed", clusterRunMode);
}

// Attempt to get the public key several times
Failsafe.with(RETRY_POLICY).get(egoClient::getPublicKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,7 @@ private void provisionS3Buckets(ClusterRunModes clusterRunMode, ScoreConfig scor

@SneakyThrows
private URI resolveS3Endpoint(ClusterRunModes clusterRunMode, ScoreS3Config scoreS3Config) {
if (clusterRunMode == SERVER) {
return scoreS3Config.getUrl().toURI();
} else if (clusterRunMode == LOCAL) {
return resolveS3LocalUrl(scoreS3Config);
} else {
throw new IllegalStateException(
format(
"The clusterRunMode '%s' is unknown and cannot be processed", clusterRunMode.name()));
}
return resolveS3LocalUrl(scoreS3Config);
}

@SneakyThrows
Expand Down
6 changes: 4 additions & 2 deletions src/main/resources/templates/servicespec/ego-api.yaml.vm
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ TaskTemplate:
- DEFAULT_USER_FIRSTUSERASADMIN=true
- SPRING_DATASOURCE_PASSWORD=$dmsConfig.ego.db.databasePassword
- SPRING_DATASOURCE_URL=jdbc:postgresql://${composeServiceResources.EGO_DB.toString()}:5432/ego?stringtype=unspecified
#if($dmsConfig.ego.api.url.port > 0)
- SWAGGER_HOST=$dmsConfig.ego.api.url.host:$dmsConfig.ego.api.url.port
#else
- SWAGGER_HOST=$dmsConfig.ego.api.url.host
#end
- SWAGGER_BASEURL=#if($dmsConfig.ego.api.url.path == '')/#{else}$dmsConfig.ego.api.url.path#end
#if( $dmsConfig.clusterRunMode == 'LOCAL')
- LOGIN_NONCE_SECURE=false
- LOGIN_NONCE_SAMESITE=lax
#end
- INITIALIZATION_ENABLED=true
- INITIALIZATION_APPLICATIONS_0_NAME=$dmsConfig.ego.api.dmsAppCredential.name
- INITIALIZATION_APPLICATIONS_0_TYPE=ADMIN
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/templates/servicespec/gateway.yaml.vm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
Name: gateway
TaskTemplate:
ContainerSpec:
# todo change this to point to a version
Image: "ghcr.io/overture-stack/dms-gateway:0.13.0"
Env:
- NGINX_PORT=80
Expand Down
3 changes: 1 addition & 2 deletions src/main/resources/templates/servicespec/maestro.yaml.vm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Name: maestro
TaskTemplate:
ContainerSpec:
Image: "ghcr.io/overture-stack/maestro:3.8.0-993b837"
Image: "ghcr.io/overture-stack/maestro:3.8.0"
Env:
- management.health.elasticsearch.enabled=false
- MAESTRO.ELASTICSEARCH.CLUSTERNODES=${composeServiceResources.ELASTICSEARCH.toString()}:9200
Expand All @@ -20,7 +20,6 @@ TaskTemplate:
- SPRING_CODEC_MAXINMEMORYSIZE=-1
- MAESTRO_REPOSITORIES_0_ORGANIZATION=local_song_organization
- MAESTRO_REPOSITORIES_0_COUNTRY=local_song_country
#- springdoc.api-docs.path=/v3/api-docs
- springdoc.swagger-ui.url=/maestro/v3/api-docs
- springdoc.webjars.prefix=/maestro/webjars
- springdoc.swagger-ui.path=/api-docs
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/templates/servicespec/song-api.yaml.vm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ TaskTemplate:
- AUTH_SERVER_SCOPE_SYSTEM=SONG.WRITE
- AUTH_JWT_PUBLICKEYURL=http://${composeServiceResources.EGO_API.toString()}:8080/oauth/token/public_key
- ID_USELOCAL=true
#if($dmsConfig.song.api.url.port > 0)
- SWAGGER_HOST=$dmsConfig.song.api.url.host:$dmsConfig.song.api.url.port
#else
- SWAGGER_HOST=$dmsConfig.song.api.url.host
#end
- SWAGGER_BASEPATH=#if($dmsConfig.song.api.url.path == '')/#{else}$dmsConfig.song.api.url.path#end
- SCORE_URL=http://${composeServiceResources.SCORE_API.toString()}:8080
- SCORE_CLIENTCREDENTIALS_ID=$dmsConfig.song.api.appCredential.clientId
Expand Down

0 comments on commit 24919b4

Please sign in to comment.