Files
debos/docker
Christopher Obbard e4dfbfa557 Build docker container in GitHub actions
This is a continuation of work done by @eds-collabora in !275

This replaces the old, simpler pipeline with a three phase process:

- First, build the image and cache it using docker buildx.
- Second, run all the tests in parallel, restoring the image from the cache.
- Thirdly, if the tests pass:
  - if this is a push to the main branch, push to DockerHub.
  - push to GitHub Container registry (PS: will push to a user's own fork).

This uses Buildkit caching aggressively, and will make use of the entire 5GiB allocation of cache space that GitHub provides over time.

It requires the following additional repository secrets:

- DOCKERHUB_USERNAME: the username to login as on DockerHub (e.g. go-debos)
- DOCKERHUB_PASSWORD: an access token for the DockerHub repository.

Closes: #275
Based on original work by: Ed Smith <ed.smith@collabora.com>
Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2022-04-20 20:45:31 +02:00
..
2022-04-14 21:14:27 +02:00

debos

Docker container for 'debos' tool.

Installation

docker pull godebos/debos

Debos needs virtualization to be enabled on the host and shared with the container.

Check that kvm is enabled and writable by the user running the docker container by running ls /dev/kvm

Usage

/!\ This container should be used as an executable, i.e. there is no need to add debos after godebos/debos.

To build recipe.yaml:

cd <PATH_TO_RECIPE_DIR>
docker run --rm --interactive --tty --device /dev/kvm --user $(id -u) --workdir /recipes --mount "type=bind,source=$(pwd),destination=/recipes" --security-opt label=disable godebos/debos <RECIPE.yaml>

Container build

To build the debos container image from current git branch:

docker build -f docker/Dockerfile -t godebos/debos .

Tests

Unit tests

Run unit tests:

docker-compose -f docker/unit-tests.test.yml up --build --exit-code-from=sut

Test recipes

Run test recipes on host:

docker-compose -f docker/recipes.test.yml up --build --exit-code-from=sut

Run test recipes using UML backend:

docker-compose -f docker/recipes-test-uml.yml up --build --exit-code-from=sut