diff --git a/apps/common_files/copy_paste_help.sh.erb b/apps/common_files/copy_paste_help.sh.erb new file mode 100644 index 0000000..e6758a3 --- /dev/null +++ b/apps/common_files/copy_paste_help.sh.erb @@ -0,0 +1,15 @@ +
+copy-paste help + +
diff --git a/apps/interactive-shell/view.html.erb b/apps/interactive-shell/view.html.erb index 37f531d..a4e4e82 100644 --- a/apps/interactive-shell/view.html.erb +++ b/apps/interactive-shell/view.html.erb @@ -12,16 +12,7 @@ + +<%= ERB.new(File.read('../common_files/copy_paste_help.sh.erb'), eoutvar: 'child').result(binding) %> + - diff --git a/apps/slicernninteractive/form.yml.erb b/apps/slicernninteractive/form.yml.erb new file mode 100644 index 0000000..af00106 --- /dev/null +++ b/apps/slicernninteractive/form.yml.erb @@ -0,0 +1,53 @@ +--- +cluster: "*" + +# app-specific attributes +attributes: + bc_num_hours: + label: "Number of hours" + widget: "number_field" + value: 12 + min: 1 + max: 120 + step: 1 + advanced_font_size: + label: Font Size + help: | + Default terminal (xterm.js) font size. + + - Dynamic font/zoom adjustments via Ctrl+(Plus|Minux|0) has UI bugs. + - To change font size, cancel your running interactive shell session and launch a new job with the desired font size. + widget: number_field + max: 30 + min: 10 + step: 1 + value: 16 + advanced_tmux_config: + label: "Tmux: Use Bundled Config File" + help: | + - Checked = load config included with this interactive app + - Unchecked = No config file is specified and Tmux will look in the default locations (usually $HOME/.tmux.conf) + - Ensure your config file is compatible with Tmux 3.1b! + widget: check_box + value: "1" + working_dir: + label: "Model weights directory" + help: | + - Optionally select a nnInteractive model weights directory. + - Default = /apps/brussel/singularity/nninteractive-slicer-server/20250404/weights + widget: "path_selector" + show_files: false + + +form: + - auto_queues + - global_num_cores + - bc_num_slots + - global_bc_num_gpu_slots + - bc_num_hours + - working_dir + - global_prerun + - global_advanced + - advanced_font_size + - advanced_tmux_config + - bc_email_on_started diff --git a/apps/slicernninteractive/icon.png b/apps/slicernninteractive/icon.png new file mode 100644 index 0000000..c876bc1 Binary files /dev/null and b/apps/slicernninteractive/icon.png differ diff --git a/apps/slicernninteractive/manifest.yml b/apps/slicernninteractive/manifest.yml new file mode 100644 index 0000000..08eff85 --- /dev/null +++ b/apps/slicernninteractive/manifest.yml @@ -0,0 +1,7 @@ +--- +name: SlicerNNInteractive Server +category: Interactive Apps +subcategory: Testing +role: batch_connect +description: | + Launch an SlicerNNInteractive Server on the compute nodes. diff --git a/apps/slicernninteractive/submit.yml.erb b/apps/slicernninteractive/submit.yml.erb new file mode 100644 index 0000000..cb6d7da --- /dev/null +++ b/apps/slicernninteractive/submit.yml.erb @@ -0,0 +1,18 @@ +--- +# +# Configure the content of the job script for the batch job here +# @see http://www.rubydoc.info/gems/ood_core/OodCore/BatchConnect/Template +# +batch_connect: + # We use the basic web server template for generating the job script + # + # @note Do not change this unless you know what you are doing! + template: "basic" + conn_params: + - app_server_port + + +script: + native: + - "--cpus-per-task=<%= global_num_cores.to_i %>" + - "--gpus-per-node=<%= global_bc_num_gpu_slots.blank? ? 0 : global_bc_num_gpu_slots.to_i %>" diff --git a/apps/slicernninteractive/template/after.sh.erb b/apps/slicernninteractive/template/after.sh.erb new file mode 120000 index 0000000..1c0c479 --- /dev/null +++ b/apps/slicernninteractive/template/after.sh.erb @@ -0,0 +1 @@ +../../interactive-shell/template/after.sh.erb \ No newline at end of file diff --git a/apps/slicernninteractive/template/before.sh.erb b/apps/slicernninteractive/template/before.sh.erb new file mode 100644 index 0000000..6a22566 --- /dev/null +++ b/apps/slicernninteractive/template/before.sh.erb @@ -0,0 +1,26 @@ +<%= ERB.new(File.read('../common_files/ood_session.sh.erb'), eoutvar: 'child').result(binding) %> + +<% + if defined?(context.working_dir) + working_dir = context.working_dir + else + working_dir = "" + end + if working_dir.blank? + working_dir = '/apps/brussel/singularity/nninteractive-slicer-server/20250404/weights' + end +%> + +# Set User Defined Working Directory +export OOD_WD="<%= working_dir.to_s %>" +echo "working dir: $OOD_WD" + +<%= ERB.new(File.read('../common_files/job_environment.sh.erb'), eoutvar: 'child').result(binding) %> + +export OOD_APP_NAME="SlicerNNInteractive Server" + +while true; do + app_server_port=$(find_port $host) + [[ $app_server_port -ne $port ]] && break +done +export app_server_port diff --git a/apps/slicernninteractive/template/script.sh.erb b/apps/slicernninteractive/template/script.sh.erb new file mode 100755 index 0000000..bb4348b --- /dev/null +++ b/apps/slicernninteractive/template/script.sh.erb @@ -0,0 +1,11 @@ +#!/usr/bin/bash -l + +<%= ERB.new(File.read('../common_files/work_directory_change.sh.erb'), eoutvar: 'child').result(binding) %> + +[[ -z $APPTAINERENV_HF_HUB_OFFLINE ]] && export APPTAINERENV_HF_HUB_OFFLINE=1 + +apptainer run --nv \ + /apps/brussel/singularity/nninteractive-slicer-server/20250404/nninteractive-slicer-server-20250404.sif \ + python /opt/server/main.py --host 127.0.0.1 --port $app_server_port 2>&1 | tee /tmp/server.log & + +<%= ERB.new(File.read('../common_files/launch_ttyd_tmux.sh.erb'), eoutvar: 'child').result(binding) %> diff --git a/apps/slicernninteractive/template/tmux.conf b/apps/slicernninteractive/template/tmux.conf new file mode 120000 index 0000000..429203e --- /dev/null +++ b/apps/slicernninteractive/template/tmux.conf @@ -0,0 +1 @@ +../../interactive-shell/template/tmux.conf \ No newline at end of file diff --git a/apps/slicernninteractive/view.html.erb b/apps/slicernninteractive/view.html.erb new file mode 100644 index 0000000..a207556 --- /dev/null +++ b/apps/slicernninteractive/view.html.erb @@ -0,0 +1,23 @@ +<% + # generate form id, based on host and port + require 'digest' + form_id = Digest::SHA1.hexdigest("--" + host.to_s + "--" + port.to_s + "--") +%> + +
+ + +<%= ERB.new(File.read('../common_files/copy_paste_help.sh.erb'), eoutvar: 'child').result(binding) %> + + +
diff --git a/ondemand-vub.spec b/ondemand-vub.spec index 109a116..4bfe2f2 100644 --- a/ondemand-vub.spec +++ b/ondemand-vub.spec @@ -3,7 +3,7 @@ Summary: Scripts, customizations and tools for Open OnDemand Name: ondemand-vub -Version: 2.01 +Version: 2.02 Release: 1 BuildArch: noarch License: GPL @@ -57,6 +57,8 @@ Scripts, customizations and tools for Open OnDemand as used at the VUB. /var/www/ood/apps/sys %changelog +* Thu Oct 09 2025 Samuel Moors +- Add SlicerNNInteractive Server app * Mon Sep 29 2025 Samuel Moors - Set graphics backend * Thu Jul 10 2025 Alex Domingo