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

Redesign workflow engine and provisioner API #352

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

apmasell
Copy link
Contributor

This replaces the call-back based WorkMonitor with the fluent monad OperationAction API. This change will prevent recovery of any inflight operations.

Jira ticket:

  • Includes a change file
  • Updates developer documentation

@avarsava
Copy link
Contributor

This change will prevent recovery of any inflight operations.

Can you elaborate on this?

@apmasell
Copy link
Contributor Author

The API change will affect what recovery information is stored in the database, so any workflow that attempted to be recovered when this feature is first deployed will fail.

@avarsava
Copy link
Contributor

OK, but after that recovery will work?

@apmasell
Copy link
Contributor Author

Yup. Maybe I should include a migration that drops any running workflows.

plugin-guide.md Outdated
The class `BaseJsonInputProvisioner` is a partial implementation that can store
crash recovery information in a JSON object of the implementor's choosing,
making recovery easier.
This plugin type uses the operations API.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these be a link to the section? if markdown can do that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

plugin-guide.md Outdated
required. This primes the sequence of events by computing a value from the
state information alone which will be the input for the first step. After this,
`then` may be called to manipulate this value. Additionally, there are
convinced methods `map`, to modify the current value, and `reload`, to discard
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"convinced" methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convenience. Fixed.

plugin-guide.md Outdated
@@ -174,17 +168,15 @@ which ones are allowed via the `supports` method.
The workflow engine will be given the complete input to the workflow (with real
paths provided by the input provisioners) and the workflow itself. Once the
workflow has completed, it must provide a JSON structure that references the
output of the workflow. Vidarr will identified the output files generated by
output of the workflow. Víðarr will identified the output files generated by
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"will identified"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

.then(
log(
Level.INFO,
id -> String.format("Started Cromwell workflow %s on %s", id, cromwellUrl)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we're not preserving the logging that indicates this is specifically the provision-out job? I know that's technically just another cromwell workflow but it was clearer before imo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly due to copy-paste. I'll fix that. Also, the logs get prefixed with context, so it wouldn't be hard to tell.

@apmasell apmasell force-pushed the monad_async branch 2 times, most recently from 1f9e831 to 5f0d855 Compare February 14, 2024 14:07
@apmasell
Copy link
Contributor Author

Also, the build issue seems to be a rebasing problem.

* Recover and operation from the database and discard and error conditions and allow it to start
* again.
*
* @param state the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop the the. It's cleaner.

@@ -24,9 +26,31 @@
/** Defines an engine that knows how to execute workflows and track the results */
@JsonTypeIdResolver(WorkflowEngine.WorkflowEngineIdResolver.class)
@JsonTypeInfo(use = JsonTypeInfo.Id.CUSTOM, include = As.PROPERTY, property = "type")
public interface WorkflowEngine {
public interface WorkflowEngine<S extends Record, C extends Record> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are S and C here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed for clarity and added JavaDoc.

@apmasell apmasell force-pushed the monad_async branch 2 times, most recently from 1a1fb41 to 22b7d9d Compare March 6, 2024 13:59
@avarsava avarsava requested review from grapigeau and removed request for mlaszloffy March 12, 2024 18:33
@@ -0,0 +1,6 @@
DELETE FROM active_operation WHERE workflow_run_id IN (SELECT active_workflow_run.id FROM active_workflow_run);
DELETE FROM analysis_external_id WHERE analysis_external_id.external_id_id IN (SELECT external_id.id FROM external_id WHERE external_id.workflow_run_id IN (SELECT active_workflow_run.id FROM active_workflow_run));
DELETE FROM external_id WHERE external_id.workflow_run_id IN (SELECT active_workflow_run.id FROM active_workflow_run);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERROR: update or delete on table "external_id" violates foreign key constraint "external_id_version_external_id_id_fkey" on table "external_id_version"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed.

This replaces the call-back based `WorkMonitor` with the fluent monad
`OperationAction` API. This change will prevent recovery of any inflight
operations.
@mlaszloffy mlaszloffy changed the base branch from master to monad_async_dev March 28, 2024 16:19
@mlaszloffy mlaszloffy merged commit bb42516 into oicr-gsi:monad_async_dev Mar 28, 2024
1 check passed
@apmasell apmasell deleted the monad_async branch March 28, 2024 23:43
avarsava pushed a commit that referenced this pull request May 30, 2024
This replaces the call-back based `WorkMonitor` with the fluent monad
`OperationAction` API. This change will prevent recovery of any inflight
operations.
callunity pushed a commit that referenced this pull request Jan 24, 2025
This replaces the call-back based `WorkMonitor` with the fluent monad
`OperationAction` API. This change will prevent recovery of any inflight
operations.
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.

4 participants