Extract ContainerAPIClient into a light, dependency-minimal client SDK for app frontends #1759
dioKaratzas
started this conversation in
Ideas
Replies: 1 comment
|
The team has been considering something similar to what you are asking for. You are correct, in that the |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
TL;DR: Could
ContainerAPIClientbe extracted/repackaged into a small, supported client SDK — its own FoundationCodablemodels plus the XPC client — that does not transitively pull the runtime (Containerization), gRPC, or NIO? A native app frontend that drives an installedcontaineronly needs XPC +Codable, but linkingContainerAPIClienttoday pulls ~34 packages (~28 MB stripped) and ties the client's source stability to a separately-versioned runtime.Who's asking / what works today
I'm building a native macOS management GUI on top of
container, shipped as a Developer-ID-signed, notarized, non-sandboxed app (DMG / Homebrew cask — not the App Store). LinkingContainerAPIClientand talking XPC to the per-usercontainer-apiserverworks today with zero entitlements —list()returns running containers (the other calls share the same XPC path). So this is not a "can I reach the API" request (that's the sandbox discussion, #323) — it's about the weight and shape of what an app frontend has to link.The problem: a client carries the whole engine
Linking
ContainerAPIClientresolves ~34 packages — gRPC (×3), SwiftNIO (×5), swift-protobuf, the entirecontainerizationruntime, Yams, zstd, … — for a ~28 MB (stripped) / ~53 MB binary. A client that just does XPC +Codableshouldn't need the runtime or a gRPC/HTTP stack. The weight comes from two couplings:ContainerResource(the model types) imports theContainerizationmodules and exposes those types in public signatures — e.g.ContainerSnapshot.platformisContainerizationOCI.Platform. Sincecontainerizationis pinned withexact:inPackage.swift, an embedder's client is transitively bound to the runtime.ContainerBuild/ BuildKit) brings gRPC and protobuf, which a non-building client never calls.The ask: extract a light client SDK
A dedicated product — say
ContainerClientKit— containing:CodableDTOs for the resources (container, image, volume, network, registry, machine, system, stats, disk-usage), rather than re-exportedContainerizationtypes; andContainerXPCimports onlyFoundation(plus a small error module). Today'sContainerClientcouples toContainerizationonly through the types in its method signatures, which is exactly what client-owned DTOs would replace.…and that depends on none of
Containerization, gRPC, NIO, or protobuf. That single change shrinks an embedding app dramatically and decouples the client from the runtime's dependency graph.Is extracting a light client SDK product something the team would consider?
All reactions