Skip to content
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

Luke/event driven script orchestrator #966

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

LukeButters
Copy link
Contributor

@LukeButters LukeButters commented Jun 20, 2024

Background

[SC-82375]

Currently we only allow calling into tentacle client to run a script via the TentacleClient.ExecuteScript method. Although extremely simple it is not re-entrant. When we talk about re-entrancy we are considding the case the client gets turned off and on and wants to continue on. The deficiencies are:

  • when using SSv1 could start a script a second time
  • it will re-fetch all logs, rather than where or close to the point we left off from.
  • it doesn't work well from an event driven orchestrator.

Results

This spikes out a tentacle client which can be driven by an event driven orchestrator which helps addresses those deficiencies.

In summary the changes are:

  • The ObservingOrchestrator is no longer abstract and becomes a thing that "just" knows how to run the life cycle of the script.
  • A new IScriptExecutor interface is created which allows driving script life cycle
    • This is now used by the ObservingOrchestrator
    • Could be used by an event driven orchestrator.
  • The ScriptService Orchestrators which inherited from ObservingOrchestrator, now implement IScriptExecutor. They now focus on implementing the main stages of script execution following a single interface.
    • They are also responsible from converting from types the client of the client might use to the types that go over the wire.
    • They are responsible for their own "quirks" providing a straight forward interface to interact with.
  • An AggregateScriptExecutor is created which:
    • On start script determines which of the other ScriptServices to use.
    • On the other methods uses the given CommandContext to determine which script service to use.
    • In doing so it can deal with calling the correct service.
  • The ObservingOrchestrator is given an AggregateScriptExecutor
    • Which is called by TentacleClient.ExecuteScript
    • In this way the existing tests are able to exercise the AggregateScriptExecutor which is what an event driven orchestrator would call.
    • This reduces what an event driven orchestrator needs to implement to just what is done in ObservingOrchestrator

@samdanaei samdanaei force-pushed the luke/event-driven-script-orchestrator branch from 00b754a to 33bb1b4 Compare June 21, 2024 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants