Step 8 of 9 · lab · 25 min
A container restarts under load
The import service moved into a container and has not processed a single export since — the container is up one moment and restarting the next. Find the cause and fix it so that the service handles the load within the limits it was given.
Situation
The ingest service processes the nightly sales exports: a CSV file appears in /srv/ingest/inbox, and a summary
of it appears in /srv/ingest/done. Until last week the service ran as the ingest system user, and the
/srv/ingest directory belongs to that user. Then it was moved into a Docker container: the container is created
by the /opt/ingest/run.sh script, and the import code sits next to it in /opt/ingest.
Since the move, not a single export has been processed: today's one, 40 MiB, is still sitting in inbox, and
docker ps shows ingest up for a couple of seconds one moment and restarting the next.
Task
- ingest processes exports and does not restart: the check will drop its own 40 MiB export into
inboxand wait for the summary. Do not change the import code in/opt/ingest. - The memory limit of the ingest container is 128 MiB: that is how much the service is given on this machine.
- The process in the container runs as the ingest user and group, as it did before the move.
- ingest comes up by itself after the machine reboots.
Run
dockercommands withsudo: the student user has no direct access to Docker. The machine has no internet access; thealpineimage is already loaded.
Lab · on your own
No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.
Goals
0 of 4-
ingest processes a 40 MiB export without restarting, and the import code is unchanged — not done yet
-
The memory limit of the ingest container is 128 MiB — not done yet
-
The process in the container runs as the ingest user and group — not done yet
-
ingest comes up by itself after the machine reboots — not done yet
The machine is starting
Hints
0 of 3Lab goals
0 of 4-
ingest processes a 40 MiB export without restarting, and the import code is unchanged — not done yet
-
The memory limit of the ingest container is 128 MiB — not done yet
-
The process in the container runs as the ingest user and group — not done yet
-
ingest comes up by itself after the machine reboots — not done yet
Goals are checked on the machine after every command.