Skip to main content

Module docker_servers

Module docker_servers 

Source
Expand description

A server a browser suite starts with docker compose, built from the copy the suite runs in. The image holds the instrumented code, but nothing else crossed into the container: not the environment that tells the server’s runtime where to write, and not the directory it writes to. A docker launcher on the suite’s PATH hands each service built from the copy that environment and Supercov’s directory, mounted at the path it has outside, and records the project so the run can stop it, and read what it wrote, once the command ends.

Anything it does not recognise, or cannot read, runs as written.

Constants§

CONTAINER_VARIABLE
Set in each such service: its runtime runs in an image of the copy.
COPY_VARIABLE
The copy: a service whose build context is in it was built from it.
DOCKER_COMMAND
The hidden command a launcher runs: supercov __docker <docker> <args>.
ENVIRONMENT_VARIABLE
Names, comma-separated, of the variables each such service is given.
MOUNT_VARIABLE
The directory mounted into each service, at the same path.
STATE_VARIABLE
Where projects the launcher started are recorded, one JSON line each.

Functions§

run
Run docker as the launcher was asked to, giving services built from the copy what their runtime needs. Returns the exit code.
stop_started
Stop what the launcher started, so each server writes its last window before the run reads them. Stopped, never removed: the containers are the suite’s. Quietly does nothing when nothing was started.
write_launchers
The launchers, docker and docker-compose for those on PATH, in directory, or None when neither is.