snakemake-software-deployment-plugin-container 0.5.2__tar.gz → 0.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {snakemake_software_deployment_plugin_container-0.5.2 → snakemake_software_deployment_plugin_container-0.6.0}/CHANGELOG.md +12 -0
- {snakemake_software_deployment_plugin_container-0.5.2 → snakemake_software_deployment_plugin_container-0.6.0}/PKG-INFO +1 -1
- {snakemake_software_deployment_plugin_container-0.5.2 → snakemake_software_deployment_plugin_container-0.6.0}/pixi.lock +2 -2
- {snakemake_software_deployment_plugin_container-0.5.2 → snakemake_software_deployment_plugin_container-0.6.0}/pyproject.toml +1 -1
- {snakemake_software_deployment_plugin_container-0.5.2 → snakemake_software_deployment_plugin_container-0.6.0}/src/snakemake_software_deployment_plugin_container/__init__.py +30 -1
- {snakemake_software_deployment_plugin_container-0.5.2 → snakemake_software_deployment_plugin_container-0.6.0}/tests/test_plugin.py +17 -2
- {snakemake_software_deployment_plugin_container-0.5.2 → snakemake_software_deployment_plugin_container-0.6.0}/.github/workflows/ci.yml +0 -0
- {snakemake_software_deployment_plugin_container-0.5.2 → snakemake_software_deployment_plugin_container-0.6.0}/.github/workflows/conventional-prs.yml +0 -0
- {snakemake_software_deployment_plugin_container-0.5.2 → snakemake_software_deployment_plugin_container-0.6.0}/.github/workflows/release-please.yml +0 -0
- {snakemake_software_deployment_plugin_container-0.5.2 → snakemake_software_deployment_plugin_container-0.6.0}/.gitignore +0 -0
- {snakemake_software_deployment_plugin_container-0.5.2 → snakemake_software_deployment_plugin_container-0.6.0}/LICENSE +0 -0
- {snakemake_software_deployment_plugin_container-0.5.2 → snakemake_software_deployment_plugin_container-0.6.0}/README.md +0 -0
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.0](https://github.com/snakemake/snakemake-software-deployment-plugin-container/compare/v0.5.2...v0.6.0) (2026-03-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* support for docker ([#14](https://github.com/snakemake/snakemake-software-deployment-plugin-container/issues/14)) ([1ccee66](https://github.com/snakemake/snakemake-software-deployment-plugin-container/commit/1ccee662f69a60b4a3afa300c4ec3c70da96bc6a))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* properly handle docker:// urls for non-apptainer runtimes ([2b8323d](https://github.com/snakemake/snakemake-software-deployment-plugin-container/commit/2b8323d0a1731d75393ca9d5c1c2b362358ab6ba))
|
|
14
|
+
|
|
3
15
|
## [0.5.2](https://github.com/snakemake/snakemake-software-deployment-plugin-container/compare/v0.5.1...v0.5.2) (2026-03-10)
|
|
4
16
|
|
|
5
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: snakemake-software-deployment-plugin-container
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Project-URL: repository, https://github.com/snakemake/snakemake-software-deployment-plugin-container
|
|
5
5
|
Project-URL: documentation, https://snakemake.github.io/snakemake-plugin-catalog/plugins/software-deployment/container.html
|
|
6
6
|
Author-email: Ben Carrillo <ben.uzh@pm.me>, Johannes Köster <johannes.koester@uni-due.de>
|
|
@@ -1336,8 +1336,8 @@ packages:
|
|
|
1336
1336
|
requires_python: '>=3.11,<4.0'
|
|
1337
1337
|
- pypi: ./
|
|
1338
1338
|
name: snakemake-software-deployment-plugin-container
|
|
1339
|
-
version: 0.
|
|
1340
|
-
sha256:
|
|
1339
|
+
version: 0.6.0
|
|
1340
|
+
sha256: 18daca129554e3467d78b71f17c2e1e0d84d0ab4610be60276629e12a6cb5309
|
|
1341
1341
|
requires_dist:
|
|
1342
1342
|
- snakemake-interface-common>=1.23.0,<2.0.0
|
|
1343
1343
|
- snakemake-interface-software-deployment-plugins>=0.16.0,<1.0
|
|
@@ -5,6 +5,7 @@ __copyright__ = "Copyright 2025, ben carrillo"
|
|
|
5
5
|
__email__ = "ben.uzh@pm.me"
|
|
6
6
|
__license__ = "MIT"
|
|
7
7
|
|
|
8
|
+
import os
|
|
8
9
|
import shlex
|
|
9
10
|
from dataclasses import dataclass, field
|
|
10
11
|
from os import getcwd
|
|
@@ -33,6 +34,7 @@ class Runtime(SettingsEnumBase):
|
|
|
33
34
|
UDOCKER = 0
|
|
34
35
|
PODMAN = 1
|
|
35
36
|
APPTAINER = 2
|
|
37
|
+
DOCKER = 3
|
|
36
38
|
|
|
37
39
|
|
|
38
40
|
@dataclass
|
|
@@ -54,6 +56,16 @@ class Settings(SoftwareDeploymentSettingsBase):
|
|
|
54
56
|
"Current working directory and the system tmpdir are always mounted.",
|
|
55
57
|
},
|
|
56
58
|
)
|
|
59
|
+
use_user_namespaces: bool = field(
|
|
60
|
+
default=False,
|
|
61
|
+
metadata={
|
|
62
|
+
"help": "Whether to use user namespaces (if supported by the runtime). "
|
|
63
|
+
"This can be useful to avoid permission issues, but is not always "
|
|
64
|
+
"supported. For non-docker runtimes, this is not needed. "
|
|
65
|
+
"For docker, the fallback option is to set the user and group id via "
|
|
66
|
+
"--user. This happens automatically if this flag here is not used.",
|
|
67
|
+
},
|
|
68
|
+
)
|
|
57
69
|
|
|
58
70
|
|
|
59
71
|
common_settings = CommonSettings(provides="container")
|
|
@@ -92,6 +104,8 @@ class Env(EnvBase):
|
|
|
92
104
|
self.runtime_manager = RuntimeManager(self)
|
|
93
105
|
if self.settings.runtime == Runtime.APPTAINER:
|
|
94
106
|
self.runtime_manager = RuntimeManagerApptainer(self)
|
|
107
|
+
elif self.settings.runtime == Runtime.DOCKER:
|
|
108
|
+
self.runtime_manager = RuntimeManagerDocker(self)
|
|
95
109
|
|
|
96
110
|
# The decorator ensures that the decorated method is only called once
|
|
97
111
|
# in case multiple environments of the same kind are created.
|
|
@@ -156,7 +170,10 @@ class RuntimeManager:
|
|
|
156
170
|
return "-v"
|
|
157
171
|
|
|
158
172
|
def image_uri(self) -> str:
|
|
159
|
-
|
|
173
|
+
image_uri = self.env.spec.image_uri
|
|
174
|
+
if image_uri.startswith("docker://"):
|
|
175
|
+
return image_uri[9:]
|
|
176
|
+
return image_uri
|
|
160
177
|
|
|
161
178
|
def subcommand(self) -> str:
|
|
162
179
|
return "run"
|
|
@@ -208,3 +225,15 @@ class RuntimeManagerApptainer(RuntimeManager):
|
|
|
208
225
|
if re.match(r"[a-z\.]+://", super().image_uri()):
|
|
209
226
|
return super().image_uri()
|
|
210
227
|
return f"docker://{super().image_uri()}"
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
class RuntimeManagerDocker(RuntimeManager):
|
|
231
|
+
def options(self) -> str:
|
|
232
|
+
options = super().options()
|
|
233
|
+
if self.env.settings.use_user_namespaces:
|
|
234
|
+
options += " --userns keep-id"
|
|
235
|
+
else:
|
|
236
|
+
uid = os.getuid()
|
|
237
|
+
gid = os.getgid()
|
|
238
|
+
options += f" --user {uid}:{gid}"
|
|
239
|
+
return options
|
|
@@ -87,18 +87,33 @@ class TestUDockerContainer(TestBase):
|
|
|
87
87
|
return Settings(runtime=Runtime.UDOCKER)
|
|
88
88
|
|
|
89
89
|
|
|
90
|
-
# Helper function to check if podman is available
|
|
91
90
|
def is_podman_available():
|
|
92
91
|
return shutil.which("podman") is not None
|
|
93
92
|
|
|
94
93
|
|
|
94
|
+
def is_docker_available():
|
|
95
|
+
return shutil.which("docker") is not None
|
|
96
|
+
|
|
97
|
+
|
|
95
98
|
@pytest.mark.skipif(
|
|
96
99
|
not is_podman_available(), reason="podman not available on the system"
|
|
97
100
|
)
|
|
98
101
|
class TestPodmanContainer(TestBase):
|
|
99
102
|
__test__ = True # activate automatic testing
|
|
100
103
|
|
|
101
|
-
def
|
|
104
|
+
def get_settings(
|
|
102
105
|
self,
|
|
103
106
|
) -> Optional[SoftwareDeploymentSettingsBase]:
|
|
104
107
|
return Settings(runtime=Runtime.PODMAN)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
@pytest.mark.skipif(
|
|
111
|
+
not is_docker_available(), reason="docker not available on the system"
|
|
112
|
+
)
|
|
113
|
+
class TestDockerContainer(TestBase):
|
|
114
|
+
__test__ = True # activate automatic testing
|
|
115
|
+
|
|
116
|
+
def get_settings(
|
|
117
|
+
self,
|
|
118
|
+
) -> Optional[SoftwareDeploymentSettingsBase]:
|
|
119
|
+
return Settings(runtime=Runtime.DOCKER)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|