Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Docker Personality to support Docker API 1.25 [full ci] #3756

Merged
merged 2 commits into from
Feb 14, 2017

Conversation

sflxn
Copy link
Contributor

@sflxn sflxn commented Jan 27, 2017

  1. Updated vendored sources to support Docker 1.13
  2. Updated all the backend interfaces within
    vic/lib/apiservers/backends
  3. Added hollowed out swarm.go and backends/exec/SwarmBackend.go
  4. Updated main.go
  5. Added robot scripts for docker secret, checkpoint, deploy, node,
    plugin, service, stack, swarm.

resolves #3415

@sflxn sflxn changed the title [WIP] Update Docker Personality to support Docker API 1.25 [skip ci] [WIP] Update Docker Personality to support Docker API 1.25 [full ci] Jan 28, 2017
@@ -24,8 +24,8 @@ import (

log "github.com/Sirupsen/logrus"

"github.com/docker/distribution/digest"
derr "github.com/docker/docker/errors"
// "github.com/docker/distribution/digest"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove it?

@@ -84,7 +85,7 @@ type VicContainerProxy interface {
CommitContainerHandle(handle, containerID string, waitTime int32) error
StreamContainerLogs(name string, out io.Writer, started chan struct{}, showTimestamps bool, followLogs bool, since int64, tailLines int64) error

Stop(vc *viccontainer.VicContainer, name string, seconds int, unbound bool) error
Stop(vc *viccontainer.VicContainer, name string, seconds *int, unbound bool) error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why pointer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is Docker's change.

@@ -711,11 +712,20 @@ func (c *ContainerProxy) AttachStreams(ctx context.Context, vc *viccontainer.Vic
plClient, transport := c.createNewAttachClientWithTimeouts(attachConnectTimeout, 0, attachAttemptTimeout)
defer transport.Close()

keys := []byte{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this case it cases memory allocation. Try to use "var keys []byte"

@@ -129,3 +129,9 @@ func (e *endpoint) Address() *net.IPNet {
func (e *endpoint) AddressIPv6() *net.IPNet {
return nil
}

// DisableService removes a managed contianer's endpoints from the load balancer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is definitely invalid. Could you fix it?

import (
"io"
"time"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove empty line here.

@sflxn sflxn force-pushed the update_api_1.25 branch 4 times, most recently from d981394 to fd90e5a Compare January 30, 2017 22:58
@vburenin
Copy link
Contributor

Let me know when you need review.

@sflxn
Copy link
Contributor Author

sflxn commented Feb 1, 2017

@vburenin Sure thing. I still need to get networking fully working and write robot scripts to verify we don't croak on swarm, checkpoint, build, and plugin calls.

Copy link
Contributor

@mdubya66 mdubya66 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve this vendor rev

@sflxn sflxn force-pushed the update_api_1.25 branch 5 times, most recently from df24972 to 8a4a503 Compare February 3, 2017 20:31
@sflxn sflxn force-pushed the update_api_1.25 branch 2 times, most recently from 3521f72 to b74444d Compare February 10, 2017 21:46
@sflxn sflxn changed the title [WIP] Update Docker Personality to support Docker API 1.25 [full ci] Update Docker Personality to support Docker API 1.25 [full ci] Feb 10, 2017
@sflxn sflxn requested a review from hickeng February 10, 2017 22:32
@@ -0,0 +1,40 @@
// Copyright 2016 VMware, Inc. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is 2017 outside, at least it was so yesterday ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch :)

}

func (b SwarmBackend) CreateManagedNetwork(clustertypes.NetworkCreateRequest) error {
return nil
Copy link
Member

@hickeng hickeng Feb 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I correct in assuming that we have to make this a noop instead an "unsupported" error?
Same question for the other operations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker called it a "backend," but it's not a REST router backend. The actual REST router backend is in lib/apiservers/engine/backends/swarm.go.

@@ -183,10 +182,10 @@ func (ic *ICache) Get(idOrRef string) (*metadata.ImageConfig, error) {
return copyImageConfig(config), nil
}

func (ic *ICache) getImageByDigest(digest digest.Digest) *metadata.ImageConfig {
func (ic *ICache) getImageByDigest(digest string) *metadata.ImageConfig {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this change to signature needed - from just this commit it looks like the original code cast it to string where needed and it's got to be a string type anyway given the comparison on line 167

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot remember why I did this. I remember it was to get around a build issue, but that was before 1.13 officially got released. With the updated vendored files, the old signature works so I reverted it back.

Copy link
Member

@hickeng hickeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't notice any issues from a scan - would like someone else to look through it as well. I've not confirmed function.

@sflxn sflxn requested a review from jzt February 10, 2017 23:50
@hmahmood
Copy link
Contributor

hmahmood commented Feb 13, 2017

Does this fix #3712 too?

@hmahmood
Copy link
Contributor

nvm ... I guess you left the networking part out.

@sflxn
Copy link
Contributor Author

sflxn commented Feb 14, 2017

@hmahmood Yeah, I left it out. Before fully hooking up the cluster management code, I wanted to see if minimally hooking it up would pass our integration tests so we can avoid unnecessary work.

package backends

import (
"fmt"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: indent is short

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -20,6 +20,7 @@ import (
"github.com/docker/docker/pkg/stringid"
"github.com/docker/libnetwork"
"github.com/docker/libnetwork/types"
// "k8s.io/minikube/pkg/minikube/notify"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if you left this on purpose, just bringing it to your attention :)

Should Be Equal As Integers ${rc} 1
Should Contain ${output} does not yet support plugins

#Docker plugin create
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need/want this test? Could we maybe pass & warn or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed that test.

@@ -1,4 +1,4 @@
// Copyright 2016-2017 VMware, Inc. All Rights Reserved.
// Copyright 2016 VMware, Inc. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you accidentally removed the copyright

@@ -166,6 +166,7 @@ func (ic *ICache) Get(idOrRef string) (*metadata.ImageConfig, error) {
var config *metadata.ImageConfig
if imgDigest != "" {
config = ic.getImageByDigest(imgDigest)
// config = ic.getImageByDigest(string(imgDigest))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented code

"github.com/docker/engine-api/types/registry"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/backend"
// "github.com/docker/docker/api/types/container"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented import

@@ -184,6 +185,7 @@ func (ic *ICache) Get(idOrRef string) (*metadata.ImageConfig, error) {
}

func (ic *ICache) getImageByDigest(digest digest.Digest) *metadata.ImageConfig {
// func (ic *ICache) getImageByDigest(digest string) *metadata.ImageConfig {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented code

@jzt
Copy link
Contributor

jzt commented Feb 14, 2017

LGTM

Approved with PullApprove

@sflxn sflxn force-pushed the update_api_1.25 branch 3 times, most recently from 428ddc2 to 4f6dbfd Compare February 14, 2017 03:39
@sflxn sflxn requested review from emlin and mhagen-vmware February 14, 2017 03:40
Copy link
Contributor

@emlin emlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

sflxn added 2 commits February 14, 2017 10:25
The following are vendored source changes.  The term rolled up
means the nested vendored version of a repo within VIC's top
level vendored sources were removed in favor of VIC's to avoid
golang's namespace collision.  For example,

	vic/vendor/github.com/docker/distribution
	vic/vendor/github.com/docker/docker/vendor/github.com/docker/distribution

In the above example, the second repo was removed.

1. Updated github.com/docker/docker to 1.13.
2. Updated github.com/docker/distribution to 28602af35aceda2f8d571bad7ca37a54cf0250bc
	-- rolled up ditribution in docker/docker
3. Updated github.com/docker/libtrust     to 9cbd2a1374f46905c68a4eb3694a130610adc62a
        -- rolled up libtrust in docker/docker
	-- rolled up libtrust in docker/distribution
4. Updated github.com/docker/swarmkit     to 335561b66a44bf214224afe879e4368204e7fa45
        -- rolled up swarmkit in docker/docker
5. Updated github.com/Sirupsen/logrus     to v0.11.0
        -- rolled up logrus in docker/docker
        -- rolled up logrus in docker/swarmkit
6. Updated google.golang.org/grpc         to v1.0.2
        -- rolled up in docker/docker
        -- rolled up in docker/swarmkit
7. github.com/golang/protobuf             to 1f49d83d9aa00e6ce4fc8258c71cc7786aec968a
8. github.com/vishvananda/netns           to 604eaf189ee867d8c147fafc28def2394e878d25
        -- rolled up in docker/docker
9. github.com/vishvananda/netlink         to 482f7a52b758233521878cb6c5904b6bd63f3457
        -- rolled up in docker/docker
10. Rolled up go-connections in docker/docker
11. Rolled up github.com/golang/x/net/context in docker/docker and docker/swarmkit
1. Updated all the backend interfaces within
   vic/lib/apiservers/backends
2. Added hollowed out swarm.go and backends/exec/SwarmBackend.go
3. Updated main.go
4. Added robot scripts for docker secret, checkpoint, deploy, node,
   plugin, service, stack, swarm.
Copy link
Contributor

@mhagen-vmware mhagen-vmware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update docker personality to accept API versions > 1.23
9 participants