diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e0920c840cb0d8f0319fb72227f527e66eb2451..fb2a0015a0fde7d0c09f559d5d465fbb4808441e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed +- Increased verbosity of output to make debugging easier. +- Does not launch template script as login shell anymore to speed up load time. + ### Fixed - Fix job not ending if forked processes still running. diff --git a/template/after.sh b/template/after.sh index b6a344ab756429605619303bfe9b00ef2184102d..1d43fceec21b68922aed7c50acb73a51fc3d4302 100755 --- a/template/after.sh +++ b/template/after.sh @@ -1,9 +1,12 @@ # Wait for the Jupyter Notebook server to start echo "Waiting for Jupyter Notebook server to open port ${port}..." +echo "TIMING - Starting wait at: $(date)" if wait_until_port_used "${host}:${port}" 60; then echo "Discovered Jupyter Notebook server listening on port ${port}!" + echo "TIMING - Wait ended at: $(date)" else echo "Timed out waiting for Jupyter Notebook server to open port ${port}!" + echo "TIMING - Wait ended at: $(date)" pkill -P ${SCRIPT_PID} clean_up 1 fi diff --git a/template/before.sh.erb b/template/before.sh.erb index 2460f3b23b505e2861e52a65d6584381c45f246b..8c9a6509ec92b3af11f507c9c90860eff59440ce 100755 --- a/template/before.sh.erb +++ b/template/before.sh.erb @@ -26,6 +26,9 @@ # - $password # The plain text password used to authenticate to the web server with +# Export the module function if it exists +[[ $(type -t module) == "function" ]] && export -f module + # Find available port to run server on port=$(find_port) diff --git a/template/script.sh.erb b/template/script.sh.erb index f0d5eb44e871d53915235384a0646a16e925c88f..718951c8076fdf1f2b30da164f99f6b5d8a87672 100755 --- a/template/script.sh.erb +++ b/template/script.sh.erb @@ -1,4 +1,7 @@ -#!/bin/bash -l +#!/usr/bin/env bash + +# Benchmark info +echo "TIMING - Starting main script at: $(date)" # Set working directory to home directory cd "${HOME}" @@ -13,7 +16,14 @@ module purge # Load the require modules module load <%= context.modules %> + +# List loaded modules +module list <%- end -%> +# Benchmark info +echo "TIMING - Starting jupyter at: $(date)" + # Launch the Jupyter Notebook Server +set -x jupyter notebook --config="${CONFIG_FILE}" <%= context.extra_jupyter_args %>