-
Notifications
You must be signed in to change notification settings - Fork 37
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
Modifies use case template format and adds graph validation when provisioning #119
Conversation
…user outputs Signed-off-by: Joshua Palis <jpalis@amazon.com>
…s into previous_node_inputs and user_inputs, adds graph validation after topologically sorting a workflow into a list of ProcessNode Signed-off-by: Joshua Palis <jpalis@amazon.com>
Signed-off-by: Joshua Palis <jpalis@amazon.com>
Codecov Report
@@ Coverage Diff @@
## main #119 +/- ##
============================================
+ Coverage 67.09% 69.05% +1.96%
- Complexity 276 302 +26
============================================
Files 35 37 +2
Lines 1319 1393 +74
Branches 125 132 +7
============================================
+ Hits 885 962 +77
+ Misses 390 386 -4
- Partials 44 45 +1
|
Signed-off-by: Joshua Palis <jpalis@amazon.com>
Signed-off-by: Joshua Palis <jpalis@amazon.com>
Signed-off-by: Joshua Palis <jpalis@amazon.com>
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.
Looks good overall with minor comments. Thanks for adding the validation. This is a great addition.
Let's try to break the PR into multiple PRs next time for easy review.
src/main/java/org/opensearch/flowframework/workflow/WorkflowProcessSorter.java
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/workflow/WorkflowProcessSorter.java
Show resolved
Hide resolved
src/test/java/org/opensearch/flowframework/workflow/WorkflowProcessSorterTests.java
Show resolved
Hide resolved
…async, adding success test case for graph validation Signed-off-by: Joshua Palis <jpalis@amazon.com>
Signed-off-by: Joshua Palis <jpalis@amazon.com>
Signed-off-by: Joshua Palis <jpalis@amazon.com>
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.
Looks great, a few suggestions.
src/main/java/org/opensearch/flowframework/model/WorkflowStepValidator.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/model/WorkflowStepValidator.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/model/WorkflowValidator.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/model/WorkflowValidator.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/workflow/WorkflowStepFactory.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/workflow/CreateIndexStep.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/workflow/CreateIngestPipelineStep.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Joshua Palis <jpalis@amazon.com>
…ass and using constants Signed-off-by: Joshua Palis <jpalis@amazon.com>
* Remove Demo Classes, add No-Op Step Signed-off-by: Daniel Widdis <widdis@gmail.com> * Add test coverage Signed-off-by: Daniel Widdis <widdis@gmail.com> * Revert enum javadocs as they are handled by #119 Signed-off-by: Daniel Widdis <widdis@gmail.com> --------- Signed-off-by: Daniel Widdis <widdis@gmail.com> Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> Co-authored-by: Owais Kazi <owaiskazi19@gmail.com>
* Remove Demo Classes, add No-Op Step Signed-off-by: Daniel Widdis <widdis@gmail.com> * Add test coverage Signed-off-by: Daniel Widdis <widdis@gmail.com> * Revert enum javadocs as they are handled by #119 Signed-off-by: Daniel Widdis <widdis@gmail.com> --------- Signed-off-by: Daniel Widdis <widdis@gmail.com> Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> Co-authored-by: Owais Kazi <owaiskazi19@gmail.com> (cherry picked from commit 9dffc0a) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Remove Demo Classes, add No-Op Step (#129) * Remove Demo Classes, add No-Op Step * Add test coverage * Revert enum javadocs as they are handled by #119 --------- (cherry picked from commit 9dffc0a) Signed-off-by: Daniel Widdis <widdis@gmail.com> Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Joshua Palis <jpalis@amazon.com>
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.
Sorry, one last change please (but I clicked approve so once that's fixed I don't need to re-review.)
src/main/java/org/opensearch/flowframework/workflow/WorkflowStepFactory.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Joshua Palis <jpalis@amazon.com>
…isioning (#119) * Simplifying Template format, removing operations, resources created, user outputs Signed-off-by: Joshua Palis <jpalis@amazon.com> * Initial commit, modifies use case template to seperate workflow inputs into previous_node_inputs and user_inputs, adds graph validation after topologically sorting a workflow into a list of ProcessNode Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding tests Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding validate graph test Signed-off-by: Joshua Palis <jpalis@amazon.com> * Addressing PR comments, moving sorting/validating prior to executing async, adding success test case for graph validation Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding javadocs Signed-off-by: Joshua Palis <jpalis@amazon.com> * Moving validation prior to updating workflow state to provisioning Signed-off-by: Joshua Palis <jpalis@amazon.com> * Addressing PR comments Part 1 Signed-off-by: Joshua Palis <jpalis@amazon.com> * Addressing PR comments Part 2 : Moving field names to common value class and using constants Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding definition for noop workflow step Signed-off-by: Joshua Palis <jpalis@amazon.com> * Addressing PR comments Part 3 Signed-off-by: Joshua Palis <jpalis@amazon.com> --------- Signed-off-by: Joshua Palis <jpalis@amazon.com> (cherry picked from commit ac76a44) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ation when provisioning (#134) Modifies use case template format and adds graph validation when provisioning (#119) * Simplifying Template format, removing operations, resources created, user outputs * Initial commit, modifies use case template to seperate workflow inputs into previous_node_inputs and user_inputs, adds graph validation after topologically sorting a workflow into a list of ProcessNode * Adding tests * Adding validate graph test * Addressing PR comments, moving sorting/validating prior to executing async, adding success test case for graph validation * Adding javadocs * Moving validation prior to updating workflow state to provisioning * Addressing PR comments Part 1 * Addressing PR comments Part 2 : Moving field names to common value class and using constants * Adding definition for noop workflow step * Addressing PR comments Part 3 --------- (cherry picked from commit ac76a44) Signed-off-by: Joshua Palis <jpalis@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Hoping to merge in #118 first prior to this PR.
This PR achieves multiple things
previous_node_inputs
anduser_inputs
as described by [DOCS] Use Case Template Format #117workflow-step.json
to define the expected inputs and outputs for each workflow stepworkflow-step.json
. Basically for eachProcessNode
in a topologically sorted graph, we retrieve all the expected outputs of its predecessor nodes, combine this with the given user inputs (WorkflowData
content) for the current node, and compare this list with the expected inputs of the current node type. If validation fails, we return to the user a list of missing inputsWorkflowStep
in theWorkflowStepFactory
has a correspondingWorkflowStepValidator
in theworkflow-steps.json
. This is a guard-rail to ensure that each new step that is registered has their inputs/outputs defined for use in validationExample create workflow request to register and deploy a model (with missing
create_connector
step that provides theconnector_id
needed for theregister_model_step
)Executing async provisioning for workflow
ewChbosBllTp7O9ki-A5
OpenSearch logs show that graph validation failed and the
connector_id
field was not provided byuser_inputs
orpredecessor_node_inputs
Issues Resolved
Part of #88
#18
#67
#117
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.