Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add singularity_options to the native structure. #853

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/ood_core/job/adapters/linux_host/launcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def wrapped_script(script, session_name)
'script_timeout' => script_timeout(script),
'session_name' => session_name,
'singularity_bin' => singularity_bin,
'singularity_options' => singularity_options(script.native),
'singularity_image' => singularity_image(script.native),
'ssh_hosts' => ssh_hosts,
'tmux_bin' => tmux_bin,
Expand Down Expand Up @@ -205,6 +206,12 @@ def singularity_bindpath(native)
native[:singularity_bindpath]
end

def singularity_options(native)
return '' unless native && native[:singularity_options]

native[:singularity_options]
end

def script_timeout(script)
wall_time = script.wall_time.to_i
return site_timeout if wall_time == 0
Expand Down Expand Up @@ -294,4 +301,4 @@ def parse_hostname(output)
end.compact.last.to_s
end

end
end
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ trap exit_script SIGINT SIGTERM
OUTPUT_PATH=<%= output_path %>
ERROR_PATH=<%= error_path %>
({
timeout <%= script_timeout %>s <%= singularity_bin %> exec <%= contain %> --pid <%= singularity_image %> /bin/bash --login $singularity_tmp_file <%= arguments %>
timeout <%= script_timeout %>s <%= singularity_bin %> exec <%= singularity_options %> <%= contain %> --pid <%= singularity_image %> /bin/bash --login $singularity_tmp_file <%= arguments %>
} | tee "$OUTPUT_PATH") 3>&1 1>&2 2>&3 | tee "$ERROR_PATH"

<%= email_on_terminated %>
Expand Down
Loading