-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stream Simulation Resources #1507
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3217388
to
fdecca9
Compare
Mythicaeda
commented
Jul 22, 2024
...iver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/resources/SimulationResourceManager.java
Outdated
Show resolved
Hide resolved
Mythicaeda
commented
Jul 22, 2024
.../main/java/gov/nasa/jpl/aerie/merlin/driver/resources/InMemorySimulationResourceManager.java
Outdated
Show resolved
Hide resolved
Mythicaeda
commented
Jul 22, 2024
...main/java/gov/nasa/jpl/aerie/merlin/driver/resources/StreamingSimulationResourceManager.java
Outdated
Show resolved
Hide resolved
Mythicaeda
commented
Jul 22, 2024
...iver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/resources/SimulationResourceManager.java
Show resolved
Hide resolved
Mythicaeda
commented
Jul 22, 2024
merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java
Outdated
Show resolved
Hide resolved
Mythicaeda
commented
Jul 22, 2024
merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java
Show resolved
Hide resolved
fdecca9
to
4de8bb5
Compare
4de8bb5
to
9f16c04
Compare
Just pushed changes addressing the set of comments left during the walkthrough. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No big concern, just a few comments.
merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java
Outdated
Show resolved
Hide resolved
.../main/java/gov/nasa/jpl/aerie/merlin/driver/resources/InMemorySimulationResourceManager.java
Show resolved
Hide resolved
merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/MissionModelService.java
Outdated
Show resolved
Hide resolved
merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/mocks/StubMissionModelService.java
Outdated
Show resolved
Hide resolved
merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java
Outdated
Show resolved
Hide resolved
merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java
Outdated
Show resolved
Hide resolved
merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/CheckpointSimulationDriver.java
Show resolved
Hide resolved
...driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/CheckpointSimulationFacade.java
Outdated
Show resolved
Hide resolved
...-worker/src/main/java/gov/nasa/jpl/aerie/merlin/worker/postgres/PostgresProfileStreamer.java
Show resolved
Hide resolved
- Add `init` and `step` to engine
Make `computeResults` non-static Replace `if` in `performJobs` with type-switch
- Remove posting resources as part of posting results
- add argument for the resource manager - remove unused interface "Response"
9f16c04
to
5a49b87
Compare
Streaming resources requires a third connection to the DB
- TimeTrackerDaemon: make counter "final" - CheckpointSimFacadeTest: Fix incorrect assertEquals - InMemoryCachedEngineTest: Use ResourceManager, reflect changes to `SimulationEngine` constructor SimulationDuplicationTest: Use ResourceManager - FooSimulationDuplicationTest: Remove empty consumer
5a49b87
to
6861a47
Compare
adrienmaillard
approved these changes
Jul 24, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work \o/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
feature
A new feature or feature request
refactor
A code change that neither fixes a bug nor adds a feature
simulation
Anything related to the simulation domain
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Should not be breaking.
Extracts resource management out of the engine and into a new class called the
SimulationResourceManager
theInMemorySimulationResourceManager
operates nearly the same way as ondevelop
, except that the serialized form of the profile segment is kept around, rather than the pre-serialized form. TheSimulate
action uses theStreamingSimulationResourceManager
, which streams profile segments to the DB in batches.Additionally, the engine has been slightly refactored:
step
andinit
logic which was repeated verbatim in allsimulate
methods has been pulled into methods in the enginetimeline
,cells
, andelapsedTime
referenceTimeline
, which is defined as thereferenceTimeline
combined with thetimeline
of the engine it was copied fromcomputeResults
and related methods have been made non-static, as they require an instance of asimulationEngine
to execute and now rely on internal fields of the engine.Additionally, since all but the
SynchronousSimulationAgent
are unused, the interfaceSimulationAgent
has been flattened.Verification
Manually verified that streaming is working.
Did some profiling on
streaming
vsdevelop
. I used Clipper’sgnc-all-activities
plan and ran profiling twice, once with high-overhead memory instrumentation and once with async sampling. Findings:I also ran a JDBC profiler alongside the memory profiler and of note:
Raw Snapshots for those curious: Streaming.zip
Documentation
No docs need to be updated.
Future work
Investigate
simulation_extent