Skip to content

WIP - Abstraction#39

Open
jackfirth wants to merge 26 commits intomasterfrom
v3
Open

WIP - Abstraction#39
jackfirth wants to merge 26 commits intomasterfrom
v3

Conversation

@jackfirth
Copy link
Collaborator

@jackfirth jackfirth commented Nov 24, 2017

NOT READY TO MERGE

An attempt to make "installation builder" and "test runner" containers that each contain a piece of the existing Docker Compose configuration along with some scripting.

Currently, implementing #7, #20, and #21 would require a combinatoric explosion in the amount of Docker Compose configuration required. Hopefully this PR will solve that problem.

Really the only thing that causes large build contexts is git history,
since barely a handful of files are needed to build the images. This
change avoids development pain when new files are excluded unexpectedly.
Allows the `docker-compose.yml` file to refer to non-image resources
(like docker networks) it creates in environment variables, which is
needed for future changes.
Instead of defining, building, and running each set of test services
for each installer we define a single “test runner” service. This test
runner contains a parameterized docker compose configuration for
building and running the tests of a single installer variant. The outer
docker-compose specifies that the containerized test runner’s
docker-compose should mount the host docker socket, ensuring that the
test runner uses the host docker engine instead of an isolated docker
engine inside the container. With a small script taking an argument for
which installer to test, we can now build and run all the tests for an
existing installer image (e.g. `racket-x86`) using `docker-compose run
racket-test-runner racket-x86`.
Also fixes naming mismatch between Travis and docker-compose
Similar to the test-runner service. The installer service consumes a
Racket installer and executes it, producing an image containing a
Racket installation. This is defined in terms of “installer types” and
“installation types”. An installer type identifies a particular
artifact available for download from a version-specific Racket
installers website such as a 64-bit linux installation script. An
“installation type” is a particular way of executing an installer,
since some installers can be installed in multiple different ways.
Currently the only implemented installation type is “script-inplace”,
meaning an in-place install of a Linux shell script installer. By
wrapping installation in a service, new installation types can be
defined with a linear amount of configuration in the number of
installation types.
The only installation step not contained by the installer service is
actually downloading an installer. This small downloader will be
combined with the installer service to replace the existing
“Dockerfile.installer” way of building installation images.
The COMPOSE_PROJECT_NAME var is already set by the test-runner.sh
script so this is a no-op.
Each of the “racket-foo” services is now a “download-{installer-type}”
service that only downloads the correct installer from the installers
site determined by .env configuration. To build an installation, first
build the download and then run `docker-compose run installer
{installer-type} {installation-type}`, producing an image named
`racket-{installer-type}-{installation-type}`, such as
`racket-download-linux-32-ospkg-minimal-script-inplace`.
Note: this uses the fancy YAML syntax >- in order to write env vars on
multiple lines with newline characters replaced by spaces.
YAML is an abomination.
@samth
Copy link
Owner

samth commented Nov 27, 2017

Let me know when you want me to look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants