You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by lf...@apache.org on 2020/06/24 09:20:01 UTC
[incubator-dlab] 01/01: [DLAB-1855]: changed pip update during
dataengine service creation
This is an automated email from the ASF dual-hosted git repository.
lfrolov pushed a commit to branch DLAB-1855
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit be4a83aac80f17fded47106b730172557dd11f10
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Tue Jun 23 20:06:56 2020 +0300
[DLAB-1855]: changed pip update during dataengine service creation
---
infrastructure-provisioning/src/general/lib/os/fab.py | 12 ++++++++----
.../src/general/scripts/aws/dataengine-service_configure.py | 2 +-
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py b/infrastructure-provisioning/src/general/lib/os/fab.py
index ffe0169..d664a5b 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -57,7 +57,9 @@ def install_pip_pkg(requisites, pip_version, lib_group):
error_parser = "Could not|No matching|ImportError:|failed|EnvironmentError:"
try:
if pip_version == 'pip3' and not exists('/bin/pip3'):
- sudo('ln -s /bin/pip3.7 /bin/pip3')
+ for v in range(4, 8):
+ if exists('/bin/pip3.{}'.format(v)):
+ sudo('ln -s /bin/pip3.{} /bin/pip3'.format(v))
sudo('{} install -U pip=={} setuptools'.format(pip_version, os.environ['conf_pip_version']))
sudo('{} install -U pip=={} --no-cache-dir'.format(pip_version, os.environ['conf_pip_version']))
sudo('{} install --upgrade pip=={}'.format(pip_version, os.environ['conf_pip_version']))
@@ -640,7 +642,7 @@ def add_breeze_library_local(os_user):
sys.exit(1)
-def configure_data_engine_service_pip(hostname, os_user, keyfile):
+def configure_data_engine_service_pip(hostname, os_user, keyfile, emr=False):
env['connection_attempts'] = 100
env.key_filename = [keyfile]
env.host_string = os_user + '@' + hostname
@@ -661,8 +663,10 @@ def configure_data_engine_service_pip(hostname, os_user, keyfile):
elif not exists('/usr/bin/pip3') and sudo("python3.7 -V 2>/dev/null | awk '{print $2}'"):
manage_pkg('-y install', 'remote', 'python3-pip')
sudo('ln -s /usr/bin/pip-3.7 /usr/bin/pip3')
- sudo('sudo pip3 install -U pip=={} setuptools'.format(os.environ['conf_pip_version']))
- sudo('sudo pip2 install -U pip=={} setuptools'.format(os.environ['conf_pip_version']))
+ if emr:
+ sudo('pip3 install -U pip=={}'.format(os.environ['conf_pip_version']))
+ sudo('pip2 install -U pip=={}'.format(os.environ['conf_pip_version']))
+ sudo('ln -s /usr/local/bin/pip3.7 /bin/pip3.7')
sudo('echo "export PATH=$PATH:/usr/local/bin" >> /etc/profile')
sudo('source /etc/profile')
run('source /etc/profile')
diff --git a/infrastructure-provisioning/src/general/scripts/aws/dataengine-service_configure.py b/infrastructure-provisioning/src/general/scripts/aws/dataengine-service_configure.py
index 9e9fb40..2245282 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/dataengine-service_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/dataengine-service_configure.py
@@ -81,7 +81,7 @@ def configure_dataengine_service(instance, emr_conf):
print('[CONFIGURE DATAENGINE SERVICE]')
try:
dlab.fab.configure_data_engine_service_pip(emr_conf['instance_ip'], emr_conf['os_user'],
- emr_conf['key_path'])
+ emr_conf['key_path'], True)
env['connection_attempts'] = 100
env.key_filename = emr_conf['key_path']
env.host_string = emr_conf['os_user'] + '@' + emr_conf['instance_ip']
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org