Skip to content

Commit 01949cb

Browse files
authored
Merge branch 'lf-edge:master' into master
2 parents 5833b78 + 58b816a commit 01949cb

File tree

3,274 files changed

+526203
-145423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,274 files changed

+526203
-145423
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ jobs:
2525
- os: ubuntu-22.04
2626
arch: amd64
2727
platform: "generic"
28-
- os: arm64-secure
28+
- os: buildjet-4vcpu-ubuntu-2204-arm
2929
arch: arm64
3030
platform: "generic"
31-
- os: arm64-secure
31+
- os: buildjet-4vcpu-ubuntu-2204-arm
3232
arch: arm64
3333
platform: "nvidia-jp5"
34-
- os: arm64-secure
34+
- os: buildjet-4vcpu-ubuntu-2204-arm
3535
arch: arm64
3636
platform: "nvidia-jp6"
3737
- os: ubuntu-latest

.github/workflows/yetus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
fetch-depth: 0
2626

2727
- name: Yetus
28-
uses: apache/yetus-test-patch-action@0.15.0
28+
uses: apache/yetus-test-patch-action@0.15.1
2929
with:
3030
basedir: ./src
3131
buildtool: nobuild

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ tools/get-deps/get-deps
2828
tools/get-deps/vendor
2929
pkg/installer/target
3030
pkg/installer/vendor
31+
pkg/monitor/eve-monitor-rs

CONTRIBUTING.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,65 @@ title".
281281

