Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.I've been giving lots of thought lately to the effort involved in maintaining platforms and sites in Aegir. Unfortunately, it ends up being somewhat confusing to end users, who end up having to understand how platforms are built, that a 'migrate' task is the appropriate method to update sites, etc.
I'd like to propose the introduction of a new content type to simplify much of this: 'distributions'. A 'distribution', in this case, refers to a 'type' or 'flavour' of platform. I'm open to using another name, but this is pretty much in line with d.o's definition:
Distributions provide site features and functions for a specific type of site as a single download containing Drupal core, contributed modules, themes, and pre-defined configuration. They make it possible to quickly set up a complex, use-specific site in fewer steps than if installing and configuring elements individually.
This'd help to solve an ongoing AegirWTF, about what platforms are, and how they work.
I propose implementing an Aegir Distribution content type that would work along the following lines:
- When creating a distribution, the following fields would be required:
- name (title)
- git repo url
- path to makefile (within the repo)
- option to track:
- a branch (text field for branch name) or
- tags (text field for tag regex)
- Creating a distribution would trigger the creation of a platform, that specifies a remote makefile constructed from the '
git repo url', the 'branch' or 'tag', and the 'path to makefile' fields. In the case of a tag, it'd query the repo to find the latest tag that matches the regex. - An Aegir queue would poll the repo regularly for new commits to the tracked branch, or new tags. Upon finding either of these:
- A new platform would be created
- Old platforms from this distribution would be locked.
- An '
update site' task would become available on all sites running on older platforms of the distribution. This would:- Look up the latest platform in the distribution to which the site's platform belongs.
- Trigger a migration of the site to the latest platform.
- An '
update all sites' task would become available on all older platforms of the distribution. This would:- Look up the latest platform in the distribution.
- Trigger a migration of all sites on the old platform to the latest one.










Comments
Comment #2
colanI like this idea, but would makefiles be mandatory? What about straight-up Git repositories?
Comment #3
gboudrias CreditAttribution: gboudrias at Praxis Labs Coop commentedI would personally rather use a lighter version of this, in which we can simply "tag" or categorize platforms. The problem with a new content type is that you have to adjust the workflow and documentation depending on whether they have it or not, which could make support more difficult. If it's just another platform attribute, it's just a matter of saying "if this is here, add it".
And if we were to make this mandatory, I think it's simply too big of a change for Aegir3, as we would have to change all the docs.
So I'm not opposed to adding this if it's not enabled by default, but I probably wouldn't use it. Based on what you're saying though it seems like it could start as a simple contrib module, doesn't seem like we would need to remove anything.
This is just my preemptive opinion, the implementation is obviously important.
Comment #4
ergonlogicSure,
hosting_gitprovides support for building platforms from git repos. It'd make [1.3] optional and alter how [2] builds a platform, but that shouldn't be too much of a challenge.Comment #5
ergonlogicDistributions would be optional, whether enabled or not. This is intended to simply automate the process of building new platforms, and selecting the target platform when running migrations, that's all.
Comment #6
gboudrias CreditAttribution: gboudrias at Praxis Labs Coop commentedAfter some further discussion on IRC, this is probably more useful than the alternative of simply tagging platforms, if we can centralize most of the logic (eg the hierarchy of which platform follows which, or at least which one is the latest).
We'd still need to adapt the contrib modules but they already don't have this, or in some cases they are implementing the logic themselves so they could be simplified.
Comment #7
ergonlogicIRC log of said discussion: https://hefring.mig5.net/bot/log/aegir/2016-04-12#T616012
Comment #8
colanAfter thinking about this some more while working on #2705805: Merge SaaS suite of modules into Aegir Services, I'm definitely in favour of this. Currently, the SaaS configuration needs to be updated every time there's a platform upgrade (i.e. sites are moved to a new platform to get an upgraded codebase): a new platform ID must be specified so that new sites don't get deployed on the old one.
If we had distributions, the distribution ID would be in the config instead, and it wouldn't have to change. New sites would automatically get deployed to the distribution's latest platform.
Comment #9
omega8cc CreditAttribution: omega8cc commentedThis is great idea!
Even the old idea, based on makefiles and feature servers, as explained by Vertice, also used "Distributions" name, even if it was in fact about building platforms:
See for reference: "Aegir 0.4 Alpha 13: Drush Make Makefile Support Allows for Automatically Building Drupal Distributions"
Comment #10
ergonlogicHaving thought this through further, I think it should be split into 2 projects. The first being the 'distribution' content type, along with it's "upgrade" tasks for sites and platforms. The second would be a framework for monitoring some source for changes and automating the builds of the platforms themselves.
So, following that logic, and setting aside the second compotent, a 'distribution' is pretty simple:
This first part is already full of wins for end-users, who will finally have a simple "upgrade" button, and alleviate their need for contextual knowledge, like which is the correct platform to upgrade to.
The second part will make the lives of platform managers easier by automating platform builds. This will be somewhat more complicated, as we'll need to support both makefile and git-based platforms; Composer too, for that matter. Also, pull- (git monitoring, lockfile diffs) vs. push-based (webhooks) mechanisms for triggering new platform builds.
However, it should provide us a convenient hook to run test suites, and eventually a full CD workflow.
Comment #11
colanSounds good. We may want to add a type field (e.g. Drupal, Wordpress, etc.) to the Distribution content type as per #2770077: RFC: Refactor how Aegir installs Drupal., however.
Comment #12
ergonlogicI've implemented the 'distribution' content type as per #10, over in the dev/distros branch of hosting_dev.
I borrowed heavily from
hosting_migrate, fixing up how some of the comparison dialogs work, and such. Some of that could potentially move upstream.I think it's fairly complete, for the first stage, and should be ready for testing.
Comment #13
ergonlogicA few design decision explanations:
Comment #14
colanSo to prepare for an upgrade, you would:
Is this the intended process? I suppose this is safer than assuming the newest platform using the distro, but requires manual work.
Comment #15
ergonlogicYes, that's correct. I wanted to keep distros relatively minimalist, for the moment, to be expanded upon later with optional extensions.
The point of this first phase is to make the upgrade process as simple as possible, from an end-user/site-owner standpoint. The second phase will deal with automating the platform maintenance aspects. I figure that'll be a good opportunity to integrate Composer support, for example. Setting the upgrade target to the latest platform (among other things) should be pretty easy, at that point.
Comment #16
ergonlogicI've added #2864854: [meta] Enhance distributions to discuss future directions.
Comment #17
ergonlogicI've split Distributions into a separate module: https://www.drupal.org/project/hosting_distribution. I've also implemented the Drush makefile tracking as per #2864854: [meta] Enhance distributions. I'll be releasing a beta shortly, to encourage testing.