feat: allow users to set a relative path to save compiled Pipeline DSL#646
feat: allow users to set a relative path to save compiled Pipeline DSL#646Ya-shh wants to merge 5 commits intokubeflow:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Signed-off-by: Yash <yashh.real@gmail.com>
40b7766 to
5811c54
Compare
|
Fixes! - #630 |
|
Thank you for working on this @Ya-shh ! The functionality works as expected and the code looks good. Only thing I would change is the error message when putting in invalid path:
With that I would also add some invalid paths to the tests. (absolute paths, paths with .. , etc.) Please let me know if you agree. |
Hey @ada333 , thanks for the review ! |
|
@Ya-shh yes exactly! |
Signed-off-by: Yash <yashh.real@gmail.com>
|
I have resolved the merge conflicts |
jesuino
left a comment
There was a problem hiding this comment.
Thanks again for your contribution. I am suggesting another way to check the path set by the user. Does that make sense? Please also let me know if you think that this could be set using settings - if that's the case we can open an issue later to make it configurable from the client side as well.
Thanks!
kale/config/validators.py
Outdated
| def _validate(self, value: str): | ||
| if not value: | ||
| return | ||
| if os.path.isabs(value): |
There was a problem hiding this comment.
Have you tried to:
- Resolve the user path using Path.resolve(); Notice that when you call resolve you will have as result the actual path, not symlinks or shortcuts (such as
..) - Make it sure that it relative to the target directory, seomthing like:
user_path.startswith(project_dir)- this way we ensure that the path is only set relative to the project path and not anywhere else on the disk
Does that make sense to you?
…-output-path # Conflicts: # kale/tests/unit_tests/test_output_path.py
1ce7658 to
789cae2
Compare
|
@jesuino Thanks a lot for the review !, I have replaced the string based checks with Path.resolve() + startswith(project_dir) as you suggested. One check now covers absolute paths, .. traversal, and symlinks. |
jesuino
left a comment
There was a problem hiding this comment.
Hello @Ya-shh
Thanks again for your changes. I did test and it is working perfectly. There's just one point which is the UI for the input path being on the LeftPane. This is better suitable to be a part of Jupyter Lab settings, see this PR by @alikhere . Once yours and theirs PR is merged we should create an issue to move this configuration to the settings.
Yes it is better suited there, but personally I find it more useful to have the path directly in the LeftPane, I think it's easier to navigate from there |
|
Hello @Ya-shh I prefer the Settings because I do believe that the Left Pane should have only Pipeline related configuration, but I do understand your point. I asked this on the community, feel free to participate there: https://cloud-native.slack.com/archives/C08KJBVDH5H/p1774566643127079 |
|
Hey @jesuino in my opinion we should go with Settings as you said .However ,it would be good to make the resolved output path visible somewhere lightweight on the Left Pane, like a small read only label or tooltip near the compile/deploy button (e.g., "Output: .kale/").
|
|
Hello @Ya-shh The settings PR has been merged. Would you please make the changes to support the output path in Settings? Thanks! |
|
Hello @Ya-shh Just to check if you are still working on this. If you are busy or don't want to work on this anymore please let us know. Thanks! |
|
Hey @jesuino, I will work on this. I was quite busy last week, but I have already planned out the code. Please wait, I will try to complete this by the end of the week |



By default, Kale saves the generated KFP DSL script to a hidden
.kale/folder, making it hard for users to find.This PR adds an Output Directory field to the Kale panel in JupyterLab, letting users specify where the compiled pipeline file should be saved (e.g.
pipelines/output).The same option is available via the
--output_pathCLI flag.Leaving the field empty preserves the existing
.kale/default.Closes #630