From 8fd4ba14bd4a59b9ee53ab58b5238eaef25d2b0b Mon Sep 17 00:00:00 2001 From: Tommaso Comparin <3862206+tcompa@users.noreply.github.com> Date: Wed, 5 Feb 2025 08:44:20 +0100 Subject: [PATCH 1/2] Add `uname -n` output to SLURM jobs - ref #1588 --- fractal_server/app/runner/executors/slurm/ssh/executor.py | 6 ++++-- fractal_server/app/runner/executors/slurm/sudo/executor.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/fractal_server/app/runner/executors/slurm/ssh/executor.py b/fractal_server/app/runner/executors/slurm/ssh/executor.py index 89ef4f4e2b..704e2feda3 100644 --- a/fractal_server/app/runner/executors/slurm/ssh/executor.py +++ b/fractal_server/app/runner/executors/slurm/ssh/executor.py @@ -1199,8 +1199,10 @@ def _prepare_sbatch_script( script_lines = slurm_config.sort_script_lines(script_lines) logger.debug(script_lines) - # Always print output of `pwd` - script_lines.append('echo "Working directory (pwd): `pwd`"\n') + # Always print output of `uname -n` and `pwd` + script_lines.append( + '"Hostname: `uname -n`; current directory: `pwd`"\n' + ) # Complete script preamble script_lines.append("\n") diff --git a/fractal_server/app/runner/executors/slurm/sudo/executor.py b/fractal_server/app/runner/executors/slurm/sudo/executor.py index 34faaa6535..535525f91d 100644 --- a/fractal_server/app/runner/executors/slurm/sudo/executor.py +++ b/fractal_server/app/runner/executors/slurm/sudo/executor.py @@ -1162,8 +1162,10 @@ def _prepare_sbatch_script( script_lines = slurm_config.sort_script_lines(script_lines) logger.debug(script_lines) - # Always print output of `pwd` - script_lines.append('echo "Working directory (pwd): `pwd`"\n') + # Always print output of `uname -n` and `pwd` + script_lines.append( + '"Hostname: `uname -n`; current directory: `pwd`"\n' + ) # Complete script preamble script_lines.append("\n") From 9ab750dfb9307284fe4162a472684b5ae48eb2ce Mon Sep 17 00:00:00 2001 From: Tommaso Comparin <3862206+tcompa@users.noreply.github.com> Date: Wed, 5 Feb 2025 08:45:19 +0100 Subject: [PATCH 2/2] CHANGELOG [skip ci] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 350a4ce6a2..b21f8635a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ * Remove `run_migrations_offline` from `env.py` and make `run_migrations_online` sync (\#2239). * Runner * Sudo/SLURM executor checks the fractal-server version using `FRACTAL_SLURM_WORKER_PYTHON` config variable, if set (\#2240). + * Add `uname -n` to SLURM submission scripts (\#2247). * Handle `_COMPONENT_KEY_`-related errors in sudo/SLURM executor, to simplify testing (\#2245). * Drop obsolete `SlurmJob.workflow_task_file_prefix` for both SSH/sudo executors (\#2245). * Drop obsolete `keep_pickle_files` attribute from slurm executors (\#2246).