From a01868e85e8a1c44fd4a18762fe6d421e705cdf9 Mon Sep 17 00:00:00 2001 From: Tiago Katcipis Date: Thu, 18 Jan 2018 21:46:48 -0200 Subject: [PATCH 1/6] Add Go only on a dev imagem instead of prod --- Dockerfile | 2 +- Makefile | 18 +++++++++++------- hack/Dockerfile | 11 +++++++++++ hack/run-tty.sh | 2 +- hack/run.sh | 2 +- 5 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 hack/Dockerfile diff --git a/Dockerfile b/Dockerfile index 41477b2..7ce7122 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM neowaylabs/klbdeps:0.3 +FROM neowaylabs/klbdeps:latest COPY ./aws ${NASHPATH}/lib/klb/aws COPY ./azure ${NASHPATH}/lib/klb/azure diff --git a/Makefile b/Makefile index e3fae31..6556562 100644 --- a/Makefile +++ b/Makefile @@ -21,13 +21,17 @@ image: export TERMINFO="" docker build . -t neowaylabs/klb:$(version) +imagedev: image + export TERMINFO="" + docker build . -f ./hack/Dockerfile -t neowaylabs/klbdev:$(version) + credentials: image guard-sh guard-subscription guard-service-principal guard-service-secret - docker run -ti --rm -v `pwd`:/credentials -w /credentials neowaylabs/klb:$(version) \ + docker run -ti --rm -v `pwd`:/credentials -w /credentials neowaylabs/klbdev:$(version) \ /credentials/tools/azure/getcredentials.sh \ $(sh) "$(subscription)" "$(service-principal)" "$(service-secret)" createsp: image guard-subscription-id guard-service-principal guard-service-secret - docker run -ti --rm -v `pwd`:/createsp -w /createsp neowaylabs/klb:$(version) \ + docker run -ti --rm -v `pwd`:/createsp -w /createsp neowaylabs/klbdev:$(version) \ /createsp/tools/azure/createsp.sh \ "$(subscription-id)" "$(service-principal)" "$(service-secret)" @@ -60,20 +64,20 @@ cpu=10 gotest=go test -v ./tests/azure -parallel $(parallel) -cpu $(cpu) gotestargs=-args -logger $(logger) -test: image +test: imagedev ./hack/run.sh nash ./azure/vm_test.sh -test-integration: image +test-integration: imagedev ./hack/run.sh $(gotest) -timeout $(integration_timeout) -run=$(run) ./... $(gotestargs) -test-examples: image +test-examples: imagedev ./hack/run.sh $(gotest) -timeout $(examples_timeout) -tags=examples -run=TestExamples $(gotestargs) # It is recommended to use this locally. It takes too much time for the CI -test-all: test +test-all: testdev ./hack/run.sh $(gotest) -timeout $(all_timeout) -tags=examples $(gotestargs) -cleanup: image +cleanup: imagedev ./hack/run-tty.sh ./tools/azure/cleanup.sh testhost: diff --git a/hack/Dockerfile b/hack/Dockerfile new file mode 100644 index 0000000..8c50cc0 --- /dev/null +++ b/hack/Dockerfile @@ -0,0 +1,11 @@ +FROM neowaylabs/klb + +ENV GO_VERSION="1.9" +ENV GOROOT="/go" +ENV PATH=${PATH}:${GOROOT}/bin + +RUN cd /tmp && \ + wget https://storage.googleapis.com/golang/go$GO_VERSION.linux-amd64.tar.gz && \ + tar -xvf go$GO_VERSION.linux-amd64.tar.gz && \ + mkdir -p $GOROOT && \ + mv ./go/* $GOROOT diff --git a/hack/run-tty.sh b/hack/run-tty.sh index b4ab149..d3654ac 100755 --- a/hack/run-tty.sh +++ b/hack/run-tty.sh @@ -5,4 +5,4 @@ set -o nounset source ./hack/loadenv.sh -docker run --rm -ti -v `pwd`:$WORKDIR -w $WORKDIR --env-file $DOCKER_ENV neowaylabs/klb "$@" +docker run --rm -ti -v `pwd`:$WORKDIR -w $WORKDIR --env-file $DOCKER_ENV neowaylabs/klbdev "$@" diff --git a/hack/run.sh b/hack/run.sh index 1a95ae1..67acf1a 100755 --- a/hack/run.sh +++ b/hack/run.sh @@ -5,4 +5,4 @@ set -o nounset source ./hack/loadenv.sh -docker run --rm -v `pwd`:$WORKDIR -w $WORKDIR --env-file $DOCKER_ENV neowaylabs/klb "$@" +docker run --rm -v `pwd`:$WORKDIR -w $WORKDIR --env-file $DOCKER_ENV neowaylabs/klbdev "$@" From 6d8de6666c09f57ef5cc04d932492d24577beda9 Mon Sep 17 00:00:00 2001 From: Tiago Katcipis Date: Thu, 18 Jan 2018 21:53:07 -0200 Subject: [PATCH 2/6] Remove verbose from tar --- hack/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/Dockerfile b/hack/Dockerfile index 8c50cc0..1408d6f 100644 --- a/hack/Dockerfile +++ b/hack/Dockerfile @@ -6,6 +6,6 @@ ENV PATH=${PATH}:${GOROOT}/bin RUN cd /tmp && \ wget https://storage.googleapis.com/golang/go$GO_VERSION.linux-amd64.tar.gz && \ - tar -xvf go$GO_VERSION.linux-amd64.tar.gz && \ + tar -xf go$GO_VERSION.linux-amd64.tar.gz && \ mkdir -p $GOROOT && \ mv ./go/* $GOROOT From a7f0d91a5a1cd1e63cbc7e7b74967b7a1962d6d1 Mon Sep 17 00:00:00 2001 From: Tiago Katcipis Date: Thu, 18 Jan 2018 21:59:26 -0200 Subject: [PATCH 3/6] Make GOROOT be different from GOPATH --- hack/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/Dockerfile b/hack/Dockerfile index 1408d6f..e5b35e4 100644 --- a/hack/Dockerfile +++ b/hack/Dockerfile @@ -1,7 +1,7 @@ FROM neowaylabs/klb ENV GO_VERSION="1.9" -ENV GOROOT="/go" +ENV GOROOT="/goroot" ENV PATH=${PATH}:${GOROOT}/bin RUN cd /tmp && \ From cb9320f16503ed7d01f4470005a70bbc1e9f25d2 Mon Sep 17 00:00:00 2001 From: Tiago Katcipis Date: Fri, 19 Jan 2018 15:36:32 -0200 Subject: [PATCH 4/6] Split image build from test running --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2039ce5..60dc20e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,5 +2,8 @@ dist: trusty sudo: required +before_script: + - travis_wait 60 make imagedev + script: - travis_wait 60 make test-integration logger=stdout From d91265f0d1234eb0bb24798914c69cae3a203b22 Mon Sep 17 00:00:00 2001 From: Tiago Katcipis Date: Mon, 22 Jan 2018 12:36:08 -0200 Subject: [PATCH 5/6] Add tagged version of deps --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7ce7122..97d2bc0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM neowaylabs/klbdeps:latest +FROM neowaylabs/klbdeps:0.4 COPY ./aws ${NASHPATH}/lib/klb/aws COPY ./azure ${NASHPATH}/lib/klb/azure From c367814b7b4535260f4c9d98e655672c04ea0499 Mon Sep 17 00:00:00 2001 From: Tiago Katcipis Date: Mon, 22 Jan 2018 12:54:46 -0200 Subject: [PATCH 6/6] Fix test-all --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6556562..6edc556 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,7 @@ test-examples: imagedev ./hack/run.sh $(gotest) -timeout $(examples_timeout) -tags=examples -run=TestExamples $(gotestargs) # It is recommended to use this locally. It takes too much time for the CI -test-all: testdev +test-all: imagedev ./hack/run.sh $(gotest) -timeout $(all_timeout) -tags=examples $(gotestargs) cleanup: imagedev