Skip to content

feat: add nextflow engine deployment#18

Merged
JaeAeich merged 6 commits intodevfrom
docs
Mar 7, 2026
Merged

feat: add nextflow engine deployment#18
JaeAeich merged 6 commits intodevfrom
docs

Conversation

@JaeAeich
Copy link
Copy Markdown
Owner

@JaeAeich JaeAeich commented Mar 7, 2026

Description

  • Fixes #(issue number)

Comments

Summary by Sourcery

Document engine-centric architecture and configuration, and wire up the default Nextflow engine in local deployments.

New Features:

  • Add comprehensive API reference, engine configuration guide, architecture overview, deployment guide, and getting-started quick start docs.
  • Introduce navigation structure for docs site with grouped Getting Started, Guides, and Reference sections.
  • Provide a documented Nextflow engine runtime service in the default Docker Compose stack.

Enhancements:

  • Clarify introduction copy to emphasise GA4GH WES compliance, design principles, and supported workflow engines.
  • Refine architecture description with a concrete, message-driven component diagram and run-state lifecycle.

Deployment:

  • Extend docker-compose stack with a metis-engine-nextflow service wired to Postgres, Valkey, NATS, and local workflow/config volumes.

Documentation:

  • Add standalone pages for API reference, engine configuration, architecture, deployment, and quick-start usage, linked from the docs sidebar.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
metis Ready Ready Preview, Comment Mar 7, 2026 10:20am

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Mar 7, 2026

Reviewer's Guide

Adds comprehensive documentation for Metis architecture, API, and engine configuration, wires in a Nextflow engine container to the local Docker Compose stack, and restructures the docs navigation to surface the new guides and references.

Sequence diagram for workflow run lifecycle via API (sequence)

sequenceDiagram
    actor Client
    participant API as metis-api
    participant PG as PostgreSQL
    participant NATS as NATS
    participant Engine as metis-engine-nextflow
    participant WF as Nextflow_process

    Client->>API: POST /runs {RunRequest}
    API->>API: Validate against engine.yaml
    API->>PG: INSERT run (state=QUEUED)
    API->>NATS: publish run.submit.Nextflow
    API-->>Client: 200 {run_id}

    NATS-->>Engine: run.submit.Nextflow message
    Engine->>PG: UPDATE run state=INITIALIZING
    Engine->>NATS: publish run.state.run_id INITIALIZING
    Engine->>Engine: Build CLI from commandTemplate
    Engine->>Engine: Create workdir layout
    Engine->>WF: Spawn Nextflow subprocess

    Engine->>PG: UPDATE run state=RUNNING
    Engine->>NATS: publish run.state.run_id RUNNING

    loop For each stdout/stderr line
        WF-->>Engine: log line
        Engine->>PG: INSERT log_lines row
    end

    WF-->>Engine: process exit (code)
    alt exit code 0
        Engine->>PG: UPDATE run state=COMPLETE
        Engine->>NATS: publish run.state.run_id COMPLETE
    else nonzero exit code
        Engine->>PG: UPDATE run state=EXECUTOR_ERROR
        Engine->>NATS: publish run.state.run_id EXECUTOR_ERROR
    end

    Client->>API: GET /runs/{id}/status or /logs
    API->>PG: SELECT state, logs
    API-->>Client: JSON response

    Client->>API: GET /runs/{id}/status/stream
    API->>NATS: subscribe run.state.run_id
    NATS-->>API: state events
    API-->>Client: SSE state events
Loading

File-Level Changes

Change Details Files
Rewrite the intro page to focus on design principles, architecture overview, supported engines, run states, and key follow-up docs.
  • Condense and rephrase the Metis overview to emphasize GA4GH WES 1.1.0 compliance, HTTP API, and pluggable engines.
  • Replace the old architecture explanation and mermaid diagram with a simplified three-layer architecture diagram wired to Postgres, NATS, Valkey, and engine processes.
  • Introduce a Design Principles section highlighting decoupled API/engine, trait-based plugin model, config-driven engine behaviour, and spec compliance.
  • Add sections for Supported Workflow Engines, Run States, and Next Steps linking to new documentation pages.
docs/intro.md
Extend the Docker Compose stack to include a Nextflow engine container configured via engine-config.yaml and Nextflow-related volumes.
  • Add a metis-engine-nextflow service built from nextflow-engine.Dockerfile with dependencies on DB migrations, NATS, and Valkey health.
  • Configure engine environment variables (DATABASE_URL, REDIS_URL, NATS_URL, KUBECONFIG) consistent with the rest of the stack.
  • Mount engine-config.yaml, Nextflow SCM/config, workflows, and kubeconfig into the engine container, and run metis-engine-generic with the configured engine config.
  • Expose host.docker.internal in the container via extra_hosts for local host access.
docker-compose.yaml
Restructure the docs site navigation to introduce Docs/API nav items and grouped sidebars for getting started, guides, and reference.
  • Rename the top-level nav entry from Introduction to Docs and add a separate API link to /api-reference.
  • Expand the Getting Started sidebar section with Quick Start.
  • Add new Guides and Reference sidebar groups pointing to Engine Configuration, Deployment, API Reference, and Architecture pages.
docs/.vitepress/config.mjs
Add a detailed API reference describing all WES endpoints, parameters, example payloads, SSE streams, states, and error formats.
  • Document base URL and general JSON response conventions.
  • Describe each /service-info, /runs (list/create), run status, cancel/delete, logs (paged and SSE), and tasks endpoints with example requests/responses and query parameters.
  • Define the run state machine and terminal states as exposed via the API.
  • Standardize error response shape and map HTTP status codes to typical failure conditions.
docs/api-reference.md
Add an engine configuration guide that fully documents the engine.yaml format and how metis-engine-generic uses it to drive behaviour.
  • Explain the engine concept (binary + engine.yaml + optional trait impl) and startup requirements (env vars, CLI).
  • Provide a full annotated example engine.yaml for Nextflow, covering command templates, workflow/engine parameters, validation rules, denied/ignored params, and workdir layout.
  • Define the schema for parameter fields, validation types, denied params, and workflowParams methods.
  • Describe how to register a new engine and when to write a custom Engine trait implementation.
docs/engine-configuration.md
Add an architecture deep-dive describing components, data flow, and crate-level structure.
  • Introduce a high-level architecture overview with mermaid diagrams showing API, NATS, Postgres, Valkey, engine runtime, and workflow process interactions.
  • Detail each core component’s responsibilities, including how status/logs are stored and streamed.
  • Document the full run lifecycle via a sequence diagram and state machine diagram.
  • Describe how crates are split between API, engine runtime, engine implementations, DB, config, and shared types.
docs/architecture.md
Add deployment documentation covering Docker Compose, image builds, and Kubernetes quickstart (including k8s-based Nextflow execution).
  • Document all services in the docker-compose stack, their ports, environment variables, and dependency ordering.
  • Explain engine volumes and how they map local configs/workflows into the Nextflow engine container.
  • Describe how to build custom images with the provided build script and individual Dockerfiles.
  • Provide a Kubernetes quickstart: building images with Minikube, applying manifests, exposing UI/API, and configuring Nextflow’s k8s executor with service accounts, PVCs, and profiles, plus production hardening notes.
docs/deployment.md
Add a quick start guide walking users through running the stack locally and submitting/monitoring their first workflow.
  • List prerequisites and steps to clone the repo and start the full stack via docker-compose.
  • Describe the core services started (API, UI, engine, Postgres, Valkey, NATS) and how to verify health via /service-info.
  • Provide example curl commands to submit a run, poll status, stream status/logs via SSE, fetch full run details, cancel runs, and tear down the stack.
  • Cross-link to deeper docs for engine configuration, deployment, and full API reference.
docs/getting-started.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The docs and configuration alternate between engine.yaml and engine-config.yaml (and different paths), which could be confusing; consider standardizing on a single filename/path and updating both the docs and docker-compose.yaml to match.
  • Several docs hardcode specific versions and paths (e.g., workflow_engine_version: "25.10.4", workflow_url: "/root/workflows/main.nf", postgres:18-alpine); it may be clearer to either reference the actual versions/paths used in docker-compose.yaml or explicitly label these as examples tied to the default local setup.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The docs and configuration alternate between `engine.yaml` and `engine-config.yaml` (and different paths), which could be confusing; consider standardizing on a single filename/path and updating both the docs and `docker-compose.yaml` to match.
- Several docs hardcode specific versions and paths (e.g., `workflow_engine_version: "25.10.4"`, `workflow_url: "/root/workflows/main.nf"`, `postgres:18-alpine`); it may be clearer to either reference the actual versions/paths used in `docker-compose.yaml` or explicitly label these as examples tied to the default local setup.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@JaeAeich
Copy link
Copy Markdown
Owner Author

JaeAeich commented Mar 7, 2026

@sourcery-ai title

@sourcery-ai sourcery-ai Bot changed the title docs: details about engine configurations feat: document architecture and add nextflow engine deployment Mar 7, 2026
@JaeAeich JaeAeich changed the title feat: document architecture and add nextflow engine deployment feat: add nextflow engine deployment Mar 7, 2026
@JaeAeich JaeAeich merged commit 00f58e5 into dev Mar 7, 2026
14 of 15 checks 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.

1 participant