Skip to content

feat: catalog-based generic workloads (--from-catalog)#194

Merged
mrhillsman merged 6 commits into
mainfrom
feat/catalog-workloads
Jun 13, 2026
Merged

feat: catalog-based generic workloads (--from-catalog)#194
mrhillsman merged 6 commits into
mainfrom
feat/catalog-workloads

Conversation

@mrhillsman

Copy link
Copy Markdown
Contributor

Summary

  • Add --from-catalog and --catalog-dir flags that let users deploy custom workloads from systemd unit files in ~/.virtwork/catalog/<entry>/ without writing Go code
  • Catalog entries support single-role (one .service file) and multi-role (manifest with workload.yaml declaring roles + per-role .service files)
  • Param substitution ({{key}} placeholders), packages, and per-workload config (--params) all work with catalog entries the same as built-in workloads

What changed

  • Catalog loading (internal/workloads/catalog.go): LoadCatalogEntry() reads an entry directory, parses optional workload.yaml manifest, discovers .service files, and returns a CatalogEntry that can produce a
    WorkloadFactory and ParamSchema
  • GenericWorkload (internal/workloads/generic.go): Single-role catalog workload — writes service files via cloud-init, enables them with systemd, substitutes params
  • GenericMultiWorkload (internal/workloads/generic_multi.go): Multi-role catalog workload following the NetworkWorkload pattern — RoleDistribution(), UserdataForRole(), per-role cloud-init
  • Config (internal/config/config.go): CatalogDir and FromCatalog fields, --catalog-dir / --from-catalog flags, env var support
  • Orchestrator (internal/orchestrator/orchestrator.go): Loads catalog entries into the registry at runtime, checks for name conflicts with built-ins, merges catalog + built-in workload lists
  • CLI (cmd/virtwork/main.go): When --from-catalog is set without --workloads, clears default built-in workloads; requires at least one workload source

Resolves #185

Introduce CatalogEntry, CatalogManifest, and RoleDefinition types with
LoadCatalogEntry() for reading user-supplied systemd unit workloads from
a catalog directory. Includes manifest YAML parsing, service file
discovery, multi-role service-to-role mapping, and comprehensive
validation. Stubs for GenericWorkload and GenericMultiWorkload added
for compilation.

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
…tion

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
… substitution

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
Load --from-catalog entries into the registry before planning VMs,
check for name conflicts with built-in workloads, and merge catalog
names into the workload list.

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
When --from-catalog is set without --workloads, clear default built-in
workloads so only catalog entries run. Validate built-in names only.
Require at least one workload source (--workloads or --from-catalog).

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
@exe-prow-github-app exe-prow-github-app Bot requested a review from OchiengEd June 13, 2026 04:17
@exe-prow-github-app

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mrhillsman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@exe-prow-github-app exe-prow-github-app Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 13, 2026
@mrhillsman mrhillsman removed the request for review from OchiengEd June 13, 2026 15:21
@mrhillsman mrhillsman merged commit 34b2fb9 into main Jun 13, 2026
3 of 4 checks passed
@mrhillsman mrhillsman deleted the feat/catalog-workloads branch June 15, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Catalog-based generic workloads (generic + generic-multi)

1 participant