shexec 2.6.0__tar.gz → 2.7.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.
- {shexec-2.6.0/shexec.egg-info → shexec-2.7.0}/PKG-INFO +1 -1
- {shexec-2.6.0 → shexec-2.7.0}/shexec/__init__.py +1 -1
- {shexec-2.6.0 → shexec-2.7.0}/shexec/models.py +4 -0
- {shexec-2.6.0 → shexec-2.7.0}/shexec/plugin.py +1 -0
- {shexec-2.6.0 → shexec-2.7.0/shexec.egg-info}/PKG-INFO +1 -1
- {shexec-2.6.0 → shexec-2.7.0}/tests/test_plugin.py +15 -0
- {shexec-2.6.0 → shexec-2.7.0}/LICENSE +0 -0
- {shexec-2.6.0 → shexec-2.7.0}/README.rst +0 -0
- {shexec-2.6.0 → shexec-2.7.0}/pyproject.toml +0 -0
- {shexec-2.6.0 → shexec-2.7.0}/setup.cfg +0 -0
- {shexec-2.6.0 → shexec-2.7.0}/shexec/__main__.py +0 -0
- {shexec-2.6.0 → shexec-2.7.0}/shexec/shexec.py +0 -0
- {shexec-2.6.0 → shexec-2.7.0}/shexec.egg-info/SOURCES.txt +0 -0
- {shexec-2.6.0 → shexec-2.7.0}/shexec.egg-info/dependency_links.txt +0 -0
- {shexec-2.6.0 → shexec-2.7.0}/shexec.egg-info/entry_points.txt +0 -0
- {shexec-2.6.0 → shexec-2.7.0}/shexec.egg-info/requires.txt +0 -0
- {shexec-2.6.0 → shexec-2.7.0}/shexec.egg-info/top_level.txt +0 -0
- {shexec-2.6.0 → shexec-2.7.0}/tests/test_cli.py +0 -0
- {shexec-2.6.0 → shexec-2.7.0}/tests/test_shexec.py +0 -0
|
@@ -83,6 +83,9 @@ class PluginSpec:
|
|
|
83
83
|
minMemory: the memory ChRIS reserves, as ``2Gi``.
|
|
84
84
|
minCpu: the CPU ChRIS reserves, in millicores, as ``1000m``.
|
|
85
85
|
minGpu: GPUs required; 0 for none.
|
|
86
|
+
maxGpu: GPUs a run may be given; 0 means as many as ``minGpu``. CUBE
|
|
87
|
+
refuses a description whose minimum exceeds its maximum, and
|
|
88
|
+
chris_plugin writes a maximum of 0 unless told otherwise.
|
|
86
89
|
defaults: flag defaults, ``exec`` above all; a derived plugin's usual command.
|
|
87
90
|
omit: engine flags this plugin does not offer, by destination name, as
|
|
88
91
|
``("threads", "threadsSplit")``. Each is removed from the parser, so
|
|
@@ -114,6 +117,7 @@ class PluginSpec:
|
|
|
114
117
|
minMemory: str = "2Gi"
|
|
115
118
|
minCpu: str = "1000m"
|
|
116
119
|
minGpu: int = 0
|
|
120
|
+
maxGpu: int = 0
|
|
117
121
|
defaults: dict[str, Any] = field(default_factory=dict)
|
|
118
122
|
omit: tuple[str, ...] = ()
|
|
119
123
|
chrisHidden: tuple[str, ...] = ()
|
|
@@ -243,6 +243,7 @@ def plugin_build(spec: PluginSpec, singleton: bool = True) -> Plugin:
|
|
|
243
243
|
min_memory_limit=spec.minMemory,
|
|
244
244
|
min_cpu_limit=spec.minCpu,
|
|
245
245
|
min_gpu_limit=spec.minGpu,
|
|
246
|
+
max_gpu_limit=max(spec.maxGpu, spec.minGpu),
|
|
246
247
|
singleton=register,
|
|
247
248
|
)(timedBody)
|
|
248
249
|
|
|
@@ -8,6 +8,7 @@ import json
|
|
|
8
8
|
from pathlib import Path
|
|
9
9
|
|
|
10
10
|
import pytest
|
|
11
|
+
from chris_plugin import _registration as chris_registration
|
|
11
12
|
from chris_plugin.parameters import serialize
|
|
12
13
|
|
|
13
14
|
from shexec import Plugin, PluginSpec, plugin_build
|
|
@@ -179,3 +180,17 @@ def test_threadsCap_note() -> None:
|
|
|
179
180
|
assert "not capped" in threads_cap(4, 16 * gib, None).note()
|
|
180
181
|
assert threads_cap(0, 16 * gib, MemoryLimit(1, "cgroup")).allowed == 0
|
|
181
182
|
assert threads_cap(4, 0, MemoryLimit(1, "cgroup")).allowed == 4
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def test_minGpu_describesAMaximumCubeAccepts(monkeypatch: pytest.MonkeyPatch) -> None:
|
|
186
|
+
monkeypatch.setattr(chris_registration, "_memory", [])
|
|
187
|
+
plugin_build(spec_make(minGpu=1), singleton=True)
|
|
188
|
+
details = chris_registration.get_registered()
|
|
189
|
+
assert (details.min_gpu_limit, details.max_gpu_limit) == (1, 1)
|
|
190
|
+
monkeypatch.setattr(chris_registration, "_memory", [])
|
|
191
|
+
plugin_build(spec_make(minGpu=1, maxGpu=2), singleton=True)
|
|
192
|
+
assert chris_registration.get_registered().max_gpu_limit == 2
|
|
193
|
+
monkeypatch.setattr(chris_registration, "_memory", [])
|
|
194
|
+
plugin_build(spec_make(), singleton=True)
|
|
195
|
+
details = chris_registration.get_registered()
|
|
196
|
+
assert (details.min_gpu_limit, details.max_gpu_limit) == (0, 0)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|