From 96b93a3d73663fba5bdeead27311a441f46706e4 Mon Sep 17 00:00:00 2001 From: Tom Szendrey Date: Thu, 10 Aug 2023 10:19:06 -0400 Subject: [PATCH 1/9] need to remove from test operation --- .../workflow/tera-simulation-workflow.vue | 23 +++++++++++++++++++ .../CalibrationIntermediateResults.java | 15 ++++++++++++ .../dataservice/SimulationResource.java | 22 ++++++++++++++++++ .../src/main/resources/application.properties | 15 ++++++++---- 4 files changed, 70 insertions(+), 5 deletions(-) create mode 100644 packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/CalibrationIntermediateResults.java diff --git a/packages/client/hmi-client/src/components/workflow/tera-simulation-workflow.vue b/packages/client/hmi-client/src/components/workflow/tera-simulation-workflow.vue index 59129e4f10..b9c4c43685 100644 --- a/packages/client/hmi-client/src/components/workflow/tera-simulation-workflow.vue +++ b/packages/client/hmi-client/src/components/workflow/tera-simulation-workflow.vue @@ -241,6 +241,8 @@ import * as d3 from 'd3'; import { IProject, ProjectAssetTypes } from '@/types/Project'; import { Dataset, Model } from '@/types/Types'; import { useDragEvent } from '@/services/drag-drop'; +import { EventSourcePolyfill } from 'event-source-polyfill'; +import useAuthStore from '@/stores/auth'; import { DatasetOperation } from './dataset-operation'; import TeraDatasetNode from './tera-dataset-node.vue'; import TeraStratifyNode from './tera-stratify-node.vue'; @@ -411,6 +413,27 @@ function appendOutputPort(node: WorkflowNode, port: { type: string; label?: stri const testNode = (node: WorkflowNode) => { const value = (node.inputs[0].value?.[0] ?? 0) + Math.round(Math.random() * 10); appendOutputPort(node, { type: 'number', label: value.toString(), value }); + + console.log('Checking MQ'); + const auth = useAuthStore(); + const ttt = new EventSourcePolyfill('/api/simulations/123/partial-result', { + headers: { + Authorization: `Bearer ${auth.token}` + } + }); + ttt.onerror = (e) => { + console.log('An error occurred while attempting to connect.'); + console.log(e); + ttt.close(); + console.log('Closing ttt'); + }; + ttt.onmessage = (event) => { + console.log(event); + const json = event.data; + console.log(json); + ttt.close(); + console.log('Closing ttt'); + }; }; const drilldown = (event: WorkflowNode) => { diff --git a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/CalibrationIntermediateResults.java b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/CalibrationIntermediateResults.java new file mode 100644 index 0000000000..c9f472cf0b --- /dev/null +++ b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/CalibrationIntermediateResults.java @@ -0,0 +1,15 @@ +package software.uncharted.terarium.hmiserver.models; + +import lombok.Data; +import lombok.experimental.Accessors; +import com.fasterxml.jackson.annotation.JsonAlias; + +import java.io.Serializable; + +@Data +@Accessors(chain = true) +public class CalibrationIntermediateResults implements Serializable { + @JsonAlias("job_id") + private String jobId; + private float progress; +} \ No newline at end of file diff --git a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java index 5c03e1c977..9f43c55f1d 100644 --- a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java +++ b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java @@ -8,7 +8,13 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.eclipse.microprofile.openapi.annotations.tags.Tag; +import io.smallrye.mutiny.Multi; +import io.smallrye.mutiny.groups.MultiSelect; import org.eclipse.microprofile.rest.client.inject.RestClient; +import org.eclipse.microprofile.reactive.messaging.Channel; +import org.eclipse.microprofile.reactive.messaging.Incoming; +import org.reactivestreams.Publisher; +import org.jboss.resteasy.annotations.SseElementType; import software.uncharted.terarium.hmiserver.models.dataservice.PresignedURL; import software.uncharted.terarium.hmiserver.models.dataservice.ResourceType; import software.uncharted.terarium.hmiserver.models.dataservice.Simulation; @@ -18,6 +24,7 @@ import software.uncharted.terarium.hmiserver.proxies.dataservice.SimulationProxy; import software.uncharted.terarium.hmiserver.resources.SnakeCaseResource; import software.uncharted.terarium.hmiserver.utils.Converter; +import software.uncharted.terarium.hmiserver.models.CalibrationIntermediateResults; import javax.inject.Inject; import javax.ws.rs.*; @@ -43,6 +50,9 @@ public class SimulationResource implements SnakeCaseResource { @RestClient DatasetProxy datasetProxy; + @Inject + @Channel("simulations") Publisher events; + @POST public Simulation createSimulation(final Simulation simulation){ return proxy.createSimulation(Converter.convertObjectToSnakeCaseJsonNode(simulation)); @@ -141,4 +151,16 @@ public Response createFromSimulationResult( .build(); } } + + @GET + @Path("/{jobId}/partial-result") + @Produces(MediaType.SERVER_SENT_EVENTS) + @SseElementType(MediaType.APPLICATION_JSON) + @Tag(name = "Stream partial/intermediate simulation result associated with run ID") + public Publisher stream( + @PathParam("jobId") final String jobId + ) { + // return Multi.createFrom().publisher(events); + return Multi.createFrom().publisher(events).select().where(event -> "123" == "123"); //event.getJobId() == jobId); + } } diff --git a/packages/services/hmi-server/src/main/resources/application.properties b/packages/services/hmi-server/src/main/resources/application.properties index 07e74af896..fd5a65719b 100644 --- a/packages/services/hmi-server/src/main/resources/application.properties +++ b/packages/services/hmi-server/src/main/resources/application.properties @@ -45,8 +45,8 @@ skema/mp-rest/url=https://skema-py.staging.terarium.ai skema-rust/mp-rest/url=https://skema-rs.staging.terarium.ai skema-unified/mp-rest/url=https://skema-unified.staging.terarium.ai model-service/mp-rest/url=https://model-service.staging.terarium.ai -%dev.data-service/mp-rest/url=http://${data-service-host:localhost}:${data-service-port:3020} -%prod.data-service/mp-rest/url=http://${data-service}:3020 +%dev.data-service/mp-rest/url=http://${data-service-host:localhost}:${data-service-port:8001} +%prod.data-service/mp-rest/url=http://${data-service}:8001 xdd-document-service/mp-rest/url=https://xdd.wisc.edu xdd-dev-service/mp-rest/url=https://xdddev.chtc.io mit/mp-rest/url=https://mit-proxy.staging.terarium.ai @@ -56,9 +56,12 @@ mira-api/mp-rest/url=http://34.230.33.149:8771 %dev.pdf/mp-rest/url=http://localhost:5000 %prod.pdf/mp-rest/url=https://hmi-extraction.staging.terarium.ai:5000/ mira-metaregistry/mp-rest/url=http://34.230.33.149:8772 -simulation-service/mp-rest/url=https://simulation-service.staging.terarium.ai -%dev.ciemss-service/mp-rest/url=http://localhost:3040 -%prod.ciemss-service/mp-rest/url=http://${pyciemss-api}:3040 +# simulation-service/mp-rest/url=https://simulation-service.staging.terarium.ai +# %dev.ciemss-service/mp-rest/url=http://localhost:3040 +# %prod.ciemss-service/mp-rest/url=http://${pyciemss-api}:3040 +simulation-service/mp-rest/url=http://localhost:3500 +%dev.ciemss-service/mp-rest/url=http://localhost:8010 +%prod.ciemss-service/mp-rest/url=http://${pyciemss-api}:8010 %dev.extraction-service-api/mp-rest/url=https://extraction-service.staging.terarium.ai %prod.extraction-service-api/mp-rest/url=${extraction-service-url} ######################################################################################################################## @@ -88,5 +91,7 @@ rabbitmq-username=${terarium-mq-username:terarium} rabbitmq-password=${terarium-mq-password:terarium123} mp.messaging.outgoing.user-event.connector=smallrye-rabbitmq mp.messaging.outgoing.user-event.exchange.name=user-event +mp.messaging.incoming.simulations.connector=smallrye-rabbitmq +mp.messaging.incoming.simulations.queue.name=simulation-status ######################################################################################################################## googleanalytics.id=G-TWXM1CJCNM From 6063d32a681c83b78d65339636440735d4cd7e40 Mon Sep 17 00:00:00 2001 From: Tom Szendrey Date: Thu, 10 Aug 2023 10:22:48 -0400 Subject: [PATCH 2/9] fix filter --- .../hmiserver/resources/dataservice/SimulationResource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java index 9f43c55f1d..cb46b88e89 100644 --- a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java +++ b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java @@ -161,6 +161,6 @@ public Publisher stream( @PathParam("jobId") final String jobId ) { // return Multi.createFrom().publisher(events); - return Multi.createFrom().publisher(events).select().where(event -> "123" == "123"); //event.getJobId() == jobId); + return Multi.createFrom().publisher(events).select().where(event -> event.getJobId == jobId); } } From 3a06f2d42cc8fe5a48056b2e783191794e4df85b Mon Sep 17 00:00:00 2001 From: Tom Szendrey Date: Mon, 14 Aug 2023 09:51:37 -0400 Subject: [PATCH 3/9] going back to orchestration --- .../hmi-server/src/main/resources/application.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/services/hmi-server/src/main/resources/application.properties b/packages/services/hmi-server/src/main/resources/application.properties index c7b41f38b4..7d60bd7423 100644 --- a/packages/services/hmi-server/src/main/resources/application.properties +++ b/packages/services/hmi-server/src/main/resources/application.properties @@ -45,8 +45,8 @@ skema/mp-rest/url=https://skema-py.staging.terarium.ai skema-rust/mp-rest/url=https://skema-rs.staging.terarium.ai skema-unified/mp-rest/url=https://skema-unified.staging.terarium.ai model-service/mp-rest/url=https://model-service.staging.terarium.ai -%dev.data-service/mp-rest/url=http://${data-service-host:localhost}:${data-service-port:8001} -%prod.data-service/mp-rest/url=http://${data-service}:8001 +%dev.data-service/mp-rest/url=http://${data-service-host:localhost}:${data-service-port:3020} +%prod.data-service/mp-rest/url=http://${data-service}:3020 xdd-document-service/mp-rest/url=https://xdd.wisc.edu xdd-dev-service/mp-rest/url=https://xdddev.chtc.io mit/mp-rest/url=https://mit-proxy.staging.terarium.ai From 9de28b78dd2c3f8f35f828dd523795d552dce0d4 Mon Sep 17 00:00:00 2001 From: Tom Szendrey Date: Mon, 14 Aug 2023 15:29:46 -0400 Subject: [PATCH 4/9] filtering not working --- .../hmiserver/models/CalibrationIntermediateResults.java | 9 +++++++++ .../resources/dataservice/SimulationResource.java | 4 +--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/CalibrationIntermediateResults.java b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/CalibrationIntermediateResults.java index c9f472cf0b..34023e3dd3 100644 --- a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/CalibrationIntermediateResults.java +++ b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/CalibrationIntermediateResults.java @@ -12,4 +12,13 @@ public class CalibrationIntermediateResults implements Serializable { @JsonAlias("job_id") private String jobId; private float progress; + + public String getJobId(){ + return this.jobId; + } + + @Override + public String toString() { + return "{ job_id:'" + jobId + "', progress:" + progress + "}"; + } } \ No newline at end of file diff --git a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java index cb46b88e89..d52f3d4998 100644 --- a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java +++ b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java @@ -9,7 +9,6 @@ import org.apache.http.impl.client.HttpClients; import org.eclipse.microprofile.openapi.annotations.tags.Tag; import io.smallrye.mutiny.Multi; -import io.smallrye.mutiny.groups.MultiSelect; import org.eclipse.microprofile.rest.client.inject.RestClient; import org.eclipse.microprofile.reactive.messaging.Channel; import org.eclipse.microprofile.reactive.messaging.Incoming; @@ -160,7 +159,6 @@ public Response createFromSimulationResult( public Publisher stream( @PathParam("jobId") final String jobId ) { - // return Multi.createFrom().publisher(events); - return Multi.createFrom().publisher(events).select().where(event -> event.getJobId == jobId); + return Multi.createFrom().publisher(events).select().where(event -> event.getJobId() == jobId); } } From b6c82f9c40bbc42ccd50382eefe91b204cf14744 Mon Sep 17 00:00:00 2001 From: Tom Szendrey Date: Mon, 14 Aug 2023 16:51:25 -0400 Subject: [PATCH 5/9] Need some cleanup now! --- packages/client/hmi-client/src/temp/sse.vue | 1 + ...ava => SimulationIntermediateResults.java} | 10 ++++++- .../dataservice/SimulationResource.java | 28 ++++++++++++++++--- .../src/main/resources/application.properties | 4 +-- 4 files changed, 36 insertions(+), 7 deletions(-) rename packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/{CalibrationIntermediateResults.java => SimulationIntermediateResults.java} (69%) diff --git a/packages/client/hmi-client/src/temp/sse.vue b/packages/client/hmi-client/src/temp/sse.vue index 23bb117a52..315abc500f 100644 --- a/packages/client/hmi-client/src/temp/sse.vue +++ b/packages/client/hmi-client/src/temp/sse.vue @@ -37,6 +37,7 @@ function listen() { async function createEmptyModel() { await API.put('/dev-tests/user-event'); + await API.put('/simulations/create-dummy-partial-result'); } diff --git a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/CalibrationIntermediateResults.java b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/SimulationIntermediateResults.java similarity index 69% rename from packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/CalibrationIntermediateResults.java rename to packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/SimulationIntermediateResults.java index 34023e3dd3..9a12e3e2a9 100644 --- a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/CalibrationIntermediateResults.java +++ b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/SimulationIntermediateResults.java @@ -8,11 +8,19 @@ @Data @Accessors(chain = true) -public class CalibrationIntermediateResults implements Serializable { +public class SimulationIntermediateResults implements Serializable { @JsonAlias("job_id") private String jobId; private float progress; + public void setJobId(String jobId){ + this.jobId = jobId; + } + + public void setProgress(float progress){ + this.progress = progress; + } + public String getJobId(){ return this.jobId; } diff --git a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java index d52f3d4998..d7f55a17d3 100644 --- a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java +++ b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java @@ -23,7 +23,10 @@ import software.uncharted.terarium.hmiserver.proxies.dataservice.SimulationProxy; import software.uncharted.terarium.hmiserver.resources.SnakeCaseResource; import software.uncharted.terarium.hmiserver.utils.Converter; -import software.uncharted.terarium.hmiserver.models.CalibrationIntermediateResults; +import software.uncharted.terarium.hmiserver.models.SimulationIntermediateResults; +import io.smallrye.reactive.messaging.annotations.Broadcast; +import org.eclipse.microprofile.reactive.messaging.Emitter; +import java.util.Map; import javax.inject.Inject; import javax.ws.rs.*; @@ -50,7 +53,11 @@ public class SimulationResource implements SnakeCaseResource { DatasetProxy datasetProxy; @Inject - @Channel("simulations") Publisher events; + @Channel("simulationStatus") Publisher partialSimulationResults; + + @Broadcast + @Channel("simulationStatus") + Emitter partialSimulationEmitter; @POST public Simulation createSimulation(final Simulation simulation){ @@ -156,9 +163,22 @@ public Response createFromSimulationResult( @Produces(MediaType.SERVER_SENT_EVENTS) @SseElementType(MediaType.APPLICATION_JSON) @Tag(name = "Stream partial/intermediate simulation result associated with run ID") - public Publisher stream( + public Publisher stream( @PathParam("jobId") final String jobId ) { - return Multi.createFrom().publisher(events).select().where(event -> event.getJobId() == jobId); + return Multi.createFrom().publisher(partialSimulationResults).select().where(event -> event.getJobId().equals(jobId)); + } + + @PUT + @Path("/create-dummy-partial-result") + @Produces(MediaType.APPLICATION_JSON) + public Response createPartialResult() { + final String jobId = "123"; + final float progress = 0.1f; + final SimulationIntermediateResults event = new SimulationIntermediateResults(); + event.setJobId(jobId); + event.setProgress(progress); + partialSimulationEmitter.send(event); + return Response.ok(Map.of("id", jobId.toString())).build(); } } diff --git a/packages/services/hmi-server/src/main/resources/application.properties b/packages/services/hmi-server/src/main/resources/application.properties index 778b1117ce..59611b0366 100644 --- a/packages/services/hmi-server/src/main/resources/application.properties +++ b/packages/services/hmi-server/src/main/resources/application.properties @@ -88,7 +88,7 @@ rabbitmq-username=${terarium-mq-username:terarium} rabbitmq-password=${terarium-mq-password:terarium123} mp.messaging.outgoing.user-event.connector=smallrye-rabbitmq mp.messaging.outgoing.user-event.exchange.name=user-event -mp.messaging.incoming.simulations.connector=smallrye-rabbitmq -mp.messaging.incoming.simulations.queue.name=simulation-status +mp.messaging.incoming.simulationStatus.connector=smallrye-rabbitmq +mp.messaging.incoming.simulationStatus.queue.name=simulation-status ######################################################################################################################## googleanalytics.id=G-TWXM1CJCNM From 383b57f96187412f41aecfaaee8a32552ddde2d4 Mon Sep 17 00:00:00 2001 From: Tom Szendrey Date: Tue, 15 Aug 2023 09:36:23 -0400 Subject: [PATCH 6/9] removing manual testing, will add a test file next --- .../workflow/tera-simulation-workflow.vue | 23 ------------------- packages/client/hmi-client/src/temp/sse.vue | 2 +- .../dataservice/SimulationResource.java | 9 ++++---- 3 files changed, 6 insertions(+), 28 deletions(-) diff --git a/packages/client/hmi-client/src/components/workflow/tera-simulation-workflow.vue b/packages/client/hmi-client/src/components/workflow/tera-simulation-workflow.vue index dad87c3f18..1825657f9c 100644 --- a/packages/client/hmi-client/src/components/workflow/tera-simulation-workflow.vue +++ b/packages/client/hmi-client/src/components/workflow/tera-simulation-workflow.vue @@ -247,8 +247,6 @@ import * as d3 from 'd3'; import { IProject, ProjectAssetTypes } from '@/types/Project'; import { Dataset, Model } from '@/types/Types'; import { useDragEvent } from '@/services/drag-drop'; -import { EventSourcePolyfill } from 'event-source-polyfill'; -import useAuthStore from '@/stores/auth'; import { DatasetOperation } from './dataset-operation'; import TeraDatasetNode from './tera-dataset-node.vue'; import TeraStratifyNode from './tera-stratify-node.vue'; @@ -426,27 +424,6 @@ function updateWorkflowNodeState(node: WorkflowNode, state: any) { const testNode = (node: WorkflowNode) => { const value = (node.inputs[0].value?.[0] ?? 0) + Math.round(Math.random() * 10); appendOutputPort(node, { type: 'number', label: value.toString(), value }); - - console.log('Checking MQ'); - const auth = useAuthStore(); - const ttt = new EventSourcePolyfill('/api/simulations/123/partial-result', { - headers: { - Authorization: `Bearer ${auth.token}` - } - }); - ttt.onerror = (e) => { - console.log('An error occurred while attempting to connect.'); - console.log(e); - ttt.close(); - console.log('Closing ttt'); - }; - ttt.onmessage = (event) => { - console.log(event); - const json = event.data; - console.log(json); - ttt.close(); - console.log('Closing ttt'); - }; }; const drilldown = (event: WorkflowNode) => { diff --git a/packages/client/hmi-client/src/temp/sse.vue b/packages/client/hmi-client/src/temp/sse.vue index 315abc500f..0f93a234da 100644 --- a/packages/client/hmi-client/src/temp/sse.vue +++ b/packages/client/hmi-client/src/temp/sse.vue @@ -37,7 +37,7 @@ function listen() { async function createEmptyModel() { await API.put('/dev-tests/user-event'); - await API.put('/simulations/create-dummy-partial-result'); + await API.put('/simulations/123/create-dummy-partial-result'); } diff --git a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java index d7f55a17d3..0b797b104c 100644 --- a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java +++ b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java @@ -170,11 +170,12 @@ public Publisher stream( } @PUT - @Path("/create-dummy-partial-result") + @Path("/{jobId}/create-dummy-partial-result") @Produces(MediaType.APPLICATION_JSON) - public Response createPartialResult() { - final String jobId = "123"; - final float progress = 0.1f; + public Response createPartialResult( + @PathParam("jobId") final String jobId + ) { + float progress = 0.1f; final SimulationIntermediateResults event = new SimulationIntermediateResults(); event.setJobId(jobId); event.setProgress(progress); From 68cabc4f047ae5e8217fdac4adce39ed450c2371 Mon Sep 17 00:00:00 2001 From: Tom Szendrey Date: Tue, 15 Aug 2023 10:19:47 -0400 Subject: [PATCH 7/9] leftovers --- packages/client/hmi-client/src/temp/sse.vue | 1 - .../hmiserver/resources/dataservice/SimulationResource.java | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/client/hmi-client/src/temp/sse.vue b/packages/client/hmi-client/src/temp/sse.vue index 0f93a234da..23bb117a52 100644 --- a/packages/client/hmi-client/src/temp/sse.vue +++ b/packages/client/hmi-client/src/temp/sse.vue @@ -37,7 +37,6 @@ function listen() { async function createEmptyModel() { await API.put('/dev-tests/user-event'); - await API.put('/simulations/123/create-dummy-partial-result'); } diff --git a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java index 0b797b104c..1fdf94bbe0 100644 --- a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java +++ b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/resources/dataservice/SimulationResource.java @@ -169,9 +169,11 @@ public Publisher stream( return Multi.createFrom().publisher(partialSimulationResults).select().where(event -> event.getJobId().equals(jobId)); } + // When we finalize the SimulationIntermediateResults object this end point will need to be passed more parameters @PUT - @Path("/{jobId}/create-dummy-partial-result") + @Path("/{jobId}/create-partial-result") @Produces(MediaType.APPLICATION_JSON) + @Tag(name = "Used to write to the simulation status channel providing a job ID") public Response createPartialResult( @PathParam("jobId") final String jobId ) { From 97818cabb73564b630b20c26fce754334248ba90 Mon Sep 17 00:00:00 2001 From: dvince Date: Tue, 15 Aug 2023 12:57:19 -0400 Subject: [PATCH 8/9] Confirming lombok works and we're not going crazy --- .../models/SimulationIntermediateResults.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/SimulationIntermediateResults.java b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/SimulationIntermediateResults.java index 9a12e3e2a9..41d088ad63 100644 --- a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/SimulationIntermediateResults.java +++ b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/SimulationIntermediateResults.java @@ -13,20 +13,8 @@ public class SimulationIntermediateResults implements Serializable { private String jobId; private float progress; - public void setJobId(String jobId){ - this.jobId = jobId; - } - - public void setProgress(float progress){ - this.progress = progress; - } - - public String getJobId(){ - return this.jobId; - } - @Override - public String toString() { + public String toString() { return "{ job_id:'" + jobId + "', progress:" + progress + "}"; } -} \ No newline at end of file +} From e258fbafb75e8a3499424a1e4421be51471a1c3f Mon Sep 17 00:00:00 2001 From: Tom Szendrey Date: Tue, 15 Aug 2023 13:03:24 -0400 Subject: [PATCH 9/9] removing explicits --- .../models/SimulationIntermediateResults.java | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/SimulationIntermediateResults.java b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/SimulationIntermediateResults.java index 9a12e3e2a9..12c0f5f535 100644 --- a/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/SimulationIntermediateResults.java +++ b/packages/services/hmi-server/src/main/java/software/uncharted/terarium/hmiserver/models/SimulationIntermediateResults.java @@ -12,21 +12,4 @@ public class SimulationIntermediateResults implements Serializable { @JsonAlias("job_id") private String jobId; private float progress; - - public void setJobId(String jobId){ - this.jobId = jobId; - } - - public void setProgress(float progress){ - this.progress = progress; - } - - public String getJobId(){ - return this.jobId; - } - - @Override - public String toString() { - return "{ job_id:'" + jobId + "', progress:" + progress + "}"; - } } \ No newline at end of file