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

lfrolov pushed a commit to branch DATALAB-2840
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git


The following commit(s) were added to refs/heads/DATALAB-2840 by this push:
     new 360a56edc [DATALAB-2840]: specified nodejs version
360a56edc is described below

commit 360a56edc84ebf9f225c60c02bebb06ffe97452f
Author: leonidfrolov <[email protected]>
AuthorDate: Tue Jun 7 13:22:40 2022 +0300

    [DATALAB-2840]: specified nodejs version
---
 .../src/general/lib/os/debian/notebook_lib.py                      | 7 +++++--
 infrastructure-provisioning/src/general/lib/os/debian/ssn_lib.py   | 1 +
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py 
b/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
index 53ecc961a..7ec98c1b4 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
@@ -474,8 +474,11 @@ def install_nodejs(os_user):
     if not 
exists(datalab.fab.conn,'/home/{}/.ensure_dir/nodejs_ensured'.format(os_user)):
         if os.environ['conf_cloud_provider'] == 'gcp' and 
os.environ['application'] == 'deeplearning':
             datalab.fab.conn.sudo('add-apt-repository --remove 
ppa:deadsnakes/ppa -y')
-        datalab.fab.conn.sudo('curl -s -O 
https://deb.nodesource.com/node_16.x/pool/main/n/nodejs/nodejs_16.15.0-1nodesource1_amd64.deb')
-        datalab.fab.conn.sudo('dpkg -i nodejs_16.15.0-1nodesource1_amd64.deb 
&& rm nodejs_16.15.0-1nodesource1_amd64.deb')
+        datalab.fab.conn.sudo(
+            'curl -o- 
https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash')
+        datalab.fab.conn.run(
+            'export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && \. 
"$NVM_DIR/nvm.sh" && [ -s "$NVM_DIR/bash_completion" ] && \. 
"$NVM_DIR/bash_completion" && nvm install 16.15.0')
+        datalab.fab.conn.sudo('cp -R .nvm/versions/node/v16.15.0/* /usr/')
         datalab.fab.conn.sudo('touch 
/home/{}/.ensure_dir/nodejs_ensured'.format(os_user))
 
 def install_os_pkg(requisites):
diff --git a/infrastructure-provisioning/src/general/lib/os/debian/ssn_lib.py 
b/infrastructure-provisioning/src/general/lib/os/debian/ssn_lib.py
index 3d952994d..e83fb7184 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/ssn_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/ssn_lib.py
@@ -385,6 +385,7 @@ def install_build_dep():
             datalab.fab.conn.sudo(
                 'curl -o- 
https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash')
             datalab.fab.conn.run('export NVM_DIR="$HOME/.nvm" && [ -s 
"$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && [ -s "$NVM_DIR/bash_completion" 
] && \. "$NVM_DIR/bash_completion" && nvm install 16.15.0')
+            datalab.fab.conn.sudo('cp -R .nvm/versions/node/v16.15.0/* /usr/')
             datalab.fab.conn.sudo('npm config set unsafe-perm=true')
             datalab.fab.conn.sudo('touch 
{}tmp/build_dep_ensured'.format(os.environ['ssn_datalab_path']))
     except Exception as err:


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

Reply via email to