Commit Graph

54 Commits

Author SHA1 Message Date
Bryan Boreham
2ddcd9c067 Add quotes required by shellcheck 2021-04-04 13:45:05 +01:00
Bryan Boreham
da81514209 Update Go compiler to 1.16.2 2021-04-04 13:45:05 +01:00
Bryan Boreham
c2578b6fb7 Move 'esc' tool out of image into vendor'd source
Smaller that way, and more consistent

(Note we run it with GC enabled; it crashes in CI otherwise)
2021-04-04 13:45:05 +01:00
Bryan Boreham
a2a63f8660 Stop installing Python in build container
Scope itself doesn't have any Python code.

Disable Python test scheduler in CI
 - we set parallelism=1 so no point scheduling
2021-04-04 11:16:13 +01:00
Bryan Boreham
833f947fb3 Run Go build as current user via -u flag
Remove complicated workaround in build.sh
2021-04-04 11:16:13 +01:00
Piotr Kiełkowicz
8ce4743cb0 github.com/fatih/hclfmt was archived. Technically there is a possibility to fork (or used another forked version) to executle hclfmt.
But it leads to another issues - problems with importing https://github.com/hashicorp/hcl/hcl/printers. HCL was released in version 2 so that the file structure was changes.
I do not see any way to install it in changed Makefile. Go installs does not support pining to given tags so that always the newest version is installed.

For now, the impact on build process should be minimal. it is used only in ./tools/lint/lint() method. I was able to execute it locally without executing hclfmt.
2021-03-03 11:06:33 +01:00
Bryan Boreham
22aa742b58 build: upgrade Go to 1.14.2 2020-05-07 11:46:52 +00:00
Bryan Boreham
265e262a65 Update Go to 1.13.9 2020-03-20 14:04:30 +00:00
Bryan Boreham
4365d3ba35 Bump Go version to 1.13.0 2019-09-23 10:43:37 +00:00
CarlosEDP
b25f7e8415 Download Docker client for multiple architectures and print error if not found. 2019-01-02 12:13:15 -02:00
CarlosEDP
833e521dce Check architecture before downloading Docker client 2019-01-02 12:08:49 -02:00
CarlosEDP
4f8fc5e010 Add ARM64 build 2019-01-02 12:08:49 -02:00
Timm, Christopher
52024d8b48 build: Fix import for golint
The import path for golint has changed

Fixes #3388
2018-10-13 17:59:08 -05:00
Bryan Boreham
29e6409fab Move all go installs to same Dockerfile step
Reduces the size of the resulting image
2018-08-30 10:13:42 +00:00
Bryan Boreham
e1552de65a 'requests' is installed via pip; we don't need to install via apt-get too 2018-08-30 10:13:42 +00:00
Bryan Boreham
5d029d74f1 Install docker client in build container 2018-08-30 10:13:42 +00:00
meghalidhoble
625998b91e Change made to the listed files, to enable weaveworks-scope on Power(ppc64le)
1)backend/Dockerfile 2) probe/endpoint/dns_snooper.go
3) client/Dockerfile 4) docker/Dockerfile.cloud-agent
5) probe/process/walker_linux_test.go & 6) tools/lint

1)'backend/Dockerfile' : Conditional added so that the cross-compiling should
   be done on amd64. Also removed support for sh-lint for ppc64le for now.
   As the version for shfmt mentioned in the dockerfile is not available for
   ppc64le and the later version does't work fine with existing application.
2)'probe/endpoint/dns_snooper.go' : Renamed this file so as to reuse for ppc64le
   and added a build-constraint. Now this file will be build for amd64 on linux
   and ppc64le on linux.
3)'client/Dockerfile' : Modified the version of the base image for node from
   8.4.0 to 8.11, as this version supports multiarch.
4)'docker/Dockerfile.cloud-agent' : Modified the version of the base image for
   golang from 1.10.2-strech to 1.10.2, which supports multiarch.
5) 'probe/process/walker_linux_test.go' : Test fixed to run for ppc64le,
    modified the code to accept RSSBytes based on pageSize value per
    architecture, instead of hard-coded values.
6)'tools/lint' : Modified the file to skip the sh-lint implementation for ppc64le.

PR #3231
2018-08-13 12:45:25 +05:30
Bryan Boreham
80b66472a5 Pin Python requests library to 2.19.1
The latest version as of the time of this commit.
2018-08-10 13:34:11 +00:00
Bryan Boreham
5ab00ae664 Build: update to Go 1.10
So that we can rely on the fix to runtime.LockOSThread()
2018-06-02 21:48:01 +00:00
Marc Carré
4e58b83024 Add org.opencontainers.image.* labels to Dockerfiles
- This should ultimately help for image-to-code back references.
- `org.label-schema.*` labels are now deprecated, in favour of `org.opencontainers.image.*` labels.
  See also: https://github.com/opencontainers/image-spec/blob/master/annotations.md#back-compatibility-with-label-schema
