Skip to content

Commit

Permalink
Merge pull request #76 from HHS/dev
Browse files Browse the repository at this point in the history
v3.0.0
  • Loading branch information
bischoffz committed Aug 20, 2024
2 parents f718545 + cc98d28 commit 54e0ac6
Show file tree
Hide file tree
Showing 268 changed files with 3,340 additions and 3,654 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/dev_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ jobs:
distribution: 'temurin'
cache: maven

- name: Get GCM and Taskit Version
- name: Get GCM 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
Expand All @@ -39,6 +38,11 @@ jobs:
path: gcm
ref: dev

- name: Get Taskit Version
if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
run: |
echo "taskit_version=v$(mvn help:evaluate -Dexpression=taskit.version -q -DforceStdout --file gcm/pom.xml)" >> "$GITHUB_ENV"
- name: Checkout Taskit
if: ${{ endsWith(env.taskit_version, 'SNAPSHOT') }}
uses: actions/checkout@v4
Expand All @@ -48,9 +52,9 @@ jobs:
ref: dev

- name: Get Util Version
if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
if: ${{ endsWith(env.taskit_version, 'SNAPSHOT') }}
run: |
echo "util_version=v$(mvn help:evaluate -Dexpression=util.version -q -DforceStdout --file gcm/pom.xml)" >> "$GITHUB_ENV"
echo "util_version=v$(mvn help:evaluate -Dexpression=util.version -q -DforceStdout --file taskit/pom.xml)" >> "$GITHUB_ENV"
- name: Checkout Util
if: ${{ endsWith(env.util_version, 'SNAPSHOT') }}
Expand All @@ -64,14 +68,14 @@ jobs:
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
if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
run: mvn clean install -DskipTests --file gcm/simulation/pom.xml

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

Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/dev_pr_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ jobs:
distribution: 'temurin'
cache: maven

- name: Get GCM and Taskit Version
- name: Get GCM 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
Expand All @@ -39,6 +38,11 @@ jobs:
path: gcm
ref: dev

- name: Get Taskit Version
if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
run: |
echo "taskit_version=v$(mvn help:evaluate -Dexpression=taskit.version -q -DforceStdout --file gcm/pom.xml)" >> "$GITHUB_ENV"
- name: Checkout Taskit
if: ${{ endsWith(env.taskit_version, 'SNAPSHOT') }}
uses: actions/checkout@v4
Expand All @@ -48,9 +52,9 @@ jobs:
ref: dev

- name: Get Util Version
if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
if: ${{ endsWith(env.taskit_version, 'SNAPSHOT') }}
run: |
echo "util_version=v$(mvn help:evaluate -Dexpression=util.version -q -DforceStdout --file gcm/pom.xml)" >> "$GITHUB_ENV"
echo "util_version=v$(mvn help:evaluate -Dexpression=util.version -q -DforceStdout --file taskit/pom.xml)" >> "$GITHUB_ENV"
- name: Checkout Util
if: ${{ endsWith(env.util_version, 'SNAPSHOT') }}
Expand All @@ -64,14 +68,14 @@ jobs:
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
if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
run: mvn clean install -DskipTests --file gcm/simulation/pom.xml

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

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
skipIfReleaseExists: true

update-gcm-pipeline:
if: ${{ !endsWith(needs.release.outputs.gcm_taskit_version, '0') }}
needs: release
runs-on: ubuntu-latest
permissions:
Expand Down
17 changes: 8 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

<!-- Properties -->
<properties>
<revision>2.8.5</revision>
<revision>3.0.0</revision>

<!-- basic project properties -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -59,20 +59,19 @@

<!-- standard plugins versions -->
<flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version>
<maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>3.2.5</maven-failsafe-plugin.version>
<maven-surefire-plugin.version>3.4.0</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>3.4.0</maven-failsafe-plugin.version>
<maven-source-plugin.version>3.3.1</maven-source-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>
<maven-javadoc-plugin.version>3.8.0</maven-javadoc-plugin.version>
<maven-gpg-plugin.version>3.2.5</maven-gpg-plugin.version>
<central-publishing-maven-plugin.version>0.5.0</central-publishing-maven-plugin.version>

<!-- dependency versions -->
<taskit.version>4.1.0</taskit.version>
<gcm.version>4.2.3</gcm.version>
<gcm.version>4.3.0</gcm.version>
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
<junit-jupiter-engine.version>5.10.2</junit-jupiter-engine.version>
<junit-jupiter-engine.version>5.11.0</junit-jupiter-engine.version>
</properties>

