Skip to content
Merged
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: 7 additions & 0 deletions form.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cluster:
form:
- auto_accounts
- mode
- working_dir
- bc_num_hours
- node_type
- gpus
Expand Down Expand Up @@ -68,6 +69,12 @@ attributes:
options:
- ["Jupyter Lab", "1"]
- ["Jupyter Notebook", "0"]
working_dir:
widget: "path_selector"
label: "Root Directory"
data-target-file-type: dirs # Valid values are: files, dirs, or both
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should actually be show_files: false.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ZQyou this data-target-file-type doesn't do anything here. You need show_files: false. Just FYI in case that's critical for this.

readonly: false
help: "Select your project directory; defaults to $HOME"
num_cores:
widget: "number_field"
label: "Number of cores"
Expand Down
9 changes: 5 additions & 4 deletions manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ category: Interactive Apps
subcategory: Servers
role: batch_connect
description: |
This app will launch a [Jupyter] server using [Python] on the [Ascend], [Owens] or
[Pitzer] clusters.
Launch a [Jupyter] server with [Python] on [Cardinal], [Ascend], or [Pitzer].
Check the [Changelog] for the recent updates.

[Jupyter]: https://jupyter.org/
[Python]: https://www.python.org/
[Owens]: https://www.osc.edu/resources/technical_support/supercomputers/owens
[Cardinal]: https://www.osc.edu/resources/technical_support/supercomputers/cardinal
[Ascend]: https://www.osc.edu/resources/technical_support/supercomputers/ascend
[Pitzer]: https://www.osc.edu/resources/technical_support/supercomputers/pitzer
[Ascend]: https://www.osc.edu/vocabulary/systems/ascend
[Changelog]: https://www.osc.edu/resources/technical_support/hpc_changelog?keys=jupyter
9 changes: 8 additions & 1 deletion template/before.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ source /bin/find_host_port
source /bin/save_passwd_as_secret
source /bin/create_salt_and_sha1
<% else -%>

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

# Find available port to run server on
Expand Down Expand Up @@ -49,7 +50,13 @@ export JUPYTERLAB_WORKSPACES_DIR=$PWD
export jupyter_api="$JUPYTER_API"

# Notebook root directory
export NOTEBOOK_ROOT="${NOTEBOOK_ROOT:-${HOME}}"
working_dir="<%= Pathname.new(context.working_dir) %>"
USER_SELECT_ROOT="${working_dir:-$HOME}"
if [[ -r "$USER_SELECT_ROOT" ]]; then
export NOTEBOOK_ROOT="$USER_SELECT_ROOT"
else
export NOTEBOOK_ROOT="$HOME"
fi

# Generate Jupyter configuration file with secure file permissions
(
Expand Down