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
feat(core): add template command #2590
Conversation
e90770b
to
fd6b01b
Compare
does
|
I guess this answers my previous question:
|
I really like the addition of the
|
This functionality is really close, but it's missing what I really want it to be able to do --> update my template when a new version has been tagged/released. Maybe we are missing a concept here since we are using |
Hi @mohammad-sdsc, thanks for putting this together. I wasn't able to run
When I ran
so I don't think this is the right version of the Renku I have in my project. Are you able to point me to the right renku version? Thanks |
@gavin-k-lee You might need to do |
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.
Thank you for working on this, it is a really big change and adding a ^renku template` command group was sorely needed!
Sorry for the ton of comments, but when looking over your and my old code I just realized that we could structure all this in a more clean way 🙈
@rokroskar Thanks for the review!
You can use We use |
Looks great! It's certainly a powerful feature and I liked the interactive write/overwrite capability. I second what Rok mentioned. I think having support to update/pull to a particular ref is quite important, especially if a project-template repo has changes often (e.g. with a class where a teacher updates materials frequently). |
@mohammad-sdsc I don't doubt that pinning the template version is useful - but it's not a nice UX imho to expect the user to go and look up a newer tag themselves. We should be able to present a list of tags to the user and offer to update to another one. Of course not any random tag, but ones that match some pre-defined regex. We can't just initialize projects with the tip of the master branch because a new template might be incompatible with what is on renkulab. |
8c28ce8
to
c3f22c3
Compare
5fba1c6
to
cc19aa1
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.
Thanks you, this looks so much cleaner now!
print_name = functools.partial(click.style, bold=True, fg="magenta") | ||
print_value = functools.partial(click.style, bold=True) |
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.
Oh I like this, we should move it to some file and combine it with the color changes in https://github.com/SwissDataScienceCenter/renku-python/pull/2633/files#diff-7d96f8caf55d6ff0f188af796d7ce5af7963c75621a4399e0197aceaa2f3d86bR118 and make it so all the print functions use it.
if not self.path.exists(): | ||
raise errors.InvalidTemplateError(f"Template directory for '{self.id}' does not exists") | ||
|
||
# TODO: What are required files |
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.
We should check this, like environment.yml might be required, too
5d11f8e
to
1aed05c
Compare
5045e5e
to
98e251f
Compare
Description
renku template
command to list, set, or update projects' template. It allows forced updates and provides an interactive flag to ask users what to do with each file that exist in the project.Project.automated_update
is deprecated now and templates can be always updated if they don't have a fixed reference.Testing
This can be tested on any project. I've used this one: https://dev.renku.ch/gitlab/mohammad.alisafaee/lego-sets.git
Example commands:
renku template update
renku template update --dry-run
renku template set -f python-minimal -s https://dev.renku.ch/gitlab/renku-python-integration-tests/core-it-template-variable-test-project
renku template set -i R-minimal
renku template ls
renku template show -s https://dev.renku.ch/gitlab/renku-python-integration-tests/core-it-template-variable-test-project
renku template show
Fixes #2460
Fixes #1482