Skip to content
Snippets Groups Projects
Commit 891c4b97 authored by schmittu's avatar schmittu :beer:
Browse files

improved / adapted euler setup scripts

parent c4d0a9b8
No related branches found
No related tags found
No related merge requests found
printout.pdf
**/.*.sw?
build
#! /bin/sh
#
# create_installer.sh
# Copyright (C) 2019 Uwe Schitt <uwe.schmitt@id.ethz.ch>
#
# Distributed under terms of the MIT license.
#
set -e
# files to include for installation:
NOTEBOOKS=??_*.ipynb
LOCAL_BUILD_FOLDER=$(pwd)/build
rm -rf ${LOCAL_BUILD_FOLDER}
# create fresh folder structure to build archive with notebooks
rm -rf ${LOCAL_BUILD_FOLDER}
mkdir -p ${LOCAL_BUILD_FOLDER}/course
mkdir -p ${LOCAL_BUILD_FOLDER}/solutions
cp ../custom.html ${LOCAL_BUILD_FOLDER}/course
cp ../custom.html ${LOCAL_BUILD_FOLDER}/solutions
# cp -r ../data ${LOCAL_BUILD_FOLDER}/course
# cp -r ../data ${LOCAL_BUILD_FOLDER}/solutions
cp -r ../images ${LOCAL_BUILD_FOLDER}/course
cp -r ../images ${LOCAL_BUILD_FOLDER}/solutions
# create solution notebooks, copy originals and solutions
# to build folder
pushd .. >/dev/null
for NOTEBOOK in ${NOTEBOOKS}; do
echo process ${NOTEBOOK}
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace ${NOTEBOOK}
TARGET=${LOCAL_BUILD_FOLDER}/course/${NOTEBOOK}
echo ${TARGET}
nb-filter-cells -i $NOTEBOOK -t solution | nb-filter-cells -t TODO -o ${TARGET}
TARGET=${LOCAL_BUILD_FOLDER}/solutions/${NOTEBOOK%.ipynb}-with-solutions.ipynb
nb-filter-cells -i $NOTEBOOK -t TODO -o ${TARGET}
# cp $NOTEBOOK ${TARGET}
done
popd >/dev/null
echo
......@@ -8,6 +8,11 @@
EULER=euler.ethz.ch
if test ! -d build; then
echo run ./prepare_notebooks.sh first
exit;
fi
cat credentials.txt | while read -r USER PASSWORD
do
# USER=$(echo $line | cut -d" " -f 1)
......@@ -15,8 +20,8 @@ do
echo $USER
echo
# https://stackoverflow.com/questions/13800225/
ssh -n -i id_rsa $USER@$EULER "mkdir -p mlw"
scp -i id_rsa ../??_*.ipynb ../custom.html $USER@$EULER:mlw
scp -i id_rsa -r ../data ../images $USER@$EULER:mlw
scp -i id_rsa ./to_deploy_on_euler/* ./upload_to_polybox_from_euler.sh $USER@$EULER:
# ssh -n -i id_rsa $USER@$EULER "rm -rf *; mkdir -p mlw"
scp -i id_rsa -r build/course $USER@$EULER:mlw/course
scp -i id_rsa -r build/solutions $USER@$EULER:mlw/solutions
scp -i id_rsa ./to_deploy_on_euler/* $USER@$EULER:
done
......@@ -85,7 +85,7 @@ EULER_INSTALL_HONE="/cluster/scratch/schmittu/mlw/"
ssh -i id_rsa $USERNAME@$CHOSTNAME "echo source /etc/bashrc > .bashrc"
# ssh -i id_rsa $USERNAME@$CHOSTNAME bsub -n $NUM_CORES -W $RUN_TIME -R "rusage[mem=$MEM_PER_CORE]" bash -l <<ENDBSUB
ssh -i id_rsa $USERNAME@$CHOSTNAME bsub -J mlw_jupyter -R light <<ENDBSUB
ssh -i id_rsa $USERNAME@$CHOSTNAME bsub -J mlw_jupyter -n 8 -W 12:00 -R "rusage[mem=2000]" <<ENDBSUB
set -x
export XDG_RUNTIME_DIR=
IP_REMOTE="\$(hostname -i)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment