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

Various wrapper scripts improvement #548

Merged
merged 20 commits into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2458aeb
Defines the constructor arguments just once
muffato Apr 30, 2022
12e68c2
Factored out the shell method as it is almost the same between both c…
muffato Apr 30, 2022
14c89f9
The DockerContainer doesn't need to know about its subclass any more
muffato Apr 30, 2022
8d28c86
Stop forbidding templates from being named podman.sh
muffato Apr 30, 2022
2bfb3d0
WrapperScript objects don't have the wrapper_template attribute anymore
muffato Apr 30, 2022
0fcb465
Merged the three generation methods of WrapperScript into one
muffato Apr 30, 2022
9712da5
Rewrote the template search
muffato Apr 30, 2022
2f0aead
Allow using a custom template for aliases
muffato Apr 30, 2022
ea88a16
Turned get_shell_path to a property
muffato May 30, 2022
fb37f66
Allow defining the alternative template script in a long form option …
muffato May 31, 2022
9756545
Ensure that the wrapper is always defined
muffato May 31, 2022
6343032
Extracted a function that checks the wrapper exists
muffato May 31, 2022
6d4d469
Updated the docs to reflect the current wait templates are rendered
muffato May 1, 2022
12f0c5a
Not used anywhere, so no need to make it a class variable
muffato Jun 2, 2022
e8841e7
Reinstated wrapper_template as a (mandatory) constructor argument
muffato Jun 3, 2022
33a7337
Further refactoring to split the function that establishes the search…
muffato Jun 3, 2022
27f6d13
Added a test for the two new methods of WrapperScript
muffato Jun 22, 2022
6cfe96c
Fixed the comment
muffato Jun 22, 2022
0698839
Pass the config as a kwarg so that we don't need to pass None for the…
muffato Jun 22, 2022
95d0506
Applied black
muffato Jun 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Turned get_shell_path to a property
Co-authored-by: Matthieu Muffato <mm49@sanger.ac.uk>
Co-authored-by: Vanessasaurus <814322+vsoch@users.noreply.github.com>
  • Loading branch information
muffato and vsoch committed Jun 16, 2022
commit ea88a162febdb19cd0fd125b493fd87bd64eb5c9
7 changes: 4 additions & 3 deletions shpc/main/container/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def __init__(self):
)
super(DockerContainer, self).__init__()

def get_shell_path(self):
@property
def shell_path(self):
"""
Return the path of the shell to use with this container.
"""
Expand All @@ -45,7 +46,7 @@ def shell(self, image):
"""
os.system(
"%s run -it --rm --entrypoint %s %s"
% (self.command, self.get_shell_path(), image)
% (self.command, self.shell_path, image)
)

def add_registry(self, uri):
Expand Down Expand Up @@ -240,7 +241,7 @@ def install(
# Make sure to render all values!
out = template.render(
settings=self.settings,
shell=self.get_shell_path(),
shell=self.shell_path,
image=container_path,
description=description,
aliases=aliases,
Expand Down
3 changes: 2 additions & 1 deletion shpc/main/container/podman.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class PodmanContainer(DockerContainer):
templatefile = "docker"
command = "podman"

def get_shell_path(self):
@property
def shell_path(self):
"""
Return the path of the shell to use with this container.
"""
Expand Down