[incubator-dlab] branch DLAB-3 updated: change ssn primary drive size first configuration of guacamole

2019-05-10 Thread ioleksandr
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/DLAB-3 by this push:
 new 616c4c0  change ssn primary drive size first configuration of guacamole
 new c14cc21  Merge remote-tracking branch 'origin/DLAB-3' into DLAB-3
616c4c0 is described below

commit 616c4c0de785666fc261fadb721776be756822ce
Author: Oleksandr_Isniuk 
AuthorDate: Fri May 10 18:35:49 2019 +0300

change ssn primary drive size
first configuration of guacamole
---
 .../src/ssn/scripts/configure_docker.py | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/infrastructure-provisioning/src/ssn/scripts/configure_docker.py 
b/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
index 00573b9..5f8c824 100644
--- a/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
+++ b/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
@@ -108,17 +108,20 @@ def build_docker_images(image_list, region, dlab_path):
 def configure_guacamole():
 try:
 mysql_pass = id_generator()
-sudo('docker run --name guacd -d -p 4822:4822 guacamole/guacd')
+sudo('docker run --name guacd --restart unless-stopped -d -p 4822:4822 
guacamole/guacd')
 sudo('docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh 
--mysql > initdb.sql')
 sudo('mkdir /tmp/scripts')
 sudo('cp initdb.sql /tmp/scripts')
 sudo('mkdir /opt/mysql')
-sudo('docker run --name guac-mysql -v /tmp/scripts:/tmp/scripts -v 
/opt/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD={} -d 
mysql:latest'.format(mysql_pass))
+sudo('docker run --name guac-mysql --restart unless-stopped -v 
/tmp/scripts:/tmp/scripts -v /opt/mysql:/var/lib/mysql -e 
MYSQL_ROOT_PASSWORD={} -d mysql:latest'.format(mysql_pass))
 sudo('touch /opt/mysql/dock-query.sql')
 sudo("""echo "CREATE DATABASE guacamole; CREATE USER 'guacamole' 
IDENTIFIED BY '{}'; GRANT SELECT,INSERT,UPDATE,DELETE ON guacamolala7.* TO 
'guacamolala7';" > /opt/mysql/dock-query.sql""")
-sudo('docker exec -it guac-mysql /bin/bash -c "mysql -u root -p{} < 
/var/lib/mysql/query.mysql"'.format(mysql_pass))
-sudo('docker exec -it guac-mysql /bin/bash -c "cat 
/tmp/scripts/initdb.sql | mysql -u root -p{} guacamole"'.format(mysql_pass))
-sudo("docker run --name guacamole --link guacd:guacd --link 
guac-mysql:mysql -e MYSQL_DATABASE='guacamole' -e MYSQL_USER='guacamole' -e 
MYSQL_PASSWORD='guacamole' -d -p 8080:8080 guacamole/guacamole")
+sudo('docker exec -i guac-mysql /bin/bash -c "mysql -u root -p{} < 
/var/lib/mysql/dock-query.sql"'.format(mysql_pass))
+sudo('docker exec -i guac-mysql /bin/bash -c "cat 
/tmp/scripts/initdb.sql | mysql -u root -p{} guacamole"'.format(mysql_pass))
+sudo("docker run --name guacamole --restart unless-stopped --link 
guacd:guacd --link guac-mysql:mysql -e MYSQL_DATABASE='guacamole' -e 
MYSQL_USER='guacamole' -e MYSQL_PASSWORD='guacamole' -d -p 8080:8080 
guacamole/guacamole")
+#create cronjob for run containers on reboot
+sudo('touch /opt/dlab/handlers/mysql-cron.sh')
+sudo('chmod 755 /opt/dlab/handlers/mysql-cron.sh')
 except Exception as err:
 traceback.print_exc()
 print('Failed to configure guacamole: ', str(err))


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



[incubator-dlab] branch DLAB-3 updated: change ssn primary drive size first configuration of guacamole

2019-05-10 Thread ioleksandr
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/DLAB-3 by this push:
 new 8640b86  change ssn primary drive size first configuration of guacamole
8640b86 is described below

commit 8640b866022a99a2093aef56d39fe56385e0d19f
Author: Oleksandr_Isniuk 
AuthorDate: Fri May 10 17:35:05 2019 +0300

change ssn primary drive size
first configuration of guacamole
---
 .../src/ssn/scripts/configure_docker.py| 23 ++
 .../src/ssn/scripts/configure_ssn_node.py  | 22 -
 2 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/infrastructure-provisioning/src/ssn/scripts/configure_docker.py 
b/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
index 56f39fc..00573b9 100644
--- a/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
+++ b/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
@@ -105,6 +105,25 @@ def build_docker_images(image_list, region, dlab_path):
 except:
 return False
 
+def configure_guacamole():
+try:
+mysql_pass = id_generator()
+sudo('docker run --name guacd -d -p 4822:4822 guacamole/guacd')
+sudo('docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh 
--mysql > initdb.sql')
+sudo('mkdir /tmp/scripts')
+sudo('cp initdb.sql /tmp/scripts')
+sudo('mkdir /opt/mysql')
+sudo('docker run --name guac-mysql -v /tmp/scripts:/tmp/scripts -v 
/opt/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD={} -d 
mysql:latest'.format(mysql_pass))
+sudo('touch /opt/mysql/dock-query.sql')
+sudo("""echo "CREATE DATABASE guacamole; CREATE USER 'guacamole' 
IDENTIFIED BY '{}'; GRANT SELECT,INSERT,UPDATE,DELETE ON guacamolala7.* TO 
'guacamolala7';" > /opt/mysql/dock-query.sql""")
+sudo('docker exec -it guac-mysql /bin/bash -c "mysql -u root -p{} < 
/var/lib/mysql/query.mysql"'.format(mysql_pass))
+sudo('docker exec -it guac-mysql /bin/bash -c "cat 
/tmp/scripts/initdb.sql | mysql -u root -p{} guacamole"'.format(mysql_pass))
+sudo("docker run --name guacamole --link guacd:guacd --link 
guac-mysql:mysql -e MYSQL_DATABASE='guacamole' -e MYSQL_USER='guacamole' -e 
MYSQL_PASSWORD='guacamole' -d -p 8080:8080 guacamole/guacamole")
+except Exception as err:
+traceback.print_exc()
+print('Failed to configure guacamole: ', str(err))
+sys.exit(1)
+
 
 ##
 # Run script #
@@ -137,4 +156,8 @@ if __name__ == "__main__":
 if not build_docker_images(deeper_config, args.region, args.dlab_path):
 sys.exit(1)
 
+print("Configuring guacamole")
+if not configure_guacamole():
+sys.exit(1)
+
 sys.exit(0)
diff --git a/infrastructure-provisioning/src/ssn/scripts/configure_ssn_node.py 
b/infrastructure-provisioning/src/ssn/scripts/configure_ssn_node.py
index e15bd17..6f55ab7 100644
--- a/infrastructure-provisioning/src/ssn/scripts/configure_ssn_node.py
+++ b/infrastructure-provisioning/src/ssn/scripts/configure_ssn_node.py
@@ -146,25 +146,6 @@ def docker_build_script():
 print('Failed to configure docker_build script: ', str(err))
 sys.exit(1)
 
-def configure_guacamole():
-try:
-mysql_pass = id_generator()
-sudo('docker run --name guacd -d -p 4822:4822 guacamole/guacd')
-sudo('docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh 
--mysql > initdb.sql')
-sudo('mkdir /tmp/scripts')
-sudo('cp initdb.sql /tmp/scripts')
-sudo('mkdir /opt/mysql')
-sudo('docker run --name guac-mysql -v /tmp/scripts:/tmp/scripts -v 
/opt/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD={} -d 
mysql:latest'.format(mysql_pass))
-sudo('touch /opt/mysql/dock-query.sql')
-sudo("""echo "CREATE DATABASE guacamole; CREATE USER 'guacamole' 
IDENTIFIED BY '{}'; GRANT SELECT,INSERT,UPDATE,DELETE ON guacamolala7.* TO 
'guacamolala7';" > /opt/mysql/dock-query.sql""")
-sudo('docker exec -it guac-mysql /bin/bash -c "mysql -u root -p{} < 
/var/lib/mysql/query.mysql"'.format(mysql_pass))
-sudo('docker exec -it guac-mysql /bin/bash -c "cat 
/tmp/scripts/initdb.sql | mysql -u root -p{} guacamole"'.format(mysql_pass))
-sudo("docker run --name guacamole --link guacd:guacd --link 
guac-mysql:mysql -e MYSQL_DATABASE='guacamole' -e MYSQL_USER='guacamole' -e 
MYSQL_PASSWORD='guacamole' -d -p 8080:8080 guacamole/guacamole")
-except Exception as err:
-traceback.print_exc()
-print('Failed to configure guacamole: ', str(err))
-sys.exit(1)
-
 ##
 # Run script #
 ##
@@ -222,8 +203,5 @@ if __name__ == "__main__":
 print("Ensuring safest ssh ciphers")
 ensure_ciphers()
 
-print("Configuring guacamole")
-configure_guacamole()
-
 print("Conf

[incubator-dlab] branch DLAB-3 updated: change ssn primary drive size first configuration of guacamole

2019-05-10 Thread ioleksandr
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/DLAB-3 by this push:
 new 0d22e40  change ssn primary drive size first configuration of guacamole
0d22e40 is described below

commit 0d22e40e892b5381aa3f32722c1a00c232d919e6
Author: Oleksandr_Isniuk 
AuthorDate: Fri May 10 17:20:28 2019 +0300

change ssn primary drive size
first configuration of guacamole
---
 infrastructure-provisioning/src/ssn/scripts/configure_ssn_node.py | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/infrastructure-provisioning/src/ssn/scripts/configure_ssn_node.py 
b/infrastructure-provisioning/src/ssn/scripts/configure_ssn_node.py
index ce10c62..e15bd17 100644
--- a/infrastructure-provisioning/src/ssn/scripts/configure_ssn_node.py
+++ b/infrastructure-provisioning/src/ssn/scripts/configure_ssn_node.py
@@ -160,7 +160,10 @@ def configure_guacamole():
 sudo('docker exec -it guac-mysql /bin/bash -c "mysql -u root -p{} < 
/var/lib/mysql/query.mysql"'.format(mysql_pass))
 sudo('docker exec -it guac-mysql /bin/bash -c "cat 
/tmp/scripts/initdb.sql | mysql -u root -p{} guacamole"'.format(mysql_pass))
 sudo("docker run --name guacamole --link guacd:guacd --link 
guac-mysql:mysql -e MYSQL_DATABASE='guacamole' -e MYSQL_USER='guacamole' -e 
MYSQL_PASSWORD='guacamole' -d -p 8080:8080 guacamole/guacamole")
-
+except Exception as err:
+traceback.print_exc()
+print('Failed to configure guacamole: ', str(err))
+sys.exit(1)
 
 ##
 # Run script #
@@ -219,5 +222,8 @@ if __name__ == "__main__":
 print("Ensuring safest ssh ciphers")
 ensure_ciphers()
 
+print("Configuring guacamole")
+configure_guacamole()
+
 print("Configuring docker_build script")
 docker_build_script()
\ No newline at end of file


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