Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdjscott committed Apr 9, 2024
1 parent 0945569 commit 54d205d
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 38 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# NeSI training environment ML102 Jupyter app
# NeSI training environment Intermediate Shell for Bioinformatics app

JupyterLab app for running the ML102 workshop on the NeSI training environment.
JupyterLab app for running Intermediate Shell for Bioinformatics on the NeSI training environment.
36 changes: 14 additions & 22 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM ubuntu:22.04
# install system dependencies
# TODO: move ldap-utils, libnss-ldapd, libpam-ldapd, nscd, nslcd to base image??
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
bioawk \
curl \
git \
ldap-utils \
Expand All @@ -23,25 +24,16 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
zip \
&& rm -rf /var/lib/apt/lists/*

# download the required image files into the container image
RUN wget -nv https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz \
-O /var/lib/flower_photos.tgz \
&& tar -xzf /var/lib/flower_photos.tgz -C /var/lib \
&& rm -f /var/lib/flower_photos.tgz \
&& chown -R root:root /var/lib/flower_photos \
&& chmod -R o+rX /var/lib/flower_photos \
&& wget -nv https://storage.googleapis.com/mledu-datasets/cats_and_dogs_filtered.zip \
-O /var/lib/cats_and_dogs_filtered.zip \
&& unzip -q -d /var/lib /var/lib/cats_and_dogs_filtered.zip \
&& rm -f /var/lib/cats_and_dogs_filtered.zip \
&& chown -R root:root /var/lib/cats_and_dogs_filtered \
&& chmod -R o+rX /var/lib/cats_and_dogs_filtered

# copy the repo source (e.g. notebooks) to the container image and install dependencies
ARG ML102_HASH="39f654a10ddcfaa06420c12173f6053ea9963d26"
RUN git clone https://github.com/nesi/ml102_workshop.git /opt/ml102_workshop \
&& cd /opt/ml102_workshop \
&& git checkout $ML102_HASH \
&& pip3 --no-cache-dir install -r requirements.txt \
&& pip3 --no-cache-dir install jupyterlab \
&& rm -rf /opt/ml102_workshop/.git
# download the required data into the container image and make sure permission are ok
RUN wget -nv https://github.com/GenomicsAotearoa/shell-for-bioinformatics/releases/download/v2.0/puzzles_da.tar.gz \
-O /var/lib/puzzles_da.tar.gz \
&& tar -xzf /var/lib/puzzles_da.tar.gz -C /var/lib \
&& rm -f /var/lib/puzzles_da.tar.gz \
&& chown -R root:root /var/lib/puzzles_da \
&& chmod -R o+rX /var/lib/puzzles_da \
&& wget -nv https://github.com/GenomicsAotearoa/shell-for-bioinformatics/releases/download/v2.0/shell4b_data.tar.gz \
-O /var/lib/shell4b_data.tar.gz \
&& tar -xzf /var/lib/shell4b_data.tar.gz -C /var/lib \
&& rm -f /var/lib/shell4b_data.tar.gz \
&& chown -R root:root /var/lib/shell4b_data \
&& chmod -R o+rX /var/lib/shell4b_data
4 changes: 2 additions & 2 deletions manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: ML102
name: Intermediate shell for bioinformatics
category: Interactive Apps
subcategory: Servers
role: batch_connect
description: |
This app will launch a Jupyter Lab server for the ML102 workshop
This app will launch a Jupyter Lab server for the intermediate shell for bioinformatics workshop
6 changes: 3 additions & 3 deletions submit.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ script:
wall_time: "<%= wall_time.to_i * 3600 %>"
native:
container:
name: "ml102"
image: "ghcr.io/nesi/training-environment-jupyter-ml102-app:v0.2.0"
name: "intermshell"
image: "ghcr.io/nesi/training-environment-jupyter-intermediate-shell-app:v0.1.0"
command: ["/bin/bash","-l","<%= staged_root %>/job_script_content.sh"]
working_dir: "<%= Etc.getpwnam(ENV['USER']).dir %>"
restart_policy: 'OnFailure'
Expand Down Expand Up @@ -56,7 +56,7 @@ script:
c.ServerApp.port_retries = 0
c.ServerApp.open_browser = False
c.ServerApp.allow_origin = '*'
c.ServerApp.root_dir = '<%= user.home %>/ml102_workshop'
c.ServerApp.root_dir = '<%= user.home %>/shell4b'
c.ServerApp.disable_check_xsrf = True
mount_path: '/ood'
init_containers:
Expand Down
19 changes: 11 additions & 8 deletions template/script.sh.erb
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
#!/usr/bin/env bash

# send all output to pod.log
exec &> >(tee -a "${LOG_DIR}/pod.log")

# Benchmark info
echo "TIMING - Starting main script at: $(date)"

# copying config file for debugging
cp /ood/ondemand_config.py ./

# Set working directory to home directory
cd "${HOME}"

#
# Start Jupyter Notebook Server
#

# Benchmark info
echo "TIMING - Starting jupyter at: $(date)"

# Launch the Jupyter Notebook Server
set -x
rsync --ignore-existing -avz /opt/ml102_workshop/ ~/ml102_workshop/

# copy data files
# note: this will not overwrite files if they already exist, so changes won't
# be lost when restarting the app
mkdir -p ~/shell4b
rsync --ignore-existing -avz /var/lib/puzzles_da/ ~/shell4b/puzzles_da/
rsync --ignore-existing -avz /var/lib/shell4b_data/ ~/shell4b/shell4b_data/

# launch JupyterLab
jupyter lab --config="/ood/ondemand_config.py"
2 changes: 1 addition & 1 deletion view.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<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-registered"></i> Connect to ML102 JupyterLab
<i class="fa fa-registered"></i> Connect to Intermediate Shell app
</button>
</form>

0 comments on commit 54d205d

Please sign in to comment.