snakemake-executor-plugin-slurm 0.6.0__py3-none-any.whl → 0.7.0__py3-none-any.whl
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.
Potentially problematic release.
This version of snakemake-executor-plugin-slurm might be problematic. Click here for more details.
- snakemake_executor_plugin_slurm/__init__.py +15 -1
- {snakemake_executor_plugin_slurm-0.6.0.dist-info → snakemake_executor_plugin_slurm-0.7.0.dist-info}/METADATA +1 -1
- snakemake_executor_plugin_slurm-0.7.0.dist-info/RECORD +5 -0
- snakemake_executor_plugin_slurm-0.6.0.dist-info/RECORD +0 -5
- {snakemake_executor_plugin_slurm-0.6.0.dist-info → snakemake_executor_plugin_slurm-0.7.0.dist-info}/LICENSE +0 -0
- {snakemake_executor_plugin_slurm-0.6.0.dist-info → snakemake_executor_plugin_slurm-0.7.0.dist-info}/WHEEL +0 -0
|
@@ -50,11 +50,24 @@ common_settings = CommonSettings(
|
|
|
50
50
|
# Implementation of your executor
|
|
51
51
|
class Executor(RemoteExecutor):
|
|
52
52
|
def __post_init__(self):
|
|
53
|
+
# run check whether we are running in a SLURM job context
|
|
54
|
+
self.warn_on_jobcontext()
|
|
53
55
|
self.run_uuid = str(uuid.uuid4())
|
|
54
56
|
self.logger.info(f"SLURM run ID: {self.run_uuid}")
|
|
55
57
|
self._fallback_account_arg = None
|
|
56
58
|
self._fallback_partition = None
|
|
57
59
|
|
|
60
|
+
def warn_on_jobcontext(self, done=None):
|
|
61
|
+
if not done:
|
|
62
|
+
if "SLURM_JOB_ID" in os.environ:
|
|
63
|
+
self.logger.warning(
|
|
64
|
+
"Running Snakemake in a SLURM within a job may lead"
|
|
65
|
+
" to unexpected behavior. Please run Snakemake directly"
|
|
66
|
+
" on the head node."
|
|
67
|
+
)
|
|
68
|
+
time.sleep(5)
|
|
69
|
+
done = True
|
|
70
|
+
|
|
58
71
|
def additional_general_args(self):
|
|
59
72
|
return "--executor slurm-jobstep --jobs 1"
|
|
60
73
|
|
|
@@ -393,6 +406,7 @@ class Executor(RemoteExecutor):
|
|
|
393
406
|
account = self.get_account()
|
|
394
407
|
if account:
|
|
395
408
|
self.logger.warning(f"Guessed SLURM account: {account}")
|
|
409
|
+
self.test_account(f"{account}")
|
|
396
410
|
self._fallback_account_arg = f" -A {account}"
|
|
397
411
|
else:
|
|
398
412
|
self.logger.warning(
|
|
@@ -430,7 +444,7 @@ class Executor(RemoteExecutor):
|
|
|
430
444
|
sacct_out = subprocess.check_output(
|
|
431
445
|
cmd, shell=True, text=True, stderr=subprocess.PIPE
|
|
432
446
|
)
|
|
433
|
-
return sacct_out.strip()
|
|
447
|
+
return sacct_out.replace("(null)", "").strip()
|
|
434
448
|
except subprocess.CalledProcessError as e:
|
|
435
449
|
self.logger.warning(
|
|
436
450
|
f"No account was given, not able to get a SLURM account via sacct: "
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
snakemake_executor_plugin_slurm/__init__.py,sha256=23xB0r9M9PqkM6g8sdOps_J6xKCwOUBOrNkZY9vJN_k,22157
|
|
2
|
+
snakemake_executor_plugin_slurm-0.7.0.dist-info/LICENSE,sha256=YVc4xTLWMqGfFL36120k7rzXtsT6e4RkJsh68VVn12s,1076
|
|
3
|
+
snakemake_executor_plugin_slurm-0.7.0.dist-info/METADATA,sha256=f77cauodNnBf_n9sGNgTkkiAhf_1A3-oAOQRtDioFZ0,1380
|
|
4
|
+
snakemake_executor_plugin_slurm-0.7.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
5
|
+
snakemake_executor_plugin_slurm-0.7.0.dist-info/RECORD,,
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
snakemake_executor_plugin_slurm/__init__.py,sha256=tYTHco7vGZ6OtU-Cxfdy9PUJX8z-Svs7exL8x8bYBLk,21575
|
|
2
|
-
snakemake_executor_plugin_slurm-0.6.0.dist-info/LICENSE,sha256=YVc4xTLWMqGfFL36120k7rzXtsT6e4RkJsh68VVn12s,1076
|
|
3
|
-
snakemake_executor_plugin_slurm-0.6.0.dist-info/METADATA,sha256=R-SvE45vFNUtJVfJjF_qOQjoSojYkKGxGsIe5kaZz-8,1380
|
|
4
|
-
snakemake_executor_plugin_slurm-0.6.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
5
|
-
snakemake_executor_plugin_slurm-0.6.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|