[arvados] created: 2.1.0-2896-gcfd1df694

git repository hosting git at public.arvados.org
Thu Sep 15 21:02:10 UTC 2022


        at  cfd1df694f8add55ea34324407208a1f100aea42 (commit)


commit cfd1df694f8add55ea34324407208a1f100aea42
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Mon Sep 12 14:50:19 2022 -0300

    Merge branch '19472-logrotate' into 2.4-release
    Refs #19472
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/tools/salt-install/config_examples/multi_host/aws/pillars/logrotate_api.sls b/tools/salt-install/config_examples/multi_host/aws/pillars/logrotate_api.sls
new file mode 100644
index 000000000..8377c0b23
--- /dev/null
+++ b/tools/salt-install/config_examples/multi_host/aws/pillars/logrotate_api.sls
@@ -0,0 +1,24 @@
+---
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+# Refer to logrotate-formula's documentation for information about customization
+# https://github.com/salt-formulas/salt-formula-logrotate/blob/master/README.rst
+
+logrotate:
+  jobs:
+    arvados-api:
+      path:
+        - /var/www/arvados-api/shared/log/*.log
+      config:
+        - daily
+        - missingok
+        - rotate 365
+        - compress
+        - nodelaycompress
+        - copytruncate
+        - sharedscripts
+        - postrotate
+        - '  [ -s /run/nginx.pid ] && kill -USR1 `cat /run/nginx.pid`'
+        - endscript
\ No newline at end of file
diff --git a/tools/salt-install/config_examples/multi_host/aws/pillars/logrotate_wb1.sls b/tools/salt-install/config_examples/multi_host/aws/pillars/logrotate_wb1.sls
new file mode 100644
index 000000000..3cbfd422a
--- /dev/null
+++ b/tools/salt-install/config_examples/multi_host/aws/pillars/logrotate_wb1.sls
@@ -0,0 +1,24 @@
+---
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+# Refer to logrotate-formula's documentation for information about customization
+# https://github.com/salt-formulas/salt-formula-logrotate/blob/master/README.rst
+
+logrotate:
+  jobs:
+    arvados-workbench:
+      path:
+        - /var/www/arvados-workbench/shared/log/*.log
+      config:
+        - daily
+        - missingok
+        - rotate 365
+        - compress
+        - nodelaycompress
+        - copytruncate
+        - sharedscripts
+        - postrotate
+        - '  [ -s /run/nginx.pid ] && kill -USR1 `cat /run/nginx.pid`'
+        - endscript
diff --git a/tools/salt-install/config_examples/single_host/multiple_hostnames/pillars/logrotate_api.sls b/tools/salt-install/config_examples/single_host/multiple_hostnames/pillars/logrotate_api.sls
new file mode 100644
index 000000000..8377c0b23
--- /dev/null
+++ b/tools/salt-install/config_examples/single_host/multiple_hostnames/pillars/logrotate_api.sls
@@ -0,0 +1,24 @@
+---
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+# Refer to logrotate-formula's documentation for information about customization
+# https://github.com/salt-formulas/salt-formula-logrotate/blob/master/README.rst
+
+logrotate:
+  jobs:
+    arvados-api:
+      path:
+        - /var/www/arvados-api/shared/log/*.log
+      config:
+        - daily
+        - missingok
+        - rotate 365
+        - compress
+        - nodelaycompress
+        - copytruncate
+        - sharedscripts
+        - postrotate
+        - '  [ -s /run/nginx.pid ] && kill -USR1 `cat /run/nginx.pid`'
+        - endscript
\ No newline at end of file
diff --git a/tools/salt-install/config_examples/single_host/multiple_hostnames/pillars/logrotate_wb1.sls b/tools/salt-install/config_examples/single_host/multiple_hostnames/pillars/logrotate_wb1.sls
new file mode 100644
index 000000000..3cbfd422a
--- /dev/null
+++ b/tools/salt-install/config_examples/single_host/multiple_hostnames/pillars/logrotate_wb1.sls
@@ -0,0 +1,24 @@
+---
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+# Refer to logrotate-formula's documentation for information about customization
+# https://github.com/salt-formulas/salt-formula-logrotate/blob/master/README.rst
+
+logrotate:
+  jobs:
+    arvados-workbench:
+      path:
+        - /var/www/arvados-workbench/shared/log/*.log
+      config:
+        - daily
+        - missingok
+        - rotate 365
+        - compress
+        - nodelaycompress
+        - copytruncate
+        - sharedscripts
+        - postrotate
+        - '  [ -s /run/nginx.pid ] && kill -USR1 `cat /run/nginx.pid`'
+        - endscript
diff --git a/tools/salt-install/config_examples/single_host/single_hostname/pillars/logrotate_api.sls b/tools/salt-install/config_examples/single_host/single_hostname/pillars/logrotate_api.sls
new file mode 100644
index 000000000..8377c0b23
--- /dev/null
+++ b/tools/salt-install/config_examples/single_host/single_hostname/pillars/logrotate_api.sls
@@ -0,0 +1,24 @@
+---
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+# Refer to logrotate-formula's documentation for information about customization
+# https://github.com/salt-formulas/salt-formula-logrotate/blob/master/README.rst
+
+logrotate:
+  jobs:
+    arvados-api:
+      path:
+        - /var/www/arvados-api/shared/log/*.log
+      config:
+        - daily
+        - missingok
+        - rotate 365
+        - compress
+        - nodelaycompress
+        - copytruncate
+        - sharedscripts
+        - postrotate
+        - '  [ -s /run/nginx.pid ] && kill -USR1 `cat /run/nginx.pid`'
+        - endscript
\ No newline at end of file
diff --git a/tools/salt-install/config_examples/single_host/single_hostname/pillars/logrotate_wb1.sls b/tools/salt-install/config_examples/single_host/single_hostname/pillars/logrotate_wb1.sls
new file mode 100644
index 000000000..3cbfd422a
--- /dev/null
+++ b/tools/salt-install/config_examples/single_host/single_hostname/pillars/logrotate_wb1.sls
@@ -0,0 +1,24 @@
+---
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+# Refer to logrotate-formula's documentation for information about customization
+# https://github.com/salt-formulas/salt-formula-logrotate/blob/master/README.rst
+
+logrotate:
+  jobs:
+    arvados-workbench:
+      path:
+        - /var/www/arvados-workbench/shared/log/*.log
+      config:
+        - daily
+        - missingok
+        - rotate 365
+        - compress
+        - nodelaycompress
+        - copytruncate
+        - sharedscripts
+        - postrotate
+        - '  [ -s /run/nginx.pid ] && kill -USR1 `cat /run/nginx.pid`'
+        - endscript
diff --git a/tools/salt-install/provision.sh b/tools/salt-install/provision.sh
index 173ed15b6..4f9c209ef 100755
--- a/tools/salt-install/provision.sh
+++ b/tools/salt-install/provision.sh
@@ -206,12 +206,17 @@ VERSION="latest"
 # ARVADOS_TAG="2.2.0"
 # BRANCH="main"
 
+# We pin the salt version to avoid potential incompatibilities when a new
+# stable version is released.
+SALT_VERSION="3004"
+
 # Other formula versions we depend on
 POSTGRES_TAG="v0.44.0"
 NGINX_TAG="v2.8.1"
 DOCKER_TAG="v2.4.2"
 LOCALE_TAG="v0.3.4"
 LETSENCRYPT_TAG="v2.1.0"
+LOGROTATE_TAG="v0.14.0"
 
 # Salt's dir
 DUMP_SALT_CONFIG_DIR=""
@@ -305,7 +310,7 @@ else
     echo "Salt already installed"
   else
     curl -L https://bootstrap.saltstack.com -o /tmp/bootstrap_salt.sh
-    sh /tmp/bootstrap_salt.sh -XdfP -x python3
+    sh /tmp/bootstrap_salt.sh -XdfP -x python3 stable ${SALT_VERSION}
     /bin/systemctl stop salt-minion.service
     /bin/systemctl disable salt-minion.service
   fi
@@ -331,34 +336,43 @@ mkdir -p ${S_DIR} ${F_DIR} ${P_DIR} ${T_DIR}
 # Get the formula and dependencies
 cd ${F_DIR} || exit 1
 echo "Cloning formulas"
-rm -rf ${F_DIR}/* || exit 1
-git clone --quiet https://github.com/saltstack-formulas/docker-formula.git ${F_DIR}/docker
-( cd docker && git checkout --quiet tags/"${DOCKER_TAG}" -b "${DOCKER_TAG}" )
+test -d docker && ( cd docker && git fetch ) \
+  || git clone --quiet https://github.com/saltstack-formulas/docker-formula.git ${F_DIR}/docker
+( cd docker && git checkout --quiet tags/"${DOCKER_TAG}" )
 
 echo "...locale"
-git clone --quiet https://github.com/saltstack-formulas/locale-formula.git ${F_DIR}/locale
-( cd locale && git checkout --quiet tags/"${LOCALE_TAG}" -b "${LOCALE_TAG}" )
+test -d locale && ( cd locale && git fetch ) \
+  || git clone --quiet https://github.com/saltstack-formulas/locale-formula.git ${F_DIR}/locale
+( cd locale && git checkout --quiet tags/"${LOCALE_TAG}" )
 
 echo "...nginx"
-git clone --quiet https://github.com/saltstack-formulas/nginx-formula.git ${F_DIR}/nginx
-( cd nginx && git checkout --quiet tags/"${NGINX_TAG}" -b "${NGINX_TAG}" )
+test -d nginx && ( cd nginx && git fetch ) \
+  || git clone --quiet https://github.com/saltstack-formulas/nginx-formula.git ${F_DIR}/nginx
+( cd nginx && git checkout --quiet tags/"${NGINX_TAG}" )
 
 echo "...postgres"
-git clone --quiet https://github.com/saltstack-formulas/postgres-formula.git ${F_DIR}/postgres
-( cd postgres && git checkout --quiet tags/"${POSTGRES_TAG}" -b "${POSTGRES_TAG}" )
+test -d postgres && ( cd postgres && git fetch ) \
+  || git clone --quiet https://github.com/saltstack-formulas/postgres-formula.git ${F_DIR}/postgres
+( cd postgres && git checkout --quiet tags/"${POSTGRES_TAG}" )
 
 echo "...letsencrypt"
-git clone --quiet https://github.com/saltstack-formulas/letsencrypt-formula.git ${F_DIR}/letsencrypt
-( cd letsencrypt && git checkout --quiet tags/"${LETSENCRYPT_TAG}" -b "${LETSENCRYPT_TAG}" )
+test -d letsencrypt && ( cd letsencrypt && git fetch ) \
+  || git clone --quiet https://github.com/saltstack-formulas/letsencrypt-formula.git ${F_DIR}/letsencrypt
+( cd letsencrypt && git checkout --quiet tags/"${LETSENCRYPT_TAG}" )
+
+echo "...logrotate"
+test -d logrotate && ( cd logrotate && git fetch ) \
+  || git clone --quiet https://github.com/saltstack-formulas/logrotate-formula.git ${F_DIR}/logrotate
+( cd logrotate && git checkout --quiet tags/"${LOGROTATE_TAG}" )
 
 echo "...arvados"
-git clone --quiet https://git.arvados.org/arvados-formula.git ${F_DIR}/arvados
+test -d arvados || git clone --quiet https://git.arvados.org/arvados-formula.git ${F_DIR}/arvados
 
 # If we want to try a specific branch of the formula
 if [ "x${BRANCH}" != "x" ]; then
   ( cd ${F_DIR}/arvados && git checkout --quiet -t origin/"${BRANCH}" -b "${BRANCH}" )
 elif [ "x${ARVADOS_TAG}" != "x" ]; then
-( cd ${F_DIR}/arvados && git checkout --quiet tags/"${ARVADOS_TAG}" -b "${ARVADOS_TAG}" )
+  ( cd ${F_DIR}/arvados && git checkout --quiet tags/"${ARVADOS_TAG}" -b "${ARVADOS_TAG}" )
 fi
 
 if [ "x${VAGRANT}" = "xyes" ]; then
@@ -555,6 +569,7 @@ if [ -z "${ROLES}" ]; then
   fi
 
   echo "    - postgres" >> ${S_DIR}/top.sls
+  echo "    - logrotate" >> ${S_DIR}/top.sls
   echo "    - docker.software" >> ${S_DIR}/top.sls
   echo "    - arvados" >> ${S_DIR}/top.sls
   echo "    - extra.shell_sudo_passwordless" >> ${S_DIR}/top.sls
@@ -564,6 +579,7 @@ if [ -z "${ROLES}" ]; then
   # Pillars
   echo "    - docker" >> ${P_DIR}/top.sls
   echo "    - nginx_api_configuration" >> ${P_DIR}/top.sls
+  echo "    - logrotate_api" >> ${P_DIR}/top.sls
   echo "    - nginx_controller_configuration" >> ${P_DIR}/top.sls
   echo "    - nginx_keepproxy_configuration" >> ${P_DIR}/top.sls
   echo "    - nginx_keepweb_configuration" >> ${P_DIR}/top.sls
@@ -572,6 +588,7 @@ if [ -z "${ROLES}" ]; then
   echo "    - nginx_webshell_configuration" >> ${P_DIR}/top.sls
   echo "    - nginx_workbench2_configuration" >> ${P_DIR}/top.sls
   echo "    - nginx_workbench_configuration" >> ${P_DIR}/top.sls
+  echo "    - logrotate_wb1" >> ${P_DIR}/top.sls
   echo "    - postgresql" >> ${P_DIR}/top.sls
 
   # We need to tweak the Nginx's pillar depending whether we want plan nginx or nginx+passenger
@@ -661,8 +678,7 @@ else
       ;;
       "api")
         # States
-        # FIXME: https://dev.arvados.org/issues/17352
-        grep -q "postgres.client" ${S_DIR}/top.sls || echo "    - postgres.client" >> ${S_DIR}/top.sls
+        grep -q "    - logrotate" ${S_DIR}/top.sls || echo "    - logrotate" >> ${S_DIR}/top.sls
         if grep -q "    - nginx.*$" ${S_DIR}/top.sls; then
           sed -i s/"^    - nginx.*$"/"    - nginx.passenger"/g ${S_DIR}/top.sls
         else
@@ -685,6 +701,7 @@ else
         fi
         grep -q "arvados.${R}" ${S_DIR}/top.sls    || echo "    - arvados.${R}" >> ${S_DIR}/top.sls
         # Pillars
+        grep -q "logrotate_api" ${P_DIR}/top.sls            || echo "    - logrotate_api" >> ${P_DIR}/top.sls
         grep -q "aws_credentials" ${P_DIR}/top.sls          || echo "    - aws_credentials" >> ${P_DIR}/top.sls
         grep -q "postgresql" ${P_DIR}/top.sls               || echo "    - postgresql" >> ${P_DIR}/top.sls
         grep -q "nginx_passenger" ${P_DIR}/top.sls          || echo "    - nginx_passenger" >> ${P_DIR}/top.sls
@@ -697,6 +714,7 @@ else
       "controller" | "websocket" | "workbench" | "workbench2" | "webshell" | "keepweb" | "keepproxy")
         # States
         if [ "${R}" = "workbench" ]; then
+          grep -q "    - logrotate" ${S_DIR}/top.sls || echo "    - logrotate" >> ${S_DIR}/top.sls
           NGINX_INSTALL_SOURCE="install_from_phusionpassenger"
           if grep -q "    - nginx$" ${S_DIR}/top.sls; then
             sed -i s/"^    - nginx.*$"/"    - nginx.passenger"/g ${S_DIR}/top.sls
@@ -729,6 +747,9 @@ else
           grep -q "arvados.${R}" ${S_DIR}/top.sls || echo "    - arvados.${R}" >> ${S_DIR}/top.sls
         fi
         # Pillars
+        if [ "${R}" = "workbench" ]; then
+          grep -q "logrotate_wb1" ${P_DIR}/top.sls || echo "    - logrotate_wb1" >> ${P_DIR}/top.sls
+        fi
         grep -q "nginx_passenger" ${P_DIR}/top.sls          || echo "    - nginx_passenger" >> ${P_DIR}/top.sls
         grep -q "nginx_${R}_configuration" ${P_DIR}/top.sls || echo "    - nginx_${R}_configuration" >> ${P_DIR}/top.sls
         # Special case for keepweb

commit 58582ec6765abcbed322d0035eb099a6dde426e5
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Thu Sep 15 17:52:31 2022 -0300

    19472: Syncs salt installer's main branch with commit 1e0108e1a
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/tools/salt-install/config_examples/multi_host/aws/pillars/arvados.sls b/tools/salt-install/config_examples/multi_host/aws/pillars/arvados.sls
index 02653082f..941bd95f1 100644
--- a/tools/salt-install/config_examples/multi_host/aws/pillars/arvados.sls
+++ b/tools/salt-install/config_examples/multi_host/aws/pillars/arvados.sls
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-# vim: ft=yaml
 ---
 # Copyright (C) The Arvados Authors. All rights reserved.
 #
@@ -74,20 +72,13 @@ arvados:
       host: __DATABASE_INT_IP__
       password: "__DATABASE_PASSWORD__"
       user: __CLUSTER___arvados
-      extra_conn_params:
-        client_encoding: UTF8
-      # Centos7 does not enable SSL by default, so we disable
-      # it here just for testing of the formula purposes only.
-      # You should not do this in production, and should
-      # configure Postgres certificates correctly
-      {%- if grains.os_family in ('RedHat',) %}
-        sslmode: disable
-      {%- endif %}
+      encoding: en_US.utf8
+      client_encoding: UTF8
 
     tls:
       # certificate: ''
       # key: ''
-      # When using arvados-snakeoil certs set insecure: true
+      # required to test with arvados-snakeoil certs
       insecure: false
 
     resources:
diff --git a/tools/salt-install/config_examples/multi_host/aws/pillars/arvados_development.sls b/tools/salt-install/config_examples/multi_host/aws/pillars/arvados_development.sls
deleted file mode 100644
index 6163cd360..000000000
--- a/tools/salt-install/config_examples/multi_host/aws/pillars/arvados_development.sls
+++ /dev/null
@@ -1,182 +0,0 @@
-# -*- coding: utf-8 -*-
-# vim: ft=yaml
----
-# Copyright (C) The Arvados Authors. All rights reserved.
-#
-# SPDX-License-Identifier: AGPL-3.0
-
-# This config file is used to test a multi-node deployment using a local
-# dispatcher. This setup is not recommended for production use.
-
-# The variables commented out are the default values that the formula uses.
-# The uncommented values are REQUIRED values. If you don't set them, running
-# this formula will fail.
-arvados:
-  ### GENERAL CONFIG
-  version: '__VERSION__'
-  ## It makes little sense to disable this flag, but you can, if you want :)
-  # use_upstream_repo: true
-
-  ## Repo URL is built with grains values. If desired, it can be completely
-  ## overwritten with the pillar parameter 'repo_url'
-  # repo:
-  #   humanname: Arvados Official Repository
-
-  release: __RELEASE__
-
-  ## IMPORTANT!!!!!
-  ## api, workbench and shell require some gems, so you need to make sure ruby
-  ## and deps are installed in order to install and compile the gems.
-  ## We default to `false` in these two variables as it's expected you already
-  ## manage OS packages with some other tool and you don't want us messing up
-  ## with your setup.
-  ruby:
-    ## We set these to `true` here for testing purposes.
-    ## They both default to `false`.
-    manage_ruby: true
-    manage_gems_deps: true
-    # pkg: ruby
-    # gems_deps:
-    #     - curl
-    #     - g++
-    #     - gcc
-    #     - git
-    #     - libcurl4
-    #     - libcurl4-gnutls-dev
-    #     - libpq-dev
-    #     - libxml2
-    #     - libxml2-dev
-    #     - make
-    #     - python3-dev
-    #     - ruby-dev
-    #     - zlib1g-dev
-
-  # config:
-  #   file: /etc/arvados/config.yml
-  #   user: root
-  ## IMPORTANT!!!!!
-  ## If you're intalling any of the rails apps (api, workbench), the group
-  ## should be set to that of the web server, usually `www-data`
-  #   group: root
-  #   mode: 640
-
-  ### ARVADOS CLUSTER CONFIG
-  cluster:
-    name: __CLUSTER__
-    domain: __DOMAIN__
-
-    database:
-      # max concurrent connections per arvados server daemon
-      # connection_pool_max: 32
-      name: __CLUSTER___arvados
-      host: 127.0.0.1
-      password: "__DATABASE_PASSWORD__"
-      user: __CLUSTER___arvados
-      extra_conn_params:
-        client_encoding: UTF8
-      # Centos7 does not enable SSL by default, so we disable
-      # it here just for testing of the formula purposes only.
-      # You should not do this in production, and should
-      # configure Postgres certificates correctly
-      {%- if grains.os_family in ('RedHat',) %}
-        sslmode: disable
-      {%- endif %}
-
-    tls:
-      # certificate: ''
-      # key: ''
-      # When using arvados-snakeoil certs set insecure: true
-      insecure: true
-
-    resources:
-      virtual_machines:
-        shell:
-          name: shell
-          backend: __SHELL_INT_IP__
-          port: 4200
-
-    ### TOKENS
-    tokens:
-      system_root: __SYSTEM_ROOT_TOKEN__
-      management: __MANAGEMENT_TOKEN__
-      anonymous_user: __ANONYMOUS_USER_TOKEN__
-
-    ### KEYS
-    secrets:
-      blob_signing_key: __BLOB_SIGNING_KEY__
-      workbench_secret_key: __WORKBENCH_SECRET_KEY__
-
-    Login:
-      Test:
-        Enable: true
-        Users:
-          __INITIAL_USER__:
-            Email: __INITIAL_USER_EMAIL__
-            Password: __INITIAL_USER_PASSWORD__
-
-    ### VOLUMES
-    ## This should usually match all your `keepstore` instances
-    Volumes:
-      # the volume name will be composed with
-      # <cluster>-nyw5e-<volume>
-      __CLUSTER__-nyw5e-000000000000000:
-        AccessViaHosts:
-          'http://__KEEPSTORE0_INT_IP__:25107':
-            ReadOnly: false
-        Replication: 2
-        Driver: Directory
-        DriverParameters:
-          Root: /tmp
-      __CLUSTER__-nyw5e-000000000000001:
-        AccessViaHosts:
-          'http://__KEEPSTORE1_INT_IP__:25107':
-            ReadOnly: false
-        Replication: 2
-        Driver: Directory
-        DriverParameters:
-          Root: /tmp
-
-    Containers:
-      LocalKeepBlobBuffersPerVCPU: 0
-
-    Users:
-      NewUsersAreActive: true
-      AutoAdminFirstUser: true
-      AutoSetupNewUsers: true
-      AutoSetupNewUsersWithRepository: true
-
-    Services:
-      Controller:
-        ExternalURL: 'https://__CLUSTER__.__DOMAIN__:__CONTROLLER_EXT_SSL_PORT__'
-        InternalURLs:
-          'http://localhost:8003': {}
-      Keepbalance:
-        InternalURLs:
-          'http://__CONTROLLER_INT_IP__:9005': {}
-      Keepproxy:
-        ExternalURL: 'https://__CLUSTER__.__DOMAIN__:__KEEP_EXT_SSL_PORT__'
-        InternalURLs:
-          'http://__KEEP_INT_IP__:25100': {}
-      Keepstore:
-        InternalURLs:
-          'http://__KEEPSTORE0_INT_IP__:25107': {}
-          'http://__KEEPSTORE1_INT_IP__:25107': {}
-      RailsAPI:
-        InternalURLs:
-          'http://localhost:8004': {}
-      WebDAV:
-        ExternalURL: 'https://__CLUSTER__.__DOMAIN__:__KEEPWEB_EXT_SSL_PORT__'
-        InternalURLs:
-          'http://localhost:9002': {}
-      WebDAVDownload:
-        ExternalURL: 'https://__CLUSTER__.__DOMAIN__:__KEEPWEB_EXT_SSL_PORT__'
-      WebShell:
-        ExternalURL: 'https://__CLUSTER__.__DOMAIN__:__WEBSHELL_EXT_SSL_PORT__'
-      Websocket:
-        ExternalURL: 'wss://__CLUSTER__.__DOMAIN__:__WEBSOCKET_EXT_SSL_PORT__/websocket'
-        InternalURLs:
-          'http://__WEBSOCKET_INT_IP__:8005': {}
-      Workbench1:
-        ExternalURL: 'https://__CLUSTER__.__DOMAIN__:__WORKBENCH1_EXT_SSL_PORT__'
-      Workbench2:
-        ExternalURL: 'https://__CLUSTER__.__DOMAIN__:__WORKBENCH2_EXT_SSL_PORT__'
diff --git a/tools/salt-install/installer.sh b/tools/salt-install/installer.sh
index 6d561a22b..e5ff7be4e 100755
--- a/tools/salt-install/installer.sh
+++ b/tools/salt-install/installer.sh
@@ -102,7 +102,7 @@ loadconfig() {
 	echo "Must be run from initialized setup dir, maybe you need to 'initialize' first?"
     fi
     source ${CONFIG_FILE}
-    GITTARGET=.arvados-deploy-config-${CLUSTER}
+    GITTARGET=arvados-deploy-config-${CLUSTER}
 }
 
 subcmd="$1"
diff --git a/tools/salt-install/provision.sh b/tools/salt-install/provision.sh
index 638e5de80..173ed15b6 100755
--- a/tools/salt-install/provision.sh
+++ b/tools/salt-install/provision.sh
@@ -12,17 +12,6 @@
 
 set -o pipefail
 
-_exit_handler() {
-  local rc="$?"
-  trap - EXIT
-  if [ "$rc" -ne 0 ]; then
-    echo "Error occurred ($rc) while running $0 at line $1 : $BASH_COMMAND"
-  fi
-  exit "$rc"
-}
-
-trap '_exit_handler $LINENO' EXIT ERR
-
 # capture the directory that the script is running from
 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
 
@@ -366,9 +355,9 @@ echo "...arvados"
 git clone --quiet https://git.arvados.org/arvados-formula.git ${F_DIR}/arvados
 
 # If we want to try a specific branch of the formula
-if [ "x${BRANCH}" != "x" -a $(git rev-parse --abbrev-ref HEAD) != "${BRANCH}" ]; then
+if [ "x${BRANCH}" != "x" ]; then
   ( cd ${F_DIR}/arvados && git checkout --quiet -t origin/"${BRANCH}" -b "${BRANCH}" )
-elif [ "x${ARVADOS_TAG}" != "x" -a $(git rev-parse --abbrev-ref HEAD) != "${ARVADOS_TAG}" ]; then
+elif [ "x${ARVADOS_TAG}" != "x" ]; then
 ( cd ${F_DIR}/arvados && git checkout --quiet tags/"${ARVADOS_TAG}" -b "${ARVADOS_TAG}" )
 fi
 
@@ -706,7 +695,6 @@ else
         sed -i "s/__NGINX_INSTALL_SOURCE__/${NGINX_INSTALL_SOURCE}/g" ${P_DIR}/nginx_passenger.sls
       ;;
       "controller" | "websocket" | "workbench" | "workbench2" | "webshell" | "keepweb" | "keepproxy")
-        NGINX_INSTALL_SOURCE="install_from_repo"
         # States
         if [ "${R}" = "workbench" ]; then
           NGINX_INSTALL_SOURCE="install_from_phusionpassenger"
@@ -787,7 +775,7 @@ else
                     s#__CERT_PEM__#/etc/nginx/ssl/arvados-${R}.pem#g;
                     s#__CERT_KEY__#/etc/nginx/ssl/arvados-${R}.key#g" \
             ${P_DIR}/nginx_${R}_configuration.sls
-            grep -q ${R}$ ${P_DIR}/extra_custom_certs.sls || echo "  - ${R}" >> ${P_DIR}/extra_custom_certs.sls
+            grep -q ${R} ${P_DIR}/extra_custom_certs.sls || echo "  - ${R}" >> ${P_DIR}/extra_custom_certs.sls
           fi
         fi
         # We need to tweak the Nginx's pillar depending whether we want plain nginx or nginx+passenger
@@ -832,17 +820,15 @@ fi
 
 # Leave a copy of the Arvados CA so the user can copy it where it's required
 if [ "$DEV_MODE" = "yes" ]; then
-  ARVADOS_SNAKEOIL_CA_DEST_FILE="${SCRIPT_DIR}/${CLUSTER}.${DOMAIN}-arvados-snakeoil-ca.pem"
-
+  echo "Copying the Arvados CA certificate to the installer dir, so you can import it"
   # If running in a vagrant VM, also add default user to docker group
   if [ "x${VAGRANT}" = "xyes" ]; then
+    cp /etc/ssl/certs/arvados-snakeoil-ca.pem /vagrant/${CLUSTER}.${DOMAIN}-arvados-snakeoil-ca.pem
+
     echo "Adding the vagrant user to the docker group"
     usermod -a -G docker vagrant
-    ARVADOS_SNAKEOIL_CA_DEST_FILE="/vagrant/${CLUSTER}.${DOMAIN}-arvados-snakeoil-ca.pem"
-  fi
-  if [ -f /etc/ssl/certs/arvados-snakeoil-ca.pem ]; then
-    echo "Copying the Arvados CA certificate to the installer dir, so you can import it"
-    cp /etc/ssl/certs/arvados-snakeoil-ca.pem ${ARVADOS_SNAKEOIL_CA_DEST_FILE}
+  else
+    cp /etc/ssl/certs/arvados-snakeoil-ca.pem ${SCRIPT_DIR}/${CLUSTER}.${DOMAIN}-arvados-snakeoil-ca.pem
   fi
 fi
 
diff --git a/tools/salt-install/tests/run-test.sh b/tools/salt-install/tests/run-test.sh
index 42ab71664..cf43273a1 100755
--- a/tools/salt-install/tests/run-test.sh
+++ b/tools/salt-install/tests/run-test.sh
@@ -9,6 +9,14 @@ export ARVADOS_API_HOST_INSECURE=true
 
 set -o pipefail
 
+# First, validate that the CA is installed and that we can query it with no errors.
+if ! curl -s -o /dev/null https://${ARVADOS_API_HOST}/users/welcome?return_to=%2F; then
+  echo "The Arvados CA was not correctly installed. Although some components will work,"
+  echo "others won't. Please verify that the CA cert file was installed correctly and"
+  echo "retry running these tests."
+  exit 1
+fi
+
 # https://doc.arvados.org/v2.0/install/install-jobs-image.html
 echo "Creating Arvados Standard Docker Images project"
 uuid_prefix=$(arv --format=uuid user current | cut -d- -f1)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list