Skip to content

Commit

Permalink
Merge pull request #703 from overture-stack/rc/4.4.0
Browse files Browse the repository at this point in the history
Release Candidate 4.4.0
  • Loading branch information
joneubank authored Nov 26, 2020
2 parents 8f9cf6a + 82e44f1 commit 52fe057
Show file tree
Hide file tree
Showing 51 changed files with 1,191 additions and 189 deletions.
36 changes: 35 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
containers:
- name: jdk
tty: true
image: openjdk:11
image: adoptopenjdk/openjdk11:jdk-11.0.6_10-alpine
env:
- name: DOCKER_HOST
value: tcp://localhost:2375
Expand Down Expand Up @@ -194,5 +194,39 @@ spec:
rtUpload(serverId: 'artifactory', spec: fileSet)
}
}

stage('Deploy to Overture QA') {
when {
branch "develop"
}
steps {
build(job: "/Overture.bio/provision/helm", parameters: [
[$class: 'StringParameterValue', name: 'OVERTURE_ENV', value: 'qa' ],
[$class: 'StringParameterValue', name: 'OVERTURE_CHART_NAME', value: 'song'],
[$class: 'StringParameterValue', name: 'OVERTURE_RELEASE_NAME', value: 'song'],
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_CHART_VERSION', value: ''], // use latest
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_REPO_URL', value: "https://overture-stack.github.io/charts-server/"],
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_REUSE_VALUES', value: "true" ],
[$class: 'StringParameterValue', name: 'OVERTURE_ARGS_LINE', value: "--set-string image.tag=${commit}" ]
])
}
}

stage('Deploy to Overture Staging') {
when {
branch "master"
}
steps {
build(job: "/Overture.bio/provision/helm", parameters: [
[$class: 'StringParameterValue', name: 'OVERTURE_ENV', value: 'staging' ],
[$class: 'StringParameterValue', name: 'OVERTURE_CHART_NAME', value: 'song'],
[$class: 'StringParameterValue', name: 'OVERTURE_RELEASE_NAME', value: 'song'],
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_CHART_VERSION', value: ''], // use latest
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_REPO_URL', value: "https://overture-stack.github.io/charts-server/"],
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_REUSE_VALUES', value: "true" ],
[$class: 'StringParameterValue', name: 'OVERTURE_ARGS_LINE', value: "--set-string image.tag=${version}" ]
])
}
}
}
}
17 changes: 11 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.7'
services:
ego-api:
image: "overture/ego:3.1.0"
image: "overture/ego:3.4.0"
environment:
SERVER_PORT: 8080
SPRING_DATASOURCE_URL: jdbc:postgresql://ego-postgres:5432/ego?stringtype=unspecified
Expand All @@ -10,11 +10,11 @@ services:
SPRING_FLYWAY_ENABLED: "true"
SPRING_FLYWAY_LOCATIONS: "classpath:flyway/sql,classpath:db/migration"
SPRING_PROFILES: demo, auth
JWT_DURATIONMS: 300000 # expire tokens in 5 min for local testing
expose:
- "8080"
ports:
- "9082:8080"
command: java -jar /srv/ego/install/ego.jar
depends_on:
- ego-postgres
ego-postgres:
Expand Down Expand Up @@ -43,10 +43,10 @@ services:
ports:
- "8085:9000"
score-server:
image: overture/score-server:5.0.0
image: overture/score-server:5.1.0
user: "$MY_UID:$MY_GID"
environment:
SPRING_PROFILES_ACTIVE: amazon,collaboratory,prod,secure
SPRING_PROFILES_ACTIVE: amazon,collaboratory,prod,secure,jwt
SERVER_PORT: 8080
OBJECT_SENTINEL: heliograph
BUCKET_NAME_OBJECT: oicr.icgc.test
Expand All @@ -57,6 +57,7 @@ services:
S3_ACCESSKEY: minio
S3_SECRETKEY: minio123
S3_SIGV4ENABLED: "true"
AUTH_JWT_PUBLICKEYURL: http://ego-api:8080/oauth/token/public_key
AUTH_SERVER_URL: http://ego-api:8080/o/check_api_key/
AUTH_SERVER_CLIENTID: score
AUTH_SERVER_CLIENTSECRET: scoresecret
Expand Down Expand Up @@ -144,7 +145,8 @@ services:
target: server
environment:
SERVER_PORT: 8080
SPRING_PROFILES_ACTIVE: "prod,secure,default"
SPRING_PROFILES_ACTIVE: "prod,secure,default,jwt,score-client-cred"
AUTH_JWT_PUBLICKEYURL: http://ego-api:8080/oauth/token/public_key
AUTH_SERVER_URL: http://ego-api:8080/o/check_api_key/
AUTH_SERVER_CLIENTID: song
AUTH_SERVER_TOKENNAME: apiKey
Expand All @@ -153,7 +155,10 @@ services:
AUTH_SERVER_SCOPE_STUDY_SUFFIX: .WRITE
AUTH_SERVER_SCOPE_SYSTEM: song.WRITE
SCORE_URL: http://score-server:8080
SCORE_ACCESSTOKEN: f69b726d-d40f-4261-b105-1ec7e6bf04d5
SCORE_CLIENTCREDENTIALS_ID: songToScore
SCORE_CLIENTCREDENTIALS_SECRET: songToScoreSecret
SCORE_CLIENTCREDENTIALS_TOKENURL: http://ego-api:8080/oauth/token
SCORE_CLIENTCREDENTIALS_SYSTEMSCOPE: "score.WRITE"
MANAGEMENT_SERVER_PORT: 8081
SPRING_DATASOURCE_USERNAME: postgres
SPRING_DATASOURCE_PASSWORD: password
Expand Down
2 changes: 2 additions & 0 deletions docker/ego-init/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ ALTER TABLE public.userpermission OWNER TO postgres;
--

