Revamp Metabox Source Container (formerly known as Venv Container) (#305)
* Rework the Source Container Machine
The ContainerVenvMachine class used python virtual environments to
install Checkbox inside a container. It is renamed
ContainerSourceMachine and now deploys Checkbox directly into the
container using pip.
It now handles the creation of a systemd service, so that the service
container can be restarted, it will become reachable as soon as the
container is up.
It also copies over the following providers, so they can be used in
scenarios:
- base
- resource
- certification-client
Note that since Checkbox is now a monorepo, the `uri` parameter of the
configuration file has to point to the root of the Checkbox monorepo and
not to the checkbox-ng directory.
The configuration to use the source container is:
configuration = {
'local': {
'origin': 'source',
'uri': '/path/to/checkbox',
'releases': ['focal', 'jammy'],
},
'remote': {
'origin': 'source',
'uri': '/path/to/checkbox',
'releases': ['focal'],
},
'service': {
'origin': 'source',
'uri': '/path/to/checkbox',
'releases': ['focal'],
},
}
* Add debugging info to Metabox
* Remove unnecessary parentheses in some Metabox modules
* Add jq as a dependency
jq is required for some JSON attachment jobs.
* Exit with error message if pylxd cannot create a client
* Send content of service directly in the container
Use textwrap.dedent() to prepare the content of the service file in a
more readable way, and put this content into a file directly instead of
relying on a bash command to avoid having to deal with escaping special
characters.
* Pass exception message (if any) when ClientConnectionFailed raised