Skip to content

Commit d8eb11b

Browse files
committed
wire up sm workers
1 parent b1147d5 commit d8eb11b

18 files changed

Lines changed: 180 additions & 0 deletions

File tree

images/drupal/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ RUN --mount=type=cache,id=drupal-apk-${TARGETARCH},sharing=locked,target=/var/ca
5959
ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=600000
6060

6161
ENV \
62+
DRUPAL_SM_WORKERS_DERIVATIVES_ENABLED=true \
63+
DRUPAL_SM_WORKERS_INDEX_BLAZEGRAPH_ENABLED=true \
64+
DRUPAL_SM_WORKERS_INDEX_FEDORA_ENABLED=true \
65+
DRUPAL_SM_WORKERS_FETCH_SIZE= \
66+
DRUPAL_SM_WORKERS_MODE=container \
67+
DRUPAL_SM_WORKERS_NO_RESET= \
68+
DRUPAL_SM_WORKERS_RETRY_DELAY=30 \
69+
DRUPAL_SM_WORKERS_TIME_LIMIT=3600 \
70+
DRUPAL_SM_WORKERS_URI= \
6271
DRUPAL_DEFAULT_ACCOUNT_EMAIL=webmaster@localhost.com \
6372
DRUPAL_DEFAULT_ACCOUNT_NAME=admin \
6473
DRUPAL_DEFAULT_ACCOUNT_PASSWORD=password \

images/drupal/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,41 @@ additional settings, volumes, ports, etc.
3030
| DRUPAL_ENABLE_HTTPS | true | Inform PHP that `https` should be used. |
3131
| DRUPAL_REVERSE_PROXY_IPS | | Use the IP address for the host 'traefik' if found otherwise default to `0.0.0.0`. |
3232

33+
### Symfony Messenger Worker Settings
34+
35+
This image can manage Islandora Events Messenger workers directly with
36+
`s6-overlay`. That is intended for single-container or small deployment
37+
topologies where worker processes should live beside PHP-FPM.
38+
39+
Set `DRUPAL_SM_WORKERS_MODE=container` to enable the built-in workers. Leave it
40+
as `external` to run workers elsewhere.
41+
42+
| Environment Variable | Default | Description |
43+
| :-------------------------------------------- | :------- | :-------------------------------------------------------------------------- |
44+
| DRUPAL_SM_WORKERS_MODE | external | `container` runs local `drush sm:consume` services, `external` disables them |
45+
| DRUPAL_SM_WORKERS_DERIVATIVES_ENABLED | true | Enable the derivative transport worker when local workers are enabled |
46+
| DRUPAL_SM_WORKERS_INDEX_FEDORA_ENABLED | true | Enable the Fedora indexing worker when local workers are enabled |
47+
| DRUPAL_SM_WORKERS_INDEX_BLAZEGRAPH_ENABLED | true | Enable the Blazegraph indexing worker when local workers are enabled |
48+
| DRUPAL_SM_WORKERS_TIME_LIMIT | 3600 | `drush sm:consume --time-limit` value used before the worker is restarted |
49+
| DRUPAL_SM_WORKERS_FETCH_SIZE | | Optional `drush sm:consume --fetch-size` value for Symfony 8.1+ |
50+
| DRUPAL_SM_WORKERS_NO_RESET | | Set to `true` to pass `drush sm:consume --no-reset` on Symfony 8.1+ |
51+
| DRUPAL_SM_WORKERS_RETRY_DELAY | 30 | Seconds to wait before retrying when Drupal is not ready or a worker exits |
52+
| DRUPAL_SM_WORKERS_URI | | Optional Drush `--uri` value for multisite bootstrap |
53+
54+
`DRUPAL_SM_WORKERS_FETCH_SIZE` and `DRUPAL_SM_WORKERS_NO_RESET` are opt-in so
55+
the image remains safe on current Drupal and Symfony releases. Only set them
56+
when the target `sm:consume` command supports those options.
57+
58+
The built-in worker services are:
59+
60+
- `islandora_derivatives`
61+
- `islandora_index_fedora`
62+
- `islandora_index_blazegraph`
63+
64+
`external` mode does not use a worker URL. Distributed workers are simply the
65+
same `drush sm:consume` commands running in another container, pod, or host
66+
against the same Drupal site and queue backend.
67+
3368
### Database Settings
3469

3570
[Drupal] can make use of different database backends for storage. Please see the
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/command/execlineb -S2
2+
/usr/local/share/s6/finish ${1} ${2}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/with-contenv bash
2+
set -e
3+
exec /etc/s6-overlay/scripts/messenger-worker.sh islandora_derivatives "${DRUPAL_SM_WORKERS_DERIVATIVES_ENABLED:-true}"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
longrun
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/command/execlineb -S2
2+
/usr/local/share/s6/finish ${1} ${2}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/with-contenv bash
2+
set -e
3+
exec /etc/s6-overlay/scripts/messenger-worker.sh islandora_index_blazegraph "${DRUPAL_SM_WORKERS_INDEX_BLAZEGRAPH_ENABLED:-true}"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
longrun

0 commit comments

Comments
 (0)