Commit 57fad264 authored by Sebastian Wahl's avatar Sebastian Wahl

Update for a smoother experience when coming from a Mac. Added info on manual...

Update for a smoother experience when coming from a Mac. Added info on manual install if remote shell is not bash
parent 44287792
......@@ -68,7 +68,7 @@ function install_conda_environment() {
cd $HOME
test -d miniconda3 && mv -v miniconda3 miniconda_$(date +%Y%m%d_%H%M%S)
if [[ "$(uname)" == "Darwin" ]] ; then
if [[ "`uname`" == "Darwin" ]] ; then
curl https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o Miniconda3.sh
else
curl https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o Miniconda3.sh
......@@ -78,13 +78,9 @@ function install_conda_environment() {
source ${HOME}/miniconda3/bin/activate base;
conda install jupyterlab nb_conda_kernels --yes
# OSX does not like /dev/stdin as it is used below
if [[ "$(uname)" == "Darwin" ]] ; then
source ~/miniconda3/bin/activate
conda env create -f py3_std.yml
else
conda env create -f /dev/stdin;
fi
# OSX client or host machines do not like /dev/stdin as it is used below
# conda env create -f /dev/stdin;
conda env create -f py3_std.yml
}
if [[ $# -lt 2 ]]; then
......@@ -160,16 +156,33 @@ elif [[ "$task" == "stop" ]]; then
elif [[ "$task" == "install" ]]; then
if [[ "$(uname)" == "Darwin" ]] && ! [[ "$hname" == "localhost" ]]; then
# cool trick from https://stackoverflow.com/a/22107893 on how to execute local functions on a remote machine
# However, OSX client machines do not like /dev/stdin as it has been previously used in the function
# install_conda_environment hence we copy py3_std.yml first (see also above)
#cat py3_std.yml | ssh $hname "$(typeset -f install_conda_environment); install_conda_environment;"
scp py3_std.yml $hname:
ssh $hname "$(typeset -f install_conda_environment); install_conda_environment;"
if [[ $? -ne 0 ]]; then
echo
echo " Only local installations supported on Mac OSX."
echo " Try $0 localhost install to perform a local installation."
echo " Start your jupyter environment with $0 localhost start."
echo " Installation seems to have failed."
echo " If the install command e.g. failed with 'else: endif nicht gefunden.' or similar"
echo " then the remote host doesn't use bash as default shell. Try "
echo
exit 1
fi
# cool trick from https://stackoverflow.com/a/22107893 on how to execute local functions on a remote machine
cat py3_std.yml | ssh $hname "$(typeset -f install_conda_environment); install_conda_environment;"
echo " scp py3_std.yml $hname:"
echo " ssh $hname"
echo " curl https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o Miniconda3.sh"
echo ' bash Miniconda3.sh -b -p ${HOME}/miniconda3'
echo ' source ${HOME}/miniconda3/bin/activate base'
echo ' conda install jupyterlab nb_conda_kernels --yes'
echo " conda env create -f py3_std.yml "
echo
echo " to perform a manual installation."
echo
else
echo " Installation of py3_std conda environment on $hname sucessfull. No start remote jupyter"
echo " manager with "
echo " $0 $hname start"
fi
elif [[ "$task" == "update" ]]; then
echo
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment