Skip to content

Commit a19590f

Browse files
authored
Merge pull request #579 from overture-stack/rc/4.0.0
Release Candidate 4.0.0
2 parents cb2fc98 + c944af2 commit a19590f

File tree

197 files changed

+3402
-3405
lines changed

Some content is hidden

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

197 files changed

+3402
-3405
lines changed

Makefile

+25
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ _ping_song_server:
8383
'http://localhost:8080/isAlive'
8484
@echo ""
8585

86+
_ping_song_db:
87+
@echo $(YELLOW)$(INFO_HEADER) "Pinging song-db on localhost:8432" $(END)
88+
@$(RETRY_CMD) $(DOCKER_COMPOSE_EXE) exec song-db psql -U postgres song -c 'select 1'
89+
@echo ""
90+
8691

8792
_setup-object-storage:
8893
@echo $(YELLOW)$(INFO_HEADER) "Setting up bucket oicr.icgc.test and heliograph" $(END)
@@ -170,6 +175,26 @@ clean-output-dirs:
170175
# Clean everything. Kills all services, maven cleans and removes generated files/directories
171176
clean: clean-docker clean-mvn clean-log-dirs clean-output-dirs
172177

178+
#############################################################
179+
# Flyway and Database Related targets
180+
#############################################################
181+
182+
refresh-db:
183+
@echo $(YELLOW)$(INFO_HEADER) "Refreshing song-db" $(END)
184+
@$(DOCKER_COMPOSE_CMD) kill song-db song-server
185+
@$(DOCKER_COMPOSE_CMD) rm -f song-db
186+
@$(DOCKER_COMPOSE_CMD) up -d song-db
187+
188+
migrate: clean-mvn package refresh-db _ping_song_db
189+
@$(MVN_CMD) -X -pl song-server flyway:migrate \
190+
-Dflyway.user=postgres \
191+
-Dflyway.password=password \
192+
-Dflyway.url=jdbc:postgresql://localhost:8432/song?stringtype=unspecified \
193+
-Dflyway.locations=classpath:db/migration
194+
195+
login-db:
196+
@$(DOCKER_COMPOSE_CMD) exec song-db psql -U postgres song
197+
173198
#############################################################
174199
# Building targets
175200
#############################################################

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ docker run --rm \
173173
-e 'CLIENT_PROGRAM_NAME=sing' \
174174
-e 'CLIENT_DEBUG=true' \
175175
-e 'CLIENT_ACCESS_TOKEN=myAccessToken' \
176-
overture/song-client:latest
177-
bin/sing config
176+
overture/song-client:latest \
177+
sing config
178178
```
179179

180180
### Notes

docker-compose.yml

+2
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ services:
9696
POSTGRES_DB: song
9797
POSTGRES_USER: postgres
9898
POSTGRES_PASSWORD: password
99+
ports:
100+
- "8432:5432"
99101
volumes:
100102
- "./docker/song-db-init:/docker-entrypoint-initdb.d"
101103
aws-cli:

docker/song-example-data/exampleVariantCall.json

+15-12
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
11
{
2-
"study" : "ABC123",
2+
"studyId" : "ABC123",
33
"analysisType" : {
4-
"name" : "variantCall",
5-
"version" : 1
4+
"name" : "variantCall"
65
},
76
"experiment": {
87
"variantCallingTool": "silver bullet",
9-
"matchedNormalSampleSubmitterId": "sample x24-11a",
8+
"matchedNormalSampleSubmitterId": "sample-x24-11a",
109
"randomField14" : "we can define any EXPERIMENT field. For example, randomField14",
1110
"randomField15" : "as a second example, we can define another random EXPERIMENT field called randomField15",
1211
"info" : {
1312
"randomField16" : "alternatively, put some extra EXPERIMENT fields here"
1413
}
1514
},
16-
"sample": [
15+
"samples": [
1716
{
18-
"sampleSubmitterId": "internal_sample_98024759826836",
17+
"submitterSampleId": "internal_sample_98024759826836",
1918
"sampleType": "Total RNA",
19+
"matchedNormalSubmitterSampleId": "sample-x24-11a",
2020
"specimen": {
21-
"specimenSubmitterId": "internal_specimen_9b73gk8s02dk",
22-
"specimenClass": "Tumour",
23-
"specimenType": "Primary tumour - other",
21+
"submitterSpecimenId": "internal_specimen_9b73gk8s02dk",
22+
"specimenType": "Primary tumour",
23+
"specimenTissueSource": "Solid tissue",
24+
"tumourNormalDesignation": "Tumour",
2425
"randomField1" : "we can define any SPECIMEN field. For example, randomField1",
2526
"randomField2" : "as a second example, we can define another random SPECIMEN field called randomField2",
2627
"info" : {
2728
"randomField3" : "alternatively, put some extra SPECIMEN fields here"
2829
}
2930
},
3031
"donor": {
31-
"donorSubmitterId": "internal_donor_123456789-00",
32-
"donorGender": "female",
32+
"submitterDonorId": "internal_donor_123456789-00",
33+
"gender": "Female",
3334
"randomField4" : "we can define any DONOR field. For example, randomField4",
3435
"randomField5" : "as a second example, we can define another random DONOR field called randomField5",
3536
"info" : {
@@ -43,8 +44,9 @@
4344
}
4445
}
4546
],
46-
"file": [
47+
"files": [
4748
{
49+
"dataType": "Variant Calling Data",
4850
"fileName": "example.vcf.gz",
4951
"fileSize": 52,
5052
"fileMd5sum": "9a793e90d0d1e11301ea8da996446e59",
@@ -57,6 +59,7 @@
5759
}
5860
},
5961
{
62+
"dataType": "Variant Calling Index",
6063
"fileName": "example.vcf.gz.idx",
6164
"fileSize": 25,
6265
"fileMd5sum": "c03274816eb4907a92b8e5632cd6eb81",

pom.xml

+3-26
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>3.1.1</version>
24+
<version>4.0.0</version>
2525
<modules>
2626
<module>song-core</module>
2727
<module>song-java-sdk</module>
@@ -41,14 +41,6 @@
4141
<id>jitpack.io</id>
4242
<url>https://jitpack.io</url>
4343
</repository>
44-
<repository>
45-
<id>dcc-releases</id>
46-
<url>https://artifacts.oicr.on.ca/artifactory/dcc-release</url>
47-
</repository>
48-
<repository>
49-
<id>dcc-snapshot</id>
50-
<url>https://artifacts.oicr.on.ca/artifactory/dcc-snapshot</url>
51-
</repository>
5244
<repository>
5345
<id>Atlassian 3rd Party</id>
5446
<url>https://maven.atlassian.com/3rdparty/</url>
@@ -243,9 +235,8 @@
243235
<version>${java-assist.version}</version>
244236
</dependency>
245237
<dependency>
246-
<groupId>javax.xml.bind</groupId>
247-
<artifactId>jaxb-api</artifactId>
248-
<version>${jaxb.version}</version>
238+
<groupId>org.glassfish.jaxb</groupId>
239+
<artifactId>jaxb-runtime</artifactId>
249240
</dependency>
250241

251242
<dependency>
@@ -254,18 +245,6 @@
254245
<version>${javax.interceptor-api.version}</version>
255246
</dependency>
256247

257-
<!--ICGC Libs-->
258-
<dependency>
259-
<groupId>org.icgc.dcc</groupId>
260-
<artifactId>dcc-common-core</artifactId>
261-
<version>${dcc-common.version}</version>
262-
</dependency>
263-
<dependency>
264-
<groupId>org.icgc.dcc</groupId>
265-
<artifactId>dcc-id-client</artifactId>
266-
<version>${dcc-id.version}</version>
267-
</dependency>
268-
269248
<!--Json Schema-->
270249
<dependency>
271250
<groupId>com.networknt</groupId>
@@ -474,7 +453,6 @@
474453
<!--<spring-data-commons.version>1.12.11.RELEASE</spring-data-commons.version>-->
475454
<spring-framework.version>5.1.9.RELEASE</spring-framework.version>
476455
<spring-cloud.version>Greenwich.SR3</spring-cloud.version>
477-
<dcc-common.version>4.3.8</dcc-common.version>
478456
<postgresql.version>42.2.2</postgresql.version>
479457
<junit.version>4.12</junit.version>
480458
<slf4j.version>1.7.25</slf4j.version>
@@ -486,7 +464,6 @@
486464
<java-uuid-generator.version>3.1.5</java-uuid-generator.version>
487465
<wiremock.version>2.14.0</wiremock.version>
488466
<springfox.version>2.9.0</springfox.version>
489-
<dcc-id.version>5.2.0</dcc-id.version>
490467
<spring-security-oauth2.version>2.1.0.RELEASE</spring-security-oauth2.version>
491468
<hibernate-native-json.version>0.4</hibernate-native-json.version>
492469

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>3.1.1</version>
21+
<version>4.0.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>3.1.1</version>
38+
<version>4.0.0</version>
3939
</dependency>
4040
<dependency>
4141
<groupId>bio.overture</groupId>
4242
<artifactId>song-core</artifactId>
43-
<version>3.1.1</version>
43+
<version>4.0.0</version>
4444
</dependency>
4545

4646
<!-- CLI -->

song-client/src/main/java/bio/overture/song/client/Main.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package bio.overture.song.client;
22

33
import static bio.overture.song.client.cli.ClientMain.createClientMain;
4+
import static bio.overture.song.core.utils.Booleans.convertToBoolean;
45
import static bio.overture.song.core.utils.JsonDocUtils.getInputStreamClasspath;
5-
import static java.lang.Boolean.parseBoolean;
66
import static java.nio.file.Files.exists;
77
import static java.nio.file.Files.newInputStream;
88
import static java.util.Objects.isNull;
@@ -62,6 +62,6 @@ private static String getString(String value, String envVar) {
6262

6363
private static boolean getBoolean(boolean value, String envVar) {
6464
val envValue = System.getenv(envVar);
65-
return isNull(envValue) ? value : parseBoolean(envValue);
65+
return isNull(envValue) ? value : convertToBoolean(envValue);
6666
}
6767
}

song-client/src/main/java/bio/overture/song/client/util/EnumConverter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package bio.overture.song.client.util;
22

3-
import static bio.overture.song.core.utils.Joiners.COMMA;
3+
import static bio.overture.song.core.utils.Separators.COMMA;
44
import static java.lang.String.format;
55

66
import com.beust.jcommander.IStringConverter;

song-client/src/test/java/bio/overture/song/client/HappyPathClientMainTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public void testAnalysisSearch() {
270270
.analysisId(DUMMY_ANALYSIS_ID)
271271
.analysisState(UNPUBLISHED)
272272
.analysisType(ANALYSIS_TYPE_ID1)
273-
.study(DUMMY_STUDY_ID)
273+
.studyId(DUMMY_STUDY_ID)
274274
.build();
275275
when(songApi.getAnalysis(DUMMY_STUDY_ID, DUMMY_ANALYSIS_ID)).thenReturn(expectedAnalysis);
276276
assertOutputJson(objectToTree(expectedAnalysis), "search", "-a", DUMMY_ANALYSIS_ID);
@@ -289,7 +289,7 @@ public void testIdSearch() {
289289
.analysisId(DUMMY_ANALYSIS_ID)
290290
.analysisState(UNPUBLISHED)
291291
.analysisType(ANALYSIS_TYPE_ID1)
292-
.study(DUMMY_STUDY_ID)
292+
.studyId(DUMMY_STUDY_ID)
293293
.build());
294294

295295
when(songApi.idSearch(DUMMY_STUDY_ID, expectedSample.getSampleId(), null, null, null))

song-core/pom.xml

+1-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>3.1.1</version>
22+
<version>4.0.0</version>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
2525

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package bio.overture.song.core.exceptions;
2+
3+
import static java.lang.String.format;
4+
5+
public class BooleanConversionException extends RuntimeException {
6+
7+
public BooleanConversionException() {}
8+
9+
public BooleanConversionException(String formattedMessage, Object... args) {
10+
super(format(formattedMessage, args));
11+
}
12+
13+
public BooleanConversionException(Throwable cause, String formattedMessage, Object... args) {
14+
super(format(formattedMessage, args), cause);
15+
}
16+
17+
public BooleanConversionException(Throwable cause) {
18+
super(cause);
19+
}
20+
21+
public BooleanConversionException(
22+
Throwable cause,
23+
boolean enableSuppression,
24+
boolean writableStackTrace,
25+
String formattedMessage,
26+
Object... args) {
27+
super(format(formattedMessage, args), cause, enableSuppression, writableStackTrace);
28+
}
29+
}

song-core/src/main/java/bio/overture/song/core/exceptions/ServerErrors.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,11 @@ public enum ServerErrors implements ServerError {
111111
REST_CLIENT_UNEXPECTED_RESPONSE(BAD_GATEWAY),
112112
ID_SERVICE_ERROR(BAD_GATEWAY),
113113
MALFORMED_JSON_SCHEMA(BAD_REQUEST),
114+
STORAGE_SERVICE_ERROR(BAD_GATEWAY),
114115
STORAGE_OBJECT_NOT_FOUND(
115116
NOT_FOUND), // Used STORAGE instead of SCORE to not tie it to a specific implementation
116-
UNKNOWN_ERROR(INTERNAL_SERVER_ERROR);
117+
UNKNOWN_ERROR(INTERNAL_SERVER_ERROR),
118+
ILLEGAL_ANALYSIS_TYPE_NAME(BAD_REQUEST);
117119

118120
private static final String ERROR_ID_SEPARATOR = ".";
119121
private static final String ENUM_NAME_SEPARATOR = "_";

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
public class Analysis extends DynamicData {
1919

2020
private String analysisId;
21-
private String study;
21+
private String studyId;
2222
private AnalysisStates analysisState;
2323
private AnalysisTypeId analysisType;
24-
private List<CompositeSample> sample;
25-
private List<FileDTO> file;
24+
private List<CompositeSample> samples;
25+
private List<FileDTO> files;
2626
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ public class Donor extends Metadata {
1717

1818
private String donorId;
1919
private String studyId;
20-
private String donorSubmitterId;
21-
private String donorGender;
20+
private String submitterDonorId;
21+
private String gender;
2222
}

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

+9-8
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,22 @@
1717

1818
package bio.overture.song.core.model;
1919

20-
import com.fasterxml.jackson.annotation.JsonInclude;
2120
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
2221
import com.fasterxml.jackson.databind.JsonNode;
2322
import java.util.List;
24-
import lombok.NonNull;
25-
import lombok.Value;
23+
import lombok.Data;
24+
import lombok.val;
2625

27-
@Value
26+
@Data
2827
@JsonPropertyOrder({"studyId", "payloads"})
29-
@JsonInclude(JsonInclude.Include.NON_NULL)
3028
public class ExportedPayload {
31-
@NonNull private String studyId;
32-
@NonNull private List<JsonNode> payloads;
29+
private String studyId;
30+
private List<JsonNode> payloads;
3331

3432
public static ExportedPayload createExportedPayload(String studyId, List<JsonNode> payloads) {
35-
return new ExportedPayload(studyId, payloads);
33+
val p = new ExportedPayload();
34+
p.setStudyId(studyId);
35+
p.setPayloads(payloads);
36+
return p;
3637
}
3738
}

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

+2
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ public interface File extends FileMetadata, FileContent {
2828
String getFileName();
2929

3030
String getFileType();
31+
32+
String getDataType();
3133
}

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

+1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ public class FileDTO extends Metadata implements File {
1919
private String fileMd5sum;
2020
private Long fileSize;
2121
private String fileAccess;
22+
private String dataType;
2223
}

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
@AllArgsConstructor
4040
@EqualsAndHashCode
4141
@ToString
42-
@JsonInclude(JsonInclude.Include.NON_ABSENT)
42+
@JsonInclude(JsonInclude.Include.NON_EMPTY)
4343
public class Metadata {
4444

4545
private final Map<String, Object> info = new TreeMap<>();
@@ -59,6 +59,7 @@ public void setInfo(String info) {
5959
}
6060

6161
@JsonGetter
62+
@JsonInclude(JsonInclude.Include.NON_EMPTY)
6263
public JsonNode getInfo() {
6364
return JsonUtils.toJsonNode(info);
6465
}

0 commit comments

Comments
 (0)