Skip to content

Commit

Permalink
Fix jupyter 4.x (#115)
Browse files Browse the repository at this point in the history
* rm accounts

* fix juypter 4.0 and up
  • Loading branch information
johrstrom authored Oct 28, 2024
1 parent d6b38cd commit 28f0901
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
9 changes: 2 additions & 7 deletions form.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ form:
- bc_email_on_started
- classroom
attributes:
auto_modules_app_jupyter:
default: false
mode:
widget: "radio"
value: "1"
Expand All @@ -34,13 +36,6 @@ attributes:
min: 1
max: 28
step: 1
account:
label: "Project"
widget: select
options:
<%- groups.each do |group| %>
- "<%= group %>"
<%- end %>
cuda_version:
widget: "select"
label: "CUDA Version"
Expand Down
10 changes: 9 additions & 1 deletion template/before.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,15 @@ if [[ ${WORKSPACE_FILE+x} ]]; then
cp $WORKSPACE_FILE .
fi

JUPYTER_API="<%= context.mode == "1" ? "lab" : "tree" %>"
<%-
api = if context.auto_modules_app_jupyter.split('/')[1].to_s > '4.0' || context.mode == "1"
'lab'
else
'tree'
end
-%>

JUPYTER_API="<%= api %>"

<%- if context.classroom == "1" -%>
module purge
Expand Down
8 changes: 7 additions & 1 deletion template/script.sh.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/usr/bin/env bash
<%-
require 'pathname'

subcommand = if context.auto_modules_app_jupyter.split('/')[1].to_s > '4.0' || context.mode == "1"
'lab'
else
'notebook'
end
-%>

echo "Starting main script..."
Expand Down Expand Up @@ -38,4 +44,4 @@ echo "TTT - $(date)"

# Launch the Jupyter server
set -x
jupyter <%= context.mode == "1" ? "lab" : "notebook" %> --config="${CONFIG_FILE}"
jupyter <%= subcommand %> --config="${CONFIG_FILE}"

0 comments on commit 28f0901

Please sign in to comment.