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 container_start_args to pass options to the start command #821

Merged
merged 1 commit into from
Jan 24, 2024
Merged
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
10 changes: 8 additions & 2 deletions lib/ood_core/batch_connect/templates/vnc_container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ class VNC_Container < Template
# empty string.
# @option context [#to_s] :container_command ("singularity") the
# singularity or apptainer execution command
# @option context [#to_a] :container_start_args ([]) Additional
# arguements you wish to pass to the container start command.
# @param instance_name (uuid) a name for the instance
# @see Template

Expand Down Expand Up @@ -99,8 +101,8 @@ module load #{container_module}
export INSTANCE_NAME="#{@instance_name}"
export instance_name="#{@instance_name}"
echo "Starting instance..."
#{container_command} instance start #{container_path} #{@instance_name}
#{container_command} instance start #{container_start_args} #{container_path} #{@instance_name}

# Setup one-time use passwords and initialize the VNC password
function change_passwd () {
echo "Setting VNC password..."
Expand Down Expand Up @@ -219,6 +221,10 @@ def container_command
context.fetch(:container_command, "singularity").to_s
end

def container_start_args
context.fetch(:container_start_args, []).to_a.join(' ')
end

# Arguments sent to `vncserver` command
def vnc_args
context.fetch(:vnc_args) do
Expand Down
Loading