diff --git a/form.yml b/form.yml index 3aaf67b223f62e6c198eeb7dc964871f98e949b1..dd8532d432a35d1e9d1e3f3400b4cef080c57ccb 100644 --- a/form.yml +++ b/form.yml @@ -8,7 +8,15 @@ # under /etc/ood/config/clusters.d/*.yml # @example Use the Owens cluster at Ohio Supercomputer Center # cluster: "owens" -cluster: "" +cluster: "SLURM_CLUSTER" + +# Title of the app displayed in the Dashboard +title: "Jupyter Notebook" + +# Description of the app displayed in the Dashboard (can use multi-line string +# and Markdown syntax) +description: | + This app will launch a Jupyter Notebook server on one or more cores. # Define attribute values that aren't meant to be modified by the user within # the Dashboard form @@ -25,11 +33,67 @@ attributes: # modules: "python/3.5" # @example Using combination of modules # modules: "python/3.5 cuda/8.0.44" - modules: "python" + custom_environment: + widget: text_area + label: Environment Setup + value: | + # The latest version of Anaconda3 with jupyter is loaded by default. + # If you would like to load other modules + # or use specific version of Anaconda please list below + # + # format: + # module load example_module/VERSION example_module2 + + # Whether Conda extensions will be available within the Jupyter notebook + # server + # + # @note Allows the user to use conda environment-based kernels from their + # Jupyter notebook dashboard + # @example Do NOT allow Conda extensions to be used + # conda_extensions: "0" + # @example Do allow Conda extensions to be used + # conda_extensions: "1" + # @see https://docs.continuum.io/anaconda/user-guide/tasks/use-jupyter-notebook-extensions + conda_extensions: "1" # Any extra command line arguments to feed to the `jupyter notebook ...` # command that launches the Jupyter notebook within the batch job - extra_jupyter_args: "" + extra_jupyter_args: + widget: text_field + label: Extra jupyter arguments + + bc_num_hours: + value: 1 + + bc_num_slots: + label: Number of CPU + value: 1 + min: 1 + max: 24 + step: 1 + + bc_num_mems: + widget: "number_field" + label: Memory per CPU (GB) + value: 4 + min: 1 + max: 128 + step: 1 + + bc_partition: + widget: select + label: Partition + options: + - [ "express", "express" ] + - [ "short", "short" ] + - [ "medium", "medium" ] + - [ "long", "long" ] + - [ "interactive", "interactive" ] + - [ "pascalnodes", "pascalnodes" ] + - [ "pascalnodes-medium", "pascalnodes-medium" ] + - [ "largemem", "largemem" ] + - [ "largemem-long", "largemem-long" ] + - [ "amd-hdr100", "amd-hdr100" ] # All of the attributes that make up the Dashboard form (in respective order), # and made available to the submit configuration file and the template ERB @@ -41,10 +105,11 @@ attributes: # option, then it will not appear in the form page that the user sees in the # Dashboard form: - - modules + - custom_environment + - conda_extensions - extra_jupyter_args - - bc_account - - bc_queue - bc_num_hours + - bc_partition - bc_num_slots + - bc_num_mems - bc_email_on_started diff --git a/script.sh.erb b/script.sh.erb new file mode 100644 index 0000000000000000000000000000000000000000..54c185de20c40284afdb4f7c58609f1435863df8 --- /dev/null +++ b/script.sh.erb @@ -0,0 +1,13 @@ +#!/bin/bash -l + +# Set working directory to home directory +cd "${HOME}" +module reset +# +# Start Jupyter Notebook Server +# +module load Anaconda3 +<%= context.custom_environment %> +unset XDG_RUNTIME_DIR +# Launch the Jupyter Notebook Server +jupyter notebook --config="${CONFIG_FILE}" <%= context.extra_jupyter_args %> diff --git a/submit.yml.erb b/submit.yml.erb index 27da4d3f5915d49f35d3bf0e084fcffca542799a..e03e6c2b222d68c46fc77be93bce3ae336d08901 100644 --- a/submit.yml.erb +++ b/submit.yml.erb @@ -1,31 +1,22 @@ # Job submission configuration file # --- +# This config comes from below URL +# https://github.com/OSC/bc_example_jupyter/blob/custom_environment/submit.yml.erb +# The -C option in the config provided for slurm has been removed because it does +# not apply to implementation at UAB. We do not use constraint list to be used with -C. -# -# 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" - # You can override the command used to query the hostname of the compute node - # here - # - # @note It is **highly** recommended this be set in the global cluster - # configuration file so that all apps can take advantage of it by default - # - #set_host: "host=$(hostname -A | awk '{print $2}')" - -# -# Configure the job script submission parameters for the batch job here -# @see http://www.rubydoc.info/gems/ood_core/OodCore/Job/Script -# -#script: -# queue_name: "queue1" -# accounting_id: "account1" -# email_on_started: true -# native: # ... array of command line arguments ... +script: + native: + - "-N 1" + - "-n <%= bc_num_slots.blank? ? 1 : bc_num_slots.to_i %>" + - "--mem-per-cpu=<%= bc_num_mems.blank? ? 4 : bc_num_mems.to_i %>G" + - "--partition=<%= bc_partition %>" + - "--time=<%= bc_num_hours.blank? ? 1 : bc_num_hours.to_i %>:00:00" + - "--job-name=ood-jupyter" +<%- if bc_partition.include? "pascalnodes" -%> + - "--gres=gpu:1" +<%- end -%> diff --git a/view.html.erb b/view.html.erb index ea48d2578162ea441b321073864581de80b8fdc2..e3f43bfab30ede42ab8294a0a490a20ba9788bda 100644 --- a/view.html.erb +++ b/view.html.erb @@ -1,6 +1,6 @@ <form action="/node/<%= host %>/<%= port %>/login" method="post" target="_blank"> <input type="hidden" name="password" value="<%= password %>"> <button class="btn btn-primary" type="submit"> - <i class="fa fa-eye"></i> Connect to Jupyter + <i class="fas fa-eye"></i> Connect to Jupyter </button> </form>