Skip to content

feat: implement pluggable runtimes - #142

Open
dungdm93 wants to merge 24 commits into
mainfrom
plugable-runtime
Open

feat: implement pluggable runtimes#142
dungdm93 wants to merge 24 commits into
mainfrom
plugable-runtime

Conversation

@dungdm93

@dungdm93 dungdm93 commented Sep 7, 2026

Copy link
Copy Markdown
Member

Summary

This PR implements Pluggable Runtimes (OCI container images as plugins, e.g. drassi/node:24, drassi/python:3.12) in Drassi across Host, Incus, and Container/Docker sandboxers.

Key Changes

  1. Runtime Configuration (core/config):

    • Added support for pluggable config.Runtime options (image, alias, subpath, executable, cmd, paths).
    • Decoupled concrete sandboxers from config using config.RegisterSandboxer factory registry to avoid import cycles.
  2. Provisioning Engine (core/pkg/runtime/provision):

    • Introduced type-safe provision.Context with Go 1.27 generic methods (Set[T], Get[T], MustGet[T]) and StateKey[T].
    • Created unified provision.Operation interface (PreLaunch, PostLaunch) and provision.Pipeline.
    • Implemented shared operations: provision.Pull, provision.Mount, and provision.ConfigurePathEnv.
  3. Storage Management (core/pkg/runtime/storage):

    • Implemented storage.Manager encapsulating go.podman.io/storage and go.podman.io/image/v5.
    • Singleflight deduplicated image pulling.
    • Ephemeral Copy-On-Write (COW) layer mounting and lifecycle teardown hooks.
  4. Runtime Registry (core/pkg/runtime):

    • Implemented runtime.Registry with direct and alias lookup (e.g., node20, node22 -> node).
    • Implemented runtime.Runtime with command templating ({0} substitution with script paths).
  5. Sandboxer Integration:

    • Host: host.Symlink operation for symlinking mounted runtime trees into the host layout.
    • Incus: incus.DiskDevice operation for host-to-container disk device mappings.
    • Container: container.BindMount and container.ImageMount operations for container spec mounts.
  6. Action Executor & DI Wiring:

    • Integrated nodeActionExecutor in action_node.go to resolve its runtime in the init phase via DI without touching action_script.go.
    • Provided runtime.Registry in core/wire/runtime/module.go.

Verification

  • Full test suites pass across core, runner-gha, and runner-gitea.
  • Comprehensive unit and integration test coverage for all new packages and operations.

@dungdm93 dungdm93 changed the title feat: implement pluggable runtimes across host, incus, and container sandboxers feat: implement pluggable runtimes Sep 7, 2026
@dungdm93
dungdm93 requested a review from tuananh September 7, 2026 10:18
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.

1 participant