Skip to content
Closed
Show file tree
Hide file tree
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
7 changes: 3 additions & 4 deletions form.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
---
cluster:
- "cardinal"
- "ascend"
form:
- auto_modules_matlab
- auto_modules_ollama
- auto_accounts
- bc_num_hours
- num_cores
- node_type
- bc_email_on_started
attributes:
auto_modules_matlab:
auto_modules_ollama:
default: false
label: "MATLAB version"
label: "Ollama version"
num_cores:
widget: "number_field"
label: "Number of cores"
Expand Down
6 changes: 3 additions & 3 deletions manifest.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
name: MATLAB
name: Ollama
category: Interactive Apps
subcategory: Servers
role: batch_connect
description: |
This app will launch the [MATLAB] desktop in a web browser on the [Cardinal cluster].
This app will launch the [Ollama] desktop in a web browser on the [Cardinal cluster].

[MATLAB]: https://www.mathworks.com/products/matlab.html
[Ollama]: https://ollama.com/
[Cardinal cluster]: https://www.osc.edu/resources/technical_support/supercomputers/cardinal
4 changes: 0 additions & 4 deletions submit.yml.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<%-

err_msg = "You are not a member of the matlab group. Please email [email protected] to request access to MATLAB."
raise(StandardError, err_msg) unless CurrentUser.group_names.include?('matlab')

ppn = num_cores.blank? ? 96 : num_cores.to_i

case node_type
Expand Down
8 changes: 2 additions & 6 deletions template/before.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@

[[ $(type -t module) == "function" ]] && export -f module

port=$(find_port ${host})

export MWI_AUTH_TOKEN=$(create_passwd 32)
password=$MWI_AUTH_TOKEN
export MWI_BASE_URL="/node/$host/$port/"
export MWI_APP_PORT=$port
port_ollama=$(find_port ${host})
port=$(find_port ${host})
11 changes: 7 additions & 4 deletions template/script.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
module purge
module restore

module load <%= context.auto_modules_matlab %>
module load project/ondemand
module load app_matlab_proxy/0.23.1
module load <%= context.auto_modules_ollama %>
export OLLAMA_PORT=$port_ollama
export OPEN_WEBUI_PORT=$port

source ollama_start_helper

cd $HOME

matlab-proxy-app
mkdir -p $OPEN_WEBUI_DATA_DIR
apptainer exec --env "WEBUI_AUTH=False,ENABLE_PERSISTENT_CONFIG=False,OLLAMA_BASE_URL=http://0.0.0.0:$OLLAMA_PORT,PORT=$OPEN_WEBUI_PORT" --fakeroot --writable-tmpfs --bind $OPEN_WEBUI_DATA_DIR:/app/backend/data $OPEN_WEBUI_IMG bash /app/backend/start.sh
5 changes: 2 additions & 3 deletions view.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

<form id="<%= form_id %>" action="<%= "/node/#{host}/#{port}" %>" method="get" target="_blank" >
<input type="hidden" name="mwi-auth-token" value="<%= password %>">
<form id="<%= form_id %>" action="<%= "/rnode/#{host}/#{port}" %>" method="get" target="_blank" >
<button class="btn btn-primary" type="submit">
<i class="fa fa-cogs"></i> Connect to Matlab
<i class="fa fa-cogs"></i> Connect to Ollama
</button>
</form>