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 2021/11/01 15:11:40 UTC

[incubator-datalab] branch DATALAB-2567 created (now 72b5650)

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

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


      at 72b5650  [DATALAB-2567]: fixed openssh version update

This branch includes the following new commits:

     new 60e3b3f  [DATALAB-2567]: added openssh version update
     new 72b5650  [DATALAB-2567]: fixed openssh version update

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


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


[incubator-datalab] 02/02: [DATALAB-2567]: fixed openssh version update

Posted by lf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 72b5650c79677246de3c912fdbd94a446ade2bd1
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Mon Nov 1 16:21:12 2021 +0200

    [DATALAB-2567]: fixed openssh version update
---
 infrastructure-provisioning/src/general/lib/os/debian/common_lib.py | 5 +----
 1 file changed, 1 insertion(+), 4 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 79efb68..543becb 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
@@ -291,12 +291,9 @@ def ensure_openssh_version(os_user):
                 datalab.fab.conn.sudo('mkdir /var/lib/sshd')
                 datalab.fab.conn.sudo('chmod -R 700 /var/lib/sshd/')
                 datalab.fab.conn.sudo('chown -R root:sys /var/lib/sshd/')
-                datalab.fab.conn.sudo('useradd -r -U -d /var/lib/sshd/ -c "sshd privsep" -s /bin/false sshd')
                 datalab.fab.conn.sudo('wget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-{0}.tar.gz '
                                       '-O /tmp/openssh-{0}.tar.gz'.format(os.environ['conf_openssh_version']))
-                datalab.fab.conn.sudo('tar -xzf /tmp/openssh-{0}.tar.gz; cd /tmp/openssh-{0}; ./configure'.format(os.environ['conf_openssh_version']))
-                datalab.fab.conn.sudo('cd /tmp/openssh-{0}; make'.format(os.environ['conf_openssh_version']))
-                datalab.fab.conn.sudo('cd /tmp/openssh-{0}; make install'.format(os.environ['conf_openssh_version']))
+                datalab.fab.conn.sudo('bash -l -c "tar -zhxvf /tmp/openssh-{0}.tar.gz -C /tmp/; cd /tmp/openssh-{0}; ./configure; make; make install"'.format(os.environ['conf_openssh_version']))
             datalab.fab.conn.sudo('touch /home/{}/.ensure_dir/openssh_version_ensured'.format(os_user))
     except Exception as err:
         logging.error('Updating openssh to version:', str(err))

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


[incubator-datalab] 01/02: [DATALAB-2567]: added openssh version update

Posted by lf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 60e3b3f2fa78c894d83ecbb9cb9f0ddc52df9cb1
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Mon Nov 1 14:54:26 2021 +0200

    [DATALAB-2567]: added openssh version update
---
 .../src/base/scripts/install_prerequisites.py          |  3 +++
 .../src/general/conf/datalab.ini                       |  3 +++
 .../src/general/lib/os/debian/common_lib.py            | 18 ++++++++++++++++++
 3 files changed, 24 insertions(+)

diff --git a/infrastructure-provisioning/src/base/scripts/install_prerequisites.py b/infrastructure-provisioning/src/base/scripts/install_prerequisites.py
index 354ad28..5e9ac24 100644
--- a/infrastructure-provisioning/src/base/scripts/install_prerequisites.py
+++ b/infrastructure-provisioning/src/base/scripts/install_prerequisites.py
@@ -60,6 +60,9 @@ if __name__ == "__main__":
         traceback.print_exc()
         sys.exit(1)
 
+    logging.info("Updating openssh to version")
+    ensure_openssh_version(args.user)
+
     logging.info("Installing python packages: {}".format(args.pip_packages))
     ensure_pip(args.pip_packages)
 
diff --git a/infrastructure-provisioning/src/general/conf/datalab.ini b/infrastructure-provisioning/src/general/conf/datalab.ini
index 017769c..c6b1ac4 100644
--- a/infrastructure-provisioning/src/general/conf/datalab.ini
+++ b/infrastructure-provisioning/src/general/conf/datalab.ini
@@ -60,7 +60,10 @@ allowed_ip_cidr = '0.0.0.0/0'
 network_type = public
 ### Additional tags in format 'Key1:Value1;Key2:Value2'
 # additional_tags =
+### pip version
 pip_version = 21.0.1
+### openssh version
+openssh_version = 8.8p1
 ### Billing tag key
 billing_tag_key = product
 ### Billing tag value
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 71a1f32..79efb68 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
@@ -284,6 +284,24 @@ def find_java_path_local():
         traceback.print_exc()
         sys.exit(1)
 
+def ensure_openssh_version(os_user):
+    try:
+        if not exists(datalab.fab.conn,'/home/{}/.ensure_dir/openssh_version_ensured'.format(os_user)):
+            if os.environ['conf_openssh_version'] not in datalab.fab.conn.sudo('ssh -V').stdout:
+                datalab.fab.conn.sudo('mkdir /var/lib/sshd')
+                datalab.fab.conn.sudo('chmod -R 700 /var/lib/sshd/')
+                datalab.fab.conn.sudo('chown -R root:sys /var/lib/sshd/')
+                datalab.fab.conn.sudo('useradd -r -U -d /var/lib/sshd/ -c "sshd privsep" -s /bin/false sshd')
+                datalab.fab.conn.sudo('wget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-{0}.tar.gz '
+                                      '-O /tmp/openssh-{0}.tar.gz'.format(os.environ['conf_openssh_version']))
+                datalab.fab.conn.sudo('tar -xzf /tmp/openssh-{0}.tar.gz; cd /tmp/openssh-{0}; ./configure'.format(os.environ['conf_openssh_version']))
+                datalab.fab.conn.sudo('cd /tmp/openssh-{0}; make'.format(os.environ['conf_openssh_version']))
+                datalab.fab.conn.sudo('cd /tmp/openssh-{0}; make install'.format(os.environ['conf_openssh_version']))
+            datalab.fab.conn.sudo('touch /home/{}/.ensure_dir/openssh_version_ensured'.format(os_user))
+    except Exception as err:
+        logging.error('Updating openssh to version:', str(err))
+        traceback.print_exc()
+        sys.exit(1)
 
 def ensure_ntpd(os_user, edge_private_ip=''):
     try:

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