Closed Bug 1353770 Opened 7 years ago Closed 7 years ago

Update docker-py to docker 2.2.1 or higher

Categories

(Developer Services :: General, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Pike, Assigned: gps)

Details

Attachments

(2 files)

I figured I'd give it a shot to upgrade the docker python library in vct, and see if that makes me a more happy camper.

I'm getting further, but I'm stuck building hgweb.

I'm also not sure if I break other things on the way, most notably, I'm hardcoding that docker listens on localhost for the rsync stuff to work. Seems that at least docker-for-mac doesn't expose the bridge gateway IP on the host, so rsync times out.

I did look a bit on the network details, see the paste below, but nothing stood out that I could use to find out that I should be talking to localhost. Maybe that's good these days, now that the explicit docker-machine isn't a thing anymore on mac and win?

[
    {
        "Name": "bridge",
        "Id": "79ee934aad9f77a1cd0b6490b8f1a15cfd1c928cb3c862a235f1ab4cf35f7774",
        "Created": "2017-04-04T17:09:50.692019387Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.17.0.0/16",
                    "Gateway": "172.17.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Containers": {},
        "Options": {
            "com.docker.network.bridge.default_bridge": "true",
            "com.docker.network.bridge.enable_icc": "true",
            "com.docker.network.bridge.enable_ip_masquerade": "true",
            "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
            "com.docker.network.bridge.name": "docker0",
            "com.docker.network.driver.mtu": "1500"
        },
        "Labels": {}
    }
]
This is stdout from ./d0cker build-hgmo, failing to find a bunch of servers on hgweb.
glob may be interested in this patch, since I think you and him and running into similar rsync problems.
I flagged this patch for review, but I kinda doubt is really done, given that I still fail on stuff locally.

Also, the update to the docker python library is a bit funky, as it changed name. You probably need to explicitly uninstall docker-py and then pip install docker. No idea how to do that automagically.
Comment on attachment 8854926 [details]
bug 1353770, update docker-py to docker 2.2.1,

https://reviewboard.mozilla.org/r/126850/#review135956

Everything except the gateway change looks OK. Although I didn't give it too much scrutiny.

There are also some consumers of the raw Docker client in testing/vcttesting/hgmo.py which will presumably also need updated.

::: testing/vcttesting/docker.py:231
(Diff revision 1)
> -            networks = self.client.networks()
> +            networks = self.client.api.networks()
>              for network in networks:
>                  if network['Name'] == 'bridge':
>                      ipam = network['IPAM']
>                      try:
> -                        addr = ipam['Config'][0]['Gateway']
> +                        addr = '127.0.0.1'

I'm pretty sure we can't make this change because it breaks environments where Docker isn't running its bridge network on 127.0.0.1.
Attachment #8854926 - Flags: review?(gps) → review-
It'd be nice to have this.
Flags: needinfo?(gps)
I'll land patches to do the upgrade shortly.

If you are still having problems with networking after the upgrade, please open a new bug. Let's keep this bug to track the docker Python package upgrade.
Assignee: nobody → gps
Status: NEW → ASSIGNED
Flags: needinfo?(gps)
Pushed by gszorc@mozilla.com:
https://hg.mozilla.org/hgcustom/version-control-tools/rev/283a174220ae
testing: upgrade docker-py==1.10.6 to docker==2.0.2 
https://hg.mozilla.org/hgcustom/version-control-tools/rev/0123eb3dfe16
testing: update docker==2.0.2 to docker==2.5.1
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: