Commit fac70681 authored by Florian Haas's avatar Florian Haas
Browse files

Enforce minimum memory requirement

The Taiga production setup guide explicitly states a 1GB minimum
memory requirement, "needed for compilation of lxml". Enforce this
requirement on taiga-back through the taiga_back_required_memory
variable, which is given in MB and defaults to 1024.

On low-memory platforms such as the Raspberry Pi 3 (1 GB nominal total
memory, 912 MB usable), it is still possible to compile and install
lxml, under the following conditions (at least for the duration of the
compilation):

1. Swap space must be available;
2. PostgreSQL must be stopped (this must be done manually, the role
   does not have a task for this);
3. RabbitMQ must not run (can be accomplished by setting
   taiga_enable_events and taiga_enable_async_tasks to false; both
   those features are probably not of much use on a Raspberry Pi
   anyway).

With all these hacks in place, the memory requirement can then be
relaxed by setting taiga_back_required_memory to a value like 900.

Reference:
https://taigaio.github.io/taiga-doc/dist/setup-production.html#_overview
parent 030dc8bc
......@@ -347,6 +347,45 @@ should
so that the roles are mapped to different group names than in
`taiga.yml`.
### Low-memory platforms
On low-memory platforms, you may bump into into the rather hefty
memory utilization from compiling the `pip`-installed `lxml` package,
to the point of your memory being exhausted and the installation
failing. To that end, the `taiga-back` role checks
`taiga_back_required_memory` against the available memory on the
target machine, defaulting to 1024 (MB).
You can still install Taiga on a box with less available memory (such
as an [Ubuntu](https://wiki.ubuntu.com/ARM/RaspberryPi)-powered
[Raspberry Pi
3](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/) that
you may use to host a Taiga instance for personal use). But you must
meet a few prerequisites, at least for the duration of the
installation:
1. Swap space must be available. Yes, it’ll be terribly slow on a
MicroSD card, but it will get you over `lxml`’s memory utilization
hump.
2. PostgreSQL must be stopped while the compilation is running. This
must be done manually, the `taiga-back` role does not have a task
for this.
3. RabbitMQ must not run while the compilation is running. This can be
accomplished by stopping RabbitMQ (again, manually), or you can set
both `taiga_enable_events` and `taiga_enable_async_tasks` to
`false`; both those features are probably not of much use on a
Raspberry Pi or similar platform anyway.
4. You must set `taiga_back_required_memory` to a value that matches
your target system, such as 900.
Even with all these hacks in place, you’re not certain to
succeed. Running Taiga on a low-memory platform generally isn’t
something that you should consider “supported.”
## License
Like Taiga itself, these playbooks are licensed under the AGPL 3.0;
......
---
# Which minimum memory requirement (in MB) should we enforce?
taiga_back_required_memory: 1024
# What repo should we check out?
# (relative to taiga_git_mirror)
taiga_back_repo: "taiga-back"
......
---
- name: check for required memory
fail:
msg: >
"The available total memory on the target host, {{
ansible_memory_mb['real']['total'] }} MB, is less than the
recommended minimum ({{ taiga_back_required_memory }} MB).
Installation may fail, primarily due to the memory required for
compiling and installing the lxml module. Reduce
taiga_back_required_memory (at your own risk) to suppress this
message."
when: "ansible_memory_mb['real']['total']|int < taiga_back_required_memory|int"
tags:
- install
- back-install
- offline
- name: install required backend-specific packages
become: true
become_user: root
......
......@@ -422,6 +422,9 @@ taiga_front_enable_gravatar: true
```yaml
---
# Which minimum memory requirement (in MB) should we enforce?
taiga_back_required_memory: 1024
# What repo should we check out?
# (relative to taiga_git_mirror)
taiga_back_repo: "taiga-back"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment