Title: Worker applications: a process manifest in the app's repository, with instances and placement in the fleet record · Issue #498 · cloudfall-dev/cloudfall · GitHub
Open Graph Title: Worker applications: a process manifest in the app's repository, with instances and placement in the fleet record · Issue #498 · cloudfall-dev/cloudfall
X Title: Worker applications: a process manifest in the app's repository, with instances and placement in the fleet record · Issue #498 · cloudfall-dev/cloudfall
Description: Problem A queue-worker application does not fit one Component today, and the parts of it that change with the code live in the fleet record instead of the application's repository. Take a Celery application with ten queues, one worker no...
Open Graph Description: Problem A queue-worker application does not fit one Component today, and the parts of it that change with the code live in the fleet record instead of the application's repository. Take a Celery ap...
X Description: Problem A queue-worker application does not fit one Component today, and the parts of it that change with the code live in the fleet record instead of the application's repository. Take a Celer...
Opengraph URL: https://github.com/cloudfall-dev/cloudfall/issues/498
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Worker applications: a process manifest in the app's repository, with instances and placement in the fleet record","articleBody":"### Problem\n\nA queue-worker application does not fit one `Component` today, and the parts of it that change with the code live in the fleet record instead of the application's repository.\n\nTake a Celery application with ten queues, one worker node per queue, a different set of queues on each server, and one Beat scheduler. In Cloudfall today:\n\n- **One component is one unit and one command.** Ten nodes become either ten hand-written components per server, or one unit that runs `celery multi`: a process manager inside systemd (`Type=forking`, pid files), where the health gate, the restart and the rollback see the whole set and never one node\n- **`deployment.servers` is a flat list.** A component cannot say \"these queues on h1, those on h2\", so each server's set needs its own component with a copied command\n- **Nothing stops a scheduler from running twice.** A Beat component deployed to two servers sends every scheduled task twice, and the record accepts it\n- **The process definition lives away from the code.** The command, its queues, its stop timeout and its health command change with the application: a new queue and the worker that consumes it should arrive in one PR and roll back with the release. In the fleet record they are a second change in a second repository, made by a different person\n\nRender solves the last point with `render.yaml` in the application's repository. Copying that whole is wrong for Cloudfall: a Blueprint also names the plan, the region and the env groups, because Render owns the infrastructure. Here the operator owns it. An application repository that picks its servers and secret references turns a merge to that repository into a deploy anywhere, past the record that is supposed to gate it.\n\n### Proposal\n\nSplit a component by who owns each part.\n\n| The application's repository | The fleet record |\n| --- | --- |\n| The process's command and its parameters | Servers |\n| The instance names a process allows (queues) | Which instances run on which server |\n| Stop timeout, health command | Environment and secret references |\n| Release command, build steps, runtime | Application user, `installRoot`, approval policy |\n\n**1. A process manifest in the application's repository**\n\n`cloudfall.yaml` at the repository root (or under `repository.subdirectory`), read from the git ref being deployed:\n\n```yaml\napiVersion: cloudfall/v1\nkind: Processes\nruntime: {type: python, version: \"3.14\", packageManager: uv}\nrelease:\n command: [.venv/bin/python, manage.py, migrate]\nprocesses:\n worker:\n instances:\n allowed: [default, mail, reports, imports]\n command: [.venv/bin/celery, -A, crm, worker, -n, \"{instance}@%h\",\n -Q, \"{instance}\", -c, \"1\"]\n stop: {timeoutSeconds: 900}\n healthCheck:\n type: command\n command: [.venv/bin/celery, -A, crm, inspect, ping, -d, \"{instance}@%h\"]\n beat:\n command: [.venv/bin/celery, -A, crm, beat]\n singleton: true\n```\n\nNothing in it is specific to Celery: a process is a command, how it stops and how to tell it is healthy.\n\n**2. A component that takes its process from the manifest**\n\n```yaml\nkind: Component\nmetadata: {id: crm-worker}\nspec:\n application: crm\n repository: {url: https://github.com/example/crm-backend.git}\n source: {manifest: cloudfall.yaml, process: worker}\n deployment:\n servers:\n - id: h1\n instances: [default, mail]\n - id: h2\n instances: [default, reports, imports]\n```\n\nA component without `source` works as it does today.\n\n**3. Instances as systemd template units**\n\nEach instance is `crm-worker@\u003cinstance>.service`, rendered from one template, with `{instance}` substituted in the command and the health command. A deploy restarts and gates the instances of a server one at a time; a receipt names each instance.\n\n**4. `singleton`**\n\nA process marked `singleton: true` deploys to exactly one server with no instances. Validation refuses a component that places it on two.\n\n**What the record can then check**\n\n- An instance a server names that the manifest does not allow fails validation, so a typo in a queue name never reaches a server\n- An allowed instance no server runs is a queue without a consumer: a validation finding\n- An instance only one server runs is reported before that server is drained or removed\n\n**Approval**\n\nThe manifest is code that decides what runs as the application user. A change to a process's command between the current release and the one being deployed shows in the plan as a diff and belongs to an operation class the policy can hold for approval.\n\n### Open questions\n\n- Per-server build variants: an application that installs an optional dependency group on one server only (`uv sync --extra …`) has no place to say so\n- Whether `runtime`, `build` and `release` may be set in both places, and which wins. Proposed: the manifest, with the record refusing to set a field the manifest sets\n- Whether a `subdirectory` monorepo has one manifest or one per component\n- Stop settings are tracked separately in #497; this proposal reuses whatever field that issue settles on\n\n### Alternatives\n\n- **Everything in the fleet record** (today): one place to read, but a process change is a second PR in another repository and does not roll back with the release\n- **Everything in the application's repository** (`render.yaml` as is): simplest for the developer, but the repository then chooses servers and secrets, which removes the operator's gate\n- **A `CeleryWorker` component kind**: no template syntax to learn, but each queue system (RQ, Dramatiq, Sidekiq, a plain consumer loop) would need its own kind\n- **Keep `celery multi` in one unit**: no schema change, but no per-node health gate, restart or rollback\n\n\u003c!-- shipmill:agent -->","author":{"url":"https://github.com/apps/shipmill-romamo","@type":"Person","name":"shipmill-romamo"},"datePublished":"2026-11-17T12:34:43Z","url":"https://github.com/cloudfall-dev/cloudfall/issues/498"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ac3b22b2-3170-5e53-2637-ca9c3cb96aa2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 98AE:B4606:C9A305:114F073:6B0550EA |
| html-safe-nonce | 387d952a00ab24c2c8b643e6c76c8a85268272b86817ca770921afa4e93817af |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OEFFOkI0NjA2OkM5QTMwNToxMTRGMDczOjZCMDU1MEVBIiwidmlzaXRvcl9pZCI6Ijc4MTk4MzEwMDE4MTkyMDU4NjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 75c6a27c1d4deb094cc7985e5549db9cd3c209f664ab16df7e40a1fbf39a8787 |
| hovercard-subject-tag | issue:6444639087 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cloudfall-dev/cloudfall/498/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ccbcbb56cfb8ea0e5e58bbff85f3ec8de6bfb77bebe2b1e86aacbbeff6cb513e/cloudfall-dev/cloudfall/issues/498 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ccbcbb56cfb8ea0e5e58bbff85f3ec8de6bfb77bebe2b1e86aacbbeff6cb513e/cloudfall-dev/cloudfall/issues/498 |
| og:image:alt | Problem A queue-worker application does not fit one Component today, and the parts of it that change with the code live in the fleet record instead of the application's repository. Take a Celery ap... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | shipmill-romamo[bot] |
| hostname | github.com |
| expected-hostname | github.com |
| None | 854d880890b5e847b3fce9d1b31f032107baeddeebad2aa379c48aa4f1451f6b |
| turbo-cache-control | no-preview |
| go-import | github.com/cloudfall-dev/cloudfall git https://github.com/cloudfall-dev/cloudfall.git |
| octolytics-dimension-user_id | 339512759 |
| octolytics-dimension-user_login | cloudfall-dev |
| octolytics-dimension-repository_id | 1360999777 |
| octolytics-dimension-repository_nwo | cloudfall-dev/cloudfall |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1360999777 |
| octolytics-dimension-repository_network_root_nwo | cloudfall-dev/cloudfall |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 220e980097d94ce616d5d11fbd5316d208e3fc93 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width