Chaffelson / nipyapi

A convenient Python wrapper for Apache NiFi
Other
245 stars 76 forks source link

start_docker_containers always pulls even if an image exists locally #76

Closed rbramley closed 6 years ago

rbramley commented 6 years ago

Description

start_docker_containers always pulls an image even if it exists locally. This is inefficient (e.g. apache/nifi:1.7.1 is 1.72GB) and painful on slow connections.

What I Did

nipyapi.utils.start_docker_containers(
    d_containers,
    d_network_name
)

Urgency

Not urgent, have patched utils.py locally to try d_client.images.get(image) before falling back to pulling.
Will create a branch and send a pull request.

Chaffelson commented 6 years ago

This is a good change, I'll look for your PR. Thanks!

Chaffelson commented 6 years ago

As I'm doing a run on updates today, I've added a fix for this: https://github.com/Chaffelson/nipyapi/commit/860b9aed576392c7c1667f5960eb735f60043109

rbramley commented 6 years ago

Looks good, was just sorting out a virtualenv for a PR...

I'd also followed the get on line 349 with log.info("Using local image for %s", image).

Chaffelson commented 6 years ago

Good call, adding that now - Thanks!