Skip to content

Commit 96947d1

Browse files
committed
Improve documentation
- Explain the `docker-compose` environment(s) - Add command to clear the queues
1 parent 5ce3c88 commit 96947d1

File tree

2 files changed

+38
-11
lines changed

2 files changed

+38
-11
lines changed

PRODUCTION.md

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# How to create screenshots in production
22

3-
The production environment uses `docker compose` to start the message
4-
queue, one metadata worker and four instances of the screenshot worker (to
5-
parallelize the screenshot processes).
6-
73
In production, you *must* run all commands described in the
8-
[README](README.md) inside Docker containers. To avoid long command lines,
9-
we have encapsulated the commands in a [`Makefile`](Makefile) and the
10-
shell script `queue_screenshots.sh`.
4+
[README](README.md) inside Docker containers. The production environment
5+
uses `docker compose` to start the message queue, one metadata worker and
6+
four instances of the screenshot worker (to parallelize the screenshot
7+
processes).
8+
119

1210
## Creating Screenshots
1311

@@ -77,11 +75,17 @@ You can get a unified stream of log output (with timestamps) by running
7775
By default, the workers should start with the `--verbose` flag
7876
(see `entrypoint` in the `docker-compose` file).
7977

80-
8178
### Show queue and message count
8279

8380
docker compose exec rabbitmq bash -c 'rabbitmqctl list_queues'
8481

82+
### Flushing all commands from the queue
83+
84+
make shutdown-workers
85+
86+
This will stop all containers *and* delete their storage volumes, making
87+
the queue empty.
88+
8589
### Refreshing the metadata summary
8690

8791
Run the command
@@ -93,4 +97,25 @@ the overview page for Shutterbug, based on the existing metadata files. If
9397
a metadata file is invalid, the metadata worker will show a log message
9498
and ignore the file.
9599

100+
## Background Information: How the docker compose environment works
101+
102+
The production environment uses *two* files to define the setup for `docker compose`:
103+
`docker-compose.yml` and `docker-compose.prod.yml`. The latter overrides
104+
settings in the former. See [Merge Compose Files](https://docs.docker.com/compose/how-tos/multiple-compose-files/merge/)
105+
from the official documentation.
106+
107+
**Do not** use `docker compose` commands without specifying both files! To
108+
make your job easer and to avoid typing long command lines, we have
109+
encapsulated some commands in the [`Makefile`](Makefile) and the shell
110+
script `queue_screenshots.sh`.
111+
112+
`docker-compose.prod.yml` is *not* part of the `banner-screenshots`
113+
repository but part of the infrastructure repository. The deployment
114+
script for `banner-screenshots` will put it into the right place.
115+
116+
You can test the `docker compose` environment: Both `Makefile` and
117+
`queue_screenshots.sh` will try to fall back to the file
118+
`docker-compose.dev.yml` if the file `docker-compose.prod.yml` does not
119+
exist. You can create the `docker-compose.dev.yml` file by copying the
120+
contents of `docker-compose.dev.example.yml` into it.
96121

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ The system consists of four parts:
1010
4. A CLI tool that creates a test matrix (a batch of screenshots) from the
1111
campaign configuration and pushes them into the queue.
1212

13-
Please note that the instructions in this README are for *local
14-
development* only! To create screenshots, use docker-compose environment
15-
and the instructions in [PRODUCTION.md](PRODUCTION.md).
13+
14+
> [!IMPORTANT]
15+
> Please note that the instructions in this README are for *local
16+
> development* only! To create screenshots, use docker-compose environment
17+
> and the instructions in [PRODUCTION.md](PRODUCTION.md).
1618
1719
## Installing the dependencies
1820

0 commit comments

Comments
 (0)