MCPcopy Index your code
hub / github.com/balena-os/balena-engine

github.com/balena-os/balena-engine @v20.10.44

Chat with this repo
repository ↗ · DeepWiki ↗ · release v20.10.44 ↗ · + Follow
11,800 symbols 54,622 edges 1,631 files 4,974 documented · 42% updated 4d agov20.10.43 · 2024-02-06★ 74164 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

balenaEngine

moby-based container engine for IoT

Highlights

  • Small footprint: 3.5x smaller than Docker CE, packaged as a single binary
  • Multi-arch support: Available for a wide variety of chipset architectures, supporting everything from tiny IoT devices to large industrial gateways
  • True container deltas: Bandwidth-efficient updates with binary diffs, 10-70x smaller than pulling layers
  • Minimal wear-and-tear: Extract layers as they arrive to prevent excessive writing to disk, protecting your storage from eventual corruption
  • Failure-resistant pulls: Atomic and durable image pulls defend against partial container pulls in the event of power failure
  • Conservative memory use: Prevents page cache thrashing during image pull, so your application runs undisturbed in low-memory situations

Motivation

balenaEngine is a container engine purpose-built for embedded and IoT use cases and compatible with Docker containers. Based on Docker’s Moby Project, balenaEngine supports container deltas for 10-70x more efficient bandwidth usage, has 3x smaller binaries, uses RAM and storage more conservatively, and focuses on atomicity and durability of container pulling.

Since 2013, when we first ported Docker to ARMv6 and the Raspberry Pi, the balena team has been working in and around the Docker codebase. Meanwhile, having seen IoT devices used in production for tens of millions of hours, we’ve become intimately acquainted with the unique needs of the embedded world. So we built a container engine that runs Docker containers just as well, shares the Docker components that are needed for our use case, and is augmented with the IoT-specific features that we’ve built out over time.

Transitioning from Docker CE

We left out Docker features that we saw as most needed in cloud deployments and therefore not warranting inclusion in a lightweight IoT-focused container engine. Specifically, we’ve excluded:

  • Docker Swarm
  • Cloud logging drivers
  • Plugin support
  • Overlay networking drivers
  • Non-boltdb discovery backends (consul, zookeeper, etcd, etc.)
  • Buildkit (although support can be enabled using a build tag)

Unless you depend on one of the features in Docker that balenaEngine omits, using balenaEngine should be a drop-in replacement.

License

balenaEngine is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

Extension points exported contracts — how you extend this code

PushLayerProvider (Interface)
PushLayerProvider provides layers to be pushed by ChainID. [50 implementers]
distribution/config.go
ErrNotFound (Interface)
import "github.com/docker/docker/errdefs" ErrNotFound signals that the requested object doesn't exist [8 implementers]
errdefs/defs.go
BuilderContext (Interface)
import "github.com/docker/docker/pkg/tarsum" BuilderContext is an interface extending TarSum by adding the Remove method [30 …
pkg/tarsum/builder_context.go
SizeReaderAt (Interface)
SizeReaderAt is an interface used to get a ReaderAt as well as the size of the underlying reader. Note that the size of [16 …
pkg/tailfile/tailfile.go
Watcher (Interface)
Watcher provides watching over a cluster for nodes joining and leaving. [8 implementers]
pkg/discovery/discovery.go
SetupTestSuite (Interface)
SetupTestSuite has a SetupTest method, which will run before each test in the suite. [9 implementers]
internal/test/suite/interfaces.go
Process (Interface)
Process of a container [22 implementers]
libcontainerd/types/types.go
NamedOption (Interface)
NamedOption is an interface that list and map options with names implement. [44 implementers]
opts/opts.go

Core symbols most depended-on inside this repo

Join
called by 1387
api/server/router/swarm/backend.go
Contains
called by 1111
pkg/discovery/entry.go
New
called by 741
builder/builder-next/executor_unix.go
Close
called by 551
builder/builder.go
String
called by 540
daemon/graphdriver/driver.go
RemoveAll
called by 426
daemon/graphdriver/lcow/remotefs_filedriver.go
Cmd
called by 347
integration-cli/daemon/daemon.go
Run
called by 343
daemon/logger/copier.go

Shape

Method 5,615
Function 4,636
Struct 1,131
Interface 231
TypeAlias 120
FuncType 63
Class 4

Languages

Go100%
C1%

Modules by API surface

integration-cli/docker_cli_build_test.go252 symbols
integration-cli/docker_cli_run_test.go239 symbols
client/interface.go131 symbols
integration-cli/docker_cli_daemon_test.go117 symbols
daemon/graphdriver/devmapper/deviceset.go117 symbols
integration-cli/docker_cli_network_unix_test.go79 symbols
integration-cli/docker_api_containers_test.go77 symbols
integration-cli/docker_cli_run_unix_test.go75 symbols
errdefs/helpers.go66 symbols
pkg/archive/archive_test.go62 symbols
api/types/container/host_config.go56 symbols
api/types/types.go54 symbols

For agents

$ claude mcp add balena-engine \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact