From 86653b6134b225fe75a203ec3e99c07ae735fc9d Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Wed, 24 Jan 2024 11:22:28 -0500 Subject: [PATCH] add container_start_args to pass options to the start command (#821) --- lib/ood_core/batch_connect/templates/vnc_container.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/ood_core/batch_connect/templates/vnc_container.rb b/lib/ood_core/batch_connect/templates/vnc_container.rb index c91155ace..dc86b3590 100644 --- a/lib/ood_core/batch_connect/templates/vnc_container.rb +++ b/lib/ood_core/batch_connect/templates/vnc_container.rb @@ -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 @@ -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..." @@ -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