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

Ausbeth reinstall #1

Open
wants to merge 55 commits into
base: sanger-tol-reinstall
Choose a base branch
from
Open

Ausbeth reinstall #1

wants to merge 55 commits into from

Conversation

Ausbeth
Copy link
Collaborator

@Ausbeth Ausbeth commented Jul 31, 2024

reinstall functionality

@Ausbeth Ausbeth requested review from muffato and gq1 July 31, 2024 13:35
@Ausbeth Ausbeth self-assigned this Jul 31, 2024
@Ausbeth Ausbeth marked this pull request as draft July 31, 2024 13:36
@Ausbeth
Copy link
Collaborator Author

Ausbeth commented Sep 2, 2024

shpc reinstall software # reinstall all installed versions of that software (achieved)
shpc reinstall software:version # reinstall only that version (achieved)
shpc reinstall --all # reinstall all installed versions of all software (achieved)

By default, shpc reinstall software will keep the current container of that software.

User can type --complete flagger to override that:
shpc reinstall software --complete/shpc reinstall software:version --complete #remove the current container and reinstall

Note - User cannot type:

   shpc reinstall software --all

@Ausbeth Ausbeth linked an issue Sep 2, 2024 that may be closed by this pull request
@Ausbeth Ausbeth marked this pull request as ready for review September 3, 2024 01:45
@gq1
Copy link
Member

gq1 commented Sep 5, 2024

shpc reinstall
You must specify a recipe to reinstall or use --all to reinstall all installed modules.
$ shpc reinstall -h
usage: shpc reinstall [-h] [--complete] [--all] [--keep-path] [--no-view] [--force] [--module-sys {lmod,tcl}] [--container-tech {singularity,podman,docker}]
                      [reinstall_recipe] [container_image]

Reinstall a module. Containers are kept by default

  # Reinstall a specific version of a module
  $ shpc reinstall python:3.12-rc

  # Reinstall the all versions of a module
  $ shpc reinstall python

  # Completely reinstall a module without keeping the container
  $ shpc reinstall python --complete

  # Reinstall all installed modules
  $ shpc reinstall python --all

positional arguments:
  reinstall_recipe      recipe to reinstall
  container_image       path to an existing container image for this software

options:
  -h, --help            show this help message and exit
  --complete, --c       do not keep the container image file, when uninstall or reinstall
  --all, --a            reinstall all installed modules
  --keep-path           if installing a local container, do not copy the container - use the provided path.
  --no-view             skip installing to the default view, if defined in settings.
  --force, -f           replace existing symlinks
  --module-sys {lmod,tcl}
                        module system to use (defaults to lmod)
  --container-tech {singularity,podman,docker}
                        container technology to use to override settings.yaml
