Write a DockerMixin for mozharness



4 years ago
4 years ago


(Reporter: mrrrgn, Assigned: mrrrgn)


Firefox Tracking Flags

(Not tracked)




4 years ago
This should be something like the existing MockMixin -- except, for docker. :)


4 years ago
Assignee: nobody → winter2718
Blocks: 1129789
we are trying to stray away from mixins as we are in mixin overload or so python's MRO suggests for some scripts.

So, as a minor change, would it be possible to make 'class DockerMixin' more like 'class Docker' where scripts can create standalone objects? for reference: https://bugzil.la/1063532

Comment 2

4 years ago
Is there any python package that allows you to do what you need?
If so, we could add it to the dependencies :)

Comment 3

4 years ago
(In reply to Armen Zambrano - Automation & Tools Engineer (:armenzg) from comment #2)
> Is there any python package that allows you to do what you need?
> If so, we could add it to the dependencies :)

This is the one that fits the bill: https://github.com/docker/docker-py
I have a lot of experience using docker-py inside version-control-tools.

Here's the 60s version that will save you possibly hours of pulling out your own hair.

The Docker CLI is just a thin shim around the Docker Remote API (https://docs.docker.com/reference/api/docker_remote_api_v1.16/). Unfortunately, verbs/commands in the Docker CLI sometimes mean different things in the Remote API world! docker-py speaks the Remote API, so if you assume docker-py functions with the same name as CLI commands are the same thing, you would be wrong.

Read the Remote API docs. Then attempt to use docker-py. Assume a docker-py method is a proxy for a Remote API, not a CLI command.

At your own risk, consult https://hg.mozilla.org/hgcustom/version-control-tools/file/b1fbfc11f837/testing/vcttesting/docker.py or ping me for any docker-py pointers. I've found a number of bugs in docker-py. Things around the transport protocol (like streaming and TLS) are particularly fragile. Simple container management should work just fine though.

Comment 5

4 years ago
So, I think I _may_ have jumped the gun on this. I have been able to modify transforming mozharness configs into docker containers with just jinja2: https://github.com/mrrrgn/build-mozilla-build-environments/blob/master/utils/compile_mozharness_config/compile_mozharness_config.py The rest of the steps I need to publish containers are just generic bash commands.

Comment 6

4 years ago
This no longer appears necessary.
Last Resolved: 4 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.