This is an automated email from the ASF dual-hosted git repository.

mhladun pushed a commit to branch gcp-jupyter-highgpu-template-1
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git


The following commit(s) were added to refs/heads/gcp-jupyter-highgpu-template-1 
by this push:
     new 6750d71  fixed anaconda installation
     new 14e71ff  Merge branch 'gcp-jupyter-highgpu-template-1' of 
https://github.com/apache/incubator-datalab into gcp-jupyter-highgpu-template-1
6750d71 is described below

commit 6750d71b5c1713c9602e35397361a6ae25731026
Author: Marian_Hladun <[email protected]>
AuthorDate: Fri Mar 11 19:56:07 2022 +0200

    fixed anaconda installation
---
 infrastructure-provisioning/src/general/lib/os/fab.py | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py 
b/infrastructure-provisioning/src/general/lib/os/fab.py
index 8c5ed3a..ad4b6e7 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -384,14 +384,13 @@ def ensure_anaconda():
         if not exists(conn, '/opt/anaconda3'):
             conn.sudo('wget 
https://repo.anaconda.com/archive/Anaconda3-2021.11-Linux-x86_64.sh -O 
/tmp/anaconda.sh')
             conn.sudo('bash /tmp/anaconda.sh -b -p /opt/anaconda3')
-            conn.sudo(''' bash -l -c "echo 'export 
PATH=/opt/anaconda3/bin/:$PATH' >> /home/datalab-user/.bashrc" ''')
-            conn.sudo('bash -l -c "source /home/datalab-user/.bashrc"')
             conn.sudo('chown -R datalab-user /opt/anaconda3')
-            conn.run('conda create -y -p /opt/anaconda3/envs/jupyter-gpu-conda 
numpy scipy pandas scikit-learn git pip')
-            conn.run('conda activate jupyter-gpu-conda && pip install 
transformers==4.4.2 gensim==4.0.1 tokenizers==0.10.1 
python-levenshtein==0.12.2')
-            conn.run("bash -l -c 'pip install -U torch==1.10.0+cu111 
torchvision==0.11.3+cu111 torchaudio==0.10.2+cu111 -f 
https://download.pytorch.org/whl/cu111/torch_stable.html --no-cache-dir'")
-            conn.run('conda activate jupyter-gpu-conda && conda install -y 
ipykernel -c anaconda')
-            conn.run('conda activate jupyter-gpu-conda && python -m ipykernel 
install --user --name=jupyter-gpu-conda')
+            conn.run('source /opt/anaconda3/etc/profile.d/conda.sh && conda 
create -y -p /opt/anaconda3/envs/jupyter-gpu-conda git pip ipykernel -c 
anaconda')
+            conn.run('source /opt/anaconda3/etc/profile.d/conda.sh && conda 
activate jupyter-gpu-conda && /opt/anaconda3/envs/jupyter-gpu-conda/bin/pip 
install numpy scipy pandas scikit-learn transformers==4.4.2 gensim==4.0.1 
tokenizers==0.10.1 python-levenshtein==0.12.2')
+            conn.run('source /opt/anaconda3/etc/profile.d/conda.sh && conda 
activate jupyter-gpu-conda && /opt/anaconda3/envs/jupyter-gpu-conda/bin/pip 
install -U torch==1.10.0+cu111 torchvision==0.11.3+cu111 
torchaudio==0.10.2+cu111 -f 
https://download.pytorch.org/whl/cu111/torch_stable.html --no-cache-dir')
+            conn.sudo('chown -R datalab-user 
/home/datalab-user/.local/share/jupyter/kernels')
+            conn.run('source /opt/anaconda3/etc/profile.d/conda.sh && conda 
activate jupyter-gpu-conda && python -m ipykernel install --user 
--name=jupyter-gpu-conda')
+            conn.sudo('chown -R root 
/home/datalab-user/.local/share/jupyter/kernels')
             conn.sudo('systemctl restart jupyter-notebook')
     except Exception as err:
         logging.error('Function ensure_anaconda error:', str(err))

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to