Skip to content

Commit

Permalink
Merge pull request #56 from HHS/update-gcm-to-4.2.1
Browse files Browse the repository at this point in the history
Update gcm to 4.2.1
  • Loading branch information
bischoffz authored Jun 14, 2024
2 parents 8a46c03 + 48ba562 commit b2b37a6
Show file tree
Hide file tree
Showing 21 changed files with 245 additions and 53 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/dev_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ name: GCM Taskit Development Build
on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]

jobs:
dev-build:
Expand All @@ -28,9 +26,10 @@ jobs:
distribution: 'temurin'
cache: maven

- name: Get GCM Version
- name: Get GCM and Taskit Version
run: |
echo "gcm_version=v$(mvn help:evaluate -Dexpression=gcm.version -q -DforceStdout --file pom.xml)" >> "$GITHUB_ENV"
echo "taskit_version=v$(mvn help:evaluate -Dexpression=taskit.version -q -DforceStdout --file pom.xml)" >> "$GITHUB_ENV"
- name: Checkout GCM
if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
Expand All @@ -40,10 +39,6 @@ jobs:
path: gcm
ref: dev

- name: Get Taskit Version
run: |
echo "taskit_version=v$(mvn help:evaluate -Dexpression=taskit.version -q -DforceStdout --file pom.xml)" >> "$GITHUB_ENV"
- name: Checkout Taskit
if: ${{ endsWith(env.taskit_version, 'SNAPSHOT') }}
uses: actions/checkout@v4
Expand Down
80 changes: 80 additions & 0 deletions .github/workflows/dev_pr_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: GCM Taskit Development PR Build

on:
pull_request:
branches-ignore: [ "main" ]

jobs:
dev-build:
runs-on: ubuntu-latest
steps:
- name: Checkout GCM Taskit
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Get GCM and Taskit Version
run: |
echo "gcm_version=v$(mvn help:evaluate -Dexpression=gcm.version -q -DforceStdout --file pom.xml)" >> "$GITHUB_ENV"
echo "taskit_version=v$(mvn help:evaluate -Dexpression=taskit.version -q -DforceStdout --file pom.xml)" >> "$GITHUB_ENV"
- name: Checkout GCM
if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
uses: actions/checkout@v4
with:
repository: HHS/ASPR-8
path: gcm
ref: dev

- name: Checkout Taskit
if: ${{ endsWith(env.taskit_version, 'SNAPSHOT') }}
uses: actions/checkout@v4
with:
repository: HHS/ASPR-ms-taskit
path: taskit
ref: dev

- name: Get Util Version
if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
run: |
echo "util_version=v$(mvn help:evaluate -Dexpression=util.version -q -DforceStdout --file gcm/pom.xml)" >> "$GITHUB_ENV"
- name: Checkout Util
if: ${{ endsWith(env.util_version, 'SNAPSHOT') }}
uses: actions/checkout@v4
with:
repository: HHS/ASPR-ms-util
path: util
ref: dev

- name: Build Util
if: ${{ endsWith(env.util_version, 'SNAPSHOT') }}
run: mvn clean install -DskipTests --file util/pom.xml

- name: Build GCM
if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
run: mvn clean install -DskipTests --file gcm/simulation/pom.xml

- name: Build Taskit
if: ${{ endsWith(env.taskit_version, 'SNAPSHOT') }}
run: mvn clean install -DskipTests --file taskit/pom.xml

- name: Build GCM Taskit
run: mvn clean install --file pom.xml

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
# - name: Update dependency graph
# uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
11 changes: 5 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

<!-- Properties -->
<properties>
<revision>2.8.1</revision>
<revision>2.8.2</revision>

<!-- basic project properties -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -62,15 +62,15 @@
<maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>3.2.5</maven-failsafe-plugin.version>
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
<maven-install-plugin.version>3.1.1</maven-install-plugin.version>
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
<maven-install-plugin.version>3.1.2</maven-install-plugin.version>
<maven-deploy-plugin.version>3.1.2</maven-deploy-plugin.version>
<maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
<maven-gpg-plugin.version>3.2.4</maven-gpg-plugin.version>
<central-publishing-maven-plugin.version>0.4.0</central-publishing-maven-plugin.version>

<!-- dependency versions -->
<taskit.version>4.0.2</taskit.version>
<gcm.version>4.2.0</gcm.version>
<gcm.version>4.2.1</gcm.version>
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
<junit-jupiter-engine.version>5.10.2</junit-jupiter-engine.version>
</properties>
Expand Down Expand Up @@ -110,7 +110,6 @@
<dependency>
<groupId>gov.hhs.aspr.ms.gcm</groupId>
<artifactId>simulation</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
Expand Down Expand Up @@ -411,4 +410,4 @@
</build>
</profile>
</profiles>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.ArrayList;
import java.util.List;