- Git revision (`git rev-parse HEAD`) is now injected at `docker build` time.
2018-05-14 11:54:33 +01:00
Bryan Boreham
3db91bced4 Upgrade Go to 1.9.2 2017-12-16 23:24:22 +00:00
Bryan Boreham
6acb397d5d Install yapf and flake8 required by build-tools lint 2017-07-13 16:11:59 +00:00
Roland Schilter
c1b56c81b7 Use latest go1.8.3 2017-06-21 14:41:51 +02:00
Alfonso Acosta
d5ad391721 Add build-essential package 2017-06-20 20:09:50 +00:00
Alfonso Acosta
1520444ab6 Use Go 1.8 2017-06-20 13:56:02 +00:00
Roland Schilter
b78745f615 Execute tests in the prog/ directory (#2567)
Also fixed prog/main_test.go (which has never been part of the test suite so far)
2017-06-08 15:41:53 +02:00
Alfonso Acosta
cb0afade3e Use shfmt v1.3.0 instead of gopkg.in's v1
"inspired" by 1ba9d6d82c
2017-05-22 17:27:35 +02:00
Iago López Galeiras
9920c4ea48 Add eBPF connection tracking without dependencies on kernel headers
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)
2017-03-08 22:11:12 +01:00
Alessandro Puccetti
3f497dd82a backend: fix permissions and add hclfmt
After updating build-tools, I got new errors:

> ./tools/lint: line 134: hclfmt: command not found

> go install net: open /usr/local/go/pkg/linux_amd64_race/net.a:
> permission denied

This patch works around that by doing the same thing as:
https://github.com/weaveworks/build-tools/pull/44/files
2017-02-21 17:19:19 +01:00
Tom Wilkie
fe81ef98f4 Update to go1.7.4 (#2147) 2017-01-22 19:51:38 +00:00
Iago López Galeiras
43d9f38c5e Fix various linter issues
Found via shellcheck.
2017-01-18 11:51:41 +01:00
Iago López Galeiras
ec0b6dd8d0 backend: add shfmt command to the docker image 2017-01-09 16:40:16 +01:00
Tom Wilkie
d1cf9f60fc Upgrade to go1.7 (#1797)
* Upgrade to go1.7

* Use the 1.7.1 tag
2016-09-13 12:40:33 +01:00
Jonathan Lange
ddf80d05cb Actually run shell-lint on tools 2016-07-12 14:22:09 +01:00
Tom Wilkie
fb8704f82d Upgrade to go1.6.2 2016-04-21 10:04:08 +01:00
Tom Wilkie
31a90c76c4 Update to go 1.6.1 2016-04-13 13:29:34 +01:00
Tom Wilkie
b9233561d8 Remove temporary files in the build container to shrink it down by ~100MB 2016-03-24 12:06:25 +00:00
Tom Wilkie
a4e707d179 Project specific changes for misspell.
- Add misspell to build container.
- Add file to build container.
- Ignore dagre spelling
2016-03-23 10:51:21 +00:00
Alfonso Acosta
783297672c Invoke Go consistently and remove GO15VENDOREXPERIMENT from container 2016-03-10 11:25:15 +01:00
Tom Wilkie
b9f788993b Upgrade to go1.6 2016-03-01 12:31:54 +00:00
Paul Bellamy
2fc05672db containerize build of prog/static.go 2016-02-16 13:55:51 +00:00
Tom Wilkie
baec4688cb Various improvements to build & tests
- Fix broken wait in tests.
- Run lint in the build container.
- Merge two quick steps in the circle plan.
- Increase number of test VMs to 3 (again).
2016-01-15 10:00:41 -08:00
Tom Wilkie
e5541b965b Update to go1.5.3 2016-01-13 16:21:51 -08:00
Tom Wilkie
4ea7453008 Update Makefile inline with some comments from weave's build. 2016-01-11 11:37:23 +00:00
Tom Wilkie
d6052973af Pass -i to go build to speed up builds. 2016-01-04 16:48:41 +00:00
Tom Wilkie
1ad7b4fce5 Speed up tests on circle.
- Ensure we use up to date build container when running tests.
- Parallelise host setup for integration tests.
- Pass some more circle env vars through to ./tools/tests so the scheduler works.
- Gather coverage from multiple shards.
- Create files as the right owner inside the container.
- Parallelise the circle.yaml
- Parallelise the intergration tests using existing machinery
- Build experimental in parallel.
- Use custom scheduler prefix for integration tests, so schedules don't clash with weave.
2015-11-04 15:35:21 +00:00
Tom Wilkie
43f6cf7114 Fix build warning with go1.5 2015-11-03 17:25:39 +00:00
Tom Wilkie
fb49e146ad Build experimental stuff in a container too 2015-10-26 16:11:16 +00:00
Tom Wilkie
c05b76373f Review feedback 2015-10-26 14:23:30 +00:00
Tom Wilkie
147db96567 Make the build-in-container vs not clearer to make, so it doesn't always rebuild the exes. 2015-10-26 14:02:39 +00:00