You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by om...@apache.org on 2020/01/27 11:22:36 UTC

[incubator-dlab] 01/01: [DLAB-1479]: Fixed issue with R repository

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

omartushevskyi pushed a commit to branch DLAB-1479
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 49d2f2e8170817e3e0f1130baece586cf467d39b
Author: Oleh Martushevskyi <Ol...@epam.com>
AuthorDate: Mon Jan 27 13:22:16 2020 +0200

    [DLAB-1479]: Fixed issue with R repository
---
 .../deploy_repository/templates/addCustomRepository.groovy |  2 +-
 .../src/general/lib/os/debian/notebook_lib.py              |  4 ++--
 infrastructure-provisioning/src/general/lib/os/fab.py      | 14 +++++++-------
 .../src/general/lib/os/redhat/notebook_lib.py              |  4 ++--
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/infrastructure-provisioning/scripts/deploy_repository/templates/addCustomRepository.groovy b/infrastructure-provisioning/scripts/deploy_repository/templates/addCustomRepository.groovy
index 37d2dd3..204c0eb 100644
--- a/infrastructure-provisioning/scripts/deploy_repository/templates/addCustomRepository.groovy
+++ b/infrastructure-provisioning/scripts/deploy_repository/templates/addCustomRepository.groovy
@@ -194,7 +194,7 @@ RProxyConfiguration = new Configuration(
                         ] as Map
                 ] as Map,
                 proxy: [
-                        remoteUrl: 'http://cran.us.r-project.org',
+                        remoteUrl: 'https://cloud.r-project.org',
                         contentMaxAge: 0,
                         metaDataMaxAge: 0
                 ] as Map,
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 87f3819..44bf218 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
@@ -64,7 +64,7 @@ def ensure_r_local_kernel(spark_version, os_user, templates_dir, kernels_dir):
             sudo('\cp -f /tmp/r_template.json {}/ir/kernel.json'.format(kernels_dir))
             sudo('ln -s /opt/spark/ /usr/local/spark')
             try:
-                sudo('cd /usr/local/spark/R/lib/SparkR; R -e "install.packages(\'roxygen2\',repos=\'http://cran.us.r-project.org\')" R -e "devtools::check(\'.\')"')
+                sudo('cd /usr/local/spark/R/lib/SparkR; R -e "install.packages(\'roxygen2\',repos=\'https://cloud.r-project.org\')" R -e "devtools::check(\'.\')"')
             except:
                 pass
             sudo('cd /usr/local/spark/R/lib/SparkR; R -e "devtools::install(\'.\')"')
@@ -86,7 +86,7 @@ def ensure_r(os_user, r_libs, region, r_mirror):
             if region == 'cn-north-1':
                 r_repository = r_mirror
             else:
-                r_repository = 'http://cran.us.r-project.org'
+                r_repository = 'https://cloud.r-project.org'
             add_marruter_key()
             sudo('apt update')
             sudo('apt-get install -y libcurl4-openssl-dev libssl-dev libreadline-dev')
diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py b/infrastructure-provisioning/src/general/lib/os/fab.py
index 879955a..47ef676 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -387,8 +387,8 @@ def install_r_pkg(requisites):
     try:
         for r_pkg in requisites:
             if r_pkg == 'sparklyr':
-                run('sudo -i R -e \'install.packages("{0}", repos="http://cran.us.r-project.org", dep=TRUE)\' 2>&1 | tee /tmp/tee.tmp; if ! grep -w -E  "({1})" /tmp/tee.tmp > /tmp/install_{0}.log; then  echo "" > /tmp/install_{0}.log;fi'.format(r_pkg, error_parser))
-            sudo('R -e \'install.packages("{0}", repos="http://cran.us.r-project.org", dep=TRUE)\' 2>&1 | tee /tmp/tee.tmp; if ! grep -w -E  "({1})" /tmp/tee.tmp >  /tmp/install_{0}.log; then  echo "" > /tmp/install_{0}.log;fi'.format(r_pkg, error_parser))
+                run('sudo -i R -e \'install.packages("{0}", repos="https://cloud.r-project.org", dep=TRUE)\' 2>&1 | tee /tmp/tee.tmp; if ! grep -w -E  "({1})" /tmp/tee.tmp > /tmp/install_{0}.log; then  echo "" > /tmp/install_{0}.log;fi'.format(r_pkg, error_parser))
+            sudo('R -e \'install.packages("{0}", repos="https://cloud.r-project.org", dep=TRUE)\' 2>&1 | tee /tmp/tee.tmp; if ! grep -w -E  "({1})" /tmp/tee.tmp >  /tmp/install_{0}.log; then  echo "" > /tmp/install_{0}.log;fi'.format(r_pkg, error_parser))
             err = sudo('cat /tmp/install_{0}.log'.format(r_pkg)).replace('"', "'")
             sudo('R -e \'installed.packages()[,c(3:4)]\' | if ! grep -w {0} > /tmp/install_{0}.list; then  echo "" > /tmp/install_{0}.list;fi'.format(r_pkg))
             res = sudo('cat /tmp/install_{0}.list'.format(r_pkg))
