Skip to content

Plan 05 limen side deployment queue and registry polling - #26

Merged
PianoNic merged 13 commits into
mainfrom
feature/25_Plan05LimenSideDeployments
Apr 15, 2026
Merged

Plan 05 limen side deployment queue and registry polling#26
PianoNic merged 13 commits into
mainfrom
feature/25_Plan05LimenSideDeployments

Conversation

@PianoNic

Copy link
Copy Markdown
Member

Summary

  • Deployment entity + partial-unique-index migration for queue dedup by (ServiceId, ImageDigest) active-state
  • Agent WS contracts: DeployCommand / HealthCheckSpec / DeployProgress / DeployResult / StopContainerCommand / RollbackCommand
  • CQRS: CreateDeploymentCommand (dedup + race-safe), Cancel, ReportProgress, ReportResult, ListDeployments, GetDeploymentLogs
  • DeploymentDispatcher resolves online agent via IAgentConnectionRegistry and sends DeployCommand over WS
  • RegistryClient (Docker v2 manifest HEAD with bearer-token flow) + Quartz RegistryPollJob (5-min) queues deployments on digest change for AutoDeploy services
  • AgentsWebSocketEndpoint extended for deploy progress / result frames; per-frame service scopes fix the prior connection-lifetime DbContext pattern
  • /api/deployments REST endpoints (list, get logs, create via DTO, cancel)
  • 21 unit tests passing; Release build clean (2 pre-existing EF version-conflict warnings only)

Limentinus-side deploy pipeline and frontend are follow-up PRs.

Closes #25

PianoNic added 13 commits April 15, 2026 12:30
Deployment entity + DeploymentStatus enum, EF configuration with partial
unique index for dedup, DbSet in IAppDbContext/AppDbContext, and DeploymentQueue migration.
DeployCommand, DeployProgress, DeployResult, StopContainerCommand, RollbackCommand
records and the matching AgentMessageTypes constants for the deployment pipeline.
CreateDeployment, CancelDeployment, ReportDeploymentProgress, ReportDeploymentResult
commands plus ListDeployments and GetDeploymentLogs queries with DeploymentDto.
Includes dedup guard in CreateDeploymentCommandHandler.
DeploymentDispatcher looks up the online agent for the target node via
IAgentConnectionRegistry and sends the DeployCommand over its channel.
Registered as scoped IDeploymentDispatcher in Infrastructure DI.
RegistryClient fetches manifest digests via the Docker Distribution HTTP API
with bearer-token auth for Docker Hub. RegistryPollJob (Quartz, every 5min)
checks each AutoDeploy service and queues a new deployment when the digest changes.
Handle agent/deployProgress and agent/deployResult frames in the inbound WS
loop by dispatching ReportDeploymentProgressCommand and ReportDeploymentResultCommand.
GET /api/deployments?serviceId=..., GET /api/deployments/{id}/logs,
POST /api/deployments, POST /api/deployments/{id}/cancel all behind RequireAuthorization.
Unit tests for CreateDeploymentCommandHandler (dedup, service-not-found, dispatch
failure swallowed) and ReportDeploymentProgressCommandHandler (Queued->InProgress
transition, StartedAt preserved, log accumulation).
@PianoNic
PianoNic merged commit 20e35da into main Apr 15, 2026
2 checks passed
@PianoNic
PianoNic deleted the feature/25_Plan05LimenSideDeployments branch April 15, 2026 10:50
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.

Implement Plan 05 limen side deployment queue and registry polling

1 participant