-
Notifications
You must be signed in to change notification settings - Fork 350
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
Fix Airflow Operator execution bugs in handling of Elyra-owned properties #2865
Conversation
Thanks for making a pull request to Elyra! To try out this branch on binder, follow this link: |
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.
Fix is looking good. Also ran some manual tests to confirm that empty volume dependencies are not surfaced.
This comment was marked as resolved.
This comment was marked as resolved.
@ptitzler thanks for the continued review! Tests have now been added and TODO's marked completed 🙂 |
elyra/tests/pipeline/resources/sample_pipelines/pipeline_valid_with_pipeline_default.json
Outdated
Show resolved
Hide resolved
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.
LGTM aside from comment about semantic inconsistency in one of the test pipelines.
This PR fixes 2 bugs related to volumes for Airflow operators:
elyra-ai/community
gitter - The issue is that themounted_volume
property is being persisted as an empty list in the case where no values are added. This value is then not being popped off the dict ofcomponent_parameters
for a given component before being passed to the DAG to render. The extra, unexpectedkwarg
is causing certain operators to fail.component_parameters
dict. Due to formatting errors with theruntime_image
field in the DAG,black
is throwing an error. Even without this formatting error, however, these operators would not execute properly.What changes were proposed in this pull request?
This PR adds more conditions around property propagation and persistence on the
Operation
object.Re: issue 1 above, the
mounted_volumes
property is now appropriately popped off the dict ofcomponent_params
for anOperation
object. If the value of themounted_volumes
param is notNone
, is alist
, and either 1. the list is empty or 2. the list consists ofVolumeMount
dataclass objects, themounted_volumes
key is popped off the dict. This means it will not be rendered alongside the component-defined parameters for which a value was supplied. Recall that we are accounting for the possibility that the component defined its ownmounted_volumes
parameter. If this is the case, and if that property happens to be list-valued and the value entered is an empty list, the consequences of popping this off the param dict should be minor.Re: issue 2 above, any property that is 1. considered a pipeline default and 2. only applies to generic components is now appropriately skipped during property propagation for custom components. A list of such properties that adhere to the 2 conditions listed above already exists as the
ELYRA_COMPONENT_PROPERTIES
variable.How was this pull request tested?
Manual testing shows that
mounted_volumes
no longer appears as an extra arg during operator construction and that runtime image, env vars, and secrets are not propagated to custom components..test_pipeline_parser.py::test_custom_component_parsed_properties
- this test takes a pipeline with 2 operators, one of which defines its ownmounted_volumes
property and one of which doesn'tmounted_volumes
property should have that component parameter in itscomponent_params_as_dict
attribute and it's value should be as-given in the pipeline filemounted_volumes
property and has no Elyra-owned mounted volumes given (and therefore hasmounted_volumes: []
in the pipeline JSON) should not have themounted_volumes
property appear in itscomponent_params_as_dict
attributecomponent_params
dict for custom componentstest_pipeline_definition.py::test_propagate_pipeline_default_properties
- these additions ensure that properties such as runtime image and env vars are not propagated to custom componentsTest resources have been updated according to the needs of the above tests. A small change to
test_processor_airflow.py::test_create_file_custom_components
was also required in order to compare a parsed pipeline file against the correct expected component parameters. I've confirmed that these new tests fail without the accompanying changes to the code base proposed in this PR.Developer's Certificate of Origin 1.1