-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Harvard-ATG/heb115
Add customizations for use in HEB 115
- Loading branch information
Showing
3 changed files
with
110 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Batch Connect app configuration file | ||
# | ||
# @note Used to define the submitted cluster, title, description, and | ||
# hard-coded/user-defined attributes that make up this Batch Connect app. | ||
<%- | ||
# User POSIX groups are checked against a list of Canvas Course IDs, which are | ||
# expected to be present in group names following the convention | ||
# `canvas<canvas_id>-<group_id>`. To add to this list, add a Canvas Course ID | ||
# and comment it with the title of the course. | ||
userGroups = OodSupport::User.new.groups.sort_by(&:id).map(&:name).flat_map{ |str| str.scan(/^canvas(\d+)-\d+/) }.flatten | ||
enabledGroups = [ | ||
"135510", # HUIT Open OnDemand Testing | ||
"139860" # HEB 115: Investigating the Human Genome | ||
] | ||
|
||
def arrays_have_common_element(array1, array2) | ||
# Use the `&` operator to get the intersection of the two arrays | ||
# If the intersection is not empty, return true, otherwise false | ||
!(array1 & array2).empty? | ||
end | ||
|
||
# Check if the groups that the user is in match any of the courses that should | ||
# have access to this app. | ||
|
||
if arrays_have_common_element(userGroups, enabledGroups) | ||
cluster="*" | ||
else | ||
cluster="disable_this_app" | ||
end | ||
-%> | ||
--- | ||
|
||
# Set cluster from group. "*" runs on whatever cluster is available, and | ||
# "disable_this_app" hides the app from view. | ||
cluster: "<%= cluster %>" | ||
|
||
title: "Jupyter Lab - HEB 115" | ||
|
||
# Define attribute values that aren't meant to be modified by the user within | ||
# the Dashboard form | ||
attributes: | ||
# Set the corresponding modules that need to be loaded for Jupyter to run | ||
# | ||
# @note It is called within the batch job as `module load <modules>` if | ||
# defined | ||
# @example Do not load any modules | ||
# modules: "" | ||
# @example Using default python module | ||
# modules: "python" | ||
# @example Using specific python module | ||
# modules: "python/3.5" | ||
# @example Using combination of modules | ||
# modules: "python/3.5 cuda/8.0.44" | ||
environment: heb115 | ||
|
||
spack: "/shared/spack" | ||
|
||
custom_num_cores: | ||
widget: "number_field" | ||
label: "Number of CPUs" | ||
value: 1 | ||
min: 1 | ||
max: 4 | ||
step: 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: "" | ||
|
||
# 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 | ||
# files | ||
# | ||
# @note You typically do not need to modify this unless you want to add a new | ||
# configurable value | ||
# @note If an attribute listed below is hard-coded above in the `attributes` | ||
# option, then it will not appear in the form page that the user sees in the | ||
# Dashboard | ||
form: | ||
- environment | ||
- spack | ||
- extra_jupyter_args | ||
- bc_num_hours | ||
- custom_num_cores |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
--- | ||
name: Jupyter Notebook (spack) | ||
name: Jupyter Lab | ||
category: Interactive Apps | ||
subcategory: Servers | ||
role: batch_connect | ||
description: | | ||
This app will launch a Jupyter Notebook server on one or more nodes. This configuration uses spack to load Jupyter Lab. | ||
This app will launch a Jupyter Lab server. This configuration uses | ||
[Spack](https://spack.io/) to load Jupyter Lab. The app launches outside of a | ||
container, so it has access to slurm commands, but since the app is running as | ||
a slurm job, the `srun` command will use the resources of the current job, | ||
rather than starting a new job. That is, unless you first run an `salloc` | ||
command to allocate a new interactive session first. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This is a Spack Environment file. | ||
# | ||
# It describes a set of packages to be installed, along with | ||
# configuration settings. | ||
spack: | ||
# add package specs to the `specs` list | ||
specs: | ||
- admixtools | ||
- bcftools | ||
- plink | ||
- samtools | ||
- py-jupyterlab | ||
- py-numpy | ||
- py-pandas | ||
- py-matplotlib | ||
- py-scipy | ||
view: true | ||
concretizer: | ||
unify: true |