Merge pull request #73 from weaveworks/update-build-instructions

Update Makefile and README
This commit is contained in:
Peter Bourgon
2015-05-21 14:27:47 +02:00
3 changed files with 2640 additions and 2074 deletions

View File

@@ -1,4 +1,4 @@
.PHONY: all static test clean
.PHONY: all static clean
# If you can use Docker without being root, you can `make SUDO= <target>`
SUDO=sudo
@@ -14,6 +14,22 @@ SCOPE_UI_BUILD_IMAGE=weave/scope-ui-build
all: $(SCOPE_EXPORT)
$(SCOPE_EXPORT): $(APP_EXE) $(PROBE_EXE) docker/*
cp $(APP_EXE) $(PROBE_EXE) docker/
$(SUDO) docker build -t $(SCOPE_IMAGE) docker/
$(SUDO) docker save $(SCOPE_IMAGE):latest > $@
$(APP_EXE): app/*.go report/*.go xfer/*.go
$(PROBE_EXE): probe/*.go report/*.go xfer/*.go
$(APP_EXE) $(PROBE_EXE):
go get -tags netgo ./$(@D)
go build -o $@ ./$(@D)
static: client/dist/scripts/bundle.js
esc -o app/static.go -prefix client/dist client/dist
$(SCOPE_UI_BUILD_EXPORT): client/Dockerfile client/gulpfile.js client/package.json
docker build -t $(SCOPE_UI_BUILD_IMAGE) client
docker save $(SCOPE_UI_BUILD_IMAGE):latest > $@
@@ -24,28 +40,6 @@ client/dist/scripts/bundle.js: client/app/scripts/*
-v $(shell pwd)/client/dist:/home/weave/dist \
$(SCOPE_UI_BUILD_IMAGE)
static: client/dist/scripts/bundle.js
esc -o app/static.go -prefix client/dist client/dist
test: $(APP_EXE) $(FIXPROBE_EXE)
# app and fixprobe needed for integration tests
go test ./...
$(APP_EXE): app/*.go report/*.go xfer/*.go
$(PROBE_EXE): probe/*.go report/*.go xfer/*.go
$(APP_EXE) $(PROBE_EXE):
go get -tags netgo ./$(@D)
go build -o $@ ./$(@D)
$(FIXPROBE_EXE):
cd experimental/fixprobe && go build
$(SCOPE_EXPORT): $(APP_EXE) $(PROBE_EXE) docker/*
cp $(APP_EXE) $(PROBE_EXE) docker/
$(SUDO) docker build -t $(SCOPE_IMAGE) docker/
$(SUDO) docker save $(SCOPE_IMAGE):latest > $@
clean:
go clean ./...
rm -rf $(SCOPE_EXPORT) $(SCOPE_UI_BUILD_EXPORT) client/dist

View File

@@ -1,70 +1,55 @@
# Scope
[![Circle CI](https://circleci.com/gh/weaveworks/scope/tree/master.svg?style=shield)](https://circleci.com/gh/weaveworks/scope/tree/master) [![Coverage Status](https://coveralls.io/repos/weaveworks/scope/badge.svg)](https://coveralls.io/r/weaveworks/scope)
[![Circle CI](https://circleci.com/gh/weaveworks/scope/tree/master.svg?style=shield)](https://circleci.com/gh/weaveworks/scope/tree/master) [![Coverage Status](https://coveralls.io/repos/weaveworks/scope/badge.svg)](https://coveralls.io/r/weaveworks/scope) [![Sourcegraph](https://sourcegraph.com/api/repos/github.com/weaveworks/scope/.badges/status.svg)](https://sourcegraph.com/github.com/weaveworks/scope)
![Weave Scope Screenshot](http://weave.works/scope/assets/img/feature-1.png)
## Overview
Weave Scope automatically generates a map of your containers, enabling you to
intuitively understand, monitor, and control your applications.
Please note that the code, and especially the building and running story, is in
a **pre-alpha** state. Please take a look, but don't be surprised if you hit
bugs or missing pieces.
Please note that the code, and especially the building and running story, is
in a **prerelease** state. Please take a look, but don't be surprised if you
hit bugs or missing pieces.
## Building
### In-place
To build the binaries in-place,
## Getting started
```
make build
sudo wget -O /usr/local/bin/scope \
https://github.com/weaveworks/scope/releases/download/latest_release/scope
sudo chmod a+x /usr/local/bin/scope
sudo scope launch
```
Note that this doesn't build or include the latest version of the user
interface. The UI is decoupled, living in `client` and following a node/gulp
workflow. To build that and include it in the application binary,
This script will download and run a recent Scope image from the Docker Hub.
Now, open your web browser to **http://localhost:4040**. (If you're using
boot2docker, replace localhost with the output of `boot2docker ip`.)
## Build
```
make client
make static
make build
make
```
Or, as a shortcut,
This will produce a Docker container called **weaveworks/scope**.
```
make dist
```
### Docker container
To build a Docker container,
```
make docker
```
### The UI
This repository contains a copy of the compiled UI. To build a fresh UI, run:
Note that the repository contains a copy of the compiled UI. To build a fresh
UI from the source in the client subdirectory, and re-build the Docker
container,
```
make scope_ui_build.tar
make static
make
```
## Running
### Manually
1. Launch a probe process on each physical host you intend to monitor, via `sudo probe`
2. Launch an app process, and configure it to talk to probes, via `app -probes="probe-host-1:4030,probe-host-2:4030"`.
3. Load the user interface, via **http://app-host:4040**
### As a Docker container
TODO
## Run
```
./scope launch
```

File diff suppressed because it is too large Load Diff