$ shpc reinstall quay.io/biocontainers/samtools
You currently don't have 'quay.io/biocontainers/samtools' installed.
Try: shpc install
$ shpc reinstall quay.io/biocontainers/samtools
Reinstalling all versions of quay.io/biocontainers/samtools...
Container was kept but template will be overwritten upon reinstall
Container was kept but template will be overwritten upon reinstall
Container was kept but template will be overwritten upon reinstall
/nfs/users/nfs_g/gq2/workdir/ausbeth/shpc2/ausbeth-reinstall/views/tol/samtools/1.20--h50ea8bc_0 has been removed.
singularity pull --name /nfs/users/nfs_g/gq2/workdir/ausbeth/shpc2/ausbeth-reinstall/container_base/quay.io/biocontainers/samtools/1.20--h50ea8bc_0/quay.io-biocontainers-samtools-1.20--h50ea8bc_0-sha256:d0ebd10e887e3ddd02d071f1ca7b649dc90dc6fb99a5ffd0f5ebf8611a1f92cc.sif docker://quay.io/biocontainers/samtools@sha256:d0ebd10e887e3ddd02d071f1ca7b649dc90dc6fb99a5ffd0f5ebf8611a1f92cc
INFO:    Using cached SIF image
Module quay.io/biocontainers/samtools:1.20--h50ea8bc_0 was created.
Creating link $module_base/quay.io/biocontainers/samtools/1.20--h50ea8bc_0/module.tcl -> $views_base/tol/samtools/1.20--h50ea8bc_0
Successfully reinstalled all versions of quay.io/biocontainers/samtools.
shpc reinstall quay.io/biocontainers/samtools:1.20--h50ea8bc_0
Reinstalling quay.io/biocontainers/samtools:1.20--h50ea8bc_0...
Container was kept but template will be overwritten upon reinstall
Container was kept but template will be overwritten upon reinstall
Container was kept but template will be overwritten upon reinstall
/nfs/users/nfs_g/gq2/workdir/ausbeth/shpc2/ausbeth-reinstall/views/tol/samtools/1.20--h50ea8bc_0 has been removed.
singularity pull --name /nfs/users/nfs_g/gq2/workdir/ausbeth/shpc2/ausbeth-reinstall/container_base/quay.io/biocontainers/samtools/1.20--h50ea8bc_0/quay.io-biocontainers-samtools-1.20--h50ea8bc_0-sha256:d0ebd10e887e3ddd02d071f1ca7b649dc90dc6fb99a5ffd0f5ebf8611a1f92cc.sif docker://quay.io/biocontainers/samtools@sha256:d0ebd10e887e3ddd02d071f1ca7b649dc90dc6fb99a5ffd0f5ebf8611a1f92cc
INFO:    Using cached SIF image
Module quay.io/biocontainers/samtools:1.20--h50ea8bc_0 was created.
Creating link $module_base/quay.io/biocontainers/samtools/1.20--h50ea8bc_0/module.tcl -> $views_base/tol/samtools/1.20--h50ea8bc_0
Successfully reinstalled of quay.io/biocontainers/samtools:1.20--h50ea8bc_0.
$ shpc reinstall --all
Reinstalling all installed modules...
Reinstalling all versions of quay.io/biocontainers/samtools...
Container was kept but template will be overwritten upon reinstall
Container was kept but template will be overwritten upon reinstall
Container was kept but template will be overwritten upon reinstall
/nfs/users/nfs_g/gq2/workdir/ausbeth/shpc2/ausbeth-reinstall/views/tol/samtools/1.20--h50ea8bc_0 has been removed.
singularity pull --name /nfs/users/nfs_g/gq2/workdir/ausbeth/shpc2/ausbeth-reinstall/container_base/quay.io/biocontainers/samtools/1.20--h50ea8bc_0/quay.io-biocontainers-samtools-1.20--h50ea8bc_0-sha256:d0ebd10e887e3ddd02d071f1ca7b649dc90dc6fb99a5ffd0f5ebf8611a1f92cc.sif docker://quay.io/biocontainers/samtools@sha256:d0ebd10e887e3ddd02d071f1ca7b649dc90dc6fb99a5ffd0f5ebf8611a1f92cc
INFO:    Using cached SIF image
Module quay.io/biocontainers/samtools:1.20--h50ea8bc_0 was created.
Creating link $module_base/quay.io/biocontainers/samtools/1.20--h50ea8bc_0/module.tcl -> $views_base/tol/samtools/1.20--h50ea8bc_0
Container was kept but template will be overwritten upon reinstall
Container was kept but template will be overwritten upon reinstall
Container was kept but template will be overwritten upon reinstall
/nfs/users/nfs_g/gq2/workdir/ausbeth/shpc2/ausbeth-reinstall/views/tol/samtools/1.19.2--h50ea8bc_1 has been removed.
singularity pull --name /nfs/users/nfs_g/gq2/workdir/ausbeth/shpc2/ausbeth-reinstall/container_base/quay.io/biocontainers/samtools/1.19.2--h50ea8bc_1/quay.io-biocontainers-samtools-1.19.2--h50ea8bc_1-sha256:9cd15e719101ae8808e4c3f152cca2bf06f9e1ad8551ed43c1e626cb6afdaa02.sif docker://quay.io/biocontainers/samtools@sha256:9cd15e719101ae8808e4c3f152cca2bf06f9e1ad8551ed43c1e626cb6afdaa02
INFO:    Using cached SIF image
Module quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1 was created.
Creating link $module_base/quay.io/biocontainers/samtools/1.19.2--h50ea8bc_1/module.tcl -> $views_base/tol/samtools/1.19.2--h50ea8bc_1
Successfully reinstalled all versions of quay.io/biocontainers/samtools.
All modules reinstalled.

Copy link
Member

@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.

Hi @Ausbeth . Here are some comments on your code, mainly going into two categories:

  • the current implementation
  • options/modes we haven't talked much about so far, like views, container paths, etc.

shpc/settings.yml Outdated Show resolved Hide resolved
shpc/client/help.py Outdated Show resolved Hide resolved
shpc/client/reinstall.py Outdated Show resolved Hide resolved
shpc/client/reinstall.py Outdated Show resolved Hide resolved
shpc/client/__init__.py Outdated Show resolved Hide resolved
shpc/client/__init__.py Outdated Show resolved Hide resolved
shpc/client/__init__.py Outdated Show resolved Hide resolved
shpc/client/reinstall.py Outdated Show resolved Hide resolved
shpc/client/reinstall.py Outdated Show resolved Hide resolved
shpc/client/reinstall.py Outdated Show resolved Hide resolved
Copy link
Member

@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.

Almost nothing left from me. Good job

shpc/client/__init__.py Outdated Show resolved Hide resolved
shpc/main/client.py 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/client.py Outdated Show resolved Hide resolved
shpc/tests/test_client.py Outdated Show resolved Hide resolved
Copy link
Member

@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.

Thank you @Ausbeth for those changes 👍🏼 .
pytest works for me locally, but I only run tcl and singularity. There seems to be an error on GitHub CI. Can you take a look ? That's the only reason why I'm not approving the PR yet

shpc/client/reinstall.py Outdated Show resolved Hide resolved
@Ausbeth
Copy link
Collaborator Author

Ausbeth commented Sep 30, 2024

Hi @muffato, yes, the issue is that the tests are not working with podman for some reason. I have been trying to solve it, but I don't know how to at the moment

making comment clearer

Co-authored-by: Matthieu Muffato <[email protected]>
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.

Command-line interface for all installation-related commands
3 participants