From 0434e3bf8f37144f725b52cc2801db7c4a6f369a Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Mon, 1 Nov 2021 09:06:58 +0200 Subject: [PATCH] Allow force-patching webpack.config.js when self-building Element We were applying the low-memory system patch to webpack.config.js on systems with < 4GB memory. From now on, we also let people force-enable patching by toggling the `matrix_client_element_container_image_self_build_low_memory_system_patch_enabled` variable. Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1357 --- roles/matrix-client-element/defaults/main.yml | 4 ++++ roles/matrix-client-element/tasks/setup_install.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/matrix-client-element/defaults/main.yml b/roles/matrix-client-element/defaults/main.yml index 527b17e5e..104b778f7 100644 --- a/roles/matrix-client-element/defaults/main.yml +++ b/roles/matrix-client-element/defaults/main.yml @@ -2,6 +2,10 @@ matrix_client_element_enabled: true matrix_client_element_container_image_self_build: false matrix_client_element_container_image_self_build_repo: "https://github.com/vector-im/riot-web.git" +# Controls whether to patch webpack.config.js when self-building, so that building can pass on low-memory systems (< 4 GB RAM): +# - https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1357 +# - https://github.com/vector-im/element-web/issues/19544 +matrix_client_element_container_image_self_build_low_memory_system_patch_enabled: "{{ ansible_memtotal_mb < 4096 }}" matrix_client_element_version: v1.9.3 matrix_client_element_docker_image: "{{ matrix_client_element_docker_image_name_prefix }}vectorim/element-web:{{ matrix_client_element_version }}" diff --git a/roles/matrix-client-element/tasks/setup_install.yml b/roles/matrix-client-element/tasks/setup_install.yml index c8f1900f8..b14a0dd55 100644 --- a/roles/matrix-client-element/tasks/setup_install.yml +++ b/roles/matrix-client-element/tasks/setup_install.yml @@ -41,7 +41,7 @@ owner: root group: root mode: '0644' - when: "matrix_client_element_container_image_self_build|bool and ansible_memtotal_mb < 4096" + when: "matrix_client_element_container_image_self_build|bool and matrix_client_element_container_image_self_build_low_memory_system_patch_enabled|bool" - name: Ensure Element Docker image is built docker_image: