Skip to content

Commit 52fe057

Browse files
authored
Merge pull request #703 from overture-stack/rc/4.4.0
Release Candidate 4.4.0
2 parents 8f9cf6a + 82e44f1 commit 52fe057

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1191
-189
lines changed

Jenkinsfile

+35-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ spec:
3636
containers:
3737
- name: jdk
3838
tty: true
39-
image: openjdk:11
39+
image: adoptopenjdk/openjdk11:jdk-11.0.6_10-alpine
4040
env:
4141
- name: DOCKER_HOST
4242
value: tcp://localhost:2375
@@ -194,5 +194,39 @@ spec:
194194
rtUpload(serverId: 'artifactory', spec: fileSet)
195195
}
196196
}
197+
198+
stage('Deploy to Overture QA') {
199+
when {
200+
branch "develop"
201+
}
202+
steps {
203+
build(job: "/Overture.bio/provision/helm", parameters: [
204+
[$class: 'StringParameterValue', name: 'OVERTURE_ENV', value: 'qa' ],
205+
[$class: 'StringParameterValue', name: 'OVERTURE_CHART_NAME', value: 'song'],
206+
[$class: 'StringParameterValue', name: 'OVERTURE_RELEASE_NAME', value: 'song'],
207+
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_CHART_VERSION', value: ''], // use latest
208+
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_REPO_URL', value: "https://overture-stack.github.io/charts-server/"],
209+
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_REUSE_VALUES', value: "true" ],
210+
[$class: 'StringParameterValue', name: 'OVERTURE_ARGS_LINE', value: "--set-string image.tag=${commit}" ]
211+
])
212+
}
213+
}
214+
215+
stage('Deploy to Overture Staging') {
216+
when {
217+
branch "master"
218+
}
219+
steps {
220+
build(job: "/Overture.bio/provision/helm", parameters: [
221+
[$class: 'StringParameterValue', name: 'OVERTURE_ENV', value: 'staging' ],
222+
[$class: 'StringParameterValue', name: 'OVERTURE_CHART_NAME', value: 'song'],
223+
[$class: 'StringParameterValue', name: 'OVERTURE_RELEASE_NAME', value: 'song'],
224+
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_CHART_VERSION', value: ''], // use latest
225+
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_REPO_URL', value: "https://overture-stack.github.io/charts-server/"],
226+
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_REUSE_VALUES', value: "true" ],
227+
[$class: 'StringParameterValue', name: 'OVERTURE_ARGS_LINE', value: "--set-string image.tag=${version}" ]
228+
])
229+
}
230+
}
197231
}
198232
}

