Skip to content

Commit

Permalink
Merge pull request #2247 from fractal-analytics-platform/1588-print-a…
Browse files Browse the repository at this point in the history
…dditional-info-from-slurm-jobs

Add `uname -n` output to SLURM jobs
  • Loading branch information
tcompa authored Feb 5, 2025
2 parents a5afca6 + 9ab750d commit 9bc9c08
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
6 changes: 4 additions & 2 deletions fractal_server/app/runner/executors/slurm/ssh/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 4 additions & 2 deletions fractal_server/app/runner/executors/slurm/sudo/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 9bc9c08

Please sign in to comment.