-
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
Support namespace configuration when using dex with kfp #1081
Conversation
Thanks for making a pull request to Elyra! To try out this branch on binder, follow this link: |
Could you please add the related issue to the description... |
Add user_namespace field to kfp metadata schema and update kfp processor to allow submission of pipelines to a dex enabled kfp cluster Fixes elyra-ai#1053
3338e16
to
2916644
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
@akchinSTC Should I wait for @reevejd feedback before merging? |
@lresende - yes lets wait until he responds. He will be testing first thing in the morning. |
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.
These changes look good Alan - thanks.
(I'm assuming you confirmed that runtime_configuration.metadata['user_namespace']
is None
when a user namespace value is not specified.)
…tring when not assigned
Thanks for the last update. I'm afk but will look into the metadata behavior tomorrow. I think we should be able to use something like .get('user_namespace') and should look why that isn't happening. I may also be misremembering things. 🙂 |
I think the issue with Were the UI able to distinguish "set" vs. "not set", then they could simply not include In fact, we should probably add an existence check to see if the key ( |
elyra/pipeline/processor_kfp.py
Outdated
@@ -50,6 +50,10 @@ def process(self, pipeline): | |||
cos_endpoint = runtime_configuration.metadata['cos_endpoint'] | |||
cos_bucket = runtime_configuration.metadata['cos_bucket'] | |||
|
|||
user_namespace = None | |||
if runtime_configuration.metadata['user_namespace']: |
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.
Per my last comment I recommend the following:
if runtime_configuration.metadata['user_namespace']: | |
if 'user_namespace' in runtime_configuration.metadata and runtime_configuration.metadata['user_namespace']: |
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.
or use get('user_namespace')
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.
@lresende - removing the if statement and using get('user_namespace')
when using an empty user_namespace
field in the runtime metadata returns the original error in the issue. Issue with using get
atm is that it will never return None
since the user_namespace
key will always exist in the metadata dict, even when the field is empty.
@kevin-bates - Since the key will always exist, the extra check for the key in metadata is redundant. I think the current check should be enough where an empty string would be considered "falsy"
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 think once the front-end issue is resolved, the key won't exist when no value is present because it won't be persisted.
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 statement (directly from the docs) should produce an instance in which user_namespace
is not persisted and is valid metadata:
elyra-metadata install runtimes --schema_name=kfp \
--name=my_kfp \
--display_name="My Kubeflow Pipeline Runtime" \
--api_endpoint=https://kubernetes-service.ibm.com/pipeline \
--api_username=username@email.com \
--api_password=mypassword \
--cos_endpoint=http://minio-service.kubeflow:9000 \
--cos_username=minio \
--cos_password=minio123 \
--cos_bucket=test-bucket
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 think once the front-end issue is resolved, the key won't exist when no value is present because it won't be persisted.
Ive opened #1087 for this. Should we wait then until that issue is fixed and merged before merging this one?
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.
There's no need to revisit this if you add the field existence test now. This does mean a condition will be required before the .get() call.
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.
Also note that the condition can occur now via the CLI tool. You should be able to produce a KeyError
if not setting a user_namespace value (and without adding the field existence test).
I can confirm that @akchinSTC 's fix is working. Thanks a bunch! |
Excellent. Thank you for all your help with this James. Alan - great (and simple) fix! (The best kind there is!) |
… and empty string value
Add user_namespace field to kfp metadata schema and update kfp processor to allow submission of pipelines to a dex enabled kfp cluster Fixes #1053
Add user_namespace field to kfp metadata schema and
update kfp processor to allow submission of pipelines
to a dex enabled kfp cluster
Fixes #1053
Developer's Certificate of Origin 1.1