[SDKs] Port arv-keepdocker to use the docker-py library
Currently arv-keepdocker works by subprocessing the
docker CLI tool and parsing the output. Port it to stop doing that, and instead use the docker-py module to talk to the Docker daemon directly over the REST API and get objects back.
Reasons to do this:
- The CLI has changed interfaces before in ways that break arv-keepdocker. (e.g., #4196) This would be more resilient.
- The client can specify which version of the API it wants to talk, making it even more resilient as Docker itself gets upgraded (which is often).
- IPC is always rickety. This would be more resilient to different user environments and enable better error reporting.
- docker-py is maintained by the Docker team, and we already use it with no major isseus in dockercleaner, so it's a pretty safe dependency.
The branch should only rewire arv-keepdocker internally. You'll also need to declare the dependency in
run-build-packages.sh. No UI changes should be needed.
#3 Updated by Brett Smith over 4 years ago
- Subject changed from [SDKs] [Maybe] Port arv-keepdocker to use the docker-py library to [SDKs] Port arv-keepdocker to use the docker-py library
- Description updated (diff)
Discussed with Tom. It's not a slam dunk decision but right now the scales seem to tip toward revamping the Python client over rewriting it in Go. If we did the latter, we would have to reimplement all the "find the right Docker image" logic, and come up with patterns and documentation to help people install client software on unsupported distributions, or systems where they don't have root. Now's not a good time for that.