Skip to content

Add Flow for Minnows; Add VM Minnows Test. - #2

Open
colemickens wants to merge 17 commits into
mainfrom
colemickens/flow-init
Open

Add Flow for Minnows; Add VM Minnows Test.#2
colemickens wants to merge 17 commits into
mainfrom
colemickens/flow-init

Conversation

@colemickens

@colemickens colemickens commented May 28, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Added a FlakeHub edge cache service with configurable caching, DNS, listen addresses, lifetimes, sizing, and storage; includes packaged runtime and startup wiring.
  • Tests

    • CI now validates the Minnows VM-based test environment.
    • Added VM-based multi-architecture tests that build and boot images and verify the edge cache service starts successfully.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds an nginx-based edge-cache Flow module, Minnows test artifacts (system and flake) that build and vmtest a VM expecting the edge-cache service, and a CI step that runs nix flake check --build-all in test/minnows.

Changes

Edge Cache Service with Test Infrastructure

Layer / File(s) Summary
Flow module metadata & interface
flow.nix
Flow module declares metadata, required capabilities (runAsRoot, fullFilesystemAccess), user/group resources, and interface options for nginx/DNS/listen/cache.
Generated nginx configs
flow.nix
Build-time generation of nginx server and runtime configs: pass-through for .narinfo, caching for /nar, and proxy_cache_path configured from inputs.
systemd service and prestart setup
flow.nix
Wires systemd.services.flakehub-edge-cache with an ExecStartPre script to create/chown the cache directory and an ExecStart that launches nginx with the generated config.
Minnows system configuration
test/minnows/system.nix
Minnows system function that composes platforms, runtime resources, and wires the fec1 flow (importing the edge-cache flow) and a debug-shell flow.
Test flake inputs & outputs helpers
test/minnows/flake.nix
Adds flake inputs (nixpkgs follow + Minnows sources), outputs function, supported systems, and helpers to build per-system pkgs/lib.
Per-system minnowsSystems export
test/minnows/flake.nix
Exports minnowsSystems.<system>.default by importing ./system.nix with per-system inputs and system.
Per-system vmtest checks
test/minnows/flake.nix
Implements checks.<system>.default as a pkgs.runCommand that runs minnows-cli to generate secure-boot state, builds a disk from the bootspec, runs vmtest expecting flow-fec1-flakehub-edge-cache.service, and writes $out.
CI Validation Integration
.github/workflows/ci.yml
Adds a checks job step "Check Minnows Test VM" that cds into test/minnows and runs nix flake check --build-all.

Sequence Diagram(s)

sequenceDiagram
  participant CI as CI Workflow
  participant FlakeCheck as "nix flake check --build-all"
  participant MinnowsCLI as minnows-cli
  participant DiskBuilder as Disk build
  participant VMTest as vmtest
  participant EdgeService as flow-fec1-flakehub-edge-cache.service

  CI->>FlakeCheck: run check in test/minnows
  FlakeCheck->>MinnowsCLI: invoke secure-boot generation
  MinnowsCLI->>DiskBuilder: build disk from bootspec
  FlakeCheck->>VMTest: execute vmtest with built disk
  VMTest->>EdgeService: verify service activation
  EdgeService-->>VMTest: service started
  VMTest-->>FlakeCheck: test result
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • grahamc

Poem

A rabbit hops where flakes compile and sing,
Caches hum, nginx keeps a steady ring,
Minnows spin disks, VMs wake and meet,
Services rise, logs whisper "start complete." 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the two main changes: adding a Flow module (flow.nix) for Minnows and adding a VM-based test suite for Minnows (test/minnows directory with flake.nix and system.nix).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch colemickens/flow-init

Comment @coderabbitai help to get the list of available commands.

@colemickens
colemickens force-pushed the colemickens/flow-init branch from 185851b to f88fc60 Compare May 28, 2026 16:44

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@flow.nix`:
- Around line 98-102: The code references this.tempDirectory but the
tempDirectory option is commented out, causing evaluation errors; either restore
the tempDirectory option block (uncomment and ensure it defines description,
type = flow.lib.types.nullOr flow.lib.types.path, and default =
"/tmp/flakehub-edge-cache") so this.tempDirectory is available, or remove/guard
uses of this.tempDirectory at the call sites (replace direct this.tempDirectory
access with a lookup that falls back to null or remove the dependency). Ensure
changes target the tempDirectory option and all usages of this.tempDirectory.

In `@test/minnows/flake.nix`:
- Around line 29-32: The check references an attribute path that doesn't exist
because minnowsSystems defines minnowsSystems.aarch64-linux.testvm (in the
import of system.nix) but the checks expression expects
inputs.self.minnowsSystems.${system}.default.bootspec; update the minnowsSystems
attribute names or the checks lookup so they match: either expose a top-level
attribute named aarch64-linux (or whatever ${system} expands to) with a
.default.bootspec, or change the checks expression to reference the .testvm
entry (inputs.self.minnowsSystems.${system}.testvm.default.bootspec or adjust
${system} accordingly); locate minnowsSystems, the import of system.nix, and the
checks usage to make names consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4ac349ae-c13b-4a82-bda4-4b50e5c33f60

📥 Commits

Reviewing files that changed from the base of the PR and between 6bd05b5 and 185851b.

⛔ Files ignored due to path filters (1)
  • test/minnows/flake.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • .github/workflows/ci.yml
  • flow.nix
  • test/minnows/flake.nix
  • test/minnows/system.nix

Comment thread flow.nix
Comment thread test/minnows/flake.nix Outdated
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Actionable comments posted: 0

@colemickens
colemickens force-pushed the colemickens/flow-init branch from f88fc60 to eb1b64f Compare May 28, 2026 16:46

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/minnows/flake.nix`:
- Around line 32-35: The import of system.nix hardcodes system =
"aarch64-linux", causing x86_64 builds to pick the wrong packages; change the
import in the default attribute (the block starting with default = import
./system.nix { inherit inputs; system = ...) to use the incoming closure/system
variable (i.e., pass the existing system instead of the literal "aarch64-linux"
or simply don’t override it) so minnowSystems.x86_64-linux.default resolves with
the correct architecture-specific packages.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 16c93571-3265-4aad-8480-3cf5a647587a

📥 Commits

Reviewing files that changed from the base of the PR and between f88fc60 and eb1b64f.

⛔ Files ignored due to path filters (1)
  • test/minnows/flake.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • test/minnows/flake.nix
  • test/minnows/system.nix
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/ci.yml
  • test/minnows/system.nix

Comment thread test/minnows/flake.nix
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Actionable comments posted: 0

@colemickens
colemickens force-pushed the colemickens/flow-init branch from ab39a20 to 3d59b64 Compare May 28, 2026 17:11
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Actionable comments posted: 0

Flake lock file updates:

• Updated input 'determinate':
    'github:DeterminateSystems/determinate/a5469e9aa3870941320cb92d899b66e141c5a3cd?narHash=sha256-sV1OJYyktJRl7I3HxeBvWTWXjqm2uCTS3gS1p%2BDLn7c%3D' (2026-01-21)
  → 'https://api.flakehub.com/f/pinned/DeterminateSystems/determinate/3.21.8/019f8227-b1af-7091-908e-aef95c3fd5e0/source.tar.gz?narHash=sha256-2z08u28D2MHNIsDfndq3yzmL1vG6Sn3sKIC77W8s13A%3D' (2026-07-21)
• Updated input 'determinate/determinate-nixd-aarch64-darwin':
    'https://install.determinate.systems/determinate-nixd/tag/v3.15.2/macOS?narHash=sha256-zK2dgNHh/p92rk5jN%2BY1LOMn0HEdTsS%2B7XXwb2g52oM%3D'
  → 'https://install.determinate.systems/determinate-nixd/tag/v3.21.8/macOS?narHash=sha256-k3TvVP0x97ao/aI8%2B8HRQhC4277gqgGxn1nudH6xe9c%3D'
• Updated input 'determinate/determinate-nixd-aarch64-linux':
    'https://install.determinate.systems/determinate-nixd/tag/v3.15.2/aarch64-linux?narHash=sha256-ckvZP0zFcbzLXWYOJUqYXkKBt0b2IZcQEr7YjEVtwOI%3D'
  → 'https://install.determinate.systems/determinate-nixd/tag/v3.21.8/aarch64-linux?narHash=sha256-WHcb%2BsQEhTjyQqtgrmGknchVP4eMU7X%2BvSXBveW5M4o%3D'
• Updated input 'determinate/determinate-nixd-x86_64-linux':
    'https://install.determinate.systems/determinate-nixd/tag/v3.15.2/x86_64-linux?narHash=sha256-8dLtm8FJrpyBmrNpspJj30/6I5HGEfjjXuFqURcZ8pk%3D'
  → 'https://install.determinate.systems/determinate-nixd/tag/v3.21.8/x86_64-linux?narHash=sha256-n4yqmhHyGB8s5nGzgweyLCpSAkr/CJC6Kn/wG1guUy0%3D'
• Updated input 'determinate/nix':
    'https://api.flakehub.com/f/pinned/DeterminateSystems/nix-src/3.15.2/019bde75-b4ee-74b2-a812-28dc2ee83d58/source.tar.gz?narHash=sha256-32oMe1y%2BkwvIJNiJsIvozTuSmDxcwST06i%2B0ak%2BL4AU%3D' (2026-01-21)
  → 'https://api.flakehub.com/f/pinned/DeterminateSystems/nix-src/3.21.8/019f821d-c2c8-79a1-824b-8fa3b0dcdc51/source.tar.gz?narHash=sha256-Ri/OBH1gg42wgC02OuFKBZu68niiRkHyBphK0pxJLfQ%3D' (2026-07-20)
• Updated input 'determinate/nix/nixpkgs':
    'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2505.811874%2Brev-daf6dc47aa4b44791372d6139ab7b25269184d55/019a3494-3498-707e-9086-1fb81badc7fe/source.tar.gz?narHash=sha256-wxX7u6D2rpkJLWkZ2E932SIvDJW8%2BON/0Yy8%2Ba5vsDU%3D' (2025-10-27)
  → 'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2511.914302%2Brev-1d4e0f865d68258aada31e68e6d79c8c463f3b34/019f1c78-b5ab-7af2-8516-c0d5406b0646/source.tar.gz?narHash=sha256-db/8NgfehQlPNt8rMY0J1gvwzTaURU/foM7y/AQimIM%3D' (2026-06-29)
• Updated input 'nixpkgs':
    'https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.942631%2Brev-fef9403a3e4d31b0a23f0bacebbec52c248fbb51/019c4621-ce4f-799f-82f6-b3b29f099b09/source.tar.gz?narHash=sha256-pF1quXG5wsgtyuPOHcLfYg/ft/QMr8NnX0i6tW2187s%3D' (2026-02-08)
  → 'https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.1037713%2Brev-241313f4e8e508cb9b13278c2b0fa25b9ca27163/019fa760-2880-7491-9ad9-7ba4669f6a84/source.tar.gz?narHash=sha256-vlHUuqAcbcH2RKmHbPiuQzbv1pnzzavXnI62RD0bqCU%3D' (2026-07-19)
@colemickens
colemickens force-pushed the colemickens/flow-init branch from 6e88e9d to 55bb9be Compare July 28, 2026 19:13
@colemickens
colemickens force-pushed the colemickens/flow-init branch 5 times, most recently from 037676c to a1273b5 Compare July 28, 2026 20:34
@colemickens
colemickens force-pushed the colemickens/flow-init branch from a1273b5 to 011f803 Compare July 28, 2026 20:37
@colemickens
colemickens force-pushed the colemickens/flow-init branch from 605166d to 4bb5ea7 Compare July 29, 2026 18:35
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