elyra icon indicating copy to clipboard operation
elyra copied to clipboard

Add initial support for rjsf in pipeline properties

Open marthacryan opened this issue 2 years ago • 2 comments

Very rough draft - corresponding to elyra-ai/pipeline-editor#197. Currently allows for editing and saving the pipeline properties and the generic node properties but not most of the custom component node properties (mostly due to needing to implement the input/ output paths).

Todo:

  • [x] basic pipeline properties support
  • [x] basic generic node properties support
  • [x] basic "canvas properties" support
  • [ ] finish airflow support
  • [x] link in custom components
  • [x] link in validation
  • [x] add in required fields
  • [x] add inputpath as oneof
  • [ ] pipeline migration
  • [ ] go through code to make sure all utilities and edits etc. are all corresponding to the updated schema

Developer's Certificate of Origin 1.1

   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.

marthacryan avatar Jun 09 '22 22:06 marthacryan

Thanks for making a pull request to Elyra!

To try out this branch on binder, follow this link: Binder

elyra-bot[bot] avatar Jun 09 '22 22:06 elyra-bot[bot]

@ajbozarth - Do we think this will make the 3.11 milestone this friday?

akchinSTC avatar Aug 08 '22 15:08 akchinSTC

Not specific to RJSF migration but since the PR already modifies canvas_properties_template.jinja2, can we add descriptions for the inputs and outputs headers like we already have for additional properties?

image

ptitzler avatar Aug 18 '22 10:08 ptitzler

When using the papermill operator, the area for the notebook parameter in the component properties side panel isnot rendering, but is a required field. image

akchinSTC avatar Aug 18 '22 21:08 akchinSTC

When using the papermill operator, the area for the notebook parameter in the component properties side panel isnot rendering, but is a required field.

I think I found a solution to this! Should be working now

kiersten-stokes avatar Aug 18 '22 22:08 kiersten-stokes

Re-assigned to 3.12 milestone since the enhancements that users would benefit from (e.g. https://github.com/elyra-ai/elyra/issues/2738, https://github.com/elyra-ai/elyra/issues/2750) won't be ready before cut-off according to https://github.com/elyra-ai/elyra/issues/2738#issuecomment-1219676250

ptitzler avatar Aug 19 '22 05:08 ptitzler

A few things I didn't see listed in the todo list in the official list.

Pipeline properties

  • Heading font size is smaller than text font size (see "Pipeline Runtime" vs "Kubeflow Pipelines")

  • Sections are not clearly separated (compare this to the layout used for node properties (shown below), which is somewhat better due to indentation). image

    Layout for node properties image

Since descriptions (for headings/properties) are now only displayed as tool tips, they are much harder to read if they are longer than a few words. In many cases a new user will likely require additional information, which we make available in the documentation. How can we make links available? Could the (?) icons perhaps serve two purposes: as a visual indication that there is info available (via tool tip) and as an HREF to a URL that would open up in a new browser window if one clicks on the icon.

ptitzler avatar Aug 25 '22 05:08 ptitzler

@kiersten-stokes I pushed the fix to migration.

I also updated some of the snapshot files, one of them will need to be regenerated again after we fix the issue with persisting the schema.

As for the complex pipeline test, that one uses accessors that no longer exist to fill out the form, I tried to update it to use the new accessors, but there are none in the new form. @marthacryan

ajbozarth avatar Sep 01 '22 01:09 ajbozarth

  • Heading font size is smaller than text font size (see "Pipeline Runtime" vs "Kubeflow Pipelines")

Fixed

  • Sections are not clearly separated (compare this to the layout used for node properties (shown below), which is somewhat better due to indentation).

Fixed

Since descriptions (for headings/properties) are now only displayed as tool tips, they are much harder to read if they are longer than a few words. In many cases a new user will likely require additional information, which we make available in the documentation. How can we make links available? Could the (?) icons perhaps serve two purposes: as a visual indication that there is info available (via tool tip) and as an HREF to a URL that would open up in a new browser window if one clicks on the icon.

I can add this as a todo, I'd need to discuss this a little further

marthacryan avatar Sep 06 '22 22:09 marthacryan

  • Heading font size is smaller than text font size (see "Pipeline Runtime" vs "Kubeflow Pipelines")

Fixed

Heading font size is still 12px vs text font size of 16px

image


[generic node] adjacent buttons should not touch

image


tool tips for custom components aren't displayed properly

image


combination of several issues if one doesn't enter a text value in list-valued input:

  • set this as pipeline default

    image

  • non-existent value rendered in node properties as pipeline default image

  • stored as null in pipeline file

    image

ptitzler avatar Sep 07 '22 07:09 ptitzler

@kiersten-stokes is this ready for testing or still in wip? https://github.com/elyra-ai/elyra/pull/2767 indicates that this PR will take care of it

image

ptitzler avatar Sep 07 '22 07:09 ptitzler

is this ready for testing or still in wip? #2767 indicates that this PR will take care of it

@ptitzler yes, this is ready to test! I saw your comment on #2759 as well and added the relevant logic to the describe command.

kiersten-stokes avatar Sep 08 '22 16:09 kiersten-stokes

Heading font size is still 12px vs text font size of 16px

I think I hadn't updated the link with that fix - it looks right on my end but let me know if you're still seeing it on a more recent build.

[generic node] adjacent buttons should not touch

Fixed

tool tips for custom components aren't displayed properly

Fixed

  • non-existent value rendered in node properties as pipeline default image

Fixed

marthacryan avatar Sep 08 '22 20:09 marthacryan

make install in a clean environment fails due to linting issues:

yarn eslint --max-warnings=0
yarn run v1.22.4
$ eslint . --fix --ignore-path .gitignore --ext .ts,.tsx,.js --max-warnings=0

/Users/patti/elyra_dev2/martha-rjsf/elyra/packages/pipeline-editor/src/PipelineEditorWidget.tsx
  306:28  warning  Missing return type on function                                                                                        @typescript-eslint/explicit-function-return-type
  338:6   warning  React Hook useCallback has a missing dependency: 'removeNullValues'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

✖ 2 problems (0 errors, 2 warnings)

ESLint found too many warnings (maximum: 0).
error Command failed with exit code 1.

ptitzler avatar Sep 09 '22 07:09 ptitzler

@kiersten-stokes: overall file input looks good but I managed to break this scenario:

  • choose an input property that has a default value defined (e.g. for bashoperator use output_encoding, which is set to utf-8)
  • change the selection from ... a string value to ... select a file
  • the default value is now interpreted as a file name, which it isn't

the incorrect values also surface in the output of the elyra-pipeline describe command:

Local file dependencies:
    - {}
    - utf-8
    - command.txt
    - true-or-false.txt

ptitzler avatar Sep 09 '22 12:09 ptitzler

tool tips for custom components aren't displayed properly

Fixed

@marthacryan now no properties are displayed image

main branch output:

image

ptitzler avatar Sep 09 '22 12:09 ptitzler

It appears that we are now persisting a property named component_source_header in the .pipeline file:

            },
            "component_source_header": null
          },

