From cee1dc83616fce1f6b720e87c44d89bf4a43e5e2 Mon Sep 17 00:00:00 2001 From: rkpattnaik780 Date: Thu, 9 Nov 2023 13:43:46 +0530 Subject: [PATCH] fix: add workaround patch for elyra validate --- jupyter/datascience/ubi8-python-3.8/Dockerfile | 3 +++ .../ubi8-python-3.8/utils/pipeline_app.patch | 12 ++++++++++++ .../ubi8-python-3.8/utils/pipeline_definition.patch | 12 ++++++++++++ jupyter/datascience/ubi9-python-3.9/Dockerfile | 3 +++ .../ubi9-python-3.9/utils/pipeline_app.patch | 12 ++++++++++++ .../ubi9-python-3.9/utils/pipeline_definition.patch | 12 ++++++++++++ 6 files changed, 54 insertions(+) create mode 100644 jupyter/datascience/ubi8-python-3.8/utils/pipeline_app.patch create mode 100644 jupyter/datascience/ubi8-python-3.8/utils/pipeline_definition.patch create mode 100644 jupyter/datascience/ubi9-python-3.9/utils/pipeline_app.patch create mode 100644 jupyter/datascience/ubi9-python-3.9/utils/pipeline_definition.patch diff --git a/jupyter/datascience/ubi8-python-3.8/Dockerfile b/jupyter/datascience/ubi8-python-3.8/Dockerfile index 527ead8ac..0c9339224 100644 --- a/jupyter/datascience/ubi8-python-3.8/Dockerfile +++ b/jupyter/datascience/ubi8-python-3.8/Dockerfile @@ -56,6 +56,9 @@ RUN mkdir /opt/app-root/runtimes && \ # Workaround for passing ssl_sa_cert patch /opt/app-root/lib/python3.8/site-packages/elyra/pipeline/kfp/kfp_authentication.py -i utils/kfp_authentication.patch && \ patch /opt/app-root/lib/python3.8/site-packages/elyra/pipeline/kfp/processor_kfp.py -i utils/processor_kfp.patch && \ + # Workaround for elyra pipeline validation command + patch /opt/app-root/lib/python3.8/site-packages/elyra/cli/pipeline_app.py -i utils/pipeline_app.patch && \ + patch /opt/app-root/lib/python3.8/site-packages/elyra/pipeline/pipeline_definition.py -i utils/pipeline_definition.patch && \ # switch to Data Science Pipeline in component catalog \ DIR_COMPONENT="/opt/app-root/lib/python3.8/site-packages/elyra/metadata/schemas/local-directory-catalog.json" && \ FILE_COMPONENT="/opt/app-root/lib/python3.8/site-packages/elyra/metadata/schemas/local-file-catalog.json" && \ diff --git a/jupyter/datascience/ubi8-python-3.8/utils/pipeline_app.patch b/jupyter/datascience/ubi8-python-3.8/utils/pipeline_app.patch new file mode 100644 index 000000000..2d65b3a86 --- /dev/null +++ b/jupyter/datascience/ubi8-python-3.8/utils/pipeline_app.patch @@ -0,0 +1,12 @@ +--- a/pipeline_app.py 2023-11-09 13:36:35 ++++ b/pipeline_app.py 2023-11-09 12:10:35 +@@ -296,7 +296,8 @@ + _validate_pipeline_definition(pipeline_definition) + except Exception: + raise click.ClickException("Pipeline validation FAILED.") +- ++ ++ print_info("Pipeline validation SUCCEEDED.", []) + + def validate_timeout_option(ctx, param, value): + """Callback for monitor-timeout parameter validation""" diff --git a/jupyter/datascience/ubi8-python-3.8/utils/pipeline_definition.patch b/jupyter/datascience/ubi8-python-3.8/utils/pipeline_definition.patch new file mode 100644 index 000000000..6110b643f --- /dev/null +++ b/jupyter/datascience/ubi8-python-3.8/utils/pipeline_definition.patch @@ -0,0 +1,12 @@ +--- a/pipeline_definition.py 2023-11-09 13:36:35 ++++ b/pipeline_definition.py 2023-11-07 20:07:49 +@@ -265,6 +265,9 @@ + if parameter_class is None: + return None # runtime type does not support parameters, skip + ++ if not ElyraProperty.subclass_exists_for_property(parameter_class.property_id): ++ ElyraProperty.build_property_map() ++ + # Convert pipeline parameters to runtime-specific instances + converted_value = ElyraProperty.create_instance(parameter_class.property_id, self.pipeline_parameters) + if converted_value is not None: diff --git a/jupyter/datascience/ubi9-python-3.9/Dockerfile b/jupyter/datascience/ubi9-python-3.9/Dockerfile index acda97499..84669ad8c 100644 --- a/jupyter/datascience/ubi9-python-3.9/Dockerfile +++ b/jupyter/datascience/ubi9-python-3.9/Dockerfile @@ -56,6 +56,9 @@ RUN mkdir /opt/app-root/runtimes && \ # Workaround for passing ssl_sa_cert and to ensure that Elyra redirects to a correct pipeline run URL patch /opt/app-root/lib/python3.9/site-packages/elyra/pipeline/kfp/kfp_authentication.py -i utils/kfp_authentication.patch && \ patch /opt/app-root/lib/python3.9/site-packages/elyra/pipeline/kfp/processor_kfp.py -i utils/processor_kfp.patch && \ + # Workaround for elyra pipeline validation command + patch /opt/app-root/lib/python3.9/site-packages/elyra/cli/pipeline_app.py -i utils/pipeline_app.patch && \ + patch /opt/app-root/lib/python3.9/site-packages/elyra/pipeline/pipeline_definition.py -i utils/pipeline_definition.patch && \ # switch to Data Science Pipeline in component catalog \ DIR_COMPONENT="/opt/app-root/lib/python3.9/site-packages/elyra/metadata/schemas/local-directory-catalog.json" && \ FILE_COMPONENT="/opt/app-root/lib/python3.9/site-packages/elyra/metadata/schemas/local-file-catalog.json" && \ diff --git a/jupyter/datascience/ubi9-python-3.9/utils/pipeline_app.patch b/jupyter/datascience/ubi9-python-3.9/utils/pipeline_app.patch new file mode 100644 index 000000000..2d65b3a86 --- /dev/null +++ b/jupyter/datascience/ubi9-python-3.9/utils/pipeline_app.patch @@ -0,0 +1,12 @@ +--- a/pipeline_app.py 2023-11-09 13:36:35 ++++ b/pipeline_app.py 2023-11-09 12:10:35 +@@ -296,7 +296,8 @@ + _validate_pipeline_definition(pipeline_definition) + except Exception: + raise click.ClickException("Pipeline validation FAILED.") +- ++ ++ print_info("Pipeline validation SUCCEEDED.", []) + + def validate_timeout_option(ctx, param, value): + """Callback for monitor-timeout parameter validation""" diff --git a/jupyter/datascience/ubi9-python-3.9/utils/pipeline_definition.patch b/jupyter/datascience/ubi9-python-3.9/utils/pipeline_definition.patch new file mode 100644 index 000000000..6110b643f --- /dev/null +++ b/jupyter/datascience/ubi9-python-3.9/utils/pipeline_definition.patch @@ -0,0 +1,12 @@ +--- a/pipeline_definition.py 2023-11-09 13:36:35 ++++ b/pipeline_definition.py 2023-11-07 20:07:49 +@@ -265,6 +265,9 @@ + if parameter_class is None: + return None # runtime type does not support parameters, skip + ++ if not ElyraProperty.subclass_exists_for_property(parameter_class.property_id): ++ ElyraProperty.build_property_map() ++ + # Convert pipeline parameters to runtime-specific instances + converted_value = ElyraProperty.create_instance(parameter_class.property_id, self.pipeline_parameters) + if converted_value is not None: