You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by lf...@apache.org on 2022/10/26 12:17:05 UTC

[incubator-datalab] branch DATALAB-3096 updated: [DATALAB-3096]: moved tag to variable in datalab.ini

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

lfrolov pushed a commit to branch DATALAB-3096
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git


The following commit(s) were added to refs/heads/DATALAB-3096 by this push:
     new 75afdd235 [DATALAB-3096]: moved tag to variable in datalab.ini
75afdd235 is described below

commit 75afdd2355c7f577fa462970d1b20a2c31924801
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Wed Oct 26 15:16:55 2022 +0300

    [DATALAB-3096]: moved tag to variable in datalab.ini
---
 infrastructure-provisioning/src/general/conf/datalab.ini        | 3 +++
 infrastructure-provisioning/src/ssn/scripts/configure_docker.py | 8 +++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/infrastructure-provisioning/src/general/conf/datalab.ini b/infrastructure-provisioning/src/general/conf/datalab.ini
index 6bb4e7c92..eda049d01 100644
--- a/infrastructure-provisioning/src/general/conf/datalab.ini
+++ b/infrastructure-provisioning/src/general/conf/datalab.ini
@@ -274,6 +274,9 @@ docker_version = 20.10.2
 # subdomain =
 ### Role ARN for creating Route53 record
 # assume_role_arn =
+### guacamole/guacamole image tag
+guacamole_image_tag = 1.4.0
+
 
 #--- [edge] section contains all parameters that are using for edge node provisioning ---#
 [edge]
diff --git a/infrastructure-provisioning/src/ssn/scripts/configure_docker.py b/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
index 698125405..e11ee85fa 100644
--- a/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
+++ b/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
@@ -150,7 +150,8 @@ def configure_guacamole():
     try:
         mysql_pass = id_generator()
         conn.sudo('docker run --name guacd --restart unless-stopped -d -p 4822:4822 guacamole/guacd')
-        conn.sudo('docker run --rm guacamole/guacamole:1.4.0 /opt/guacamole/bin/initdb.sh --mysql > initdb.sql')
+        conn.sudo('docker run --rm guacamole/guacamole:{} /opt/guacamole/bin/initdb.sh --mysql > initdb.sql'
+                  .format(os.environ['ssn_guacamole_image_tag']))
         conn.sudo('mkdir /tmp/scripts')
         conn.sudo('cp initdb.sql /tmp/scripts')
         conn.sudo('mkdir /opt/mysql')
@@ -167,7 +168,7 @@ def configure_guacamole():
              .format(mysql_pass))
         conn.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='{}'" \
-             " -d -p 8080:8080 guacamole/guacamole:1.4.0".format(mysql_pass))
+             " -d -p 8080:8080 guacamole/guacamole:{}".format(mysql_pass, os.environ['ssn_guacamole_image_tag']))
         # create cronjob for run containers on reboot
         conn.sudo('mkdir /opt/datalab/cron')
         conn.sudo('touch /opt/datalab/cron/mysql.sh')
@@ -177,7 +178,8 @@ def configure_guacamole():
         conn.sudo('bash -c "echo \"docker rm guacamole\" >> /opt/datalab/cron/mysql.sh"')
         conn.sudo('''bash -c "echo \\"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='{}' '''\
-                  '''-d -p 8080:8080 guacamole/guacamole:1.4.0\\" >> /opt/datalab/cron/mysql.sh"'''.format(mysql_pass))
+                  '''-d -p 8080:8080 guacamole/guacamole:{}\\" >> /opt/datalab/cron/mysql.sh"'''
+                  .format(mysql_pass, os.environ['ssn_guacamole_image_tag']))
         conn.sudo("bash -c '(crontab -l 2>/dev/null; echo \"@reboot sh /opt/datalab/cron/mysql.sh\") | crontab -'")
         return True
     except Exception as err:


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