Commit Graph

198 Commits

Author SHA1 Message Date
Bryan Boreham
7243af71c7 Create embedded Go files before linting
Otherwise we get a compile error
2020-12-30 18:30:34 +00:00
Daniel Holbach
1ab610ca78 .. 2020-09-03 10:16:04 +02:00
Daniel Holbach
b64ac919f7 shellcheck version? 2020-09-03 10:15:02 +02:00
Daniel Holbach
c9b44d7c93 use supported releases 2020-09-03 10:15:02 +02:00
Bryan Boreham
15bb96bb67 Remove outdated instructions about rebuilding Go libraries
This bit is unnecessary with newer versions of Go that cache builds
for different tags in different places.
2020-01-14 13:22:33 +00:00
Bryan Boreham
bc4ec26bf5 Turn off module use for codecgen build
There is no way to pass `-mod=vendor` through to the Go compilation
that codecgen runs.
2020-01-14 12:33:49 +00:00
Bryan Boreham
aae86877c7 Add back runsvint dependency
This is a small program used to watch app and probe running inside
the container.  We need to go round a few houses to be able to build
it from vendor directory.
2020-01-14 12:29:31 +00:00
Bryan Boreham
3a991eca99 build: use vendored files when building 2020-01-13 17:29:07 +00:00
Bryan Boreham
3357551619 build: don't need -i flag
This was useful to cache dependent library builds, but Go does that
better now so we don't need the flag.
2020-01-13 17:28:18 +00:00
Shovan Maity
95b231727e update build to run as current user
pass user and group id in docker run command to run it as current user

Signed-off-by: Shovan Maity <shovan.cse91@gmail.com>
2019-10-14 17:01:59 +05:30
Bryan Boreham
9e62dac37d build: don't lint tools shellscripts in Scope CI
It's now run in the CI for the upstream repo weaveworks/build-tools.
2019-10-02 14:34:44 +00:00
Daniel Holbach
3ceb987608 Fix bind-mount volume path "client/client"
yarn will otherwise complain about missing client/package.json
	in "make client-test"

Signed-off-by: Daniel Holbach <daniel@weave.works>
2019-01-15 09:29:09 +05:30
Marcus Cobden
4dd6f4cd2b Create UI toolchain dirs from Makefile
To prevent docker from creating it with root as the owner
2018-10-11 11:07:19 +01:00
Marcus Cobden
041ebed8a3 Fix path confusion in bundle building 2018-09-26 12:16:49 +01:00
Marcus Cobden
3a0dc3c34f Fix CI by removing Dockerfile workdir 2018-09-26 10:41:31 +01:00
Marcus Cobden
aafab27c74 Add Makefile target for UI build toolchain 2018-09-26 10:41:31 +01:00
Marcus Cobden
c03e6a0e50 Rework UI build to improve caching and fix packaging issue
Stop baking the toolchain and dependencies into the build image.
Instead, run the install step each time, but use volume mounts or
CircleCI caching to keep the happy path fast.

Previously, some parts of the client (UI) directory were baked into the build
image, and some parts were mounted or copied into the build environment.
As a result, files baked into the build image require a two-step
update for changes to take effect in CI.

Now, for dockerised builds, we pre-install very little into the build
image and mount the whole directory into the build environment.
However, we do overlay a volume on the node_modules folder to allow the
standard build toolchain to be separate from the host build toolchain.

Non-dockerised builds (e.g. CI) are now more similar to the dockerised
versions.
2018-09-26 10:41:30 +01:00
Bryan Boreham
ebfed1bc83 Don't insist the build container is up-to-date when BUILD_IN_CONTAINER=false
Why do you care?  You're either inside it or not using it.
2018-08-30 10:13:42 +00:00
Bryan Boreham
ec49a38b83 Tag build images with git hash 2018-08-30 10:13:41 +00:00
Lili Cosic
31d68c44a2 Add make target to generate CRI files
The cri make target generates the api.pb.go files by first fetching the
latest proto files from upstream and uses protoc to generate them.
2018-07-26 10:51:53 +01: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
Matthias Radestock
5a6a6dfd58 remove from cruft from Makefile
This was left over from #1345.
2017-12-27 16:34:00 +00:00
Matthias Radestock
efbfd5d582 don't embed docker binary
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.
2017-12-11 17:02:20 +00:00
Matthias Radestock
c6455c41a0 bump embedded Weave Net version to 2.1.3 2017-12-11 11:33:17 +00:00
Matthias Radestock
2cd8b3388f add 'realclean' make target to clear out container images
...and use that in bin/release, so that we don't build releases with
ancient images.
2017-07-30 07:16:39 +01:00
Bryan Boreham
3c16c416a5 Merge pull request #2618 from weaveworks/unit-test-tags
Pass build tags to unit tests
2017-07-22 09:45:35 -07:00
Roland Schilter
ce728d2b79 Allows to skip client build when doing make prog/scope (#2732)
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.
2017-07-21 19:10:18 +02:00
Bryan Boreham
d8278ec8ae Pass all Go build tags to tests 2017-07-13 16:08:03 +00:00
Roland Schilter
718e817c73 Update README/Makefile/package.json to use yarn
Fixes #2606
2017-07-04 14:50:53 +02: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
Roland Schilter
1c4f0036cf Fix incomplete dependencies for make scope/prog
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.
2017-06-05 15:56:16 +01:00
Ilya Dmitrichenko
05f6a9b217 Add website preview via Netlify 2017-04-27 13:52:57 +01:00
Alfonso Acosta
70cd3aaba0 only lint files in git ls-files, not .git/* 2017-04-26 16:43:06 +00:00
Jordan Pellizzari
6608b79c17 Added Scope version to S3 module path 2017-03-25 10:49:40 -07:00
Bryan Boreham
97dda9454d Fix mismatched code coverage errors
'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.
2017-03-23 13:31:38 +00:00
Bryan Boreham
a884ceae06 Tests need to depend on code generation 2017-03-23 12:25:12 +00:00
jpellizzari
b8326f417f Added job to trigger service-ui build 2017-03-22 13:00:57 -07: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
Alfonso Acosta
98395bb595 Create cloud agent image (#2284)
* Create cloud-agent image

* Refactor Makefile

* Push the image from CircleCI and releases

* Review feedback

* Review feedback

* Review feedback
2017-02-27 17:49:26 +01:00
Jordan Pellizzari
107a933530 Merge pull request #2281 from weaveworks/ui-pkg-fix
Changed ui-build-pkg job to use a docker container
2017-02-24 14:24:59 -08:00
jpellizzari
efdd8e4b0e Changed ui-build-pkg job to use a docker container 2017-02-24 14:03:05 -08:00
Alfonso Acosta
41c7451795 Review feedback 2017-02-24 13:50:20 +00:00
Alfonso Acosta
051884d26a Embed Docker 1.13.1 (but force protocol 1.22) 2017-02-24 13:50:19 +00:00
Alfonso Acosta
9c2009f63e Simplify copying of weaveutil 2017-02-24 12:31:11 +00:00
Bryan Boreham
a60192d98a Install weaveutil so we don't have to run it via docker 2017-02-24 12:31:10 +00:00
Bryan Boreham
0a3c58b641 Pin the version of Weave Net embedded
for more repeatable builds
2017-02-24 12:31:09 +00:00
Matthias Radestock
4aa73bf7f0 don't attempt to make 'make clean' work on old checkouts
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.
2017-02-03 21:52:55 +00:00
Alfonso Acosta
92c4bc968c Embed and require Docker version 1.10 2017-02-03 14:26:58 +00:00
Mike Lang
02a2dd9d7a Fix ownership issues with client/build-external
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"
2017-01-27 14:57:02 -08:00
jpellizzari
33844ca650 npm scripts change 2017-01-24 17:41:41 -08:00