Skip to content

feat: introduce recipes for development environments - #5

Merged
pigmej merged 5 commits into
pigmej:mainfrom
kacpersaw:kacpersaw/plan-recipes-and-projects
Sep 17, 2026
Merged

pigmej merged 5 commits into
pigmej:mainfrom
kacpersaw:kacpersaw/plan-recipes-and-projects

Conversation

@kacpersaw

@kacpersaw kacpersaw commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Introduce recipes to ocdev so users can define how a development environment is created from an existing snapshot, configured, and cleaned up.

Recipes contain reusable tasks and lifecycle hooks. Project files select a recipe and provide local configuration files and task defaults.

What was added

  • YAML/JSON recipes with named tasks and ordered setup and cleanup hooks.
  • Project definitions for copying local files, such as .env, into an environment.
  • Commands to validate and register recipes, create environments, run tasks, and explicitly rerun setup.
  • Environment inspection, operation history, and bounded task logs.
  • Optional process-compose support for starting, stopping, restarting, and inspecting services.
  • --json support across noninteractive management commands, preserving the existing list --json behavior.
  • Documentation and Node/Redis and Python/PostgreSQL examples.

Behavior and safety

Each environment keeps the recipe version it was created with. Instance UUID checks, environment locks, and atomic port reservations protect lifecycle operations.

Failed setup leaves the container available for debugging. Cleanup hooks run before deletion and block it if they fail. Dry-run checks do not modify environments, but still require Incus.

Recipes execute trusted commands and require prepared snapshots. This PR does not add a build engine or manage the source snapshots.

Testing

  • All 74 Nim unit and fake-Incus tests pass.
  • Full rebuild and tests passed with a clean HOME and no Python or live Incus on PATH.
  • CI passes; Atlas remains the dependency manager.
  • Example definitions pass validation, but their application workflows have not been live-tested.

@kacpersaw kacpersaw changed the title feat: add snapshot-based recipes and project workflows feat: introduce recipes for development environments Sep 15, 2026
Merge current main while preserving global create defaults, --fresh, Atlas, and Nim-only verification. Guard pinned identities and both rebind endpoints, give reservation cleanup one owner, close registry files once, and reject special or oversized inputs. Add fake-backend regressions and port the incoming create-config tests to Nim.

@pigmej pigmej left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@pigmej
pigmej merged commit f49ee81 into pigmej:main Sep 17, 2026
1 check passed
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.

2 participants