Skip to content

Commit

Permalink
Apptainer call
Browse files Browse the repository at this point in the history
  • Loading branch information
maouw committed Sep 28, 2023
1 parent 5f30021 commit 96a2dbd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hyakvnc/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ def create_node_signal_handler(signal_number, frame):
# Template to name the apptainer instance:
apptainer_instance_name = f"{app_config.apptainer_instance_prefix}-$SLURM_JOB_ID-{container_name}"
# Command to start the apptainer instance:
apptainer_cmd = f"apptainer instance start {container_path} {apptainer_instance_name}"
apptainer_cmd = f"apptainer instance start --writable-tmpfs --cleanenv {container_path} {apptainer_instance_name}"

# Command to start the apptainer instance and keep it running:
apptainer_cmd_with_rest = apptainer_env_vars_string + f"{apptainer_cmd} && while true; do sleep 10; done"
apptainer_cmd_with_rest = (
apptainer_env_vars_string + "printenv && " + apptainer_cmd + " && while true; do sleep 10; done"
)

# The sbatch wrap functionality allows submitting commands without an sbatch script:t
sbatch_opts["wrap"] = apptainer_cmd_with_rest
Expand Down

0 comments on commit 96a2dbd

Please sign in to comment.