-
Notifications
You must be signed in to change notification settings - Fork 194
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
Pipeline Configuration Transformation #4446
Conversation
@@ -0,0 +1,69 @@ | |||
"{{pipeline-name}}-writer": |
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.
This template is not the final version, needs to be finalized. Check the test/resources/templates/testSource for the templates i used to test
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.
acknowledgments: false -> This should be true.
* @return RuleEvaluatorResult | ||
*/ | ||
private RuleEvaluatorResult isDocDBSource(PipelinesDataFlowModel pipelinesModel) { | ||
PLUGIN_NAME = "documentdb"; |
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.
This is only a temporary implementation, will move towards scanning folder and fetching and applying rule file dynamically.
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.
I made some high-level comments. I'll also try to dive into some lower-level details later.
data-prepper-core/src/main/java/org/opensearch/dataprepper/AbstractContextManager.java
Outdated
Show resolved
Hide resolved
data-prepper-core/src/main/java/org/opensearch/dataprepper/parser/PipelineTransformer.java
Outdated
Show resolved
Hide resolved
...r/src/main/java/org/opensearch/dataprepper/pipeline/parser/PipelinesDataflowModelParser.java
Outdated
Show resolved
Hide resolved
data-prepper-pipeline-parser/src/main/java/org/opensearch/dataprepper/pipeline/parser/README.md
Outdated
Show resolved
Hide resolved
...in/java/org/opensearch/dataprepper/pipeline/parser/transformer/DynamicConfigTransformer.java
Outdated
Show resolved
Hide resolved
...in/java/org/opensearch/dataprepper/pipeline/parser/transformer/DynamicConfigTransformer.java
Outdated
Show resolved
Hide resolved
...org/opensearch/dataprepper/pipeline/parser/transformer/PipelineConfigurationTransformer.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/opensearch/dataprepper/parser/config/PipelineParserConfiguration.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/opensearch/dataprepper/parser/config/PipelineParserConfiguration.java
Outdated
Show resolved
Hide resolved
...arser/src/main/java/org/opensearch/dataprepper/pipeline/parser/rule/RuleEvaluatorResult.java
Show resolved
Hide resolved
import java.util.List; | ||
|
||
@Data | ||
public class RuleTransformerModel { |
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.
Should this be RuleTransformerModelConfig
?
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.
can address this nitpick in the subsequent pr.
* @param json | ||
* @return Map<String, List<String>> , K:placeholder, V: list of jsonPath in templateJson | ||
* @throws IOException | ||
*/ |
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.
Probably good idea to document example input args and expected output which helps in understanding the code better. (This comment is for all functions in this file)
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.
can address this nitpick in the subsequent pr.
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.
@srikanthjg , Your DCO is failing. You have some commits from a merge in here. Please use a rebase from main
instead.
Other than that, this should be good to merge. I think the rest of the changes will now be internal to the transformation code.
@srikanthjg , Please also add a DCO to your commits. Please see: |
d1f6fd7
to
f65594b
Compare
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
…cDB with big template Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
templates and rules Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@amazon.com>
24d4c44
to
5b4825f
Compare
Signed-off-by: srigovs <srigovs@amazon.com>
Signed-off-by: srigovs <srigovs@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. Thanks for this significant contribution!
Description
Support pipeline configuration transformation based on rules and templates.
Rules for a transformation will be defined in a yaml file. It will be checked for every pipeline. If rules apply, a corresponding template is chosen. The template defines the transformation for that pipeline. Currently if there are multiple sub-pipelines, only one pipeline is chosen for which the rules apply.
Template definitions uses JsonPath to index nodes in the user provided configuration.
Current Assumptions:
$..
is NOT supported. Always use a more specific expression. In the event specific variables in a path are not known, use wildcards.<< .. >>
is the placeholder in the template.<<pipeline-name>>
is handled differently as compared to other placeholdersas other placeholders are jsonPaths, this just replaces placeholder with the pipeline Name that needs transformation.
Issues Resolved
Resolves #4444
Check List
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.