This property is only used as a visualization aid ("section header") in the UI and shouldn't be persisted:

From https://github.com/marthacryan/elyra/blob/pipeline-rjsf/elyra/templates/components/canvas_properties_template.jinja2#L123-L129

"component_source_header": {
      "type": "null",
      "title": "Component Source",
      "uihints": {
        "ui:field": "header"
      }
    },

ptitzler avatar Sep 09 '22 12:09 ptitzler

choose an input property that has a default value defined (e.g. for bashoperator use output_encoding, which is set to utf-8) change the selection from ... a string value to ... select a file the default value is now interpreted as a file name, which it isn't

@ptitzler yeah, just checked and I see this too. I think the fix will be in the frontend, but I'll double check at the meeting this AM!

kiersten-stokes avatar Sep 09 '22 14:09 kiersten-stokes

@ptitzler Thanks for checking it out again! I fixed the lint and the extra null value. I'm working on the airflow components tooltips issue

marthacryan avatar Sep 09 '22 18:09 marthacryan

@ajbozarth migration of the noaa tutorial pipeline fails:

image

ptitzler avatar Sep 12 '22 12:09 ptitzler

The validation message is invalid if one does not specify a file as string input:

image

Note the value of value, which is not what the user provided as input. The expected value would be null (undefined).

ptitzler avatar Sep 13 '22 08:09 ptitzler

Tooltip for custom nodes in Airflow are now looking good ... image

For property values that are provided via input files (URL in node download file in the example below), can we prepend the file name with a string that indicates that we are displaying a reference, not the value? The count rows node is an example of a property that is also defined via reference, specifically a reference to the output of an upstream node:

2022-09-13_10-16-26 (1)

ptitzler avatar Sep 13 '22 08:09 ptitzler

The validation message is invalid if one does not specify a file as string input:

Good point! I've fixed validation to allow an empty string for file input types for non-required properties. From here, the processor behaves the same way as an empty string for raw input as well.

kiersten-stokes avatar Sep 13 '22 15:09 kiersten-stokes

The validation message is invalid if one does not specify a file as string input:

Good point! I've fixed validation to allow an empty string for file input types for non-required properties. From here, the processor behaves the same way as an empty string for raw input as well.

Thank you! Looking good. It appears to preserve default values, which I would expect to happen since the user didn't provide a property value.

ptitzler avatar Sep 13 '22 16:09 ptitzler

Congratulations (and thank you :heart:) to everyone that worked on this - it's one for the ages! :tada:

kevin-bates avatar Sep 13 '22 22:09 kevin-bates

I would also love to thank everyone for their amazing effort!!!

❤️

thesuperzapper avatar Sep 14 '22 01:09 thesuperzapper