Determine matrix_architecture automatically

This commit is contained in:
Slavi Pantaleev 2022-11-22 09:09:11 +02:00
parent a98f249e40
commit 2ad6bd87c7
4 changed files with 10 additions and 17 deletions

View File

@ -1,26 +1,18 @@
# Alternative architectures
As stated in the [Prerequisites](prerequisites.md), currently only `x86_64` is fully supported. However, it is possible to set the target architecture, and some tools can be built on the host or other measures can be used.
As stated in the [Prerequisites](prerequisites.md), currently only `amd64` (`x86_64`) is fully supported.
To that end add the following variable to your `vars.yml` file (see [Configuring playbook](configuring-playbook.md)):
The playbook automatically determines the target server's architecture (the `matrix_architecture` variable) to be one of the following:
```yaml
matrix_architecture: <your-matrix-server-architecture>
```
Currently supported architectures are the following:
- `amd64` (the default)
- `arm64`
- `amd64` (`x86_64`)
- `arm32`
- `arm64`
so for the Raspberry Pi, the following should be in your `vars.yml` file:
Some tools and container images can be built on the host or other measures can be used to install on that architecture.
```yaml
matrix_architecture: "arm32"
```
## Implementation details
For `amd64`, prebuilt container images (see the [container images we use](container-images.md)) are used for all components (except [Hydrogen](configuring-playbook-client-hydrogen.md), which goes through self-building).
For other architectures, components which have a prebuilt image make use of it. If the component is not available for the specific architecture, [self-building](self-building.md) will be used. Not all components support self-building though, so your mileage may vary.
For other architecture (`arm64`, `arm32`), components which have a prebuilt image make use of it. If the component is not available for the specific architecture, [self-building](self-building.md) will be used. Not all components support self-building though, so your mileage may vary.

View File

@ -6,11 +6,11 @@ The playbook supports self-building of various components, which don't have a co
For other architectures (e.g. `arm32`, `arm64`), ready-made container images are used when available. If there's no ready-made image for a specific component and said component supports self-building, an image will be built on the host. Building images like this takes more time and resources (some build tools need to get installed by the playbook to assist building).
To make use of self-building, you don't need to do anything besides change your architecture variable (e.g. `matrix_architecture: arm64`). If a component has an image for the specified architecture, the playbook will use it directly. If not, it will build the image on the server itself.
To make use of self-building, you don't need to do anything. If a component has an image for the specified architecture, the playbook will use it directly. If not, it will build the image on the server itself.
Note that **not all components support self-building yet**.
List of roles where self-building the Docker image is currently possible:
Possibly outdated list of roles where self-building the Docker image is currently possible:
- `matrix-synapse`
- `matrix-synapse-admin`
- `matrix-client-element`

View File

@ -86,7 +86,7 @@ matrix_federation_public_port: 8448
# Recognized values by us are 'amd64', 'arm32' and 'arm64'.
# Not all architectures support all services, so your experience (on non-amd64) may vary.
# See docs/alternative-architectures.md
matrix_architecture: amd64
matrix_architecture: "{{ 'amd64' if ansible_architecture == 'x86_64' else ('arm64' if ansible_architecture == 'aarch64' else ('arm32' if ansible_architecture.startswith('armv') else '')) }}"
# The architecture for Debian packages.
# See: https://wiki.debian.org/SupportedArchitectures

View File

@ -40,6 +40,7 @@
- {'var': matrix_server_fqn_element, 'value': "{{ matrix_server_fqn_element | default('') }}"}
- {'var': matrix_homeserver_container_url, 'value': "{{ matrix_homeserver_container_url | default('') }}"}
- {'var': matrix_homeserver_container_federation_url, 'value': "{{ matrix_homeserver_container_federation_url | default('') }}"}
- {'var': matrix_architecture, 'value': "{{ matrix_architecture | default('') }}"}
when: "item.value is none or item.value == ''"
- name: Fail if uppercase domain used