docker-compose.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.7'
22
services:
33
ego-api:
4-
image: "overture/ego:3.1.0"
4+
image: "overture/ego:3.4.0"
55
environment:
66
SERVER_PORT: 8080
77
SPRING_DATASOURCE_URL: jdbc:postgresql://ego-postgres:5432/ego?stringtype=unspecified
@@ -10,11 +10,11 @@ services:
1010
SPRING_FLYWAY_ENABLED: "true"
1111
SPRING_FLYWAY_LOCATIONS: "classpath:flyway/sql,classpath:db/migration"
1212
SPRING_PROFILES: demo, auth
13+
JWT_DURATIONMS: 300000 # expire tokens in 5 min for local testing
1314
expose:
1415
- "8080"
1516
ports:
1617
- "9082:8080"
17-
command: java -jar /srv/ego/install/ego.jar
1818
depends_on:
1919
- ego-postgres
2020
ego-postgres:
@@ -43,10 +43,10 @@ services:
4343
ports:
4444
- "8085:9000"
4545
score-server:
46-
image: overture/score-server:5.0.0
46+
image: overture/score-server:5.1.0
4747
user: "$MY_UID:$MY_GID"
4848
environment:
49-
SPRING_PROFILES_ACTIVE: amazon,collaboratory,prod,secure
49+
SPRING_PROFILES_ACTIVE: amazon,collaboratory,prod,secure,jwt
5050
SERVER_PORT: 8080
5151
OBJECT_SENTINEL: heliograph
5252
BUCKET_NAME_OBJECT: oicr.icgc.test
@@ -57,6 +57,7 @@ services:
5757
S3_ACCESSKEY: minio
5858
S3_SECRETKEY: minio123
5959
S3_SIGV4ENABLED: "true"
60+
AUTH_JWT_PUBLICKEYURL: http://ego-api:8080/oauth/token/public_key
6061
AUTH_SERVER_URL: http://ego-api:8080/o/check_api_key/
6162
AUTH_SERVER_CLIENTID: score
6263
AUTH_SERVER_CLIENTSECRET: scoresecret
@@ -144,7 +145,8 @@ services:
144145
target: server
145146
environment:
146147
SERVER_PORT: 8080
147-
SPRING_PROFILES_ACTIVE: "prod,secure,default"
148+
SPRING_PROFILES_ACTIVE: "prod,secure,default,jwt,score-client-cred"
149+
AUTH_JWT_PUBLICKEYURL: http://ego-api:8080/oauth/token/public_key
148150
AUTH_SERVER_URL: http://ego-api:8080/o/check_api_key/
149151
AUTH_SERVER_CLIENTID: song
150152
AUTH_SERVER_TOKENNAME: apiKey
@@ -153,7 +155,10 @@ services:
153155
AUTH_SERVER_SCOPE_STUDY_SUFFIX: .WRITE
154156
AUTH_SERVER_SCOPE_SYSTEM: song.WRITE
155157
SCORE_URL: http://score-server:8080
156-
SCORE_ACCESSTOKEN: f69b726d-d40f-4261-b105-1ec7e6bf04d5
158+
SCORE_CLIENTCREDENTIALS_ID: songToScore
159+
SCORE_CLIENTCREDENTIALS_SECRET: songToScoreSecret
160+
SCORE_CLIENTCREDENTIALS_TOKENURL: http://ego-api:8080/oauth/token
161+
SCORE_CLIENTCREDENTIALS_SYSTEMSCOPE: "score.WRITE"
157162
MANAGEMENT_SERVER_PORT: 8081
158163
SPRING_DATASOURCE_USERNAME: postgres
159164
SPRING_DATASOURCE_PASSWORD: password

docker/ego-init/init.sql

+2
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ ALTER TABLE public.userpermission OWNER TO postgres;
295295
--
296296

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

300301

@@ -344,6 +345,7 @@ COPY public.flyway_schema_history (installed_rank, version, description, type, s
344345
--
345346

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

349351

pom.xml

+6-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<groupId>bio.overture</groupId>
2222
<artifactId>song</artifactId>
2323
<packaging>pom</packaging>
24-
<version>4.3.0</version>
24+
<version>4.4.0</version>
2525
<modules>
2626
<module>song-core</module>
2727
<module>song-java-sdk</module>
@@ -176,6 +176,11 @@
176176
<artifactId>jackson-datatype-guava</artifactId>
177177
<version>${jackson.version}</version>
178178
</dependency>
179+
<dependency>
180+
<groupId>com.fasterxml.jackson.datatype</groupId>
181+
<artifactId>jackson-datatype-jsr310</artifactId>
182+
<version>${jackson.version}</version>
183+
</dependency>
179184
<dependency>
180185
<groupId>com.fasterxml.jackson.dataformat</groupId>
181186
<artifactId>jackson-dataformat-yaml</artifactId>

song-client/pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<parent>
1919
<artifactId>song</artifactId>
2020
<groupId>bio.overture</groupId>
21-
<version>4.3.0</version>
21+
<version>4.4.0</version>
2222
</parent>
2323
<modelVersion>4.0.0</modelVersion>
2424

@@ -35,12 +35,12 @@
3535
<dependency>
3636
<groupId>bio.overture</groupId>
3737
<artifactId>song-java-sdk</artifactId>
38-
<version>4.3.0</version>
38+
<version>4.4.0</version>
3939
</dependency>
4040
<dependency>
4141
<groupId>bio.overture</groupId>
4242
<artifactId>song-core</artifactId>
43-
<version>4.3.0</version>
43+
<version>4.4.0</version>
4444
</dependency>
4545

4646
<!-- CLI -->

song-core/pom.xml

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<artifactId>song</artifactId>
2121
<groupId>bio.overture</groupId>
22-
<version>4.3.0</version>
22+
<version>4.4.0</version>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
2525

@@ -65,6 +65,10 @@
6565
<groupId>com.fasterxml.jackson.core</groupId>
6666
<artifactId>jackson-annotations</artifactId>
6767
</dependency>
68+
<dependency>
69+
<groupId>com.fasterxml.jackson.datatype</groupId>
70+
<artifactId>jackson-datatype-jsr310</artifactId>
71+
</dependency>
6872

6973
<!-- Utilities -->
7074
<dependency>

song-core/src/main/java/bio/overture/song/core/model/Analysis.java

+10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package bio.overture.song.core.model;
22

33
import bio.overture.song.core.model.enums.AnalysisStates;
4+
import java.time.LocalDateTime;
45
import java.util.List;
6+
import java.util.SortedSet;
57
import lombok.AllArgsConstructor;
68
import lombok.Builder;
79
import lombok.Data;
@@ -23,4 +25,12 @@ public class Analysis extends DynamicData {
2325
private AnalysisTypeId analysisType;
2426
private List<CompositeSample> samples;
2527
private List<FileDTO> files;
28+
29+
private LocalDateTime createdAt;
30+
private LocalDateTime updatedAt;
31+
32+
private LocalDateTime firstPublishedAt;
33+
private LocalDateTime publishedAt;
34+
35+
private SortedSet<AnalysisStateChange> analysisStateHistory;
2636
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package bio.overture.song.core.model;
2+
3+
import java.time.LocalDateTime;
4+
import lombok.*;
5+
6+
@Data
7+
@Builder
8+
@NoArgsConstructor
9+
@AllArgsConstructor
10+
@ToString(callSuper = true)
11+
@EqualsAndHashCode(callSuper = true)
12+
public class AnalysisStateChange extends DynamicData implements Comparable<AnalysisStateChange> {
13+
private String initialState;
14+
private String updatedState;
15+
private LocalDateTime updatedAt;
16+
17+
@Override
18+
public int compareTo(AnalysisStateChange o) {
19+
return this.getUpdatedAt().compareTo(o.getUpdatedAt());
20+
}
21+
}

song-core/src/main/java/bio/overture/song/core/model/AnalysisType.java

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.fasterxml.jackson.annotation.JsonInclude;
44
import com.fasterxml.jackson.databind.JsonNode;
5+
import java.time.LocalDateTime;
56
import javax.validation.constraints.NotNull;
67
import lombok.AllArgsConstructor;
78
import lombok.Builder;
@@ -16,6 +17,7 @@ public class AnalysisType {
1617

1718
@NotNull private String name;
1819
@NotNull private Integer version;
20+
private LocalDateTime createdAt;
1921

2022
@JsonInclude(JsonInclude.Include.NON_NULL)
2123
private JsonNode schema;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package bio.overture.song.core.model.enums;
2+
3+
import static java.lang.String.format;
4+
import static java.util.Arrays.stream;
5+
import static java.util.stream.Collectors.toUnmodifiableSet;
6+
7+
import bio.overture.song.core.utils.Streams;
8+
import java.util.Collection;
9+
import java.util.Set;
10+
import lombok.NonNull;
11+
12+
public enum AnalysisActions {
13+
PUBLISH,
14+
UNPUBLISH,
15+
SUPPRESS,
16+
CREATE;
17+
18+
private static final Set<String> SET =
19+
Streams.stream(values()).map(AnalysisActions::toString).collect(toUnmodifiableSet());
20+
21+
public String toString() {
22+
return this.name();
23+
}
24+
25+
public static AnalysisActions resolveAnalysisActions(@NonNull String analysisAction) {
26+
return Streams.stream(values())
27+
.filter(x -> x.toString().equals(analysisAction))
28+
.findFirst()
29+
.orElseThrow(
30+
() ->
31+
new IllegalStateException(
32+
format("The analysis action '%s' cannot be resolved", analysisAction)));
33+
}
34+
35+
public static String[] toStringArray() {
36+
return stream(values()).map(Enum::name).toArray(String[]::new);
37+
}
38+
39+
public static Set<String> findIncorrectAnalysisActions(
40+
@NonNull Collection<String> analysisActions) {
41+
return analysisActions.stream().filter(x -> !SET.contains(x)).collect(toUnmodifiableSet());
42+
}
43+
}

song-core/src/main/java/bio/overture/song/core/utils/JsonUtils.java

+18-1
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,14 @@
3131
import com.fasterxml.jackson.databind.deser.std.StringDeserializer;
3232
import com.fasterxml.jackson.databind.module.SimpleModule;
3333
import com.fasterxml.jackson.databind.node.ObjectNode;
34+
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
35+
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
36+
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
3437
import java.io.IOException;
3538
import java.io.InputStream;
3639
import java.net.URL;
40+
import java.time.LocalDateTime;
41+
import java.time.format.DateTimeFormatter;
3742
import java.util.Map;
3843
import lombok.NonNull;
3944
import lombok.SneakyThrows;
@@ -48,10 +53,22 @@ public class JsonUtils {
4853
protected static final ObjectMapper mapper = mapper();
4954

5055
public static ObjectMapper mapper() {
56+
val mapper = new ObjectMapper();
57+
58+
/* Register Moduless */
5159
val specialModule = new SimpleModule();
5260
specialModule.addDeserializer(String.class, SpecialStringJsonDeserializer.instance);
5361

54-
val mapper = new ObjectMapper().registerModule(specialModule);
62+
val isoDateFormatter = DateTimeFormatter.ISO_DATE_TIME;
63+
val dateTimeDeserializer = new LocalDateTimeDeserializer(isoDateFormatter);
64+
val dateTimeSerializer = new LocalDateTimeSerializer(isoDateFormatter);
65+
66+
val javaTimeModule = new JavaTimeModule();
67+
javaTimeModule.addDeserializer(LocalDateTime.class, dateTimeDeserializer);
68+
javaTimeModule.addSerializer(LocalDateTime.class, dateTimeSerializer);
69+
70+
mapper.registerModule(specialModule);
71+
mapper.registerModule(javaTimeModule);
5572

5673
mapper.disable(DeserializationFeature.FAIL_ON_MISSING_CREATOR_PROPERTIES);
5774
mapper.disable(DeserializationFeature.FAIL_ON_UNRESOLVED_OBJECT_IDS);

song-java-sdk/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<parent>
1919
<artifactId>song</artifactId>
2020
<groupId>bio.overture</groupId>
21-
<version>4.3.0</version>
21+
<version>4.4.0</version>
2222
</parent>
2323
<modelVersion>4.0.0</modelVersion>
2424

song-server/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<artifactId>song</artifactId>
2121
<groupId>bio.overture</groupId>
22-
<version>4.3.0</version>
22+
<version>4.4.0</version>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
2525

@@ -37,7 +37,7 @@
3737
<dependency>
3838
<groupId>bio.overture</groupId>
3939
<artifactId>song-core</artifactId>
40-
<version>4.3.0</version>
40+
<version>4.4.0</version>
4141
</dependency>
4242

4343
<!-- Spring -->

song-server/src/main/java/bio/overture/song/server/ServerMain.java

+7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
*/
1717
package bio.overture.song.server;
1818

19+
import java.util.TimeZone;
20+
import javax.annotation.PostConstruct;
1921
import org.springframework.boot.SpringApplication;
2022
import org.springframework.boot.autoconfigure.SpringBootApplication;
2123
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
@@ -24,6 +26,11 @@
2426
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class})
2527
public class ServerMain {
2628

29+
@PostConstruct
30+
public void init() {
31+
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
32+
}
33+
2734
public static void main(String... args) {
2835
SpringApplication.run(ServerMain.class, args);
2936
}

0 commit comments

Comments
 (0)