diff --git a/README.md b/README.md index 35d8c56..8356be4 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/docker/Dockerfile b/docker/Dockerfile index 08320a7..d653946 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -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 \ @@ -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 diff --git a/manifest.yml b/manifest.yml index d79708b..51c1486 100644 --- a/manifest.yml +++ b/manifest.yml @@ -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 diff --git a/submit.yml.erb b/submit.yml.erb index 566e740..4c5721d 100644 --- a/submit.yml.erb +++ b/submit.yml.erb @@ -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' @@ -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: diff --git a/template/script.sh.erb b/template/script.sh.erb index c5f2e4e..8dcea82 100755 --- a/template/script.sh.erb +++ b/template/script.sh.erb @@ -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" diff --git a/view.html.erb b/view.html.erb index b5c7d77..afecc4c 100644 --- a/view.html.erb +++ b/view.html.erb @@ -1,7 +1,7 @@