Skip to content

Commit

Permalink
make the script executable
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Jan 20, 2025
1 parent e670864 commit 8cc0431
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app_runner/src/app_runner/submitter/slurm_submitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import TYPE_CHECKING

import yaml
from loguru import logger
from pydantic import BaseModel

if TYPE_CHECKING:
Expand Down Expand Up @@ -81,12 +82,12 @@ def submit(self, workunit_wrapper_data: WorkunitWrapperData, specific_params: di
main_command = self._get_main_command(workunit_wrapper_data=workunit_wrapper_data)
script = self._compose_script(main_command=main_command, specific_params=specific_params)
script_path.write_text(script)
script_path.chmod(0o755)

# Execute sbatch
sbatch_bin = self._default_config.config.slurm_root / "bin" / "sbatch"
env = os.environ | {"SLURMROOT": self._default_config.config.slurm_root}
# TODO remove after debug
print(script_path)
logger.info("Script written to {}", script_path)
# TODO remove after debug
1 / 0
subprocess.run([str(sbatch_bin), str(script_path)], env=env, check=True)

0 comments on commit 8cc0431

Please sign in to comment.