ACCC1380 commited on
Commit
e8dd581
1 Parent(s): 669bc66

Upload install_packages.sh with huggingface_hub

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