You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by lf...@apache.org on 2020/12/15 11:22:42 UTC

[incubator-datalab] 01/02: [DATALAB-2190]: changed how r_libs are installed in ensure_r

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

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

commit a87a5deba61c92ef1c11e80a37e0ebde327657bd
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Tue Dec 15 13:21:58 2020 +0200

    [DATALAB-2190]: changed how r_libs are installed in ensure_r
---
 .../src/general/lib/os/debian/notebook_lib.py                  | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

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 3a1d21a..8375cb3 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
@@ -95,8 +95,16 @@ def ensure_r(os_user, r_libs, region, r_mirror):
             manage_pkg('-y install', 'remote', 'r-base r-base-dev')
             sudo('R CMD javareconf')
             sudo('cd /root; git clone https://github.com/zeromq/zeromq4-x.git; cd zeromq4-x/; mkdir build; cd build; cmake ..; make install; ldconfig')
+            sudo('R -e "install.packages(\'devtools\',repos=\'{}\')"'.format(r_repository))
             for i in r_libs:
-                sudo('R -e "install.packages(\'{}\',repos=\'{}\')"'.format(i, r_repository))
+                if '=' in i:
+                    name = i.split('=')[0]
+                    vers = '"{}"'.format(i.split('=')[1])
+                else:
+                    name = i
+                    vers = ''
+                sudo('R -e \'devtools::install_version("{}", version = {}, repos ="{}", dependencies = NA)\''.format(name, vers, r_repository))
+                #sudo('R -e "install.packages(\'{}\',repos=\'{}\')"'.format(i, r_repository))
             sudo('R -e "library(\'devtools\');install.packages(repos=\'{}\',c(\'rzmq\',\'repr\',\'digest\',\'stringr\',\'RJSONIO\',\'functional\',\'plyr\'))"'.format(r_repository))
             try:
                 sudo('R -e "library(\'devtools\');install_github(\'IRkernel/repr\');install_github(\'IRkernel/IRdisplay\');install_github(\'IRkernel/IRkernel\');"')


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org