Skip to content

Commit

Permalink
add container_start_args to pass options to the start command (#821)
Browse files Browse the repository at this point in the history
  • Loading branch information
johrstrom authored Jan 24, 2024
1 parent e750a4d commit 86653b6
Showing 1 changed file with 8 additions and 2 deletions.
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

0 comments on commit 86653b6

Please sign in to comment.