Skip to content

Implement multi-layer OCI support with daemon integration#24

Merged
richardkiene merged 3 commits into
mainfrom
feature/multi-layer-oci-support
Jan 24, 2026
Merged

Implement multi-layer OCI support with daemon integration#24
richardkiene merged 3 commits into
mainfrom
feature/multi-layer-oci-support

Conversation

@richardkiene

Copy link
Copy Markdown
Contributor

Summary

  • Implement multi-layer OCI manifest support for base image sharing
  • Add daemon integration for running modules from OCI storage by tag
  • Handle interpreted runtimes (Python) by extracting source layers and mounting at /app
  • Enforce network security model (internal by default, explicit external access)
  • Update Python runtime and example documentation with proper daemon workflow

Key Changes

OCI Support:

  • Add runtime layer media type for base images
  • Extend FabricksModule to support multiple layers
  • Add source layer support for interpreted runtimes

Daemon Integration:

  • Add run_module endpoint to load modules by tag from OCI storage
  • Add OCI storage to daemon's AppState
  • Extract source layers for interpreted runtimes
  • Mount source files at /app via WASI preopens

Network Security:

  • Services are internal by default
  • Must explicitly join a network with external access
  • Full CLI support: fabricks network create, fabricks network join

Test Plan

  • Build Python runtime: fabricks build examples/runtimes/python --tag fabricks.dev/runtimes/python:3.12
  • Build Python hello example: fabricks build examples/python-hello
  • Start daemon and run service: fabricks run python-hello:1.0.0
  • Verify internal-only access is enforced
  • Create public network: fabricks network create public
  • Join service to network: fabricks network join public python-hello
  • Verify external access works: curl http://localhost:8088/

Closes #20

Add support for multi-layer OCI images to enable base runtime images
that can be composed with application WASM modules. This allows language
runtimes (Python, Ruby, etc.) to be distributed as reusable base layers.

Core changes:
- Add RUNTIME_LAYER_MEDIA_TYPE for base image layers
- Extend FabricksModule to handle multiple layers with composition
- Add wac-graph dependency for WASM component composition
- Implement multi-layer manifest support in LocalStorage
- Update registry client pull/push for multi-layer images
- Enhance build command to support base images via [from].image
- Add entrypoint and version fields to Fabrickfile schema

New examples:
- examples/test-runtime/ - minimal test runtime for validation
- examples/python-hello/ - Python example demonstrating runtime usage

Additional improvements:
- Fix clippy warnings in fabricksd policy and networking modules
Implement a language-specific builder system that enables users to write
Python HTTP services without any WASM toolchain knowledge. Simply specify
source = "python" in the Fabrickfile and run fabricks build.

Builder System:
- Builder trait and registry for extensible language support
- Rust builder using cargo-component
- Python builder using componentize-py with embedded WASI HTTP framework
- Automatic builder selection based on [from].source field

Python Runtime:
- Reference implementation with WASI HTTP handler interface
- Embedded framework in examples/runtimes/python
- WIT definitions for HTTP request/response handling
- CPython interpreter bundled into WASM component

User Experience:
- Write simple Python handler functions
- Zero WASM knowledge required
- Single command build: fabricks build
- Example updated with improved documentation

Requirements:
- componentize-py installed via pip
- Python 3.10+
- Add run_module endpoint to daemon for loading modules by tag
- Handle interpreted runtimes (Python) by extracting source layers
- Mount source files at /app via WASI preopens
- Enforce network security (internal by default, explicit external)
- Update Python runtime and example documentation with daemon workflow
- Add flate2 and tar dependencies for source layer extraction
- Add OCI storage to daemon's AppState for module loading
- Update .gitignore for Python runtime build artifacts

All execution now goes through the daemon to ensure proper security
boundaries and capability enforcement.
@richardkiene
richardkiene merged commit 5643426 into main Jan 24, 2026
0 of 3 checks passed
@richardkiene
richardkiene deleted the feature/multi-layer-oci-support branch January 24, 2026 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-layer OCI manifest support for base images

1 participant