Setup packer container image scripts
Immediate tasks:
-
Clean up Ansible cruft -
configure Supervisor (on dispatcherd) for: -
RabbitMQ -
Redis -
dispatcherd worker
-
-
Add start.sh
to run Supervisor in non-daemon mode (see here) -
Split up aegir.relayd/tasks/main.yml
to allow for easier re-use -
(maybe?) Add relayd-base image (just dependencies) -
Configure Supervisor (on relayd) for: -
relayd worker
-
-
Add docker login
target (and maybe others) -
Add tests: -
test-dispatcherd.yml
-
test-relayd.yml
-
-
Clean up Packer cruft -
Move Packer scripts under build
The immediate goal here is to shift the install and setup out of Lando/DDEV of the stack of services software we rely on to get Aegir going in a Development environment. Instead, we should bake as much as possible into the container, so the dev environment simply starts the container and kicks off a "start aegir" type command (initscript, daemon-mode systemd service via systemd-run, or simple shell script in /usr/local/bin for now).
To some extent we want to model the way that this will actually work in a production container-driven infrastructure, but the details of that are secondary to the current need to bootstrap a development environment with a working and reasonably thorough test suite, so we can confidently refactor things at all levels, including the service layer.
Initially the goal is to mirror what we're doing in Lando currently, in conjunction with #79 (closed)'s effort to move to DDEV, and mapping our lando setup scripts and Ansible playbooks for relayd and dispatcherd into a Packer-driven mechanism in order to speed up spinning up a dev environment.
Layers of container images (goal state):
-
10-focal.json
builds a root image with the relevant OS -
20-base.json
builds in some extra "base" packages likemake
,sudo
,screen
,strace
,htop
,vim
, etc. ("slightly opinionated Ubuntu") -
30-python.json
builds in the python basics, needed for all three "top-level" images -
40-relayd.json
builds a "frontend" aegir image, with PHP and the Drupal stack, ready to install Aegir's frontend site.- only needs celery php library, and enough python to run
relayd.py
(and not rabbitmq)
- only needs celery php library, and enough python to run
-
40-dispatcherd.json
builds a "backend" aegir image- needs fully rabbitmq + redis + celery setup
- needs ansible
- might need
php-cli
? - from DDEV perspective, goal is to install up to the point that container "entrypoint" command can be our
celery multi start
command
-
40-minion.json
builds a bare-bones image to serves as the basis for both:- other "flavours" of minion (ie. with a LAMP stack pre-configured, for Aegir to deploy Drupal sites on, or a Ruby stack on which to deploy Rails apps)
- a "clean slate" image for Aegir Server & Service entity Operations to provision via the frontend Aegir UI
-
KEY to a minion is that it has a mechanism (initially just baked into the Packer build scripts) to generate and provision SSH keys so that the
dispatcherd
container can SSH to its minions immediately upon spinning up- over the medium term, we'll want a more secure mechanism to inject these as the container is spun up, and for updating/removing keypairs from an environment
Coming from #75 (closed), let's make sure to update:
-
PHP (php8?)see #84 (closed) -
MySQL (maria) -
Ansible (latest) -
s/bionic/focal/