-
Notifications
You must be signed in to change notification settings - Fork 4
add SlicerNNInteractive Server app #40
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
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
07c51c7
add nninteracive server app
smoors 835de85
update spec file
smoors 3e36bcc
make symlinks to interactive shell files
smoors cf428bd
split out copy-paste help
smoors 225a24c
use free port
smoors 2bbf5fc
use localhost
smoors File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <details> | ||
| <summary>copy-paste help</summary> | ||
| <ul> | ||
| <li>Select & Copy to Clipboard</li> | ||
| <ul> | ||
| <li>Line: <b>Shift+Left Click & Drag</b></li> | ||
| <li>Block: <b>Shift+Alt+Left Click & Drag</b></li> | ||
| </ul> | ||
| <li>Paste From Clipboard</li> | ||
| <ul> | ||
| <li><b>Shift+Insert</b></li> | ||
| <li><b>Ctrl+Shift+V</b></li> | ||
| </ul> | ||
| </ul> | ||
| </details> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 <code>$HOME/.tmux.conf</code>) | ||
| - 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 = <code>/apps/brussel/singularity/nninteractive-slicer-server/20250404/weights</code> | ||
| 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 | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| name: SlicerNNInteractive Server | ||
| category: Interactive Apps | ||
| subcategory: Testing | ||
| role: batch_connect | ||
| description: | | ||
| Launch an SlicerNNInteractive Server on the compute nodes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 %>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../interactive-shell/template/after.sh.erb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this directory is not writable by the user
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indeed, the weights are pre-downloaded in this location, and the server expects to find them in the cwd. |
||
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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) %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../interactive-shell/template/tmux.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 + "--") | ||
| %> | ||
| <script type="text/javascript"> | ||
| function get_<%= form_id %>_action(form) { | ||
| form.action = "https://" + window.location.host + "/node/<%= host %>/<%= port %>/?arg=<%= password %>" | ||
| } | ||
| </script> | ||
| <form id="<%= form_id %>" method="post" target="_blank" onsubmit="get_<%= form_id %>_action(this)"> | ||
| <button class="btn btn-primary" type="submit"> | ||
| <i class="fa fa-eye"></i> Connect to Shell | ||
| </button> | ||
|
|
||
| <%= ERB.new(File.read('../common_files/copy_paste_help.sh.erb'), eoutvar: 'child').result(binding) %> | ||
|
|
||
| <ul> | ||
| <li>Server log file: <code>/tmp/server.log</code></li> | ||
| <li>SSH tunnel: <code>ssh <%= host %> -NL 127.0.0.1:<%= app_server_port %>:127.0.0.1:<%= app_server_port %> -J <%= CurrentUser.name %>@login.hpc.vub.be</code></li> | ||
| <li>Server URL: <code>http://127.0.0.1:<%= app_server_port %></code></li> | ||
| </ul> | ||
| </form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 <[email protected]> | ||
| - Add SlicerNNInteractive Server app | ||
| * Mon Sep 29 2025 Samuel Moors <[email protected]> | ||
| - Set graphics backend | ||
| * Thu Jul 10 2025 Alex Domingo <[email protected]> | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naive question, why is tmux needed? is this a shell application with a TUI interface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the interactive shell is not needed, it's only there because the user wants to monitor the log from a terminal.