File size: 1,084 Bytes
e8dd581 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
#!/bin/bash
#install
ENABLE_MULTI_ENV=$1
BASE_PACKAGE=$2
chmod +x /opt/google/conda/install_to_env.sh
. "${DL_ANACONDA_HOME}/etc/profile.d/conda.sh"
# Installs Jupyterlab separate from" base packages if" ENABLE_MULTI_ENV,
# is defined when building container.
if [[ "${ENABLE_MULTI_ENV,,}" == 'true' ]]; then
if [[ "${BASE_PACKAGE}" == *"base"* ]]; then
BASE_PACKAGE="ml-framework"
fi
/opt/google/conda/install_to_env.sh jupyterlab dlenv-jupyterlab-meta
/opt/google/conda/install_to_env.sh base "dlenv-${BASE_PACKAGE}-meta"
conda activate jupyterlab
else
/opt/google/conda/install_to_env.sh base dlenv-${BASE_PACKAGE}-meta
conda activate ${BASE_PACKAGE}
fi
if [[ "${CONTAINER_NAME}" == *"beatrix"* ]]; then
BEATRIX_EXTENSION=$(gsutil ls "${CONTINUOUS_BUILD_PATH}" | tail -1) && \
gsutil cp "${BEATRIX_EXTENSION}" . && \
pip install "$(basename "${BEATRIX_EXTENSION}")"
jupyter labextension enable beatrix_jupyterlab
# Install Docker and dependencies
/opt/google/beatrix/setup_beatrix_container.sh
fi
jupyter lab build --debug && jupyter lab clean
|