20889: Adds config handling of external database service.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Thu, 24 Aug 2023 20:56:05 +0000 (17:56 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Thu, 24 Aug 2023 20:56:05 +0000 (17:56 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

tools/salt-install/config_examples/multi_host/aws/pillars/arvados.sls
tools/salt-install/config_examples/multi_host/aws/pillars/prometheus_server.sls
tools/salt-install/config_examples/multi_host/aws/states/host_entries.sls
tools/salt-install/local.params.example.multiple_hosts
tools/salt-install/provision.sh

index 301790088071718979ecba2ec4e7cb8c2068d658..29d414cf5ca380f7c50463fcb46c121c77b19847 100644 (file)
@@ -6,6 +6,7 @@
 {%- set _workers = ("__CONTROLLER_MAX_WORKERS__" or grains['num_cpus']*2)|int %}
 {%- set max_workers = [_workers, 8]|max %}
 {%- set max_reqs = ("__CONTROLLER_MAX_QUEUED_REQUESTS__" or 128)|int %}
+{%- set database_host = ("__DATABASE_EXTERNAL_SERVICE_HOST_OR_IP__" or "__DATABASE_INT_IP__") %}
 
 # 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
@@ -73,7 +74,7 @@ arvados:
       # max concurrent connections per arvados server daemon
       # connection_pool_max: 32
       name: __CLUSTER___arvados
-      host: __DATABASE_INT_IP__
+      host: {{ database_host }}
       password: "__DATABASE_PASSWORD__"
       user: __CLUSTER___arvados
       encoding: en_US.utf8
index 70320d610caec46d466714b1a6ab1a4f8b8f3e9e..26877f35df13166769d9ee8ac841cb0d82097ac7 100644 (file)
@@ -99,6 +99,7 @@ prometheus:
                     instance: arvados-dispatch-cloud.__CLUSTER__
                     cluster: __CLUSTER__
 
+            {%- if "__DATABASE_INT_IP__" != "" %}
             # Database
             - job_name: postgresql
               static_configs:
@@ -109,6 +110,7 @@ prometheus:
                   labels:
                     instance: database.__CLUSTER__
                     cluster: __CLUSTER__
+            {%- endif %}
 
             # Nodes
             {%- set node_list = "__NODELIST__".split(',') %}
index 68aeab3abb6cf87cfc4300ac86114f4f1151aae1..42f492e8119ecdf124dc021a78e5b2ff4ed5fc04 100644 (file)
@@ -8,12 +8,15 @@
 {%- set tpldir = curr_tpldir %}
 
 #CRUDE, but functional
+
+{%- if "__DATABASE_INT_IP__" != "" %}
 extra_extra_hosts_entries_etc_hosts_database_host_present:
   host.present:
     - ip: __DATABASE_INT_IP__
     - names:
       - db.{{ arvados.cluster.name }}.{{ arvados.cluster.domain }}
       - database.{{ arvados.cluster.name }}.{{ arvados.cluster.domain }}
+{%- endif %}
 
 extra_extra_hosts_entries_etc_hosts_api_host_present:
   host.present:
index 0cf52c73437960ac2bccd41044bc69526c2d107d..1fc38fca4b29ad1cd6e67fdf52bc35eb9c2bb6e6 100644 (file)
@@ -139,6 +139,9 @@ KEEP_INT_IP=${WORKBENCH1_INT_IP}
 KEEPSTORE0_INT_IP=10.1.2.13
 SHELL_INT_IP=10.1.2.17
 
+# Set this if using an external PostgreSQL service.
+#DATABASE_EXTERNAL_SERVICE_HOST_OR_IP=
+
 # Performance tuning parameters.  If these are not set, workers
 # defaults on the number of cpus and queued requests defaults to 128.
 #CONTROLLER_MAX_WORKERS=
index ea98fdec33b6b7d10328e1ebac7d752d39976a0a..b2c5d71928439b199e25848e4c2df93e4a4cf166 100755 (executable)
@@ -196,7 +196,8 @@ apply_var_substitutions() {
        s#__SHELL_INT_IP__#${SHELL_INT_IP}#g;
        s#__WORKBENCH1_INT_IP__#${WORKBENCH1_INT_IP}#g;
        s#__WORKBENCH2_INT_IP__#${WORKBENCH2_INT_IP}#g;
-       s#__DATABASE_INT_IP__#${DATABASE_INT_IP}#g;
+       s#__DATABASE_INT_IP__#${DATABASE_INT_IP:-}#g;
+       s#__DATABASE_EXTERNAL_SERVICE_HOST_OR_IP__#${DATABASE_EXTERNAL_SERVICE_HOST_OR_IP:-}#g;
        s#__WORKBENCH_SECRET_KEY__#${WORKBENCH_SECRET_KEY}#g;
        s#__SSL_KEY_ENCRYPTED__#${SSL_KEY_ENCRYPTED}#g;
        s#__SSL_KEY_AWS_REGION__#${SSL_KEY_AWS_REGION:-}#g;