@@ -470,7 +470,7 @@ def install_java_pkg(requisites):
 def get_available_r_pkgs():
     try:
         r_pkgs = dict()
-        sudo('R -e \'write.table(available.packages(contriburl="http://cran.us.r-project.org/src/contrib"), file="/tmp/r.csv", row.names=F, col.names=F, sep=",")\'')
+        sudo('R -e \'write.table(available.packages(contriburl="https://cloud.r-project.org/src/contrib"), file="/tmp/r.csv", row.names=F, col.names=F, sep=",")\'')
         get("/tmp/r.csv", "r.csv")
         with open('r.csv', 'rb') as csvfile:
             reader = csv.reader(csvfile, delimiter=',')
@@ -590,11 +590,11 @@ def set_mongo_parameters(client, mongo_parameters):
 
 def install_r_packages(os_user):
     if not exists('/home/' + os_user + '/.ensure_dir/r_packages_ensured'):
-        sudo('R -e "install.packages(\'devtools\', repos = \'http://cran.us.r-project.org\')"')
-        sudo('R -e "install.packages(\'knitr\', repos = \'http://cran.us.r-project.org\')"')
-        sudo('R -e "install.packages(\'ggplot2\', repos = \'http://cran.us.r-project.org\')"')
+        sudo('R -e "install.packages(\'devtools\', repos = \'https://cloud.r-project.org\')"')
+        sudo('R -e "install.packages(\'knitr\', repos = \'https://cloud.r-project.org\')"')
+        sudo('R -e "install.packages(\'ggplot2\', repos = \'https://cloud.r-project.org\')"')
         sudo('R -e "install.packages(c(\'devtools\',\'mplot\', \'googleVis\'), '
-             'repos = \'http://cran.us.r-project.org\'); require(devtools); install_github(\'ramnathv/rCharts\')"')
+             'repos = \'https://cloud.r-project.org\'); require(devtools); install_github(\'ramnathv/rCharts\')"')
         sudo('touch /home/' + os_user + '/.ensure_dir/r_packages_ensured')
 
 
diff --git a/infrastructure-provisioning/src/general/lib/os/redhat/notebook_lib.py b/infrastructure-provisioning/src/general/lib/os/redhat/notebook_lib.py
index 17ff931..78d70af 100644
--- a/infrastructure-provisioning/src/general/lib/os/redhat/notebook_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/redhat/notebook_lib.py
@@ -65,7 +65,7 @@ def ensure_r_local_kernel(spark_version, os_user, templates_dir, kernels_dir):
             run('R -e "IRkernel::installspec()"')
             sudo('ln -s /opt/spark/ /usr/local/spark')
             try:
-                sudo('cd /usr/local/spark/R/lib/SparkR; R -e "install.packages(\'roxygen2\',repos=\'http://cran.us.r-project.org\')" R -e "devtools::check(\'.\')"')
+                sudo('cd /usr/local/spark/R/lib/SparkR; R -e "install.packages(\'roxygen2\',repos=\'https://cloud.r-project.org\')" R -e "devtools::check(\'.\')"')
             except:
                 pass
             sudo('cd /usr/local/spark/R/lib/SparkR; R -e "devtools::install(\'.\')"')
@@ -87,7 +87,7 @@ def ensure_r(os_user, r_libs, region, r_mirror):
             if region == 'cn-north-1':
                 r_repository = r_mirror
             else:
-                r_repository = 'http://cran.us.r-project.org'
+                r_repository = 'https://cloud.r-project.org'
             sudo('yum install -y cmake')
             sudo('yum -y install libcur*')
             sudo('echo -e "[base]\nname=CentOS-7-Base\nbaseurl=http://buildlogs.centos.org/centos/7/os/x86_64-20140704-1/\ngpgcheck=1\ngpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7\npriority=1\nexclude=php mysql" >> /etc/yum.repos.d/CentOS-base.repo')


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