import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.input.ExperimentParameterDataInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.input.SimulationStateInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.testsupport.translationSpecs.ExampleDimensionTranslationSpec;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translationSpecs.DimensionTranslationSpec;
Expand Down Expand Up @@ -51,6 +52,19 @@ private static Translator.Builder builder() {

translationEngineBuilder.addFieldToIncludeDefaultValue(
SimulationStateInput.getDescriptor().findFieldByName("startTime"));

translationEngineBuilder.addFieldToIncludeDefaultValue(
ExperimentParameterDataInput.getDescriptor().findFieldByName("threadCount"))
.addFieldToIncludeDefaultValue(
ExperimentParameterDataInput.getDescriptor().findFieldByName("startRecordingIsScheduled"))
.addFieldToIncludeDefaultValue(
ExperimentParameterDataInput.getDescriptor().findFieldByName("simulationHaltTime"))
.addFieldToIncludeDefaultValue(
ExperimentParameterDataInput.getDescriptor().findFieldByName("haltOnException"))
.addFieldToIncludeDefaultValue(
ExperimentParameterDataInput.getDescriptor().findFieldByName("experimentProgressLogPath"))
.addFieldToIncludeDefaultValue(
ExperimentParameterDataInput.getDescriptor().findFieldByName("continueFromProgressLog"));
});

return builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.List;

