This is an automated email from the ASF dual-hosted git repository.
ioleksandr pushed a commit to branch DLAB-657
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
The following commit(s) were added to refs/heads/DLAB-657 by this push:
new 9e97347 fix+redhat version
9e97347 is described below
commit 9e973471b9ef7fe4cf69bd8a7db9b0120fd00b05
Author: Oleksandr_Isniuk <[email protected]>
AuthorDate: Mon May 27 17:55:53 2019 +0300
fix+redhat version
---
.../src/general/lib/os/debian/common_lib.py | 2 +-
.../src/general/lib/os/debian/ssn_lib.py | 22 +---------
.../src/general/lib/os/redhat/ssn_lib.py | 49 +++++++++++++++-------
3 files changed, 37 insertions(+), 36 deletions(-)
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 2cc64a8..b4a5ca5 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
@@ -64,7 +64,7 @@ def change_pkg_repos():
sudo('touch /tmp/pkg_china_ensured')
-def find_java_path_remote():
+def update-alternatives --query java | grep 'Value: ' | grep -o '/.*/jre'():
java_path = sudo("sh -c \"update-alternatives --query java | grep 'Value:
' | grep -o '/.*/jre'\"")
return java_path
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 eac937e..eef8b25 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/ssn_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/ssn_lib.py
@@ -296,6 +296,7 @@ def start_ss(keyfile, host_string, dlab_conf_dir, web_path,
.format(dlab_source_dir))
sudo("cd {}; docker build --file
general/files/aws/billing_Dockerfile -t docker.dlab-billing ."
.format(dlab_source_dir))
+ sudo("rm -rf {}".format(k8s_dir))
except Exception as err:
traceback.print_exc()
print('Failed to build images for services: ', str(err))
@@ -321,27 +322,6 @@ def start_ss(keyfile, host_string, dlab_conf_dir, web_path,
print('Failed to start Self-service: ', str(err))
sys.exit(1)
-
-def create_kuber_images(dlab_path):
- try:
- dlab_source_dir =
'{}sources/infrastructure-provisioning/src/'.format(dlab_path)
- k8s_dir = '{}tmp-kuber/'.format(dlab_source_dir)
- sudo("mkdir {}".format(k8s_dir))
- sudo("cp -r {0}conf/ {1}".format(dlab_path))
- sudo("cp -r {0}webapp/self-service/lib/*.jar {1}".format(dlab_path,
k8s_dir))
- sudo("cp -r {0}webapp/security-service/lib/*.jar
{1}".format(dlab_path, k8s_dir))
- sudo("cp -r {0}webapp/provisioning-service/lib/*.jar
{1}".format(dlab_path, k8s_dir))
- sudo("cp -r {0}webapp/billing/lib/*.jar {1}".format(dlab_path,
k8s_dir))
- sudo('sed -i "s|ssn.yml|/root/ssn.yml|g"
{}self-service.yml'.format(k8s_dir))
- sudo("cd {}; docker build --file general/files/aws/webui_Dockerfile -t
docker.dlab-ui .".format(dlab_source_dir))
- sudo("cd {}; docker build --file general/files/aws/billing_Dockerfile
-t docker.dlab-billing ."
- .format(dlab_source_dir))
-
- except Exception as err:
- traceback.print_exc()
- print('Failed to build images for Kubernetes', str(err))
- sys.exit(1)
-
def install_build_dep():
try:
if not
exists('{}tmp/build_dep_ensured'.format(os.environ['ssn_dlab_path'])):
diff --git a/infrastructure-provisioning/src/general/lib/os/redhat/ssn_lib.py
b/infrastructure-provisioning/src/general/lib/os/redhat/ssn_lib.py
index 164dfc5..502e8c8 100644
--- a/infrastructure-provisioning/src/general/lib/os/redhat/ssn_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/redhat/ssn_lib.py
@@ -216,17 +216,6 @@ def start_ss(keyfile, host_string, dlab_conf_dir, web_path,
sudo('mv /tmp/ssn.yml ' + os.environ['ssn_dlab_path'] + 'conf/')
put('/root/templates/proxy_location_webapp_template.conf',
'/tmp/proxy_location_webapp_template.conf')
sudo('mv /tmp/proxy_location_webapp_template.conf ' +
os.environ['ssn_dlab_path'] + 'tmp/')
- with open('/root/templates/supervisor_svc.conf', 'r') as f:
- text = f.read()
- text = text.replace('WEB_CONF', dlab_conf_dir).replace('OS_USR',
os_user)
- with open('/root/templates/supervisor_svc.ini', 'w') as f:
- f.write(text)
- put('/root/templates/supervisor_svc.ini',
'/tmp/supervisor_svc.ini')
- sudo('mv /tmp/supervisor_svc.ini ' + os.environ['ssn_dlab_path'] +
'tmp/')
- sudo('cp ' + os.environ['ssn_dlab_path'] +
- 'tmp/proxy_location_webapp_template.conf
/etc/nginx/locations/proxy_location_webapp.conf')
- sudo('cp ' + os.environ['ssn_dlab_path'] + 'tmp/supervisor_svc.ini
{}'.format(supervisor_conf))
- sudo('sed -i \'s=WEB_APP_DIR={}=\' {}'.format(web_path,
supervisor_conf))
try:
sudo('mkdir -p /var/log/application')
run('mkdir -p /tmp/yml_tmp/')
@@ -323,9 +312,41 @@ def start_ss(keyfile, host_string, dlab_conf_dir, web_path,
except:
append_result("Unable to generate cert and copy to java
keystore")
sys.exit(1)
- sudo('systemctl restart supervisord')
- sudo('service nginx restart')
- sudo('touch ' + os.environ['ssn_dlab_path'] + 'tmp/ss_started')
+ if kuber_enabled:
+ try:
+ dlab_source_dir =
'{}sources/infrastructure-provisioning/src/'.format(dlab_path)
+ k8s_dir = '{}tmp-kuber/'.format(dlab_source_dir)
+ sudo("mkdir {}".format(k8s_dir))
+ sudo("cp -r {0}conf/ {1}".format(dlab_path))
+ sudo("cp -r {0}webapp/self-service/lib/*.jar
{1}".format(dlab_path, k8s_dir))
+ sudo("cp -r {0}webapp/security-service/lib/*.jar
{1}".format(dlab_path, k8s_dir))
+ sudo("cp -r {0}webapp/provisioning-service/lib/*.jar
{1}".format(dlab_path, k8s_dir))
+ sudo("cp -r {0}webapp/billing/lib/*.jar
{1}".format(dlab_path, k8s_dir))
+ sudo('sed -i "s|ssn.yml|/root/ssn.yml|g"
{}self-service.yml'.format(k8s_dir))
+ sudo("cd {}; docker build --file
general/files/aws/webui_Dockerfile -t docker.dlab-ui ."
+ .format(dlab_source_dir))
+ sudo("cd {}; docker build --file
general/files/aws/billing_Dockerfile -t docker.dlab-billing ."
+ .format(dlab_source_dir))
+ sudo("rm -rf {}".format(k8s_dir))
+ except Exception as err:
+ traceback.print_exc()
+ print('Failed to build images for services: ', str(err))
+ sys.exit(1)
+ else:
+ with open('/root/templates/supervisor_svc.conf', 'r') as f:
+ text = f.read()
+ text = text.replace('WEB_CONF',
dlab_conf_dir).replace('OS_USR', os_user)
+ with open('/root/templates/supervisor_svc.ini', 'w') as f:
+ f.write(text)
+ put('/root/templates/supervisor_svc.ini',
'/tmp/supervisor_svc.ini')
+ sudo('mv /tmp/supervisor_svc.ini ' +
os.environ['ssn_dlab_path'] + 'tmp/')
+ sudo('cp ' + os.environ['ssn_dlab_path'] +
+ 'tmp/proxy_location_webapp_template.conf
/etc/nginx/locations/proxy_location_webapp.conf')
+ sudo('cp ' + os.environ['ssn_dlab_path'] +
'tmp/supervisor_svc.ini {}'.format(supervisor_conf))
+ sudo('sed -i \'s=WEB_APP_DIR={}=\' {}'.format(web_path,
supervisor_conf))
+ sudo('systemctl restart supervisord')
+ sudo('service nginx restart')
+ sudo('touch ' + os.environ['ssn_dlab_path'] + 'tmp/ss_started')
except Exception as err:
traceback.print_exc()
print('Failed to start Self-service: ', str(err))
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]