[Windows docker] Move join handling from Create Endpoint to Join

Bug #1778671 reported by Michał Kostrzewa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
In Progress
Undecided
Michał Kostrzewa
Trunk
Won't Fix
Undecided
Michał Kostrzewa
OpenContrail
Won't Fix
Undecided
Unassigned

Bug Description

Currently, when docker daemon sends a CreateEndpoint request to docker driver, it immediately assings it to network and sends AddPort to vRouter Agent. This may lead to race conditions.

Instead, it should be done in JoinNetwork handler.

This change requires some refactors in core/driver module to be able to implement new unit tests.

Tags: windows
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/44121
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44123
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44126
Submitter: Michal Kostrzewa (<email address hidden>)

Jeba Paulaiyan (jebap)
tags: added: windows
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44121
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44123
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44126
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44188
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44189
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/44121
Committed: http://github.com/Juniper/contrail-windows-docker-driver/commit/be77379f66a6af513c379202918fa6c98580bb34
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit be77379f66a6af513c379202918fa6c98580bb34
Author: Michal Kostrzewa <email address hidden>
Date: Tue Jun 26 11:34:35 2018 +0200

Extract LocalContrailnetworkRepository interface.

This change extracts the old hnsManager logic as a separate adapter. It
brins us closer to pure core/driver module.

hnsManager package used to be responsible for creating HNS networks that
are associated with Contrail subnets.

Packaging:
* Create adapters/secondary/local_networking
* Create adapters/secondary/local_networking/simulator. Simulated HNS
and related code can be implemented there.
* Move everything under adapters/secondary/hns to
adapters/secondary/local_networking/hns - this is the actual HNS
implementation

Tests:
* Move old hnsManager integration tests to hns_test package, and
subsequently into the same hns_test.go file. This is because ginkgo
can't handle multile *_test.go files in the same package, it seems.

Partial-Bug: #1778671
Change-Id: Ieaedc0bb1604f4f59f852c7b9f14025bf034a30c

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/44123
Committed: http://github.com/Juniper/contrail-windows-docker-driver/commit/ecbfc5bbd5a6138969b61c2c839c4e8db6080b2d
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit ecbfc5bbd5a6138969b61c2c839c4e8db6080b2d
Author: Michal Kostrzewa <email address hidden>
Date: Tue Jun 26 12:16:09 2018 +0200

Refactor LocalContrailEndpointRepository.

Changes towards pureness of core/driver.

A thin wrapper around HNS is introduced. This makes it easier to
subsitute a fake implementation in future core/driver tests (in
driver_test.go).

Change-Id: Id7531eeb238808439121517ec488acca322e8732
Partial-Bug: #1778671

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/44192
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44198
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/44126
Committed: http://github.com/Juniper/contrail-windows-docker-driver/commit/a61735f55c69f1548977d19ed0daa9c0da5d75a4
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit a61735f55c69f1548977d19ed0daa9c0da5d75a4
Author: Michal Kostrzewa <email address hidden>
Date: Tue Jun 26 13:06:07 2018 +0200

Remove any references to HNS from core/driver.

More changes towards making core/driver pure.

* Move reponsibility for initializing root HNS network to HNS network
repository.
* Remove any mention of physical network adapter names in core/driver.

Change-Id: Id49e472cdc74f671c7dbf0325daec5e536f9965e
Partial-Bug: #1778671

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/44314
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44188
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44189
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44198
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44188
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/44188
Committed: http://github.com/Juniper/contrail-windows-docker-driver/commit/a6e2495477efd29815db4e4e65ea6d295edbeeb9
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit a6e2495477efd29815db4e4e65ea6d295edbeeb9
Author: Michal Kostrzewa <email address hidden>
Date: Thu Jun 28 11:45:35 2018 +0200

Implement CreateNetworkWithSubnet

This method of Controller interface is being used a lot in
driver_test.go.

Change-Id: I594b5e60686c83be1960620e3e4af4d9ebaa174b
Partial-Bug: #1778671

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/44189
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44192
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44198
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44189
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44192
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44314
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44198
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/44189
Committed: http://github.com/Juniper/contrail-windows-docker-driver/commit/1cf5a7d92573fd867ea4a946ea700ed1a5d60ce4
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit 1cf5a7d92573fd867ea4a946ea700ed1a5d60ce4
Author: Michal Kostrzewa <email address hidden>
Date: Thu Jun 28 11:49:04 2018 +0200

Implement InMemContrailNetworksRepository stubs.

They will be used extensively in driver_test.go.

Change-Id: Ie23c1318dca0c7858d69fd3a729643bf44176658
Partial-Bug: #1778671

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/44192
Committed: http://github.com/Juniper/contrail-windows-docker-driver/commit/9cc0b694e86adffdb8ad433e212f7604fbd051f6
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit 9cc0b694e86adffdb8ad433e212f7604fbd051f6
Author: Michal Kostrzewa <email address hidden>
Date: Thu Jun 28 12:53:48 2018 +0200

Move all ports in driver/ to one file.

This change moves every port interface into one place. This makes it
possible to see what the core logic interfaces with at a glance.

Change-Id: I00c78a4b8908aac91ec87e268eb1b57ad5709321
Partial-Bug: #1778671

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/44198
Committed: http://github.com/Juniper/contrail-windows-docker-driver/commit/f73c0f84f874c1700ecab3c1a0e4ae0701a39cf5
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit f73c0f84f874c1700ecab3c1a0e4ae0701a39cf5
Author: Michal Kostrzewa <email address hidden>
Date: Thu Jun 28 16:14:04 2018 +0200

Extract adapters/primary/docker_libnetwork_plugin.

Move most of pure logic into core/driver_core (name subject to change).
Move over CreateNetwork test as well.

Move pipe handling and the rest of handlers (for now) to
adapters/primary/docker_libnetwork_plugin.

Rename structs accordingly.

Change-Id: I396ad26f31846e775ccc1c5f4be2a9cabd0c59a7
Partial-Bug: #1778671

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/44314
Submitter: Michal Kostrzewa (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/44314
Committed: http://github.com/Juniper/contrail-windows-docker-driver/commit/ad77e134aea7761bc005f8f622d239ea71014f6f
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit ad77e134aea7761bc005f8f622d239ea71014f6f
Author: Michal Kostrzewa <email address hidden>
Date: Tue Jul 3 13:19:02 2018 +0200

Refactor out CreateEndpoint method.

CreateEndpoint touches many different parts of the codebase, so the
refactors are surprisingly extensive.

* Create a facade for Controller to try and shrink the Controller port
interface. It's still WIP (needs to be done gradually when refactoring
other handlers), but I belive it's a step in the right direction.
* Refactor CreateEndpoint by simplifying the way it calls its
collaborators. Move it to driver_core package.
* Fixed fake controller implementation by using
contrail-go-api Interceptors to mimic the actual API server behaviour of
assigning Default GW, MAC and IPs. This accidentally fixed two
controlelr_test.go tests. Oops.

Change-Id: I8a4f9dbdd390f7167409689cd2ae6c204b0a3edb
Partial-Bug: #1778671

Changed in opencontrail:
status: New → Won't Fix
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.