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 2019/04/01 14:16:18 UTC

[incubator-dlab] branch EPMCDLAB-1186 updated: fixed issue with nexus repository

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

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


The following commit(s) were added to refs/heads/EPMCDLAB-1186 by this push:
     new bda478f  fixed issue with nexus repository
bda478f is described below

commit bda478f7555825dcfce51367b85e4ffe508c486e
Author: Oleh Martushevskyi <Ol...@epam.com>
AuthorDate: Mon Apr 1 17:16:05 2019 +0300

    fixed issue with nexus repository
---
 .../scripts/deploy_repository/deploy_repository.py     |  4 +++-
 .../src/general/lib/aws/actions_lib.py                 |  1 +
 .../src/general/lib/os/debian/common_lib.py            | 18 +++++++++++++-----
 .../src/general/lib/os/debian/notebook_lib.py          |  9 ++++++++-
 4 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/infrastructure-provisioning/scripts/deploy_repository/deploy_repository.py b/infrastructure-provisioning/scripts/deploy_repository/deploy_repository.py
index c8d40bb..9092a64 100644
--- a/infrastructure-provisioning/scripts/deploy_repository/deploy_repository.py
+++ b/infrastructure-provisioning/scripts/deploy_repository/deploy_repository.py
@@ -1201,7 +1201,9 @@ def download_packages():
                 'https://archive.apache.org/dist/incubator/toree/0.2.0-incubating/toree/'
                 'toree-0.2.0-incubating-bin.tar.gz',
                 'https://repo1.maven.org/maven2/org/apache/toree/toree-assembly/0.2.0-incubating/'
-                'toree-assembly-0.2.0-incubating.jar'
+                'toree-assembly-0.2.0-incubating.jar',
+                'https://cran.r-project.org/src/contrib/Archive/keras/keras_{}.tar.gz'.format(
+                    configuration['notebook_keras_version'])
             ]
             packages_list = list()
             for package in packages_urls:
diff --git a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
index 1a6ba65..d228e99 100644
--- a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
+++ b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
@@ -1553,6 +1553,7 @@ def installing_python(region, bucket, user_name, cluster_name, application='', p
                 local(venv_command + ' && sudo -i ' + pip_command + ' install ipython ipykernel --no-cache-dir')
             except:
                 local(venv_command + ' && sudo -i ' + pip_command + ' install ipython==5.0.0 --no-cache-dir')
+                local(venv_command + ' && sudo -i ' + pip_command + ' install tornado==5.1.1 --no-cache-dir')
                 local(venv_command + ' && sudo -i ' + pip_command + ' install ipykernel --no-cache-dir')
             local(venv_command + ' && sudo -i ' + pip_command + ' install NumPy=={} --no-cache-dir'.format(
                 numpy_version))
diff --git a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
index f4d30ac..563004f 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
@@ -28,6 +28,17 @@ import os
 import time
 
 
+def check_apt():
+    try:
+        apt_proccess = sudo('ps aux | grep apt | grep -v grep | wc -l')
+        while apt_proccess != '0':
+            time.sleep(10)
+            apt_proccess = sudo('ps aux | grep apt | grep -v grep | wc -l')
+        sudo('rm -f /var/lib/apt/lists/lock')
+    except:
+        sys.exit(1)
+
+
 def ensure_pkg(user, requisites='linux-headers-generic python-pip python-dev '
                                 'groff gcc vim less git wget sysv-rc-conf '
                                 'libssl-dev unattended-upgrades nmap '
@@ -36,11 +47,7 @@ def ensure_pkg(user, requisites='linux-headers-generic python-pip python-dev '
         if not exists('/home/{}/.ensure_dir/pkg_upgraded'.format(user)):
             print("Updating repositories "
                   "and installing requested tools: {}".format(requisites))
-            apt_proccess = sudo('ps aux | grep apt | grep -v grep | wc -l')
-            while apt_proccess != '0':
-                time.sleep(10)
-                apt_proccess = sudo('ps aux | grep apt | grep -v grep | wc -l')
-            sudo('rm -f /var/lib/apt/lists/lock')
+            check_apt()
             sudo('apt-get update')
             sudo('apt-get -y install ' + requisites)
             sudo('unattended-upgrades -v')
@@ -78,6 +85,7 @@ def update_apt_repository_configuration(repository_host=''):
         else:
             sudo('sed -i "s|REPOSITORY_UBUNTU|{}|g" /etc/apt/sources.list'.format(repository_host))
             sudo('sed -i "s|REPOSITORY_SECURITY_UBUNTU|{}|g" /etc/apt/sources.list'.format(repository_host))
+        check_apt()
         sudo('apt-get update')
         sudo('touch /tmp/apt_conf_update_ensured')
 
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 30ac5f3..4e21289 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
@@ -128,7 +128,14 @@ def ensure_r(os_user, r_libs, region, r_mirror):
                      'install_github(\'IRkernel/repr\');install_github(\'IRkernel/IRdisplay\');'
                      'install_github(\'IRkernel/IRkernel\');"')
             if os.environ['application'] == 'tensor-rstudio':
-                sudo('R -e "library(\'devtools\');install_version(\'keras\', version = \'{}\', repos = \'{}\');"'.format(os.environ['notebook_keras_version'],r_repository))
+                if os.environ['local_repository_enabled'] == 'True':
+                    sudo('R -e "install.packages(\'zeallot\',repos=\'{}\')"'.format(r_repository))
+                    sudo('R -e "library(\'devtools\'); packageurl <- \'{0}/keras_{1}.tar.gz\'; '
+                         'install.packages(packageurl, repos=NULL, type=\'source\');"'.format(
+                          os.environ['local_repository_packages_repo'], os.environ['notebook_keras_version']))
+                else:
+                    sudo('R -e "library(\'devtools\');install_version(\'keras\', version = \'{}\', '
+                         'repos = \'{}\');"'.format(os.environ['notebook_keras_version'], r_repository))
             sudo('R -e "install.packages(\'RJDBC\',repos=\'{}\',dep=TRUE)"'.format(r_repository))
             sudo('touch /home/' + os_user + '/.ensure_dir/r_ensured')
         except:


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