How spkenv/spk works
Project’s Core Purpose and Type
• This project is a combination of two related systems:
– SPFS, which implements process filesystem isolation (with support for Fuse on Unix and WinFsp on Windows);
– SPK, a packaging system built on top of SPFS to manage software environments and dependencies.
• The target domain is high-velocity software environments where filesystem capture, layering, and package management are critical.
• The Rust codebase is split into many smaller “crates” (libraries, CLI commands, build tools, etc.) for modular development and independent testing.
Break Down the Architecture into Main Components
• SPFS Core:
– Include subcomponents representing the layers of abstraction (e.g., “Virtual Filesystem (VFS)”, “Fuse/WinFsp Adapters”, “Storage/Database Modules”, “Runtime Isolation Layers”).
– Indicate integration for both Unix and Windows (e.g., “spfs/src/status_unix.rs” and “spfs/src/status_win.rs”).
• SPK Packaging System:
– Represent a component labeled “SPK” built on top of SPFS.
– Show the connection between SPK and the underlying SPFS environment.
• Common Libraries and Support Crates:
– Indicate that these “crates” provide supporting functionality to the core systems (e.g., encoding, schema parsing, dependency resolution, build validation).
• Packages and Examples:
– Optionally, add a connector to show how these recipes are used by SPK to build and run environments.
• CI, Build, and Testing Infrastructure:
– Illustrate the build scripts (Makefile, make targets like “build”, “setcap”, “rpms”) and CI pipelines (GitHub workflows, .dockerignore, and integration tests).
– These are supporting components that manage compilation, testing, linting, rpm/dpkg packaging, and Docker integration.
Relationships and Interactions
• Bidirectional interaction where SPK relies on common libraries for encoding, schema validation, and dependency resolution.
• Connections from the “Packages / Recipes” component to SPK (as input for building packages), and from SPK to the build system (Makefiles and CI scripts) that generate RPM packages and Docker images.
Architectural Patterns & Design Principles
• Service Composition: SPK “glues” together various specialized components (like spk-cli groups, spk-solve, spk-storage) to form a comprehensive software package management service.
Incorporate Technologies and Frameworks
• Clearly label components that use Rust (via Cargo.toml in each crate) for the core system logic.
• Use of Docker and RPM for container-based builds and distribution.
• If relevant, note that testing, linting, and CI pipelines (GitHub Actions workflows) tie into the overall build process.