Ægir backend APIs (Provision/Hosting)
The PHP half of BOA: the four omega8cc Ægir forks (Hostmaster, Hosting, Provision, Drush) and how a task travels from frontend node to backend command and back.
The PHP half of BOA: the four omega8cc Ægir-layer forks and how they talk to each other. Everything in this topic is Drupal 7 / Drush 8 PHP that runs as an unprivileged system user, and all of it must stay parse- and runtime-safe on PHP 5.6 — that floor is a hard contract for every patch in this layer, not a style preference.
The layer in one paragraph, verified at source:
Hostmaster is a D7 install
profile (hostmaster.info, core = 7.x, 40 active dependencies[] lines) whose
make chain bundles the eldir theme and the hosting_* modules under
subdir "aegir" (drupal-org.make:12-25); on a BOA build, hostmaster.make
includes drupal-org.make (hostmaster.make:7) and pins the ten Ægir
projects to copy downloads from the /opt/tmp/make_local/* staging clones
(hostmaster.make:11-63; the D7 contrib set is pinned the same way inside
drupal-org.make itself), staged by _master_download_for_local_build
(master.sh.inc:547).
Hosting is
that module suite — 26 *.module files in the core repo (three of them
example/ scaffolds) plus BOA's satellite
repos (aegir_objects, hosting_civicrm, hosting_custom_settings,
hosting_tasks_extra, …) — which models servers/platforms/sites as nodes and
queues work as task nodes.
Provision is the Drush-command backend that
does the actual filesystem/DB/vhost work; it is cloned into the backend's
.drush/sys/provision at ${_BRANCH_PRN} by _provision_backend_up
(master.sh.inc:656,688), while hostmaster, hosting and eldir clone at
5.x-${_tRee} into the platform build (master.sh.inc:576-578).
Both halves
run under the omega8cc Drush 8 fork (pin _DRUSH_EIGHT_VRN=8.5.4,
BARRACUDA.sh.txt:50), which bootstraps BOA's own extension deny-filter on
every run (includes/preflight.inc:129 →
includes/boa_extension_filter.inc).
Two hook surfaces, one per half:
provision.api.php backend-side, hosting.api.php (plus five per-module
*.api.php files) frontend-side. An extension is therefore usually a pair
of modules — one per surface.
The task round-trip
The bridge between the two API surfaces is one Drush process chain:
Hostmaster frontend (D7, hosting_* modules) — surface: hosting.api.php
task node saved (hosting_task); queues declared via hook_hosting_queues()
(hosting.api.php:138)
↓ drush @hostmaster hosting-dispatch → hosting-<queue>
per-queue commands registered dynamically from hosting_get_queues()
(hosting.drush.inc:19,40-54)
↓ drush @hostmaster hosting-task <nid>
drush_hosting_task() (task.hosting.inc:189)
provision-save — re-export the node as a backend context/alias
with hook_hosting_TASK_OBJECT_context_options() applied
(task.hosting.inc:208)
provision_backend_invoke($alias, $task->task_command, …)
(task.hosting.inc:226)
↓
Provision backend (Drush 8, aegir/oN user) — surface: provision.api.php
provision-* command from provision_drush_command() (provision.drush.inc:91)
provision-save:92 · provision-install:108 · provision-verify:207
· provision-deploy:239
contexts via d() (provision.context.inc:23)
service orchestrators: db/ http/ platform/*.provision.inc
classes: Provision_Context, Provision_Service extends Provision_ChainedState
(Provision/Service.php:10; PSR-0 "Provision_" → Provision/,
composer.json:28-31)
↓ backend log/result rides the Drush backend channel back
post_hosting_<task_type>_task() hooks fire frontend-side
(task.hosting.inc:259-262)
Hold that picture and every leaf below is a zoom into one box.
Boundaries
- How this layer is built and shipped — the
/opt/tmp/make_localstaging clone set (_mL,master.sh.inc:551),AegirSetup{A,B,C,M}and the platform build — belongs to the Install & staged-setup internals topic. - The Provision
*.tpl.phptemplate set and Nginx render pipeline belong to Web & search stack internals.
Both are indexed from the guide front page.
Day-to-day queue operation (dispatch cadence, semaphore clearing, forcing runs) is operator material and deliberately not covered in this guide.
Reference
- Variables and
Commands — the auto-generated consolidated
_VARand CLI reference tables. - Discontinued features — retired Ægir-layer pieces land there; check it before documenting anything found only in old trees.
Hostmaster frontend internals
The Drupal 7 install profile that is Ægir's web UI: its .info manifest, install node graph, make-file chain, the eldir theme, and how Master and Satellite frontends differ.
Provision backend internals
The Drush 8 command package behind every server-side action Ægir takes: the command registry, verify/install/deploy hook choreography, the context data model, and services.
Hosting module suite map
A module-by-module map of the hosting module suite: the node types it defines, the six api.php hook files it carries, and which modules BOA enables versus which ship dormant.
Provision API
The backend extension contract: the two dispatch channels, the provision.api.php hook surface, service-driver classes and contexts, and a working provision extension skeleton.
Hosting API
The frontend extension contract: the hosting.api.php hook surface and five per-module api files, dynamic queue command registration, feature toggles, and adding a feature module.
Extending Ægir: contexts, hooks, module pairs
Writing the paired frontend and backend extension: the contexts model, the d() accessor, how a property travels frontend to backend and back, and which hook surface to use.
Drush fork internals (8-boa-micro)
The omega8cc Drush 8 fork that runs every Ægir backend task: the 8-boa-micro base and version pins, the PHP 8.x startup backstop, and the drush.inc extension deny-filter.