282282
Example of such a PR: [#4527](https://github.com/lf-edge/eve/pull/4527)
283283

284+
## Kernel development
285+
286+
The [eve-kernel](https://github.com/lf-edge/eve-kernel) project provides
287+
all kernel versions used by EVE. Some devices, like those from NVIDIA
288+
Jetson platform, use a different kernel from the main one. Each supported
289+
kernel is provided in a dedicated branch of the eve-kernel project so it
290+
facilitates the integration with EVE's build system. When contributing with
291+
a kernel change (adding a driver to the default configuration, providing a
292+
driver fix, etc) developers must pay attention to provide the change for
293+
all relevant kernel versions. All active branches of the eve-kernel project
294+
can be listed using the script `./tools/update_kernel_commits.py`:
295+
296+
```sh
297+
./tools/update_kernel_commits.py -v
298+
```
299+
300+
The output should be something like the following:
301+
302+
```text
303+
Fetching branch information from github...
304+
eve-kernel-amd64-v6.1.111-rt, Commit: c708a17493f1
305+
eve-kernel-amd64-v6.1.112-generic, Commit: 272f44dbfe09
306+
eve-kernel-arm64-v5.10.192-nvidia-jp5, Commit: 6e54f05fbd3b
307+
eve-kernel-arm64-v5.15.136-nvidia-jp6, Commit: 22e03b8516f2
308+
eve-kernel-arm64-v6.1.112-generic, Commit: 9f160b774dbc
309+
eve-kernel-riscv64-v6.1.112-generic, Commit: 18e1d313b90b
310+
skipping: linux-6.1.y
311+
skipping: main
312+
skipping: rucoder/new-sbom
313+
Checking for updated branches...
314+
eve-kernel-amd64-v6.1.111-rt, current commit: c708a17493f1
315+
eve-kernel-amd64-v6.1.112-generic, current commit: 272f44dbfe09
316+
eve-kernel-arm64-v5.10.192-nvidia-jp5, current commit: 6e54f05fbd3b
317+
eve-kernel-arm64-v5.15.136-nvidia-jp6, current commit: 22e03b8516f2
318+
eve-kernel-arm64-v6.1.112-generic, current commit: 9f160b774dbc
319+
eve-kernel-riscv64-v6.1.112-generic, current commit: 18e1d313b90b
320+
Checking for removed branches...
321+
eve-kernel-amd64-v6.1.111-rt, current commit: c708a17493f1
322+
eve-kernel-amd64-v6.1.112-generic, current commit: 272f44dbfe09
323+
eve-kernel-arm64-v5.10.192-nvidia-jp5, current commit: 6e54f05fbd3b
324+
eve-kernel-arm64-v5.15.136-nvidia-jp6, current commit: 22e03b8516f2
325+
eve-kernel-arm64-v6.1.112-generic, current commit: 9f160b774dbc
326+
eve-kernel-riscv64-v6.1.112-generic, current commit: 18e1d313b90b
327+
No kernel updates available.
328+
```
329+
330+
In this case the active branches are:
331+
332+
* eve-kernel-amd64-v6.1.111-rt
333+
* eve-kernel-amd64-v6.1.112-generic
334+
* eve-kernel-arm64-v5.10.192-nvidia-jp5
335+
* eve-kernel-arm64-v5.15.136-nvidia-jp6
336+
* eve-kernel-arm64-v6.1.112-generic
337+
* eve-kernel-riscv64-v6.1.112-generic
338+
339+
For instance, if the developer enables an USB Webcam driver in the
340+
`eve-kernel-amd64-v6.1.112-generic`, it must provide the patch for all
341+
other active branches as well, when applicable.
342+
284343
## Check how we are doing
285344

286345
Linux Foundation maintains a [project health dashboard](https://insights.lfx.linuxfoundation.org/foundation/lfedge/overview/github?project=project-eve)

Makefile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
1212

1313
# you are not supposed to tweak these variables -- they are effectively R/O
1414
HV_DEFAULT=kvm
15-
GOVER ?= 1.20.1
15+
GOVER ?= 1.24.1
1616
PKGBASE=github.com/lf-edge/eve
1717
GOMODULE=$(PKGBASE)/pkg/pillar
1818
GOTREE=$(CURDIR)/pkg/pillar
@@ -352,7 +352,7 @@ endif
352352

353353
# for the go build sources
354354
GOSOURCES=$(BUILDTOOLS_BIN)/go-sources-and-licenses
355-
GOSOURCES_VERSION=6047a068b2702ed2687cd13dcb7eaa2542d20344
355+
GOSOURCES_VERSION=v1.0.0
356356
GOSOURCES_SOURCE=github.com/deitch/go-sources-and-licenses
357357

358358
# for the compare sbom and collecte sources
@@ -458,7 +458,7 @@ currentversion:
458458

459459
.PHONY: currentversion linuxkit pkg/kernel
460460

461-
test: $(LINUXKIT) test-images-patches | $(DIST)
461+
test: $(LINUXKIT) pkg/pillar test-images-patches | $(DIST)
462462
@echo Running tests on $(GOMODULE)
463463
make -C pkg/pillar test
464464
cp pkg/pillar/results.json $(DIST)/
@@ -491,18 +491,19 @@ $(DOCKERFILE_FROM_CHECKER): $(DOCKERFILE_FROM_CHECKER_DIR)/*.go $(DOCKERFILE_FRO
491491
IGNORE_DOCKERFILE_HASHES_PKGS=alpine installer
492492
IGNORE_DOCKERFILE_HASHES_EVE_TOOLS=bpftrace-compiler
493493

494+
IGNORE_DOCKERFILE_DOT_GO_DIR=$(shell find .go/ -name Dockerfile -exec echo "-i {}" \;)
494495
IGNORE_DOCKERFILE_HASHES_PKGS_ARGS=$(foreach pkg,$(IGNORE_DOCKERFILE_HASHES_PKGS),-i pkg/$(pkg)/Dockerfile)
495496
IGNORE_DOCKERFILE_HASHES_EVE_TOOLS_ARGS=$(foreach tool,$(IGNORE_DOCKERFILE_HASHES_EVE_TOOLS),$(addprefix -i ,$(shell find eve-tools/$(tool) -path '*/vendor' -prune -o -name Dockerfile -print)))
496497

497498
.PHONY: check-docker-hashes-consistency
498499
check-docker-hashes-consistency: $(DOCKERFILE_FROM_CHECKER)
499500
@echo "Checking Dockerfiles for inconsistencies"
500-
$(DOCKERFILE_FROM_CHECKER) ./ $(IGNORE_DOCKERFILE_HASHES_PKGS_ARGS) $(IGNORE_DOCKERFILE_HASHES_EVE_TOOLS_ARGS)
501+
$(DOCKERFILE_FROM_CHECKER) ./ $(IGNORE_DOCKERFILE_HASHES_PKGS_ARGS) $(IGNORE_DOCKERFILE_HASHES_EVE_TOOLS_ARGS) $(IGNORE_DOCKERFILE_DOT_GO_DIR)
501502

502503
yetus:
503504
@echo Running yetus
504505
mkdir -p yetus-output
505-
docker run --rm -v $(CURDIR):/src:delegated,z ghcr.io/apache/yetus:0.15.0 \
506+
docker run --rm -v $(CURDIR):/src:delegated,z ghcr.io/apache/yetus:0.15.1 \
506507
--basedir=/src \
507508
--test-parallel=true \
508509
--dirty-workspace \
@@ -760,8 +761,8 @@ ifeq ($(ROOTFS_FORMAT),squash)
760761
endif
761762
$(QUIET): $@: Succeeded
762763

763-
$(GET_DEPS):
764-
$(MAKE) -C $(GET_DEPS_DIR) GOOS=$(LOCAL_GOOS)
764+
$(GET_DEPS): $(GOBUILDER)
765+
$(QUIET)$(DOCKER_GO) "make" $(GET_DEPS_DIR)
765766

766767
sbom_info:
767768
@echo "$(SBOM)"
@@ -913,7 +914,7 @@ cache-export-docker-load: $(LINUXKIT)
913914
rm -rf ${TARFILE}
914915

915916
%-cache-export-docker-load: $(LINUXKIT)
916-
$(eval IMAGE_TAG := $(shell $(MAKE) $*-show-tag))
917+
$(eval IMAGE_TAG := $(shell $(LINUXKIT) pkg show-tag --canonical pkg/$*))
917918
$(eval CACHE_CONTENT := $(shell $(LINUXKIT) cache ls 2>&1))
918919
$(if $(filter $(IMAGE_TAG),$(CACHE_CONTENT)),$(MAKE) cache-export-docker-load IMAGE=$(IMAGE_TAG),@echo "Missing image $(IMAGE_TAG) in cache")
919920

docs/CONFIG-PROPERTIES.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,14 @@
6868
| goroutine.leak.detection.cooldown.minutes | integer (minutes) | 5 | Cooldown period in minutes after the leak detection is triggered. During this period, no stack traces are collected; only warning messages are logged. |
6969
| kubevirt.drain.timeout | integer | 24 | hours to allow kubernetes to drain a node |
7070
| memory-monitor.enabled | boolean | false | Enable external memory monitoring and memory pressure events handling |
71+
| debug.tui.loglevel | string | info | Set log level for EVE Text UI (TUI) monitor. Possible values are "OFF", "ERROR", "WARN", "INFO", "DEBUG", "TRACE" and are case insensitive
72+
| log.dedup.window.size | integer | 0 | The size of the log deduplicator's sliding window (in number of messages). See logging [docs](LOGGING.md#log-filtering-counting-and-deduplication) for details. If the window size is set to 0 (default), no deduplication is performed. |
73+
| log.count.filenames | string | "" | Comma-separated list of log's filenames to be counted and logged once instead of logging them every time. Example `/my-pkg/main.go:123,/other-pkg/code.go:42`. See logging [docs](LOGGING.md#log-filtering-counting-and-deduplication) for details. |
74+
| log.filter.filenames | string | "" | Comma-separated list of log's filenames to be filtered out. Example `/my-pkg/main.go:123,/other-pkg/code.go:42`. See logging [docs](LOGGING.md#log-filtering-counting-and-deduplication) for details. |
7175

7276
## Log levels
7377

74-
Log level can be set for three different components of EVE: EVE microservices, syslog, and kernel.
78+
Log level can be set for four different components of EVE: EVE microservices, syslog, kernel, and TUI monitor application. Logs for TUI monitor are not sent to the controller and only available locally on the device.
7579
The log levels set this way are used to control the verbosity of the logs produced by the corresponding components.
7680
All logs produced this way will be saved locally in /persist/newlog/keepSentQueue/ directory and will be subject to rotation based on the max total size of stored logs.
7781

@@ -94,6 +98,7 @@ A corresponding "remote" log level can be set for each of the three components:
9498
| debug.syslog.remote.loglevel | string | info | level of the syslog messages sent to the controller. System default loglevel string representation should be used as described here ["https://man7.org/linux/man-pages/man3/syslog.3.html"]: emerg, alert, crit, err, warning, notice, info, debug. |
9599
| debug.kernel.loglevel | string | info | level of the produced kernel log messages. System default loglevel string representation should be used as described here ["https://man7.org/linux/man-pages/man3/syslog.3.html"]: emerg, alert, crit, err, warning, notice, info, debug. |
96100
| debug.kernel.remote.loglevel | string | info | level of the kernel log messages sent to the controller. System default loglevel string representation should be used as described here ["https://man7.org/linux/man-pages/man3/syslog.3.html"]: emerg, alert, crit, err, warning, notice, info, debug. |
101+
debug.tui.loglevel | string | info | Set log level for EVE Text UI (TUI) monitor. Possible values are "OFF", "ERROR", "WARN", "INFO", "DEBUG", "TRACE" and are case insensitive
97102

98103
In addition, there can be per-agent settings to overwrite the default log level set for EVE microservices.
99104
These use the same log levels as the default log level settings (logrus).

docs/LOGGING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,28 @@ The following diagram shows the flow of logs from containers to newlogd and to c
3636

3737
![EVE Log Flow](images/eve_newlog_flow.png)
3838

39+
### Application Logging and Nested Application Logging
40+
41+
For logs originating from sources containing the string `guest_vm-[Domain-ID]`, the `newlogd` service formats each log entry and writes it to a log file. These log files are named with the prefix `app.<app-uuid>`. This naming convention allows the controller to quickly dispatch log entries to the appropriate application instance for storage and display.
42+
43+
When log entries originate from nested applications within a runtime VM, the agent inside the runtime formats the entry using a proto/JSON structure defined as `NestedAppInstanceLogMsg`:
44+
45+
```go
46+
type NestedAppInstanceLogMsg struct {
47+
// NestedAppId is the AppId of the nested application instance or virtual application instance.
48+
// For example, a Docker Compose application instance ID.
49+
NestedAppId string `protobuf:"bytes,1,opt,name=nested_app_id,json=nestedAppId,proto3" json:"nested_app_id,omitempty"`
50+
// ContainerName is the shortened name of the container.
51+
// For example, a Compose application container name is project_name-service-replica.
52+
// This field should contain the service-replica suffix.
53+
ContainerName string `protobuf:"bytes,2,opt,name=container_name,json=containerName,proto3" json:"container_name,omitempty"`
54+
// Msg is the original log message from the runtime container.
55+
Msg string `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"`
56+
}
57+
```
58+
59+
The newlogd service subscribes to the NestedAppDomainStatus publication from zedrouter. It processes nested application logs similarly to how it handles DomainStatus publications, specifically in terms of generating log files for application log entries. If the VM's deployment type is "Docker" and a log entry's content can be successfully unmarshalled from JSON into the NestedAppInstanceLogMsg structure, the entry is written to a file with the prefix app.<nestedAppId>. This facilitates rapid log dispatch to the correct application instance (including nested application instances) on the controller side.
60+
3961
## Log Aggregation, Reformatting and Compression for Persistent Log Files
4062

4163
All logs collected from various containers/services/kernel in the system will reach newlogd daemon.
@@ -88,6 +110,34 @@ There are no granularity nobs for the edge apps' log levels - all logs generated
88110

89111
For the full list of log level parameters and the possible values, see the [config-properties](CONFIG-PROPERTIES.md#log-levels) doc.
90112

113+
## Log filtering, counting and deduplication
114+
115+
To reduce the amount of logs sent to the controller, EVE offers three mechanisms:
116+
117+
* filter
118+
* counter
119+
* deduplicator
120+
121+
All of the above are implemented in the newlogd daemon.
122+
The transformations are performed when newlog compresses the logs into gzip files.
123+
124+
Filter simply removes the specified log entries from the log file.
125+
126+
Counter counts the number of specified log entries and only keeps the first occurrence of the specified log entries.
127+
It also adds a "count" tag to that log entry with the number of times that log entry was repeated in the file.
128+
129+
The identifier for the log entries to be filtered or counted is the field "Filename" that's present in every [log entry](https://github.com/lf-edge/eve-api/go/logs/log.pb.go#L39).
130+
It's a string that contains the name of the source code file and the line number where the log entry was generated (e.g. "/my-pkg/main.go:123").
131+
The config properties for the filter and counter are:
132+
133+
* `log.count.filenames`
134+
* `log.filter.filenames`
135+
136+
Deduplicator goes through all log entries in the file, keeping a sliding window of the last N error messages.
137+
It checks: if the N+1'th message is already in the window - it is not logged.
138+
Either way the first message in the window is replaced with the new message (FIFO).
139+
The window size is configurable via the `log.dedup.window.size` config property.
140+
91141
## Log export to cloud
92142

93143
"loguploader" is a pillar service which is responsible for uploading the gzip log files to the controller. The binary data of a gzip file is the payload portion of the authentication protobuf envolope structure. This is similar to all the other EVE POST messages, except that in those messages the payload usually is data of another protobuf structure.

0 commit comments

Comments
 (0)