COPY public.egoapplication (name, clientid, clientsecret, redirecturi, description, status, id, type) FROM stdin;
song-to-score songToScore songToScoreSecret http://example.com song-to-score APPROVED 77f1ef78-7495-4b4a-982a-6b9532dc69fb CLIENT
\.


Expand Down Expand Up @@ -344,6 +345,7 @@ COPY public.flyway_schema_history (installed_rank, version, description, type, s
--

COPY public.groupapplication (group_id, application_id) FROM stdin;
f2885e96-f74e-4f7a-b935-fb48b18e761d 77f1ef78-7495-4b4a-982a-6b9532dc69fb
\.


Expand Down
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<groupId>bio.overture</groupId>
<artifactId>song</artifactId>
<packaging>pom</packaging>
<version>4.3.0</version>
<version>4.4.0</version>
<modules>
<module>song-core</module>
<module>song-java-sdk</module>
Expand Down Expand Up @@ -176,6 +176,11 @@
<artifactId>jackson-datatype-guava</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions song-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<artifactId>song</artifactId>
<groupId>bio.overture</groupId>
<version>4.3.0</version>
<version>4.4.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -35,12 +35,12 @@
<dependency>
<groupId>bio.overture</groupId>
<artifactId>song-java-sdk</artifactId>
<version>4.3.0</version>
<version>4.4.0</version>
</dependency>
<dependency>
<groupId>bio.overture</groupId>
<artifactId>song-core</artifactId>
<version>4.3.0</version>
<version>4.4.0</version>
</dependency>

<!-- CLI -->
Expand Down
6 changes: 5 additions & 1 deletion song-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<artifactId>song</artifactId>
<groupId>bio.overture</groupId>
<version>4.3.0</version>
<version>4.4.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -65,6 +65,10 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>

<!-- Utilities -->
<dependency>
Expand Down
10 changes: 10 additions & 0 deletions song-core/src/main/java/bio/overture/song/core/model/Analysis.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package bio.overture.song.core.model;

import bio.overture.song.core.model.enums.AnalysisStates;
import java.time.LocalDateTime;
import java.util.List;
import java.util.SortedSet;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -23,4 +25,12 @@ public class Analysis extends DynamicData {
private AnalysisTypeId analysisType;
private List<CompositeSample> samples;
private List<FileDTO> files;

private LocalDateTime createdAt;
private LocalDateTime updatedAt;

private LocalDateTime firstPublishedAt;
private LocalDateTime publishedAt;

private SortedSet<AnalysisStateChange> analysisStateHistory;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package bio.overture.song.core.model;

import java.time.LocalDateTime;
import lombok.*;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class AnalysisStateChange extends DynamicData implements Comparable<AnalysisStateChange> {
private String initialState;
private String updatedState;
private LocalDateTime updatedAt;

@Override
public int compareTo(AnalysisStateChange o) {
return this.getUpdatedAt().compareTo(o.getUpdatedAt());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.JsonNode;
import java.time.LocalDateTime;
import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand All @@ -16,6 +17,7 @@ public class AnalysisType {

@NotNull private String name;
@NotNull private Integer version;
private LocalDateTime createdAt;

@JsonInclude(JsonInclude.Include.NON_NULL)
private JsonNode schema;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package bio.overture.song.core.model.enums;

import static java.lang.String.format;
import static java.util.Arrays.stream;
import static java.util.stream.Collectors.toUnmodifiableSet;

import bio.overture.song.core.utils.Streams;
import java.util.Collection;
import java.util.Set;
import lombok.NonNull;

public enum AnalysisActions {
PUBLISH,
UNPUBLISH,
SUPPRESS,
CREATE;

private static final Set<String> SET =
Streams.stream(values()).map(AnalysisActions::toString).collect(toUnmodifiableSet());

public String toString() {
return this.name();
}

public static AnalysisActions resolveAnalysisActions(@NonNull String analysisAction) {
return Streams.stream(values())
.filter(x -> x.toString().equals(analysisAction))
.findFirst()
.orElseThrow(
() ->
new IllegalStateException(
format("The analysis action '%s' cannot be resolved", analysisAction)));
}

public static String[] toStringArray() {
return stream(values()).map(Enum::name).toArray(String[]::new);
}

public static Set<String> findIncorrectAnalysisActions(
@NonNull Collection<String> analysisActions) {
return analysisActions.stream().filter(x -> !SET.contains(x)).collect(toUnmodifiableSet());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@
import com.fasterxml.jackson.databind.deser.std.StringDeserializer;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Map;
import lombok.NonNull;
import lombok.SneakyThrows;
Expand All @@ -48,10 +53,22 @@ public class JsonUtils {
protected static final ObjectMapper mapper = mapper();

public static ObjectMapper mapper() {
val mapper = new ObjectMapper();

/* Register Moduless */
val specialModule = new SimpleModule();
specialModule.addDeserializer(String.class, SpecialStringJsonDeserializer.instance);

val mapper = new ObjectMapper().registerModule(specialModule);
val isoDateFormatter = DateTimeFormatter.ISO_DATE_TIME;
val dateTimeDeserializer = new LocalDateTimeDeserializer(isoDateFormatter);
val dateTimeSerializer = new LocalDateTimeSerializer(isoDateFormatter);

val javaTimeModule = new JavaTimeModule();
javaTimeModule.addDeserializer(LocalDateTime.class, dateTimeDeserializer);
javaTimeModule.addSerializer(LocalDateTime.class, dateTimeSerializer);

mapper.registerModule(specialModule);
mapper.registerModule(javaTimeModule);

mapper.disable(DeserializationFeature.FAIL_ON_MISSING_CREATOR_PROPERTIES);
mapper.disable(DeserializationFeature.FAIL_ON_UNRESOLVED_OBJECT_IDS);
Expand Down
2 changes: 1 addition & 1 deletion song-java-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<artifactId>song</artifactId>
<groupId>bio.overture</groupId>
<version>4.3.0</version>
<version>4.4.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions song-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<artifactId>song</artifactId>
<groupId>bio.overture</groupId>
<version>4.3.0</version>
<version>4.4.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -37,7 +37,7 @@
<dependency>
<groupId>bio.overture</groupId>
<artifactId>song-core</artifactId>
<version>4.3.0</version>
<version>4.4.0</version>
</dependency>

<!-- Spring -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
package bio.overture.song.server;

import java.util.TimeZone;
import javax.annotation.PostConstruct;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
Expand All @@ -24,6 +26,11 @@
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class})
public class ServerMain {

@PostConstruct
public void init() {
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
}

public static void main(String... args) {
SpringApplication.run(ServerMain.class, args);
}
Expand Down
Loading

0 comments on commit 52fe057

Please sign in to comment.