diff --git a/installer/construct.yaml b/installer/construct.yaml deleted file mode 100644 index 440640b..0000000 --- a/installer/construct.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: TheLittlestJupyterHub -version: 0.1 - -channels: - - http://repo.continuum.io/pkgs/free/ - - https://conda.anaconda.org/conda-forge - -conda_default_channels: - - http://repo.continuum.io/pkgs/free/ - - https://conda.anaconda.org/conda-forge - -specs: - - python 3.6 - - conda - -post_install: post-install.bash diff --git a/installer/install.bash b/installer/install.bash new file mode 100755 index 0000000..654ad6d --- /dev/null +++ b/installer/install.bash @@ -0,0 +1,42 @@ +#!/usr/bin/bash +set -exuo pipefail + +# Set up defaults for configurable env vars +TLJH_INSTALL_PREFIX=${TLJH_INSTALL_PREFIX:-/opt/tljh} +TLJH_INSTALL_PIP_SPEC=${TLJH_INSTALL_SPEC:-git+https://github.com/yuvipanda/the-littlest-jupyterhub.git} +TLJH_INSTALL_PIP_FLAGS=${TLJH_PIP_FLAGS:---no-cache-dir} + + +function install_miniconda { + CONDA_DIR=${1} + CONDA_VERSION=4.5.4 + URL="https://repo.continuum.io/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh" + INSTALLER_PATH=/tmp/miniconda-installer.sh + + wget $URL -O ${INSTALLER_PATH} + chmod +x ${INSTALLER_PATH} + + # Only MD5 checksums are available for miniconda + # Can be obtained from https://repo.continuum.io/miniconda/ + MD5SUM="a946ea1d0c4a642ddf0c3a26a18bb16d" + + if ! echo "${MD5SUM} ${INSTALLER_PATH}" | md5sum --quiet -c -; then + echo "md5sum mismatch for ${INSTALLER_PATH}, exiting!" + exit 1 + fi + + bash ${INSTALLER_PATH} -b -p ${CONDA_DIR} + + # Allow easy direct installs from conda forge + ${CONDA_DIR}/bin/conda config --system --add channels conda-forge + + # Do not attempt to auto update conda or dependencies + ${CONDA_DIR}/bin/conda config --system --set auto_update_conda false + ${CONDA_DIR}/bin/conda config --system --set show_channel_urls true +} + +HUB_CONDA_DIR=${TLJH_INSTALL_PREFIX}/hub +install_miniconda ${HUB_CONDA_DIR} +${HUB_CONDA_DIR}/bin/pip install ${TLJH_INSTALL_PIP_FLAGS} ${TLJH_INSTALL_PIP_SPEC} + +${HUB_CONDA_DIR}/bin/python3 -m tljh.installer diff --git a/installer/post-install.bash b/installer/post-install.bash deleted file mode 100755 index 7464118..0000000 --- a/installer/post-install.bash +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/bash -set -euo pipefail - -# Run by the installer after the hub environment has been set up. - -export PATH=${PREFIX}/bin:$PATH - -pip install --no-cache-dir git+https://github.com/yuvipanda/the-littlest-jupyterhub.git - -python3 -m tljh.installer