-
Notifications
You must be signed in to change notification settings - Fork 948
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
refactor: use govendor to depend on libnetwork #1445
refactor: use govendor to depend on libnetwork #1445
Conversation
Thanks a lot for your work. This is quite important for pouch team how it will work with the latest libnetwork.
I think for the quite huge pull request, squashing is not necessary, and splitting the work into several commits would make it much easier to code review.
Could you explain more on the point above. also involve @rudyfly for communication. |
@allencloud Please take a look at contiv/executor and commit 4649d1d. We may send the patch to them or drop this package (to implement the feature we need by ourselves) later if you want. Also, I think I could use some help with the (CI) tests, thanks. |
daemon/mgr/network.go
Outdated
@@ -537,18 +536,16 @@ func (nm *NetworkManager) getNetworkSandbox(id string) libnetwork.Sandbox { | |||
return sb | |||
} | |||
|
|||
// libnetwork's logrus version is different from pouchd, | |||
// so we need to set libnetwork's logrus addintionly. | |||
func initNetworkLog(cfg *config.Config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If pouchd use the lastest libnetwork, initialize logrus is unuse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I thought about this but was not sure then.
@idealhack Thanks a lot for your work. Change |
@rudyfly I see. It's reasonable to maintain a fork if you want change many things. So after you select a suitable version of libnetwork and forked it, I will make changes in this PR. |
@idealhack I have fork |
627d187
to
67f98e3
Compare
address @rudyfly’s [comment](AliyunContainerService#1445 (comment)) Signed-off-by: Yang Li <idealhack@gmail.com>
@rudyfly I've rebased the branch. Could you check the tests? |
@idealhack Thanks for your job! You need to modify |
@rudyfly Thanks, PTAL. |
docs/test/test.md
Outdated
@@ -100,7 +100,7 @@ The following steps are also needed to make sure libnetwork package could be fou | |||
``` | |||
BUILDPATH=/tmp/pouchbuild | |||
mkdir -p $BUILDPATH/src/github.com/docker | |||
cp -r /go/src/github.com/alibaba/pouch/extra/libnetwork $BUILDPATH/src/github.com/docker/libnetwork | |||
cp -r /go/src/github.com/alibaba/pouch/vendor/github.com/docker/libnetwork $BUILDPATH/src/github.com/docker/libnetwork |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add libnetwork directory into GOPATH, it will vendor to build. I think just keep $BUILDPATH
in GOPATH
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I was not sure about this.
@@ -2,7 +2,7 @@ | |||
GOBUILD=go build | |||
GOCLEAN=go clean | |||
GOTEST=go test | |||
GOPACKAGES=$(shell go list ./... | grep -v /vendor/ | grep -v /extra/ | sed 's/^_//') | |||
GOPACKAGES=$(shell go list ./... | grep -v /vendor/ | sed 's/^_//') | |||
|
|||
# Binary name of CLI and Daemon | |||
BINARY_NAME=pouchd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make pre
in hack/build
should be deleted libnetwork into GOPATH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but what do you suggest for this line in Makefile
?
hack/build
Outdated
@@ -26,7 +26,7 @@ function pre() | |||
|
|||
mkdir -p $BUILDPATH/src/github.com/docker | |||
[ -L $BUILDPATH/src/github.com/docker/libnetwork ] && rm -f $BUILDPATH/src/github.com/docker/libnetwork | |||
ln -s $DIR/extra/libnetwork $BUILDPATH/src/github.com/docker/libnetwork | |||
ln -s $DIR/vendor/github.com/docker/libnetwork $BUILDPATH/src/github.com/docker/libnetwork |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rudyfly Is there any need for ln
?
hack/make.sh
Outdated
@@ -247,7 +247,7 @@ function target | |||
rich container related tests will be skipped" | |||
|
|||
docker run --rm -v "$(pwd):$SOURCEDIR" \ | |||
-e GOPATH=/go:$SOURCEDIR/extra/libnetwork/Godeps/_workspace \ | |||
-e GOPATH=/go:$SOURCEDIR/vendor/github.com/docker/libnetwork/Godeps/_workspace \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rudyfly Also, please take a look at this line.
This is my modify for delete |
8771c6d
to
429f4e1
Compare
@rudyfly I've checked your commit and made some modifications. |
@idealhack I think your modification is ok, but there are some ci fails, do you have ci environment to fix ci fails? |
@rudyfly Yes this is what I'm confusing about. Could anyone who contributing this project give some guidance on how to fix that? |
@idealhack OK, can you rebase master code, because I have changed network configure. |
@idealhack I have push my modification to your fork. 😃 |
@rudyfly Well done! Did you resolve those dependencies by hand? |
yes, it makes me crazy. 😭 And can you do |
@rudyfly I was just about to said how can we do this in a less tedious way... If we have a script we can check it in here. Hope it will not make us more trouble in the future. I see some commits are meanningless now. After the CI passed, I can do some squash work. |
3af70b8
to
5eb0ea3
Compare
@rudyfly I've squashed the commits, it's much cleaner now. Also, I backed up the old commits at The CI still fails. |
@idealhack could you provide the information about how to use |
@fuweid As I metioned in #1344 (comment) I found there are useless packages too. That said, AFAIK |
@idealhack I'm sorry for delaying this work, I have modified libnetwork in alibaba, Can you update the latest commit on master again? Thank you very much. |
@rudyfly Sure, here it is. Since I want to leave the record of it, I added a new commit instead of amending. |
02d67e9
to
a8c1cf2
Compare
Codecov Report
@@ Coverage Diff @@
## master #1445 +/- ##
==========================================
- Coverage 40.56% 40.45% -0.12%
==========================================
Files 254 254
Lines 16535 16527 -8
==========================================
- Hits 6708 6686 -22
- Misses 8965 8976 +11
- Partials 862 865 +3
|
Signed-off-by: Yang Li <idealhack@gmail.com>
Signed-off-by: Yang Li <idealhack@gmail.com>
The adding command is `govendor add github.com/docker/libnetwork/^::github.com/alibaba/libnetwork` Signed-off-by: Yang Li <idealhack@gmail.com>
Signed-off-by: Yang Li <idealhack@gmail.com>
Signed-off-by: Yang Li <idealhack@gmail.com>
Signed-off-by: Rudy Zhang <rudyflyzhang@gmail.com>
1. `go get -u github.com/alibaba/libnetwork` 2. `govendor update github.com/docker/libnetwork/...::github.com/alibaba/libnetwork@04a77bdbfb6f51185791ee3d61e3644f058e6b21` Signed-off-by: Yang Li <idealhack@gmail.com>
a8c1cf2
to
a9fa255
Compare
CI tests passing after I rebased on master 🎉 We can now verify if this is what we need. Also, I've updated the description, PTAL. |
@idealhack Fantastic! 🍺🍺 LGTM |
Thanks for your work, and it is quite important for PouchContainer @idealhack |
Ⅰ. Describe what this PR did
Use govendor to depend on alibaba/libnetwork.
Ⅱ. Does this pull request fix one issue?
this pull request should fixes #1344, but some issues with
vendor.json
raised there were not addressed yet, see #1344 (comment)Ⅲ. Describe how you did it
As the commits show:
initNetworkLog
functionextra/libnetwork
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
I'm new to pouch, so please tell me if I missing anything.