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

Makefile: initial commit #8628

Merged
merged 5 commits into from
Oct 5, 2017
Merged

Makefile: initial commit #8628

merged 5 commits into from
Oct 5, 2017

Conversation

gyuho
Copy link
Contributor

@gyuho gyuho commented Sep 29, 2017

For #8502.

First step to make DNS/SRV tests easier to run.

@gyuho gyuho force-pushed the makefile branch 2 times, most recently from e8f2a5c to b8871c4 Compare September 29, 2017 14:53
@gyuho gyuho requested review from xiang90 and fanminshi September 29, 2017 19:32
@gyuho gyuho force-pushed the makefile branch 4 times, most recently from e96bb2d to 7aa1522 Compare October 3, 2017 11:19
@gyuho gyuho changed the title Makefile: initial commit with 'docker-dns-test' Makefile: add 'docker-dns-test' Oct 3, 2017
@gyuho gyuho force-pushed the makefile branch 5 times, most recently from c66caa4 to c14ad35 Compare October 4, 2017 17:47
@gyuho gyuho changed the title Makefile: add 'docker-dns-test' Makefile: initial commit Oct 4, 2017
@gyuho
Copy link
Contributor Author

gyuho commented Oct 4, 2017

@xiang90 @fanminshi Please review. This is an initial step to test etcd with DNS/SRV (helpful for debugging issues like #8608).

Also Makefile is needed to make test commands more consistent between different releases.
For every minor release, we just update the GO_VERSION string while keeping the same test command make docker-test.

Currently, we hard-code Go version for all branches in CIs, so it is impossible to test with correct Go versions.

@gyuho gyuho force-pushed the makefile branch 3 times, most recently from b7dc10f to 9c100ff Compare October 5, 2017 14:23
gyuho added 3 commits October 5, 2017 09:47
Initial commit to run DNS/SRV tests.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
@@ -0,0 +1,145 @@
.PHONY: build
Copy link
Member

Choose a reason for hiding this comment

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

keep this # run makefile from repo root?

Makefile Outdated
--volume=`pwd`/bin:/etcd \
--volume=`pwd`/integration/fixtures:/certs \
gcr.io/etcd-development/etcd-dns-test:$(_GO_VERSION) \
/bin/bash -c "pushd /etcd && /run.sh && rm -rf m*.etcd && popd"
Copy link
Member

Choose a reason for hiding this comment

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

maybe use cd instead of pushd?

Makefile Outdated
--rm \
--volume=`pwd`/:/etcd \
gcr.io/etcd-development/etcd-test:$(_GO_VERSION) \
/bin/bash -c "pushd /etcd && GO_BUILD_FLAGS=-v ./build && ./bin/etcd --version"
Copy link
Member

Choose a reason for hiding this comment

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

s/pushd/cd/ ?

@fanminshi
Copy link
Member

lgtm after nits

gyuho added 2 commits October 5, 2017 09:48
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
@gyuho gyuho merged commit 75a51f7 into etcd-io:master Oct 5, 2017
@gyuho gyuho deleted the makefile branch October 5, 2017 16:58
@jpbetz
Copy link
Contributor

jpbetz commented Oct 6, 2017

@gyuho Having some trouble with this docker build:

$ make docker-dns-srv-test-build
docker build \
	  --tag gcr.io/etcd-development/etcd-dns-srv-test:go1.9.1 \
	  --file ./e2e/docker-dns-srv/Dockerfile \
	  ./e2e/docker-dns-srv
...
Successfully built 46d8c5294e3f
docker run \
	  --rm \
	  --dns 127.0.0.1 \
	  gcr.io/etcd-development/etcd-dns-srv-test:go1.9.1 \
	  /bin/bash -c "/etc/init.d/bind9 start && cat /dev/null >/etc/hosts && dig +noall +answer SRV _etcd-client-ssl._tcp.etcd.local && dig +noall +answer SRV _etcd-server-ssl._tcp.etcd.local && dig +noall +answer m1.etcd.local m2.etcd.local m3.etcd.local"
WARNING: Localhost DNS setting (--dns=127.0.0.1) may fail in containers.
Starting domain name service...: bind9 failed!
make: *** [docker-dns-srv-test-build] Error 1
$ docker --version
Docker version 1.12.6, build 78d1802

Still working on getting more detailed logging from a bind9 init.d start failure.

Any idea what might be wrong?
What version of docker where you running this with?

@gyuho
Copy link
Contributor Author

gyuho commented Oct 6, 2017

@jpbetz Hmm works for me?

Docker version 17.09.0-ce, build afdb6d4

go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/gyuho/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/1x/0sf85stn6sb01sx6ncs7x_ph0000gn/T/go-build867045777=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

@jpbetz
Copy link
Contributor

jpbetz commented Oct 6, 2017

@gyuho What version of bind9 did apt install for you?

$ docker run gcr.io/etcd-development/etcd-dns-srv-test:go1.9.1 apt show bind9 2>/dev/null
Package: bind9
Version: 1:9.10.3.dfsg.P4-12.3+deb9u3
...

@gyuho
Copy link
Contributor Author

gyuho commented Oct 6, 2017

Looks same

docker run gcr.io/etcd-development/etcd-dns-srv-test:go1.9.1 apt show bind9 2>/dev/null
Package: bind9
Version: 1:9.10.3.dfsg.P4-12.3+deb9u3
...

?

Maybe docker issue...? Have you tried running with sudo if you run on Linux?

@gyuho
Copy link
Contributor Author

gyuho commented Oct 6, 2017

Works in my GCP VM too.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.3 LTS
Release:	16.04
Codename:	xenial

$ docker --version
Docker version 17.09.0-ce, build afdb6d4

$ uname -a
Linux gyuho-fast 4.10.0-35-generic #39~16.04.1-Ubuntu SMP Wed Sep 13 09:02:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

@jpbetz
Copy link
Contributor

jpbetz commented Oct 6, 2017

@gyuho It's something with that older docker version. Networking maybe? Everything works with a more recent one. I'm all set now. Thanks!

@xiang90
Copy link
Contributor

xiang90 commented Oct 6, 2017

@gyuho @jpbetz

probably the build script should check docker version then? or it would confuse other people too :P.

@jpbetz
Copy link
Contributor

jpbetz commented Oct 7, 2017

@xiang90 Absolutely. I've figured out the incompatibility and submitted a fix (#8661) for the docker files.


# build base container image for testing on Linux
docker-test-build:
docker build --tag gcr.io/etcd-development/etcd-test:$(_GO_VERSION) --file ./Dockerfile-test .
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll need to have some way to distinguish the docker image architecture. Maybe something like gcr.io/etcd-development/etcd-test:$(_GO_VERSION)-$(ARCH)., and also have arch specific docker files.

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

Successfully merging this pull request may close these issues.

5 participants