<dependencyManagement>
Expand Down
27 changes: 8 additions & 19 deletions protobuf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<properties>
<!-- protobuf specific plugins versions -->
<os-maven-plugin.version>1.7.1</os-maven-plugin.version>
<maven-dependency-plugin.version>3.6.1</maven-dependency-plugin.version>
<build-helper-maven-plugin.version>3.5.0</build-helper-maven-plugin.version>
<maven-dependency-plugin.version>3.7.1</maven-dependency-plugin.version>
<build-helper-maven-plugin.version>3.6.0</build-helper-maven-plugin.version>
<protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
<maven-replacer-plugin.version>1.4.1</maven-replacer-plugin.version>

Expand All @@ -37,11 +37,6 @@

<!-- Dependencies -->
<dependencies>
<dependency>
<groupId>gov.hhs.aspr.ms.taskit</groupId>
<artifactId>protobuf</artifactId>
<version>${taskit.version}</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protoc</artifactId>
Expand Down Expand Up @@ -94,20 +89,14 @@
<id>unpack-protos</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack</goal>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>gov.hhs.aspr.ms.taskit</groupId>
<artifactId>protobuf</artifactId>
<version>${taskit.version}</version>
<overWrite>true</overWrite>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<includes>**/*.proto</includes>
<excludes>**/testsupport/*.proto</excludes>
</artifactItem>
</artifactItems>
<includes>**/*.proto</includes>
<excludes>**/testsupport/*.proto</excludes>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<includeArtifactIds>protobuf</includeArtifactIds>
<includeTypes>jar</includeTypes>
</configuration>
</execution>
</executions>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.testsupport.translationSpecs;
package gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.testsupport.translation.specs;

import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.testsupport.ExampleDimension;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.testsupport.input.ExampleDimensionInput;
import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;

public class ExampleDimensionTranslationSpec extends ProtobufTranslationSpec<ExampleDimensionInput, ExampleDimension> {

@Override
protected ExampleDimension convertInputObject(ExampleDimensionInput inputObject) {
protected ExampleDimension translateInputObject(ExampleDimensionInput inputObject) {
return new ExampleDimension(inputObject.getLevelName());
}

@Override
protected ExampleDimensionInput convertAppObject(ExampleDimension appObject) {
protected ExampleDimensionInput translateAppObject(ExampleDimension appObject) {
return ExampleDimensionInput.newBuilder().setLevelName(appObject.getLevelName()).build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
package gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translation;

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.translation.specs.ExampleDimensionTranslationSpec;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translation.specs.DimensionTranslationSpec;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translation.specs.ExperimentParameterDataTranslationSpec;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translation.specs.PlannerTranslationSpec;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translation.specs.SimulationStateTranslationSpec;
import gov.hhs.aspr.ms.taskit.core.translation.Translator;
import gov.hhs.aspr.ms.taskit.protobuf.engine.IProtobufTaskitEngineBuilder;
import gov.hhs.aspr.ms.taskit.protobuf.engine.ProtobufJsonTaskitEngine;
import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;

/**
* Translator for Nucleus Using this Translator will add all the necessary
* TranslationSpecs needed to read and write the classes within Nucleus
*/
public class NucleusTranslator {

private NucleusTranslator() {
}

protected static List<ProtobufTranslationSpec<?, ?>> getTranslationSpecs() {
List<ProtobufTranslationSpec<?, ?>> list = new ArrayList<>();

list.add(new SimulationStateTranslationSpec());
list.add(new PlannerTranslationSpec());
list.add(new DimensionTranslationSpec());
list.add(new ExampleDimensionTranslationSpec());
list.add(new ExperimentParameterDataTranslationSpec());

return list;
}

/**
* Returns a Translator Builder that already includes the necessary
* TranslationSpecs needed to read and write the classes within Nucleus
*/
private static Translator.Builder builder() {
Translator.Builder builder = Translator.builder()
.setTranslatorId(NucleusTranslatorId.TRANSLATOR_ID)
.setInitializer((translatorContext) -> {
IProtobufTaskitEngineBuilder taskitEngineBuilder = translatorContext
.getTaskitEngineBuilder(IProtobufTaskitEngineBuilder.class);

for (ProtobufTranslationSpec<?, ?> translationSpec : getTranslationSpecs()) {
taskitEngineBuilder.addTranslationSpec(translationSpec);
}

if (taskitEngineBuilder instanceof ProtobufJsonTaskitEngine.Builder) {
((ProtobufJsonTaskitEngine.Builder) taskitEngineBuilder).addFieldToIncludeDefaultValue(
SimulationStateInput.getDescriptor().findFieldByName("startTime"));

((ProtobufJsonTaskitEngine.Builder) taskitEngineBuilder)
.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;
}

/**
* Returns a Translator that includes TranslationSpecs for the classes within
* Nucleus
*/
public static Translator getTranslator() {
return builder().build();
}
}
Loading

0 comments on commit 54e0ac6

Please sign in to comment.