dpc-sdp / tide_marina
Drupal integrations and dependency management for the Tide Marina.
This package is auto-updated.
Last update: 2026-11-23 21:41:45 UTC
README
Drupal integrations and dependency management for the Tide Marina hosting platform.
Development
Develop and validate this module on the host. It requires PHP 8.3, Composer, and the PHP extensions declared in composer.json: gd, igbinary, redis, pdo_mysql, zip, and zlib.
Getting started
Install the module dependencies and the pinned development tools:
composer install --prefer-dist --no-progress --no-interaction composer --working-dir=tools install --prefer-dist --no-progress --no-interaction
Validating a build
Run the same Composer validation and dependency installation performed by CI:
composer validate composer install --prefer-dist --no-progress --no-interaction
Run coding-standard checks with:
tools/vendor/bin/phpcs --standard=phpcs.xml.dist
Features
- Ensures dependencies required for the Tide Marina hosting platform are installed.
- Enforces runtime container requirements (PHP 8.3 and required PHP extensions).
- Provides the optional
marina_cf_cachetagsmodule. It sends cacheable responses' Drupal cache tags in thex-amz-meta-cache-tagheader and invalidates those tags through the local CloudFront SigV4 sidecar. - Automatically handles migration tasks from legacy Section.io purgers to the Marina CloudFront integration upon module installation (tide_marina_install()).
- Sends Drupal logs to the container output as JSON through Monolog.
Logging
tide_marina requires and enables monolog (existing sites get it through
tide_marina_update_10001()). Install and the update hook both log
Tide Marina: Monolog JSON logging enabled. on the tide_marina channel, so
log collection can be checked after deployment. Monolog replaces Drupal's
logger factory, so
every channel goes to the tide_marina_output handler. The handler is
registered by TideMarinaServiceProvider only when Monolog is enabled, so the
container can still be rebuilt before the update hook runs:
- Web requests write JSON to
php://stdout. PHP-FPM forwards it to the container log whencatch_workers_outputis enabled. - Drush also writes JSON, but to
php://stderr, so command output on stdout stays clean and Batch API commands keep working.
Other Drupal loggers (dblog, syslog, lagoon_logs, tide_logs) no longer
receive records unless they are added as handlers. The minimum level defaults
to info. To change it, or to change the handlers, override the parameters in
a site services.yml:
parameters: tide_marina.log_level: 'warning'
CloudFront cache tags
Enable the submodule with:
drush en marina_cf_cachetags
On install it registers Purge's HTTP bundled purger (instance
marina_cf_cachetags), enables the coretags queuer, the throttled late
runtime processor and the cron processor (disabling Purge's lateruntime),
and empties the purge queue so nothing queued for a previous purger lingers.
Processing. The queue is sent at the end of a request, after the response,
but at most once every 60 seconds across all requests. The first request after
a quiet period sends straight away, so a single edit is not delayed; edits made
during the interval go out together, with duplicate tags removed, at the end of
the first request after it. On a site with no further traffic, drush cron
sends what is left. Change the interval in settings.php:
$settings['marina_cf_cachetags_processing_interval'] = 30;
Response header. Cacheable responses carry x-amz-meta-cache-tag, a
comma-separated list of the response's Drupal cache tags hashed with xxHash3
and truncated to 6 hex characters (node:203 → # + first 6 chars of
hash('xxh3', 'node:203')). Tags matching the purge_queuer_coretags
blacklist are dropped, entity tags are listed first, and the list is capped at
the 50 tags CloudFront stores per object. Hashing keeps the header far below
CloudFront's 1,783-character limit.
Allowed tags. Only tags matching one of the
marina_cf_cachetags.allowed_tag_patterns container parameter's patterns are
sent in the header or queued for invalidation. The coretags queuer is replaced
with one that applies the same filter, so a tag is only invalidated if it can
appear on a cached object. The defaults keep:
- entity tags for nodes, media, taxonomy terms, menu links, reusable
(library) paragraphs and redirects, e.g.
node:203 - list tags for nodes, media, taxonomy terms and menu links, e.g.
node_list:landing_page - config tags, except
config:views.view.admin_audit_trail
Everything else is dropped. That includes paragraph tags (saving a paragraph
also saves its parent), revision tags, and bookkeeping tags such as
search_api_list:* and simple_sitemap:*. Override the parameter in a site's
services.yml; an empty list keeps every tag that is not blocklisted.
Invalidation. The purger sends a POST to
http://localhost:8083/prod/cache-invalidation/{project}/{environment} (the
platform's SigV4 sidecar) with a JSON body of the same hashes, each prefixed
with tag::
{"tagsCsv":"tag:b9917e,tag:4c1d2a"}
The cache invalidation API rewrites tag:<hash> to #<hash>, which is
CloudFront's tag-invalidation syntax. Both sides must use the same hash, so
they share the marina_cf_cachetags.cache_tags_hash service. Override
marina_cf_cachetags.cache_tag_filter or
marina_cf_cachetags.cache_tag_prioritizer in a site's services.yml to
change which tags are kept and in what order.
Retries. The purger (plugin marina_cf_cachetags) is Purge's HTTP bundled
purger with a cap on attempts. A request can fail after the API has already
published the event, for example when the response is slower than the 5
second timeout, so each retry can become another CloudFront invalidation. An
invalidation is sent at most 3 times; after that it is dropped and an error
is logged to the purger_marina_cf_cachetags_marina_cf_cachetags channel.
Stale items. Items that never reach the purger, such as invalidation types
it does not support or anything queued while Purge's diagnostics are failing,
are not covered by that cap. On each drush cron, unclaimed queue items older
than an hour are deleted and a warning is logged. Change the age (in seconds,
0 disables it) in settings.php:
$settings['marina_cf_cachetags_queue_max_age'] = 7200;
Site configuration. Override the purger's path with the deployment's
project and environment names (the placeholders are not substituted
anywhere else), e.g. in settings.php:
$config['purge_purger_http.settings.marina_cf_cachetags']['path'] = sprintf('/prod/cache-invalidation/%s/%s', 'my-project', getenv('MARINA_ENVIRONMENT'));
Platform requirements. The CloudFront distribution must declare
CacheTagConfig with HeaderName: x-amz-meta-cache-tag; distributions
without it ignore the header and every tag invalidation is a no-op. Objects
cached before CacheTagConfig is enabled carry no tags — issue one /*
invalidation after enabling it.
To invalidate a tag by hand, hash it first:
aws cloudfront create-invalidation --distribution-id <id> \ --paths "#$(php -r 'echo substr(hash("xxh3", "node:203"), 0, 6);')"
Patches
Redis
This module handles patching of the Redis module with a few key features
- Adds support for RedisCluster client.
- Uses the current RedisCluster upstream patch.
- Preserves the configured TLS context during RedisCluster node discovery.