We needed it because some of our invocations of Weave Net's `weave`
script depended on it, but that is no longer the case as of Weave Net
2.1.
Fixes#2974.
When you run the client locally with `yarn start` and modify the
app/probe code you don't want to compile the client on `make prog/scope`.
This allows you to do `SCOPE_SKIP_UI_ASSETS=true make prog/scope` to
only build the scope binary.
It seems that on my OS the passed param to find gets expanded early and
thus the command
$(shell find ./ -path ./vendor -prune -o -type f -name *.go)
results in
./test.go ./vendor
instead of including all the go files from subdirs. Quoting helps.
'codecgen' embeds a random integer in each identifier; this means code
coverage across different CircleCI lanes may not match.
Here we force the integer to 23 on every CircleCI build so they always match.
Based on work from Lorenzo, updated by Iago, Alban, Alessandro and
Michael.
This PR adds connection tracking using eBPF. This feature is not enabled by default.
For now, you can enable it by launching scope with the following command:
```
sudo ./scope launch --probe.ebpf.connections=true
```
This patch allows scope to get notified of every connection event,
without relying on the parsing of /proc/$pid/net/tcp{,6} and
/proc/$pid/fd/*, and therefore improve performance.
We vendor https://github.com/iovisor/gobpf in Scope to load the
pre-compiled ebpf program and https://github.com/weaveworks/tcptracer-bpf
to guess the offsets of the structures we need in the kernel. In this
way we don't need a different pre-compiled ebpf object file per kernel.
The pre-compiled ebpf program is included in the vendoring of
tcptracer-bpf.
The ebpf program uses kprobes/kretprobes on the following kernel functions:
- tcp_v4_connect
- tcp_v6_connect
- tcp_set_state
- inet_csk_accept
- tcp_close
It generates "connect", "accept" and "close" events containing the
connection tuple but also pid and netns.
Note: the IPv6 events are not supported in Scope and thus not passed on.
probe/endpoint/ebpf.go maintains the list of connections. Similarly to
conntrack, it also keeps the dead connections for one iteration in order
to report short-lived connections.
The code for parsing /proc/$pid/net/tcp{,6} and /proc/$pid/fd/* is still
there and still used at start-up because eBPF only brings us the events
and not the initial state. However, the /proc parsing for the initial
state is now done in foreground instead of background, via
newForegroundReader().
NAT resolution on connections from eBPF works in the same way as it did
on connections from /proc: by using conntrack. One of the two conntrack
instances is only started to get the initial state and then it is
stopped since eBPF detects short-lived connections.
The Scope Docker image size comparison:
- weaveworks/scope in current master: 22 MB (compressed), 68 MB
(uncompressed)
- weaveworks/scope with this patchset: 23 MB (compressed), 69 MB
(uncompressed)
Fixes#1168 (walking /proc to obtain connections is very expensive)
Fixes#1260 (Short-lived connections not tracked for containers in
shared networking namespaces)
Fixes#1962 (Port ebpf tracker to Go)
Fixes#1961 (Remove runtime kernel header dependency from ebpf tracker)
It's just not worth the extra complication in the Makefile, and the
code for it was actually broken.
Also, outdent comment so it doesn't get splattered onto the console.
When the directory is created during the build process, it is as root.
This prevents us deleting root-owned files inside the directory during make clean.
In client/build/, we get around this because the directory contains a tracked file,
so it's created during git checkout.
We make this the case for build-external by adding a hidden, empty file to track.
This won't fix existing checkouts though, so we also add a fix-up step to make clean.
The use of .gitignore as the empty file to track is taken from
https://git.wiki.kernel.org/index.php/GitFaq#Can_I_add_empty_directories.3F
Specifically:
"If you really need a directory to exist in checkouts you should create a file in it.
.gitignore works well for this purpose"
* Squashed 'tools/' changes from e9e7e6b..db5efc0
db5efc0 Merge pull request #28 from weaveworks/mike/add-image-tag
5312c40 Import image-tag script into build tools so it can be shared
7e850f8 Fix logs path
dda9785 Update deploy api
f2f4e5b Fix the wcloud client
3925eb6 Merge pull request #27 from weaveworks/wcloud-events
77355b9 Lint
d9a1c6c Add wcloud events, update flags and error nicely when there is no config
git-subtree-dir: tools
git-subtree-split: db5efc0537
* Remove ./image-tag and use ./tools/image-tag instead
image-tag is now shared code from the build-tools repo
* adds `?hash` to JS and CSS bundle URLs against caching in production
* uses `html-webpack-plugin` to generate html dynamically
* html based on template in `app/html/index.html`
* per-app html files no longer needed
* `build/` dir is now completely deleteable, and fully gitignored
* top-level `make` now requires `client/app` to pick up on html and
style changes
* cleaned up `server.js` code for production bundle testing
* added readme entry about testing production bundles
Dependencies are built out of the build container and we shouldn't enforce
specific tags.
It breaks the release process (see https://github.com/weaveworks/scope/wiki/Release-Process#go-to-a-linux-host)
in machines with standard Go installations resulting in:
```
go install net: open /usr/local/go/pkg/linux_amd64/net.a: permission denied
```
Add debug.html to show toolbar
Perfjankie test runner
Playing w/ the pure mixin for perf. improvements
* Works well! Smoother zooming/panning when things have settled.
* Extract node movement to node-container, make nodes pure
Extracted node chart elements into own components
Keep control objects immutable while in components
Keep layout state objects alive
Made other components pure, removed mixin from stateless components
Remove font size adjustment from scaling
Fix zoomscale
Move node transform to node
* makes more sense there because the coords are rounded in the container
dynamic coords precision based on topology size
Make edge points immutable
Remove nodes maximum for layout engine
Dont send all canvas state down to next component
moving layout handling back to nodes-chart.js
Omit some props for edges/nodes, dont animate edges on low precision
Moved AppStore access out of lower components