-
Notifications
You must be signed in to change notification settings - Fork 347
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
Support data exchange between custom & generic components via volumes #2799
Support data exchange between custom & generic components via volumes #2799
Conversation
Thanks for making a pull request to Elyra! To try out this branch on binder, follow this link: |
@kiersten-stokes - the description is excellent and extremely helpful - thank you.
I view things like Seems like we could then easily catch custom component properties that are prefixed by |
Just to clarify, do you mean adding the I think that would be all that's needed! And I would imagine it would be fairly easy migration code too (I may even be able to do it myself 😄 ). Of course, it sounds like we can get rid of that "first"
Correct! The property id (called the ref in the canvas properties) is never displayed. |
No, only prefix system-owned properties. This way, |
|
a1ff622
to
808f0c4
Compare
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!
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, kfp portion. thanks!
Fixes #2760
What changes were proposed in this pull request?
While working through #2785, an issue was encountered that complicated things to a degree that made that approach almost useless. Long story short, the
elyra_
prefix that we use to denote which properties are 'component parameters' or 'pipeline default' properties was affecting both how the component properties appeared in the GUI and how they were processed. In this PR, a different approach is taken, as described below.The
mounted_volumes
property is added to the canvas properties for custom components. It will exist as a child within thecomponent_parameters
stanza of the pipeline JSON, which is the same as how this property is handled for generic components. Processing proceeds the same for both generic and custom components in the case where the custom component does not define a property of the same id (mounted_volumes
) in its component definition.A few additional safeguards are required to handle the case where a property id collision does occur (e.g. the component defines its own property called
mounted_volumes
). First, a new keyword arg is passed to the properties template for custom components that tells the template not to render any Elyra-owned properties that have the same id as any component-defined properties that are parsed from the definition. Similar logic is added topipeline_definition.py
that checks for any property id collisions and does not perform certain logic (property propagation from pipeline defaults, conversion to relevant dataclass objects, etc.) if the property is determined to be component-defined. Any value entered for a component-defined property of the same id should not be touched, but rather passed directly to the component constructor (via the DAG or theContainerOp
object).Much of the above paragraph could be simplified or removed should we decide that we want to do a pipeline migration, in which case we could change the id for the built-in
mounted_volumes
property to something that we could be nearly sure would not result in a collision of property ids (though I suppose this could never be guaranteed so perhaps we wouldn't want to remove the safeguards?).A new
mounted_volumes
property is also added to theOperation
class. Akubernetes_secret
property is added to theGenericOperation
class as well just to make processing more straightforward.Finally, logic was added to both
processor_kfp.py
andprocessor_airflow.py
to handle the addition of volumes for custom components. I also refactored how the Airflow processor handles volumes and secrets in order to simplify the DAG template. Now, all volumes and secrets are rendered by functions defined inprocessor_airflow.py
and passed to the template env. (I think we could also further re-factor this in a future PR to make the DAG template even more straightforward).Documentation has been updated to reflect the availability of volumes on custom components.
How was this pull request tested?
Existing server tests have been updated. Tests have been added to cover the following scenarios:
mounted_volumes
results in the appropriate properties JSON (i.e., skips the system-definedmounted_volumes
property and only defines its own)mounted_volumes
does not go through the processing steps that the system-defined property of the same name does (propagation, conversion to dataclass, etc.).Developer's Certificate of Origin 1.1