581 Commits

Author SHA1 Message Date
Arnav Reddy 5427fd21de LinuxContainer: stop the VM when setup fails after start (#836)
vm.start() sits outside the do block that owns teardown. This change
prevents a failure in the agent setup from orphaning a VM.
0.41.0
2026-08-10 09:52:44 -04:00
Arnav Reddy dac8a2ca8c LinuxContainer: finish the copyOut metadata stream on every path (#837)
metadataCont.finish() only runs inside onMetadata, which vminitd.copy
never invokes when the guest path is missing.
2026-08-10 09:45:12 -04:00
Arnav Reddy 55d1dc95e2 ImageStore: write state.json atomically (#835)
save() encodes into state.json in place, so a concurrent reader can
observe a truncated or garbled file.
2026-08-10 09:43:03 -04:00
Michael Crosby fc2b9bd816 align timeout for all platforms (#834)
Signed-off-by: michael_crosby <michael_crosby@apple.com>
2026-08-10 09:42:16 -04:00
Islam Gagiev b9c65e59b2 fix(oci): render arm64 platform description without redundant v8 (#783)
- Omit the redundant `v8` variant for arm64 when rendering
  `description`, so equal arm64 platforms always describe as
  `linux/arm64` — matching how Docker and containerd display
  the platform. Other variants (`arm/v7`) and architectures
  (`amd64`) are unaffected.
- Only the rendered `description` changes. The stored `variant`
  and the `Codable` encoding are untouched, so OCI content
  digests remain stable.
- Closes apple/container#1542 (normalization-consistency aspect).
2026-08-07 08:19:40 -07:00
Saehej Kang d18b82867e [gitignore]: ignore vscode workspace files (#817)
In case any devs are using `vscode` we should add this so autogenerated
files are not accidentally committed.
2026-08-06 23:56:24 -07:00
Aditya Ramani 2ec221af5a Fix bug when comparing the Platform struct (#833)
This fixes a latent bug in the `Platform` types equality operator where
two platforms with differing OS's would be treated as the same if they
both had variant set to 'v8' or nil
2026-08-06 11:18:01 -07:00
Aditya Ramani 5796abeaea Use a custom volume for build cache inside of a container (#828)
Keep in-container Swift build directories away from the virtiofs
`/workspace` share and use a named volume instead for the cache store
0.40.2
2026-07-31 10:51:05 -07:00
Vyncint Ng ff44a5b683 Redact environment variable values in vminitd debug logs (#813)
Fixes #518.

## What

vminitd logs the full OCI spec and exec process at debug level in
`ManagedContainer` ("created bundle with spec …", "creating exec process
with …"), which puts every `NAME=value` environment entry into the boot
log. Environment variables routinely carry secrets, so `container logs
--boot web | grep PASSWORD` reproduces the leak exactly as described in
#518.

Rather than redacting at the call sites, this makes the redacted form
the *default* rendering of the types that own an environment: `Process`
and `Hook` conform to `CustomStringConvertible` with values masked and
names kept. `Spec` and `Hooks` inherit it, because Swift's
reflection-based description renders a nested value through that value's
own `description`.

The effect is that any `\(spec)` or `\(process)` is safe without the
author knowing this file exists, which is what stops a log line added
later from reintroducing the leak. The two existing log sites are
unchanged, so this no longer touches vminitd at all.

Two details worth calling out:

- **`Codable` is untouched.** `description` governs text rendering only,
so an encoded spec still carries the real values and nothing changes
about what is written to disk or sent to the guest. The unredacted
environment also remains available to callers through `process.env`.
- **`description` renders through a mirror** rather than a hand-written
field list. `Process` has 13 fields; listing them by hand would drop the
rest from the log line and would rot as fields are added.

## Verification

- New `SpecRedactionTests` (9 tests) cover: a whole `Spec` interpolated
into a log line never renders the values; `String(describing:)` and
`String(reflecting:)` are redacted too; variable names survive;
`NAME`-only inherit entries pass through; `NAME=` and values containing
further `=` are masked whole; encoding round-trips with the real values;
rendering does not mutate; and the other fields are still rendered.
- Negative control: with the redaction disabled the suite fails with 13
issues, and the output shows the secret in the clear, reproducing #518.
- Full `ContainerizationOCITests` passes, 58 tests in 9 suites.
- `swift format lint --strict --configuration .swift-format-nolint` is
clean, and `swift format` leaves both files unchanged.

Every line here is one I can explain and justify; the reasoning above is
the complete rationale for each change.
2026-07-29 13:49:56 -04:00
Aditya Ramani 7800b46421 Dont remount /run/virtiofs when adding container (#824)
Track if `/run/virtiofs` is mounted in the guest and dont attempt to
re-mount it if it already is
0.40.1
2026-07-28 13:08:21 -07:00
Kathryn Baldauf 3a224e9f90 Make nested virt optional for makefile linux_run helper function (#822)
This PR allows callers to use `linux_run` in the makefile without
relying on nested virtualization by default. This allows us to build a
subset of makefile targets on machines where nested virtualization is
not supported.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-07-28 11:15:27 -07:00
Kathryn Baldauf 50f7722296 Mask high mode bits in archive reader (#816)
Build containerization / containerization (push) Failing after 0s
Release containerization / containerization (push) Failing after 0s
Build containerization / Verify commit signatures (push) Has been cancelled
Linux build / Determine Swift version (push) Has been cancelled
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Linux build / Linux compile check (push) Has been cancelled
This PR masks the high mode bits when setting file attributes for
consistency with mode at file creation.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
0.40.0
2026-07-27 11:42:07 -07:00
Michael Crosby a4d2510a3c Fix virtiofs makefile syntax (#815)
Signed-off-by: michael_crosby <michael_crosby@apple.com>
2026-07-27 12:08:45 -04:00
Michael Crosby 74ace148de Build vminitd and initfs inside the dev container (#810)
Build containerization / containerization (push) Failing after 1s
Build containerization / Verify commit signatures (push) Has been cancelled
Linux build / Determine Swift version (push) Has been cancelled
Linux build / Linux compile check (push) Has been cancelled
Signed-off-by: michael_crosby <michael_crosby@apple.com>
2026-07-24 11:04:06 -04:00
Kameron Kilchrist 450d44ecb6 perf: index EXT4 FileTree children by name to avoid O(n^2) unpack (#793)
- `FileTree.lookup` resolved each path component by linearly scanning the
  node's `children` array. This changes the node's child storage to an
  `OrderedDictionary<String, Ptr<FileTreeNode>>` (from swift-collections,
  which is already a package dependency) keyed by name, so `lookup`
  resolves each component in O(1) while iteration keeps the existing
  insertion order.
- Little or no difference in unpack time for images with ~10k files, significant
  improvement for images with ~100k files or more.
2026-07-23 14:34:28 -07:00
Michael Crosby 2563ed5736 feat: virtiofs rootfs hotplug for LinuxPod on cloud-hypervisor (#809)
Build containerization / containerization (push) Failing after 2s
Build containerization / Verify commit signatures (push) Has been cancelled
Linux build / Determine Swift version (push) Has been cancelled
Linux build / Linux compile check (push) Has been cancelled
Release containerization / containerization (push) Failing after 1s
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Allow a container hotplugged into an already-running LinuxPod VM
(addContainer after create()) to have a virtiofs (directory-share)
rootfs, not just an ext4 virtio-blk image, on the cloud-hypervisor
backend.

Host side:
- Generalize CHHotplugProvider.hotplug to branch on the rootfs
runtimeOptions (.virtioblk / .virtiofs / unsupported), reusing the
per-tag virtiofsd/vm.add-fs machinery factored into a new
ensureVirtiofsDevice helper. Make registerMounts the sole writer of the
per-VM mount registry so the rootfs is always first and mounts are not
double-registered (also fixes a latent ordering bug on the block path).
Exclude the rootfs from the /run/virtiofs holding-dir loop in
addContainer.

Guest side (fixes a pre-existing, feature-independent bug):
- The addContainer-after-create (runtime hotplug) path had never been
exercised by any test. cloud-hypervisor adds hot-plugged
virtio-blk/virtio-fs devices to the guest PCI bus but the guest does not
auto-probe them, so a mount by /dev/vdX or virtio-fs tag fails (ENOENT /
tag-not-found) for ALL CH hotplug.
- vminitd's mount RPC now, on a mount failure for a hot-plug-candidate
source (virtiofs type or /dev/vd* source), forces /sys/bus/pci/rescan
and retries with a bounded wait. Scoped so boot-time and non-device
mounts are unaffected.

Tests / build:
- First coverage of LinuxPod.addContainer after create() (CH-only; VZ
has no runtime hotplug): pod hotplug virtiofs rootfs and pod hotplug
block rootfs, registered in a Linux-only test list, plus a
directory-rootfs unpack helper.
- make linux-integration gains an optional FILTER passthrough (make
linux-integration FILTER="pod hotplug").

Signed-off-by: michael_crosby <michael_crosby@apple.com>
0.39.0
2026-07-23 11:00:57 -04:00
J Logan 4f8dc6b53c Update Package.resolved with latest versions. (#808)
Build containerization / Verify commit signatures (push) Has been cancelled
Linux build / Determine Swift version (push) Has been cancelled
Linux build / Linux compile check (push) Has been cancelled
Build containerization / containerization (push) Successful in 1s
- Closes #807.
- Ensure everything builds and passes with latest conforming package
versions.
- Use swift-collections 1.5.1 instead of 1.6.0 due to Swift 6.3
limitations.
2026-07-21 18:27:36 -07:00
Aditya Ramani d9868bb657 Add support for tmpfs based pod volumes (#803)
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Release containerization / containerization (push) Successful in 1s
`tmpfs` based volumes can also be shared between containers in the same
`LinuxPod`. This change adds support for it
0.38.0
2026-07-20 16:07:05 -07:00
J Logan 5d5204a383 Add journal parameter to EXT4Unpacker unpack(). (#806)
- Follow up PR #775 to add `journal` to the other `unpack()` call, which
is the one the container tool uses.
2026-07-20 15:54:50 -07:00
adityabagchi24 585fd8cfd2 Rename misleading blockSizeInBytes parameter to capacityInBytes in EXT4Unpacker (#789)
- Closes #787.
- The `blockSizeInBytes` parameter on `EXT4Unpacker`
  was misleading — it does not represent an ext4 filesystem
  block size.
- This change renames `blockSizeInBytes` to
  `capacityInBytes`, updates the doc comment to accurately
  describe the parameter and updates the name in the call
  sites.
2026-07-18 16:43:53 -07:00
Steve 2a591c2aee fix(package): exclude CloudHypervisor README (#798)
## Summary

Exclude `Sources/CloudHypervisor/README.md` from the `CloudHypervisor`
SwiftPM target. The README remains tracked and available as source
documentation, while package evaluation and builds no longer emit an
unhandled-file warning.

## Motivation


[apple/containerization#782](https://github.com/apple/containerization/pull/782)
added a standalone `CloudHypervisor` target with a README inside its
source directory. SwiftPM requires non-source files in target
directories to be declared as resources or excluded. This README is
documentation rather than a runtime resource, so exclusion is the
smallest accurate manifest change.

## Changes

- Add `README.md` to the `CloudHypervisor` target's `exclude` list.
- Preserve the existing README content and location.
- Leave runtime code, products, resources, and package APIs unchanged.

## Validation

```sh
swift package describe >/dev/null
swift test --disable-automatic-resolution --filter CloudHypervisorTests
make check
git diff --check upstream/main...HEAD
```

- Package evaluation completes without the
`Sources/CloudHypervisor/README.md` warning.
- All 41 focused `CloudHypervisorTests` pass.
- Swift formatting and Hawkeye license checks pass.
- The committed diff has no whitespace errors.

## Compatibility And Risk

This manifest-only change does not alter compiled sources, runtime
resources, public APIs, or supported platforms. The README is already
non-executable documentation, so excluding it accurately records
SwiftPM's intended treatment of the file.

## Related

- Follow-up to
[apple/containerization#782](https://github.com/apple/containerization/pull/782).

## Release Note Highlight

- Stops SwiftPM builds from warning about the `CloudHypervisor` README
added by
[apple/containerization#782](https://github.com/apple/containerization/pull/782).
2026-07-15 10:20:08 -04:00
Aditya Ramani 2f947e7614 Unset CONFIG_VSOCKETS_LOOPBACK in kernel config (#797)
Align this setting with what the Kata kernel used by the container tool
specifies.
2026-07-09 17:25:44 -07:00
Michael Crosby 315341b625 add masked and readonly path support (#795)
Signed-off-by: michael_crosby <michael_crosby@apple.com>
2026-07-08 16:47:16 -04:00
Michael Crosby 6093542d9c cctl: deprecate creds over http (#788)
Signed-off-by: michael_crosby <michael_crosby@apple.com>
2026-07-08 14:31:26 -04:00
Michael Crosby 1d5641ff96 fix hotplug mounting of virtiofs (#794)
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Release containerization / containerization (push) Successful in 1s
Signed-off-by: michael_crosby <michael_crosby@apple.com>
0.37.0
2026-07-07 18:09:37 -04:00
adityabagchi24 7aa4e723f6 Upgrade grpc-swift-nio-transport to 2.9.0 and remove HTTP2ConnectBuff… (#778)
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Release containerization / containerization (push) Successful in 1s
- Fixes #776
- Release 2.9.0 of `grpc-swift-nio-transport` fixes
  the HTTP/2 initialization race that required a
  `HTTP2ConnectBufferingHandler` for the vminitd
  API. This upgrades the dependency and eliminates
  the workaround.
0.36.0
2026-07-07 08:49:17 -07:00
Michael Crosby bd709ba8cb fix: default to restricted OCI capability set (#786)
Changes the default Linux capability set for container processes from
`.allCapabilities` to `.defaultOCICapabilities`, making the library
secure-by-default. Callers that genuinely need elevated capabilities
must now opt in explicitly.

Signed-off-by: michael_crosby <michael_crosby@apple.com>
2026-07-02 12:45:15 -04:00
Michael Crosby b438e97b93 Add cloud-hypervisor VMM backend for Linux hosts (#782)
apple/containerization currently runs containers in per-container VMs on
macOS hosts via Virtualization.framework. This adds a second VMM backend
so the same Swift orchestration layer (LinuxContainer / LinuxPod /
Vminitd gRPC contract) runs on Linux hosts via cloud-hypervisor + KVM.

**CloudHypervisor Swift package** (`Sources/CloudHypervisor/`) — a thin
client for cloud-hypervisor's REST-over-UDS API, layered on
AsyncHTTPClient. Endpoints cover VMM / VM lifecycle / hotplug (disk, fs,
net, vsock, remove-device). Cross-platform (compiles on macOS for unit
tests; consumed at runtime only by the Linux side of Containerization).

**CH backend in Containerization** — one cloud-hypervisor subprocess per
VM, gated behind `#if os(Linux)`. CHVirtualMachineManager /
CHVirtualMachineInstance mirror the VZ shape behind the existing
VirtualMachineManager / VirtualMachineInstance protocol. CHProcess and
VirtiofsdProcess manage the binaries; CHHotplugProvider handles
virtio-blk and virtio-fs runtime hotplug (with one virtiofsd per unique
source-hash tag, refcounted across containers).

**Linux host networking** — BridgeManager brings up a Linux bridge with
an IPv4 subnet and (opt-in via `--enable-nat`) iptables MASQUERADE +
scoped FORWARD rules. LinuxBridgedNetwork enslaves a fresh TAP per
container to the bridge. State is recorded under `/run/containerization`
so `cctl bridge delete` reverses exactly what create did. Bridge
teardown verifies the link kind via sysfs to refuse deleting non-bridge
interfaces.

**cctl run / bridge** — end-to-end Linux container run path (image pull,
ext4 rootfs assembly, VM boot, container exec) plus `cctl bridge
create|delete` for the host network plumbing.

**Build & dist** — `make linux-build` / `make linux-integration` build
and exercise the host side inside an apple/container `--virtualization`
dev container. `make dist-x86_64` produces a deployment tarball (cctl +
cloud-hypervisor + virtiofsd + initfs + kernel) cross-compiled from the
aarch64 dev container; pipeline documented in `docs/x86_64-build.md`.
Static-musl C deps and the Zig cross compiler are pinned by SHA256.

The host orchestrator runs as root. Per-VM runtime state lives under
`/run/containerization/ch/<UUID>` with mode 0700; UDS sockets inside are
bound with mode 0600. Vminitd's gRPC channel inherits that trust
boundary — socket-file perms are the auth.

Sandbox flags are upstream-secure by default. Two per-component opt-outs
exist for the apple/container dev-container case (where the host seccomp
profile SIGSYS-kills CH and virtiofsd):
- `CONTAINERIZATION_NO_CH_SECCOMP=1` — `cloud-hypervisor --seccomp
false`.
- `CONTAINERIZATION_NO_VIRTIOFSD_SANDBOX=1` — `virtiofsd --sandbox
none`. Each emits a one-shot `logger.warning` at process start. Legacy
alias `CONTAINERIZATION_RELAXED_SANDBOX=1` flips both. cctl spawns both
binaries with `setsid` and a minimal env allowlist (PATH / HOME /
RUST_LOG / RUST_BACKTRACE) so the parent's secrets don't leak to
children.

`make linux-integration` runs the cross-platform integration suite
against a real cloud-hypervisor VM inside the dev container. Linux runs
the cross-platform subset (`process true`/`false`/`echo hi`, virtiofs
round-trip, hotplug); the macOS suite is unchanged.

Signed-off-by: michael_crosby <michael_crosby@apple.com>
2026-07-02 11:20:22 -04:00
Kathryn Baldauf ade205218c Add checksum validation to hawkeye installation (#785)
Related to https://github.com/apple/container/pull/1869

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-06-30 13:40:34 -07:00
Aditya Ramani 44bec8b993 Support disk image based pod volumes (#780)
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Release containerization / containerization (push) Successful in 1s
The `PodVolume` type in `LinuxPod` only defined the `nbd` enum value -
however, disk based images are also supported and the pattern is
essentially the same

Signed-off-by: Aditya Ramani <a_ramani@apple.com>
0.35.0
2026-06-26 10:55:36 -07:00
Malte Poll d992a1996d fix(EXT4): create missing parent dirs for hardlinks during unpack (#777)
When unpacking an OCI/tar layer, create() already creates missing parent
directories recursively, so regular files and symlinks with absent
parent entries unpack correctly. link() did not, so a hardlink whose
parent directory had no explicit archive entry failed with "<path> not
found" (e.g. images produced by Bazel rules_img). Mirror create()'s
implicit parent creation in link() so such layers unpack, matching
Docker/containerd.

Adds a direct link() unit test and an end-to-end unpack regression test
covering a hardlink, regular file, and symlink with no explicit parent.

Fixes https://github.com/apple/container/issues/1797
2026-06-24 10:31:07 -07:00
J Logan a132341dc6 Make EXT4Unpacker configurable for journal mode. (#775)
- Closes #774.
- Adds a default journal configuration parameter to the EXT4Unpacker
init function, defaulting to nil (no journal) to preserve source
compatibility.
2026-06-23 10:41:25 -07:00
Saehej Kang 6b7b42ca3e [vminitd]: api for trim filesystem operations (#700)
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Release containerization / containerization (push) Successful in 1s
Addition of `vminitd` API for trim filesystem operations

Closes #773

Depends on #685
0.34.0
2026-06-20 06:32:23 -07:00
Saehej Kang 5887dc55f3 [vminitd]: api for freeze/thaw filesystem operations (#685)
Addition of `vminitd` API for freeze/thaw filesystem operations

Closes #660
2026-06-19 14:45:17 -07:00
Aditya Ramani d55cc188ce Allow setting log level for vminitd (#772)
The `--log-level` option when running the agent sub-command for vminitd
was being silently ignored cause of the way the agent is being run. As a
workaround we need to read `/proc/self/cmdline` to get the right args
2026-06-16 18:04:31 -07:00
Mojtaba Hosseini 7e2ae5a170 docs: fix traversal in a public method's documentation (#770)
Seems like a typo.
The change only affected a comment and does not disturb the code at all
(backward compatible).

Co-authored-by: J Logan <john_logan@apple.com>
2026-06-16 12:41:46 -07:00
Michael Crosby ddd19a61a8 add x86 kernel config (#765)
Add x86 kernel config and build scripts.

Signed-off-by: michael_crosby <michael_crosby@apple.com>
2026-06-16 12:47:20 -04:00
J Logan e29657b86e Pin macOS CI builds to Swift 6.3 for now. (#771)
- CI runners moved to the Xcode developer beta as the default, but macOS
builds are failing with a conflicting options error for
`-warnings-as-errors` and `-suppress-warnings`.
2026-06-16 11:44:27 -04:00
Vitor Hugo 4f6df44c2a fix(Platform): make arm64 nil-variant and v8 hash identically (#764)
## Summary

`Platform.==` treats `arm64` with `nil` variant as equal to `arm64/v8`,
but `hash(into:)` used `description` which serializes them differently
(`linux/arm64` vs `linux/arm64/v8`). This violates the `Hashable`
contract — equal values must produce the same hash.

### Root cause

```swift
// == returns true for these two
let a = Platform(arch: "arm64", os: "linux", variant: nil)
let b = Platform(arch: "arm64", os: "linux", variant: "v8")
a == b // true ✓

// but hash was different — broken
a.hashValue == b.hashValue // false ✗ (before this fix)
```

This mismatch caused `Set<Platform>` and `Dictionary<Platform, ...>`
lookups to silently miss entries when one platform was decoded from JSON
(no `variant` field in the manifest) and another was created via
`Platform(from:)` or `Platform.current` (which both set `variant =
"v8"`).

### Practical consequence

In `apple/container`, this manifests as inconsistent platform-string
normalization across stages of a single `container build` — some stages
log `linux/arm64`, others `linux/arm64/v8` — which can cause `COPY
--from=<stage>` to fail to resolve the source stage under concurrent
builds. See apple/container#1542.

### Fix

`hash(into:)` now normalizes `arm64` with `nil` variant to `"v8"` before
hashing, matching the existing `==` behavior.
2026-06-16 10:06:06 -04:00
Kathryn Baldauf 1437c67f5a Update github actions to use SHA versions (#763)
Related to https://github.com/apple/container/pull/1649. This PR updates
the GitHub workflows to ensure all imported actions are referenced by
commit SHA.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-06-04 15:08:22 -07:00
Danny Canter 9275f365dd [Experimental] Add Sandboxy binary (#607)
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Release containerization / containerization (push) Successful in 1s
Sandboxy is an example tool to run isolated coding agents.
0.33.4
2026-06-03 12:27:49 -04:00
Yibo Zhuang e1e31b7ae9 add IPv6 support (#752)
Extends the network plumbing to support per-interface IPv6 address
configuration.
The `Interface` protocol supports `ipv6Address` and `ipv6Gateway`.
The agent's networking RPCs carry per-family fields via new
`InterfaceAddress`, `LinkRoute`, and `DefaultRoute` types in
`ContainerizationExtras`.
`NetlinkSession` adds IPv6 methods for address and route operations.

---------

Co-authored-by: michael_crosby <michael_crosby@apple.com>
Co-authored-by: Michael Crosby <crosbymichael@gmail.com>
2026-06-03 12:07:20 -04:00
Yibo Zhuang 72043f90ac ContentStore: Fix totalAllocatedSize on Linux (#761)
`.totalFileAllocatedSizeKey` returns nil for directories on Darwin but
on Linux it returns `st_blocks * st_blksize` (4 KB each) in Foundation.
The empty-store test summed three directory inodes on Linux and failed
with `#expect(size == 0)`. This change adds filter on the enumerator to
regular files only so the totals are content-only and will work for both
Darwin and Linux.
2026-06-01 17:06:09 -07:00
Raj a2a1add6c7 Add totalAllocatedSize to ContentStore (#760)
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Release containerization / containerization (push) Successful in 1s
This PR adds `totalAllocatedSize()` to the `ContentStore` protocol so it
can be used to get the on-disk footprint without reaching past the
abstraction. `LocalContentStore` implements it by walking its base path,
covering both committed blobs and active ingest sessions.
0.33.3
2026-06-01 14:22:04 -07:00
Danny Canter 6cb66583e2 Stats: Expose more memory stats (#758) 2026-06-01 11:52:53 -07:00
Danny Canter b1e779eb2a Cgroup2: Add ability to filter stats (#757) 2026-06-01 11:51:50 -07:00
mlsad3 fd820380a6 Fix head-of-line blocking and resource leak in BidirectionalRelay (#713)
- Closes #712.
- Replace synchronous `write()` calls in
  `BidirectionalRelay` with non-blocking I/O
  and `DispatchSourceWrite` backpressure
  handling. Under concurrent vsock proxy load,
  a single blocked write on the shared serial
  dispatch queue would freeze all relay
  connections permanently, including unrelated
  new connections.
- Set relay file descriptors to `O_NONBLOCK`
  and handle `EAGAIN` by suspending reads and
  installing a write source to drain pending data.
- Give each `BidirectionalRelay` its own serial queue
  instead of sharing one from `UnixSocketRelayManager`,
  eliminating cross-connection blocking.
- Resume suspended read sources before cancelling
  in `stop()` — GCD does not deliver cancel handlers
  on suspended dispatch sources, which caused file
  descriptor and memory leaks on teardown under
  backpressure.
- Guard-unwrap `buf.baseAddress` in
  `drainPendingWrite`.
2026-06-01 10:33:36 -07:00
Saehej Kang 2550dd49f1 [os]: add FilePathOps utility type + initial absolute path function (#751)
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Release containerization / containerization (push) Successful in 1s
- Closes #744
- Adds the initial `FilePathOps` utility type
- Adds the `absolutePath` implementation
- Adds the `FilePathOpsTests` file and initial test cases
0.33.2
2026-05-27 08:27:28 -07:00
pickle-RickA 565e8a3e02 Improve documentation formatting and consistency (#633)
Small documentation improvements for better consistency:

- Fixed capitalization (url → URL) in kernel README
- Added bash syntax highlighting to code block in lab.md  
- Improved formatting consistency in ctr-example README (added colon +
code fence)

Co-authored-by: pickle-RickA <273219719+pickle-RickA@users.noreply.github.com>
2026-05-27 00:23:39 -07:00
Aditya Singh d09a1026b7 Fix incorrect byte shift in IPv4Address byte-array initializer (#754)
The `IPv4Address(_ bytes: [UInt8])` initializer in
ContainerizationExtras shifts the third octet by 16 bits instead of 8:

```swift
self.value =
    (UInt32(bytes[0]) << 24)
    | (UInt32(bytes[1]) << 16)
    | (UInt32(bytes[2]) << 16)   // should be << 8
    | UInt32(bytes[3])
```

Because `bytes[2]` lands in the same bit range as `bytes[1]`, the second
octet gets corrupted by the OR, the third octet is dropped, and bits 8
through 15 are always left zero. Concretely, decoding `[192, 168, 1, 1]`
yields `192.169.0.1` instead of `192.168.1.1`, and `[18, 52, 86, 120]`
yields `18.118.0.120` instead of `18.52.86.120`.

This went unnoticed because the `bytes` computed property getter uses
the correct `>> 8` for the third octet, but there was no test exercising
the byte-array initializer, so the encode and decode paths were never
checked against each other. The sibling `IPv6Address(_ bytes:)`
initializer uses the correct descending shifts (`<< 120, << 112, ... <<
8, << 0`), which is what the IPv4 version should mirror.

The fix changes the third octet shift to 8 bits so the initializer is
the exact inverse of the `bytes` property. I also added two tests to the
initializer suite: a valid-input test that asserts both the resulting
`value` and that `init(bytes).bytes == bytes` round-trips, and an
invalid-length test. The round-trip test fails on the current code and
passes with the fix.

Verification: `swift test --filter ContainerizationExtrasTests` passes
221 tests in 26 suites (the IPv4Address suite goes from 23 to 25 tests).
The new round-trip test fails before the one-line change and passes
after.

Signed-off-by: Aditya Singh <adisin650@gmail.com>
2026-05-26 13:38:05 -07:00