Skip to content
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

View install commands #596

Merged
merged 11 commits into from
Oct 12, 2022
Merged

View install commands #596

merged 11 commits into from
Oct 12, 2022

Conversation

muffato
Copy link
Contributor

@muffato muffato commented Oct 10, 2022

Hi.

Here is a pull-request to address #590 (comment) and #590 (comment)

  1. shpc install doesn't accept a --view argument anymore.
  2. shpc view install now honours the default view, as set in the settings.
  3. I've renamed the view and disable_view arguments of the install method to resp. extra_view and disable_default_view to clarify what they refer to.
  4. I've updated the CI to test views on tcsh too, so that both shells test (almost1) entirely the same thing.
  5. Both CI tests clean up their modules / views to ensure nothing bleeds from the first one to the next

Footnotes

  1. tcsh still doesn't run shpc test. I've tried to add it, but couldn't manage to make it work: it complains that module is not found even though the module commands work. I found something weird: shpc test always runs the test script with bash even if the user requested a different test shell. I tried using the test shell throughout but it didn't help. And anyway, tcsh is not allowed as a shell.

Copy link
Member

@vsoch vsoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @muffato ! Some comments below!

shpc/main/modules/base.py Outdated Show resolved Hide resolved
shpc/main/modules/base.py Outdated Show resolved Hide resolved
shpc/main/modules/base.py Outdated Show resolved Hide resolved
shpc/main/modules/base.py Outdated Show resolved Hide resolved
shpc/main/modules/base.py Outdated Show resolved Hide resolved
shpc/tests/test_views.py Outdated Show resolved Hide resolved
@muffato
Copy link
Contributor Author

muffato commented Oct 10, 2022

The latest version makes most of the comments obsolete

shpc/main/modules/base.py Outdated Show resolved Hide resolved
@vsoch
Copy link
Member

vsoch commented Oct 10, 2022

okay I started a rough idea - too tired to finish tonight but will try to soon this week!

@vsoch
Copy link
Member

vsoch commented Oct 10, 2022

muffato#4 (comment)

This will help to carry around some common data
attributes and functions, and reduce redundancy within
the ModuleBase class. It also allows for providing
fewer variables to the rendered templates since
they can come from the module.

Signed-off-by: vsoch <[email protected]>
@@ -52,7 +52,10 @@ def create_from_file(

# Extra modules to install
for install_module in install_modules:
cli.install(install_module, view=view_name, disable_view=False, force=force)

# TODO: can we cut out early if already installed?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'll keep that in mind when implementing reinstall and upgrade. I could split force into specific flags (like ignore-missing and uninstall-missing in upgrade)

@muffato
Copy link
Contributor Author

muffato commented Oct 11, 2022

Here it is, I've split view_uninstall from uninstall like I did for install

Copy link
Contributor Author

@muffato muffato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've annotated the occurrences of force. I'll probably tidy some of them up in #590

shpc/main/modules/base.py Show resolved Hide resolved
shpc/main/modules/base.py Show resolved Hide resolved
shpc/main/modules/base.py Show resolved Hide resolved
shpc/main/modules/base.py Show resolved Hide resolved
Copy link
Member

@vsoch vsoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a heck of a lot neater - I really like it! Some small tweaks, and then given you've taken the basic changes for a spin and are happy, I'm good to merge this into main and keep working. I think your other PR #590 is going to add some really good functionality, and we can finish up there and ping Marco to see what he thinks before doing a release.

And I'm also down to keep iterating on improving the new Module class to better handle some of the logic - let me know if you see / think of something that can be improved and I'll be on it!

shpc/main/modules/base.py Outdated Show resolved Hide resolved
shpc/main/modules/base.py Show resolved Hide resolved
shpc/main/modules/template.py Outdated Show resolved Hide resolved
shpc/main/modules/base.py Show resolved Hide resolved
muffato and others added 3 commits October 11, 2022 22:22
@muffato
Copy link
Contributor Author

muffato commented Oct 11, 2022

Looks good to me ! I'll rebase #590 once this is merged.

Copy link
Member

@vsoch vsoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK this is a lot of changes - but I'm good as well! Let's merge this! 🥳

@vsoch vsoch merged commit ceca803 into singularityhub:main Oct 12, 2022
@muffato muffato deleted the view_install branch October 12, 2022 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants