61 Commits

Author SHA1 Message Date
Vincent Bernat
fce383dbf4 build: switch to pnpm
It should be a bit more secure to not install scripts by default and to
allow one to update dependencies with a delay. Also, it is faster. The
downside is that it is not usually shipped with npm, but we can download
it through corepack (which is shipped with node). It also has more
builtin features, including patching packages (but we don't need that
anymore).
2025-09-18 07:31:45 +02:00
Vincent Bernat
b1d6382585 common/embed: replace all go:embed use by an embedded archive
Some of the files were quite big:

- asns.csv ~ 3 MB
- index.js ~ 1.5 MB
- *.svg ~ 2 MB

Use a ZIP archive to put them all and embed it. This reduce the binary
size from 89 MB to 82 MB. 🤯

This also pulls some code modernization (use of http.ServeFileFS).
2025-09-03 00:00:05 +02:00
Vincent Bernat
94fb1c6483 build: accept building with a not up-to-date toolchain
While I was relunctant to let Go download the right toolchain if we
didn't have one, this makes everything simpler. The Go version is now
fully controlled by `go.mod`. It also a nice for people wanting to build
on older distributions.

For Nix, GOTOOLCHAIN is set to local, so we rely on `go_latest` being
up-to-date enough. But they are usually quite fast to update, so it
should be OK.
2025-08-30 19:14:59 +02:00
Vincent Bernat
357733a7e4 build: don't cache bin in Gitlab
Not needed anymore.
2025-08-24 13:57:02 +02:00
Vincent Bernat
8a7c5b0c0c build: remove Docker proxy configuration from Gitlab build
This does not seem to be our job to setup that.
2025-08-24 09:12:21 +02:00
Vincent Bernat
fe42529bbc build: switch to Go 1.25
But Go 1.24 is still supported.
2025-08-24 09:12:21 +02:00
Vincent Bernat
5b86e7e4a7 build: don't use Corbetura for Go coverage anymore
gocov and gocovxml are unmaintained. There is
https://github.com/boumenot/gocover-cobertura which is linked from
Gitlab, but it is missing some lines during the conversion (code defined
in callbacks called from var, see hellogopher as an example), so it is
not reliable.
2025-08-20 07:13:12 +02:00
Vincent Bernat
f4c879e525 build: switch from protoc to buf to build protobuf 2025-07-27 21:44:28 +02:00
Vincent Bernat
ac68c5970e inlet: split inlet into new inlet and outlet
This change split the inlet component into a simpler inlet and a new
outlet component. The new inlet component receive flows and put them in
Kafka, unparsed. The outlet component takes them from Kafka and resume
the processing from here (flow parsing, enrichment) and puts them in
ClickHouse.

The main goal is to ensure the inlet does a minimal work to not be late
when processing packets (and restart faster). It also brings some
simplification as the number of knobs to tune everything is reduced: for
inlet, we only need to tune the queue size for UDP, the number of
workers and a few Kafka parameters; for outlet, we need to tune a few
Kafka parameters, the number of workers and a few ClickHouse parameters.

The outlet component features a simple Kafka input component. The core
component becomes just a callback function. There is also a new
ClickHouse component to push data to ClickHouse using the low-level
ch-go library with batch inserts.

This processing has an impact on the internal representation of a
FlowMessage. Previously, it was tailored to dynamically build the
protobuf message to be put in Kafka. Now, it builds the batch request to
be sent to ClickHouse. This makes the FlowMessage structure hides the
content of the next batch request and therefore, it should be reused.
This also changes the way we decode flows as they don't output
FlowMessage anymore, they reuse one that is provided to each worker.

The ClickHouse tables are slightly updated. Instead of using Kafka
engine, the Null engine is used instead.

Fix #1122
2025-07-27 21:44:28 +02:00
Vincent Bernat
415ca6659c build: switch to Go 1.24 2025-02-15 09:39:03 +01:00
Vincent Bernat
c8aff8bb4a build: update Go 1.22 to 1.23 2024-08-15 13:52:41 +02:00
Vincent Bernat
68a845b169 build: explicitely support Go 1.21/1.22
When new Go versions are released, we'll move from Go 1.22 to Go
1.23 (for example).
2024-07-06 16:43:06 +02:00
Vincent Bernat
9b662759e8 build: remove functional tests for GitLab CI
It was working, but this is a bit of work to keep it working. Now that
we use docker compose with GitHub CI, GitLab CI starts to diverge. As
GitLab setup often run dind as a runner, I don't know if it is as easy
to run docker compose in GitLab and I don't have time to test it.

If someone is interested in this support, there are two possibilities:
use act to run GitHub CI from GitLab or also adapt docker compose
workflow to GitLab CI (but it should work with docker-based runners).
2024-03-31 11:53:57 +02:00
Vincent Bernat
1aaf5ebe4a docker: update to Redis 7.2
Latest opensource version.
2024-03-23 07:19:45 +01:00
Vincent Bernat
b471039476 inlet/metadata: add gNMI provider
The unit tests require a SR Linux container. Unfortunately, there is no
good open source implementation of a gNMI target. It is unknown if
anything else than SR Linux would work.

Fix: #759
2024-01-22 23:44:37 +01:00
Vincent Bernat
0185bfe06b docker: update ClickHouse to 23.8 2023-11-07 15:17:26 +01:00
Vincent Bernat
59d461cf26 build: use Go 1.21 2023-09-02 07:49:40 +02:00
Vincent Bernat
fd773cfacf docker: move Docker-related files to docker/ 2023-08-14 13:36:44 +02:00
Vincent Bernat
79d9a448c4 docker: switch back to non KRaft mode
This reverts commit 549a573312. KRaft mode
introduces more caching and it makes tests fail.
2023-08-11 15:50:04 +02:00
Vincent Bernat
549a573312 docker: for dev and CI, use Kafka in KRaft mode 2023-08-07 08:42:36 +02:00
Vincent Bernat
66bd65d5ba docker: pin more versions of Kafka 2023-08-07 07:51:40 +02:00
Vincent Bernat
4a0d8afb4c common/clickhousedb: set allow_suspicious_low_cardinality_types to 1
This enables use of `LowCardinality(IPv6)` since exporter IP addresses
are really of low cardinality. ClickHouse is fixed (23.3.8.31-lts for
example).
2023-07-17 07:32:58 +02:00
Vincent Bernat
ced8b89a99 Revert "common/clickhousedb: set allow_suspicious_low_cardinality_types to 1"
This reverts commit 6244b2e136. ClickHouse
23.3 does not work correctly with IPv6 and Kafka.
2023-05-16 08:33:05 +02:00
Vincent Bernat
6244b2e136 common/clickhousedb: set allow_suspicious_low_cardinality_types to 1
This enables use of `LowCardinality(IPv6)` since exporter IP addresses
are really of low cardinality.
2023-05-03 16:20:19 +02:00
Vincent Bernat
b234a3f293 build: do not enable KRaft for Kafka
This shouldn't be enabled silently as it can break existing setups.
Moreover, it seems not reliable yet.
2023-04-24 09:20:16 +02:00
Vincent Bernat
84a0d0ee70 build: also fix GitLab configuration for Kafka 2023-04-24 09:06:47 +02:00
Vincent Bernat
b57e9edbcc build: switch to Go 1.20 for building
We still support Go 1.19.
2023-04-05 09:39:13 +02:00
Vincent Bernat
487cf24099 build: remove use of protobuf-compiler
Not needed anymore.
2023-01-19 11:51:25 +01:00
Vincent Bernat
775dc08db2 console: implement an HTTP cache for Clickhouse-backed requests
Fix #328
2022-12-22 16:23:49 +01:00
Vincent Bernat
fe4295614e build: only run race tests for Go in GitLab 2022-12-22 15:30:34 +01:00
Vincent Bernat
34a1fc1d61 docker: update Kafka to latest stable release 2022-12-07 15:03:27 +01:00
Vincent Bernat
3a3d30d1db docker: use latest stable branch for Zookeeper 2022-12-07 15:01:45 +01:00
Vincent Bernat
d7b71d587b build: fix path to JUnit and Cobertura reports
Currently, only expose Go Cobertura reports
2022-10-16 08:42:03 +02:00
Vincent Bernat
e63b7ab100 build: also run coverage tests for JS 2022-10-16 08:35:07 +02:00
Vincent Bernat
9ebc0537ff build: use a specific target for each coverage test format 2022-09-10 14:52:15 +02:00
Vincent Bernat
672d632a5a console: use INTERPOLATE to fill values when no value present
This dump the requirement on ClickHouse to 22.4. Use 22.8 LTS. This
should also fix a memory leak (not yet fixed in 22.3).
2022-09-08 15:43:27 +02:00
Vincent Bernat
18ee3eac6f build: switch to Go 1.19
This enables us to use atomic.Pointer!
2022-08-19 17:46:49 +02:00
Vincent Bernat
24e4776316 build: display version after CI build 2022-07-22 11:16:32 +02:00
Vincent Bernat
fe4030ca45 build: do not rely on ex either
This is a bit of a nightmare tool. Different versions accepting
different flags (nvi vs vim) and when something is wrong, you are
stuck into some interactive/not really interactive tool.
2022-07-18 11:04:22 +02:00
Vincent Bernat
a80064c3b4 build: install vim to get ex on Alpine Linux 2022-07-16 21:25:41 +02:00
Vincent Bernat
ce1916d0ce build: build then test
This way, we don't hide all the build steps into an implicit test step.
2022-07-14 16:05:07 +02:00
Vincent Bernat
2eee9bd6cd build: switch to npm
We have little reason to use Yarn now. Moreover, Yarn requires to
embed itself into the repository and that's something I'd like to
avoid.

Fix #2
2022-07-14 16:03:36 +02:00
Vincent Bernat
328d11158e build: update coverage report directive in .gitlab-ci.yml 2022-07-07 22:10:20 +02:00
Vincent Bernat
b2ffc5b8cd build: update clickhouse to 22.3 (LTS) 2022-06-14 10:12:31 +02:00
Vincent Bernat
bcb664e338 build: fix building of ASN map 2022-05-12 17:42:24 +02:00
Vincent Bernat
ce7fce32ba console: switch to Vue.JS + Tailwind CSS + Headless UI for the frontend 2022-04-06 21:03:19 +02:00
Vincent Bernat
a336370c05 web: frontend using Bootstrap 2022-03-31 20:56:14 +02:00
Vincent Bernat
b6a6a0392d build: fix build on Gitlab 2022-03-29 13:22:49 +02:00
Vincent Bernat
3d6d28f15f build: try twice test-race and test-coverage when test is successful 2022-03-23 16:39:12 +01:00
Vincent Bernat
9d4ce0bc9f build: switch to Go 1.18 2022-03-22 07:38:30 +01:00