Ability to build container against docker swarm

Bug #1779460 reported by Victor Coutellier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla
Fix Released
Undecided
Victor Coutellier

Bug Description

I wan't to build my kolla container using a corporate docker swarm environment to push resulting container into a DTR.

However, in recent swarm environment, docker API doesn't return clear JSON when using this code in kolla/images/build.py :

for response in self.dc.build(path=image.path,
                              tag=image.canonical_name,
                              nocache=not self.conf.cache,
                              rm=True,
                              network_mode=self.conf.network_mode,
                              pull=pull,
                              forcerm=self.forcerm,
                              buildargs=buildargs):

The "response" of is line is truncated, by exemple :
    '{"stream":"'

Then this line in kolla will fail with an error decoding the JSON
                stream = json.loads(response.decode('utf-8'))

There is an option to force json decoding in modern version of docker sdk : http://docker-py.readthedocs.io/en/stable/api.html#module-docker.api.build

This option is already used earlier in the code when pushing to a registry, so there must be no problem to use it here too.

Changed in kolla:
assignee: nobody → Victor Coutellier (alistarle)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla (master)

Fix proposed to branch: master
Review: https://review.openstack.org/579337

Changed in kolla:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla (master)

Reviewed: https://review.openstack.org/579337
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=f53fcc7e5b250118830615a90cc1675032ffd2aa
Submitter: Zuul
Branch: master

commit f53fcc7e5b250118830615a90cc1675032ffd2aa
Author: Victor Coutellier <email address hidden>
Date: Sat Jun 30 08:32:37 2018 -0400

    Ability to build container against docker swarm

    Add a decode=True option during call to dockerAPI in order
    to build container against recent docker swarm.

    Closes-Bug: #1779460
    Change-Id: I48f041e7ed9dd5a5f410b4eaa081f6f013119d17

Changed in kolla:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla 7.0.0.0b3

This issue was fixed in the openstack/kolla 7.0.0.0b3 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.