Hi everyone,
I’m working on a custom Open OnDemand BatchConnect app for Ollama + Open WebUI and ran into two issues while staging and launching the app.
The first error during staging was:
Failed to stage the template with the following error:
undefined method `modules' for an instance of BatchConnect::SessionContext
I tracked that down to these references in the app templates:
MODS="<%= context.modules.to_s.strip %>"
which appeared in template/before.sh.erb and template/script.sh.erb.
After removing that older context.modules usage, the app stages and launches further, but now the job fails during startup with:
/var/spool/slurm/job.../slurm_script: line 15: port: unbound variable
Relevant details:
-
OOD app: custom dev app for Ollama/Open WebUI
-
Ports are generated in
before.sh.erband written to:-
.port_webui -
.port_ollama
-
-
Then loaded in
script.sh.erbwith:
port_webui="$(cat "${PWD}/.port_webui")"
port_ollama="$(cat "${PWD}/.port_ollama")"
I also found that the app had older port-style logic mixed with newer port_webui logic, for example:
port="${port_webui}"
export host port
and an old backup template:
---
host: "<%= host %>"
port: <%= port %>
scheme: "http"
path: "/"
The app now writes connection.yml using:
cat > "${PWD}/connection.yml" << EOF
---
host: "${host_fqdn}"
port: "${port_webui}"
scheme: "http"
path: "/"
EOF
What I’m trying to confirm is:
-
In older OOD versions, is
context.modulesunsupported in BatchConnectSessionContext? -
Is the recommended approach to avoid
context.modulesentirely and load modules directly inbefore.sh.erb/script.sh.erb? -
For connection handling, should I rely on a
template/connect.yml.erbfile instead of writingconnection.ymlmanually? -
Does anyone know if OOD may still be picking up an old
connect.yml.erb/ stale staged template that references bareport?
My current suspicion is that I still have a stale port-based connection template being rendered somewhere, even though the main script now uses port_webui.
Any guidance on the cleanest modern structure for:
-
form.yml.erb -
submit.yml.erb -
before.sh.erb -
script.sh.erb -
connect.yml.erb
would be greatly appreciated.
Thanks.
view.html.erb.txt (27.7 KB)
submit.yml.erb.txt (1019 Bytes)
script.sh.erb.txt (5.1 KB)
form.yml.erb.txt (2.1 KB)
before.sh.erb.txt (1.3 KB)
after.sh.erb.txt (1.1 KB)