From 2fc05672db1e846f1d039bd86dcaaa3c894a8c98 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Tue, 16 Feb 2016 13:55:01 +0000 Subject: [PATCH 1/3] containerize build of prog/static.go --- Makefile | 16 ++++++++++++---- backend/Dockerfile | 5 +++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e6be5f03e8..614feeb649 100644 --- a/Makefile +++ b/Makefile @@ -82,9 +82,6 @@ endif static: prog/static.go -prog/static.go: client/build/app.js - esc -o $@ -prefix client/build client/build - ifeq ($(BUILD_IN_CONTAINER),true) client/build/app.js: $(shell find client/app/scripts -type f) $(SCOPE_UI_BUILD_UPTODATE) mkdir -p client/build @@ -106,9 +103,21 @@ client-start: $(SCOPE_UI_BUILD_UPTODATE) $(SUDO) docker run $(RM) $(RUN_FLAGS) --net=host -v $(shell pwd)/client/app:/home/weave/app \ -v $(shell pwd)/client/build:/home/weave/build \ $(SCOPE_UI_BUILD_IMAGE) npm start + +prog/static.go: client/build/app.js $(SCOPE_BACKEND_BUILD_UPTODATE) + $(SUDO) docker run $(RM) $(RUN_FLAGS) --net=host \ + -v $(shell pwd):/go/src/github.com/weaveworks/scope \ + -v $(shell pwd)/.pkg:/go/pkg \ + -w /go/src/github.com/weaveworks/scope \ + --entrypoint=make \ + $(SCOPE_BACKEND_BUILD_IMAGE) BUILD_IN_CONTAINER=false prog/static.go + else client/build/app.js: cd client && npm run build + +prog/static.go: client/build/app.js + esc -o $@ -prefix client/build client/build endif $(SCOPE_UI_BUILD_UPTODATE): client/Dockerfile client/package.json client/webpack.local.config.js client/webpack.production.config.js client/server.js client/.eslintrc @@ -129,5 +138,4 @@ deps: $(GO) get -u -f -tags netgo \ github.com/FiloSottile/gvt \ github.com/mattn/goveralls \ - github.com/mjibson/esc \ github.com/weaveworks/github-release diff --git a/backend/Dockerfile b/backend/Dockerfile index eff72a8232..5db434d54c 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -3,8 +3,9 @@ ENV GO15VENDOREXPERIMENT 1 RUN apt-get update && apt-get install -y libpcap-dev python-requests time RUN go clean -i net && go install -tags netgo std && go install -race -tags netgo std RUN go get -tags netgo \ - github.com/golang/lint/golint \ github.com/fzipp/gocyclo \ - github.com/kisielk/errcheck + github.com/golang/lint/golint \ + github.com/kisielk/errcheck \ + github.com/mjibson/esc COPY build.sh / ENTRYPOINT ["/build.sh"] From 0a383d75f74c34064cc832786678e12920d1b929 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Tue, 16 Feb 2016 13:36:32 +0000 Subject: [PATCH 2/3] added note about docker dependency to the readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index adaf5b8fad..70f3690fcd 100644 --- a/README.md +++ b/README.md @@ -217,6 +217,10 @@ kubectl create -f scope-probe-ds.yaml ## Developing +Building Scope from source depends on the latest version of +[docker](https://www.docker.com/), so please install that before +proceeding. + The build is in two stages. `make deps` installs some tools we use later in the build. `make` builds the UI build container, builds the UI in said container, builds the backend build container, builds the app and probe in a From 404aa7f0dd9ad2a015b07ab7529c9924a73f566b Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Tue, 16 Feb 2016 14:55:57 +0000 Subject: [PATCH 3/3] clarifying the relationship between make and make deps --- README.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 70f3690fcd..70b4711442 100644 --- a/README.md +++ b/README.md @@ -221,14 +221,12 @@ Building Scope from source depends on the latest version of [docker](https://www.docker.com/), so please install that before proceeding. -The build is in two stages. `make deps` installs some tools we use later in -the build. `make` builds the UI build container, builds the UI in said -container, builds the backend build container, builds the app and probe in a -said container, and finally pushes the lot into a Docker image called -**weaveworks/scope**. +The main build is `make`, which builds the UI build container, builds +the UI in said container, builds the backend build container, builds +the app and probe in a said container, and finally pushes the lot into +a Docker image called **weaveworks/scope**. ``` -make deps make ``` @@ -238,6 +236,15 @@ Then, run the local build via ./scope launch ``` +If needed, install tools used for managing dependencies, managing releases, and doing coverage analysis via + +``` +make deps +``` + +Note that the tools from `make deps` will depend on a local install of +[go](https://golang.org). + ## Debugging Scope has a collection of built in debugging tools to aid Scope delevopers.