[ARVADOS] created: 2.1.0-2393-g1b2b061a8
Git user
git at public.arvados.org
Wed Apr 27 21:57:51 UTC 2022
at 1b2b061a8cd0d91a838fbe12412c4e804fffb00f (commit)
commit 1b2b061a8cd0d91a838fbe12412c4e804fffb00f
Author: Ward Vandewege <ward at curii.com>
Date: Wed Apr 27 17:56:26 2022 -0400
19015: installer fix: work around a Passenger issue with the detection of RVM
This fixes the on-demand building of passenger_native_support.so when
RVM is in use.
Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>
diff --git a/tools/salt-install/config_examples/multi_host/aws/pillars/nginx_passenger.sls b/tools/salt-install/config_examples/multi_host/aws/pillars/nginx_passenger.sls
index fbd42bd7a..2b6b96c3a 100644
--- a/tools/salt-install/config_examples/multi_host/aws/pillars/nginx_passenger.sls
+++ b/tools/salt-install/config_examples/multi_host/aws/pillars/nginx_passenger.sls
@@ -25,6 +25,8 @@ nginx:
### SERVER
server:
config:
+ # Needed for RVM, harmless otherwise. Cf. https://dev.arvados.org/issues/19015
+ env: GEM_HOME
# As we now differentiate where passenger is required or not, we need to
# load this module conditionally, so we add this conditional just to use
# the same pillar file
diff --git a/tools/salt-install/config_examples/multi_host/aws/states/nginx_passenger_rvm.sls b/tools/salt-install/config_examples/multi_host/aws/states/nginx_passenger_rvm.sls
new file mode 100644
index 000000000..a033676cc
--- /dev/null
+++ b/tools/salt-install/config_examples/multi_host/aws/states/nginx_passenger_rvm.sls
@@ -0,0 +1,38 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Make sure that /var/www/.passenger exists with the proper ownership
+# so that passenger can build passenger_native_support.so
+
+extra_var_www_passenger:
+ file.directory:
+ - name: /var/www/.passenger
+ - user: www-data
+ - group: www-data
+ - mode: '0755'
+ - makedirs: True
+
+{%- if grains.osfinger in ('CentOS Linux-7', 'Ubuntu-18.04', 'Debian-10') %}
+# Work around passenger issue when RVM is in use, cf
+# https://dev.arvados.org/issues/19015
+extra_nginx_set_gem_home:
+ file.managed:
+ - name: /etc/systemd/system/nginx.service.d/override.conf
+ - mode: '0644'
+ - user: root
+ - group: root
+ - makedirs: True
+ - replace: False
+ - contents: |
+ [Service]
+ ExecStart=
+ ExecStart=/bin/bash -a -c "GEM_HOME=`/usr/local/rvm/bin/rvm-exec default env |grep GEM_HOME=|cut -f2 -d=` && /usr/sbin/nginx -g 'daemon on; master_process on;'"
+ cmd.run:
+ - name: systemctl daemon-reload
+ - require:
+ - file: extra_nginx_set_gem_home
+ - file: extra_var_www_passenger
+ - onchanges:
+ - file: extra_nginx_set_gem_home
+{%- endif -%}
diff --git a/tools/salt-install/config_examples/single_host/multiple_hostnames/pillars/nginx_passenger.sls b/tools/salt-install/config_examples/single_host/multiple_hostnames/pillars/nginx_passenger.sls
index dbf21c265..e51ec21eb 100644
--- a/tools/salt-install/config_examples/single_host/multiple_hostnames/pillars/nginx_passenger.sls
+++ b/tools/salt-install/config_examples/single_host/multiple_hostnames/pillars/nginx_passenger.sls
@@ -25,6 +25,8 @@ nginx:
### SERVER
server:
config:
+ # Needed for RVM, harmless otherwise. Cf. https://dev.arvados.org/issues/19015
+ env: GEM_HOME
# As we now differentiate where passenger is required or not, we need to
# load this module conditionally, so we add this conditional just to use
# the same pillar file
diff --git a/tools/salt-install/config_examples/single_host/multiple_hostnames/states/nginx_passenger_rvm.sls b/tools/salt-install/config_examples/single_host/multiple_hostnames/states/nginx_passenger_rvm.sls
new file mode 100644
index 000000000..a033676cc
--- /dev/null
+++ b/tools/salt-install/config_examples/single_host/multiple_hostnames/states/nginx_passenger_rvm.sls
@@ -0,0 +1,38 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Make sure that /var/www/.passenger exists with the proper ownership
+# so that passenger can build passenger_native_support.so
+
+extra_var_www_passenger:
+ file.directory:
+ - name: /var/www/.passenger
+ - user: www-data
+ - group: www-data
+ - mode: '0755'
+ - makedirs: True
+
+{%- if grains.osfinger in ('CentOS Linux-7', 'Ubuntu-18.04', 'Debian-10') %}
+# Work around passenger issue when RVM is in use, cf
+# https://dev.arvados.org/issues/19015
+extra_nginx_set_gem_home:
+ file.managed:
+ - name: /etc/systemd/system/nginx.service.d/override.conf
+ - mode: '0644'
+ - user: root
+ - group: root
+ - makedirs: True
+ - replace: False
+ - contents: |
+ [Service]
+ ExecStart=
+ ExecStart=/bin/bash -a -c "GEM_HOME=`/usr/local/rvm/bin/rvm-exec default env |grep GEM_HOME=|cut -f2 -d=` && /usr/sbin/nginx -g 'daemon on; master_process on;'"
+ cmd.run:
+ - name: systemctl daemon-reload
+ - require:
+ - file: extra_nginx_set_gem_home
+ - file: extra_var_www_passenger
+ - onchanges:
+ - file: extra_nginx_set_gem_home
+{%- endif -%}
diff --git a/tools/salt-install/config_examples/single_host/single_hostname/pillars/nginx_passenger.sls b/tools/salt-install/config_examples/single_host/single_hostname/pillars/nginx_passenger.sls
index c25720c60..2b764eb2c 100644
--- a/tools/salt-install/config_examples/single_host/single_hostname/pillars/nginx_passenger.sls
+++ b/tools/salt-install/config_examples/single_host/single_hostname/pillars/nginx_passenger.sls
@@ -25,6 +25,8 @@ nginx:
### SERVER
server:
config:
+ # Needed for RVM, harmless otherwise. Cf. https://dev.arvados.org/issues/19015
+ env: GEM_HOME
# As we now differentiate where passenger is required or not, we need to
# load this module conditionally, so we add this conditional just to use
# the same pillar file
diff --git a/tools/salt-install/config_examples/single_host/single_hostname/states/nginx_passenger_rvm.sls b/tools/salt-install/config_examples/single_host/single_hostname/states/nginx_passenger_rvm.sls
new file mode 100644
index 000000000..a033676cc
--- /dev/null
+++ b/tools/salt-install/config_examples/single_host/single_hostname/states/nginx_passenger_rvm.sls
@@ -0,0 +1,38 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Make sure that /var/www/.passenger exists with the proper ownership
+# so that passenger can build passenger_native_support.so
+
+extra_var_www_passenger:
+ file.directory:
+ - name: /var/www/.passenger
+ - user: www-data
+ - group: www-data
+ - mode: '0755'
+ - makedirs: True
+
+{%- if grains.osfinger in ('CentOS Linux-7', 'Ubuntu-18.04', 'Debian-10') %}
+# Work around passenger issue when RVM is in use, cf
+# https://dev.arvados.org/issues/19015
+extra_nginx_set_gem_home:
+ file.managed:
+ - name: /etc/systemd/system/nginx.service.d/override.conf
+ - mode: '0644'
+ - user: root
+ - group: root
+ - makedirs: True
+ - replace: False
+ - contents: |
+ [Service]
+ ExecStart=
+ ExecStart=/bin/bash -a -c "GEM_HOME=`/usr/local/rvm/bin/rvm-exec default env |grep GEM_HOME=|cut -f2 -d=` && /usr/sbin/nginx -g 'daemon on; master_process on;'"
+ cmd.run:
+ - name: systemctl daemon-reload
+ - require:
+ - file: extra_nginx_set_gem_home
+ - file: extra_var_www_passenger
+ - onchanges:
+ - file: extra_nginx_set_gem_home
+{%- endif -%}
diff --git a/tools/salt-install/provision.sh b/tools/salt-install/provision.sh
index 669d04d92..c3959e26e 100755
--- a/tools/salt-install/provision.sh
+++ b/tools/salt-install/provision.sh
@@ -565,6 +565,7 @@ if [ -z "${ROLES}" ]; then
echo " - arvados" >> ${S_DIR}/top.sls
echo " - extra.shell_sudo_passwordless" >> ${S_DIR}/top.sls
echo " - extra.shell_cron_add_login_sync" >> ${S_DIR}/top.sls
+ echo " - extra.nginx_passenger_rvm" >> ${S_DIR}/top.sls
# Pillars
echo " - docker" >> ${P_DIR}/top.sls
@@ -657,6 +658,7 @@ else
else
echo " - nginx.passenger" >> ${S_DIR}/top.sls
fi
+ echo " - extra.nginx_passenger_rvm" >> ${S_DIR}/top.sls
### If we don't install and run LE before arvados-api-server, it fails and breaks everything
### after it. So we add this here as we are, after all, sharing the host for api and controller
if [ "${SSL_MODE}" = "lets-encrypt" ]; then
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list