import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.stochastics.translationSpecs.RandomNumberGeneratorIdTranslationSpec;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.stochastics.translationSpecs.SimpleRandomNumberGeneratorIdTranslationSpec;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.stochastics.translationSpecs.StochasticsPluginDataTranslationSpec;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.stochastics.translationSpecs.TestRandomGeneratorIdTranslationSpec;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.stochastics.translationSpecs.WellStateTranslationSpec;
Expand All @@ -27,6 +28,8 @@ private StochasticsTranslator() {
list.add(new WellStateTranslationSpec());
list.add(new RandomNumberGeneratorIdTranslationSpec());
list.add(new TestRandomGeneratorIdTranslationSpec());
list.add(new SimpleRandomNumberGeneratorIdTranslationSpec());


return list;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.stochastics.translationSpecs;

import gov.hhs.aspr.ms.gcm.simulation.plugins.reports.support.SimpleReportLabel;
import gov.hhs.aspr.ms.gcm.simulation.plugins.stochastics.support.SimpleRandomNumberGeneratorId;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.reports.support.input.SimpleReportLabelInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.stochastics.support.input.SimpleRandomNumberGeneratorIdInput;
import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;

/**
* TranslationSpec that defines how to convert between
* {@linkplain SimpleReportLabelInput} and {@linkplain SimpleReportLabel}
*/
public class SimpleRandomNumberGeneratorIdTranslationSpec
extends ProtobufTranslationSpec<SimpleRandomNumberGeneratorIdInput, SimpleRandomNumberGeneratorId> {

@Override
protected SimpleRandomNumberGeneratorId convertInputObject(SimpleRandomNumberGeneratorIdInput inputObject) {
return new SimpleRandomNumberGeneratorId(this.translationEngine.getObjectFromAny(inputObject.getValue()));
}

@Override
protected SimpleRandomNumberGeneratorIdInput convertAppObject(SimpleRandomNumberGeneratorId appObject) {
return SimpleRandomNumberGeneratorIdInput.newBuilder()
.setValue(this.translationEngine.getAnyFromObject(appObject.getValue()))
.build();
}

@Override
public Class<SimpleRandomNumberGeneratorId> getAppObjectClass() {
return SimpleRandomNumberGeneratorId.class;
}

@Override
public Class<SimpleRandomNumberGeneratorIdInput> getInputObjectClass() {
return SimpleRandomNumberGeneratorIdInput.class;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ message RandomNumberGeneratorIdInput {
google.protobuf.Any id = 1;
}

message SimpleRandomNumberGeneratorIdInput {
google.protobuf.Any value = 1;
}


message WellStateInput {
int64 seed = 1;
optional int32 index = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

public class IT_NucleusTranslator {
Path basePath = ResourceHelper.getResourceDir(this.getClass());
Path filePath = ResourceHelper.makeOutputDir(basePath, "test-output");
Path filePath = ResourceHelper.createDirectory(basePath, "test-output");

@Test
@UnitTestForCoverage
public void testSimulationStateTranslator() {
String fileName = "simulationState.json";

ResourceHelper.createOutputFile(filePath, fileName);
ResourceHelper.createFile(filePath, fileName);

TranslationController translatorController = TranslationController.builder()
.addTranslationEngine(
Expand Down Expand Up @@ -57,7 +57,7 @@ public void testSimulationStateTranslator() {
public void testExperimentParameterDataTranslator() {
String fileName = "experimentParameterData.json";

ResourceHelper.createOutputFile(filePath, fileName);
ResourceHelper.createFile(filePath, fileName);

TranslationController translatorController = TranslationController.builder()
.addTranslationEngine(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@

public class IT_GlobalPropertiesTranslator {
Path basePath = ResourceHelper.getResourceDir(this.getClass());
Path filePath = ResourceHelper.makeOutputDir(basePath, "test-output");
Path filePath = ResourceHelper.createDirectory(basePath, "test-output");

@Test
@UnitTestForCoverage
public void testGlobalPropertiesPluginDataIntegration() {
String fileName = "globalPropertiesPluginData.json";

ResourceHelper.createOutputFile(filePath, fileName);
ResourceHelper.createFile(filePath, fileName);

ProtobufTranslationEngine protobufTranslationEngine = ProtobufTranslationEngine.builder()
.addTranslator(GlobalPropertiesTranslator.getTranslator())
Expand Down Expand Up @@ -68,7 +68,7 @@ public void testGlobalPropertiesPluginDataIntegration() {
public void testGlobalPropertyReportPluginDataIntegration() {
String fileName = "propertyReport.json";

ResourceHelper.createOutputFile(filePath, fileName);
ResourceHelper.createFile(filePath, fileName);

ProtobufTranslationEngine protobufTranslationEngine = ProtobufTranslationEngine.builder()
.addTranslator(GlobalPropertiesTranslator.getTranslator())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@

public class IT_GroupsTranslator {
Path basePath = ResourceHelper.getResourceDir(this.getClass());
Path filePath = ResourceHelper.makeOutputDir(basePath, "test-output");
Path filePath = ResourceHelper.createDirectory(basePath, "test-output");

@Test
@UnitTestForCoverage
public void testGroupsTranslator() {
String fileName = "groupsPluginData.json";

ResourceHelper.createOutputFile(filePath, fileName);
ResourceHelper.createFile(filePath, fileName);

ProtobufTranslationEngine protobufTranslationEngine = ProtobufTranslationEngine.builder()
.addTranslator(GroupsTranslator.getTranslator())
Expand Down Expand Up @@ -99,7 +99,7 @@ public void testGroupsTranslator() {
public void testGroupPropertyReportTranslatorSpec() {
String fileName = "propertyReport.json";

ResourceHelper.createOutputFile(filePath, fileName);
ResourceHelper.createFile(filePath, fileName);

ProtobufTranslationEngine protobufTranslationEngine = ProtobufTranslationEngine.builder()
.addTranslator(GroupsTranslator.getTranslator())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@

public class IT_MaterialsTranslator {
Path basePath = ResourceHelper.getResourceDir(this.getClass());
Path filePath = ResourceHelper.makeOutputDir(basePath, "test-output");
Path filePath = ResourceHelper.createDirectory(basePath, "test-output");

@Test
@UnitTestForCoverage
public void testMaterialsTranslator() {
String fileName = "materialsPluginData.json";

ResourceHelper.createOutputFile(filePath, fileName);
ResourceHelper.createFile(filePath, fileName);

TranslationController translatorController = TranslationController.builder()
.addTranslationEngine(ProtobufTranslationEngine.builder()
Expand Down Expand Up @@ -76,7 +76,7 @@ public void testMaterialsTranslator() {
public void testBatchStatusReportPluginDataTranslatorSpec() {
String fileName = "batchStatusReport.json";

ResourceHelper.createOutputFile(filePath, fileName);
ResourceHelper.createFile(filePath, fileName);

TranslationController translatorController = TranslationController.builder()
.addTranslationEngine(ProtobufTranslationEngine.builder()
Expand Down Expand Up @@ -116,7 +116,7 @@ public void testBatchStatusReportPluginDataTranslatorSpec() {
public void testMaterialsProducerPropertyReportPluginDataTranslatorSpec() {
String fileName = "materialsProducerPropertyReport.json";

ResourceHelper.createOutputFile(filePath, fileName);
ResourceHelper.createFile(filePath, fileName);

TranslationController translatorController = TranslationController.builder()
.addTranslationEngine(ProtobufTranslationEngine.builder()
Expand Down Expand Up @@ -155,7 +155,7 @@ public void testMaterialsProducerPropertyReportPluginDataTranslatorSpec() {
public void testMaterialsProducerResourceReportPluginDataTranslatorSpec() {
String fileName = "materialsProducerResourceReport.json";

ResourceHelper.createOutputFile(filePath, fileName);
ResourceHelper.createFile(filePath, fileName);

TranslationController translatorController = TranslationController.builder()
.addTranslationEngine(ProtobufTranslationEngine.builder()
Expand Down Expand Up @@ -194,7 +194,7 @@ public void testMaterialsProducerResourceReportPluginDataTranslatorSpec() {
public void testStageReportPluginDataTranslatorSpec() {
String fileName = "stageReport.json";

ResourceHelper.createOutputFile(filePath, fileName);
ResourceHelper.createFile(filePath, fileName);

TranslationController translatorController = TranslationController.builder()
.addTranslationEngine(ProtobufTranslationEngine.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

public class IT_PartitionsTranslator {
Path basePath = ResourceHelper.getResourceDir(this.getClass());
Path filePath = ResourceHelper.makeOutputDir(basePath, "test-output");
Path filePath = ResourceHelper.createDirectory(basePath, "test-output");

@Test
@UnitTestForCoverage
public void testGroupsTranslator() {
String fileName = "partitionsPluginData.json";

ResourceHelper.createOutputFile(filePath, fileName);
ResourceHelper.createFile(filePath, fileName);

TranslationController translatorController = TranslationController.builder()
.addTranslationEngine(ProtobufTranslationEngine.builder()
Expand Down
Loading

0 comments on commit b2b37a6

Please sign in to comment.