This should be something like the existing MockMixin -- except, for docker. :)
Assignee: nobody → winter2718
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
Is there any python package that allows you to do what you need? If so, we could add it to the dependencies :)
(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.
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.
This no longer appears necessary.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.