Skip to content

feat: set the task manager retention and start the background services through infrahub - #100

Draft
saltas888 wants to merge 2 commits into
stablefrom
task-manager-retention-infp-507
Draft

saltas888 wants to merge 2 commits into
stablefrom
task-manager-retention-infp-507

Conversation

@saltas888

@saltas888 saltas888 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Why

Separate background services must apply Infrahub's retention settings before starting Prefect. Starting them directly with prefect server services start ignores those settings: finished task history remains unbounded and activity events follow Prefect's default retention.

This accompanies Infrahub #11289.

Changes

  • The base chart starts separate services with infrahub tasks background-services, including deployments without a sizing preset. The five Enterprise presets use the same command after their existing wait loop.
  • prefect-server.global.prefect.env supplies both containers with defaults of 30 days for task history, 7 days for Infrahub activity, and 2 days for Prefect internal events, including heartbeats.
  • Infrahub retention settings accept 1–365 days; internal-event retention cannot exceed activity-log retention. Native Prefect overrides retain precedence. Set the complete environment list when overriding it, because Helm replaces lists.
  • The base background container uses its writable /tmp directory for Prometheus metric files.
  • Regenerated the configuration reference and aligned the changelog.

Enterprise availability and edition-specific restrictions remain undecided. The current implementation has no edition gate.

The upgrade job only prints task-history size and cleanup guidance. Operators start backlog cleanup separately with infrahub tasks flush flow-runs [--rewrite].

Validation

Rendered twelve cases using Helm v3.19's chart dependency processing and rendering engine with Prefect chart 2026.10.21032730: Community and Enterprise bases, separate services without presets, all five Enterprise presets, OpenShift variants and custom overrides. Checked the startup arguments, retention environment and writable metrics directory; per-service overrides retain precedence.

The scratch Enterprise chart used this branch's Community chart, with unrelated service dependencies disabled. Regenerated the README with helm-docs 1.14.2. No Kubernetes deployment or database cleanup ran.

Release coordination

Do not merge until the Infrahub images move to 1.13 or newer. The chart still selects 1.11.9, which lacks the new command. This requirement applies to all separate-service deployments, including presets.

The Enterprise chart must also move from Community dependency 4.35.0 to the release containing these changes. The chart currently adds no version guard; decide whether to reject older images explicitly before release.

saltas888 added a commit to opsmill/infrahub that referenced this pull request Oct 11, 2026
…mits

The implementation report records the 11 Oct run of quickstart Part 1
steps 5 and 6 on a dev stack, and the test runs of T061 and T062. T050 is
ticked with opsmill/infrahub-helm#100, a draft until the chart's images
move to Infrahub 1.13. The report's commit IDs point at the commits of the
stack as it is now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
saltas888 added a commit to opsmill/infrahub that referenced this pull request Oct 13, 2026
…mits

The implementation report records the 11 Oct run of quickstart Part 1
steps 5 and 6 on a dev stack, and the test runs of T061 and T062. T050 is
ticked with opsmill/infrahub-helm#100, a draft until the chart's images
move to Infrahub 1.13. The report's commit IDs point at the commits of the
stack as it is now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
saltas888 added a commit to opsmill/infrahub that referenced this pull request Oct 14, 2026
…mits

The implementation report records the 11 Oct run of quickstart Part 1
steps 5 and 6 on a dev stack, and the test runs of T061 and T062. T050 is
ticked with opsmill/infrahub-helm#100, a draft until the chart's images
move to Infrahub 1.13. The report's commit IDs point at the commits of the
stack as it is now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@saltas888
saltas888 force-pushed the task-manager-retention-infp-507 branch from cdad2d6 to 72c0791 Compare October 14, 2026 13:27
…ugh infrahub

Infrahub 1.13 adds three task manager retention settings, read from
INFRAHUB_TASK_MANAGER_RETENTION_TASK_HISTORY (default 30d),
INFRAHUB_TASK_MANAGER_RETENTION_ACTIVITY_LOG (default 7d) and
INFRAHUB_TASK_MANAGER_RETENTION_PREFECT_OWN_EVENTS (default 7d). They
must reach the task manager container and, when Prefect's background
services run in a pod of their own, that container too.

Set them in prefect-server.global.prefect.env, the one env list that
prefect-helm renders into both the server and the background services
containers. server.env and backgroundServices.env would not work: the
enterprise values and its config presets replace those lists, and Helm
replaces lists instead of merging them.

The small, medium, medium-data, large and large-data presets start the
separate background services pod with `prefect server services start`,
which does not read the retention settings, so it would not delete old
task runs and would keep events for Prefect's default retention. Start
it with `infrahub tasks background-services` instead, which loads the
Infrahub configuration, applies the retention to Prefect's settings and
then runs the same services. The wait loop before it is unchanged.

The new command exists only from Infrahub 1.13 on, and the presets run
the image set by prefect-server.global.prefect.image.prefectTag, so
this change must not be released before that tag points to 1.13.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
saltas888 added a commit to opsmill/infrahub that referenced this pull request Oct 27, 2026
…mits

The implementation report records the 11 Oct run of quickstart Part 1
steps 5 and 6 on a dev stack, and the test runs of T061 and T062. T050 is
ticked with opsmill/infrahub-helm#100, a draft until the chart's images
move to Infrahub 1.13. The report's commit IDs point at the commits of the
stack as it is now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@saltas888
saltas888 force-pushed the task-manager-retention-infp-507 branch from 72c0791 to 472f126 Compare October 27, 2026 22:07
saltas888 added a commit to opsmill/infrahub that referenced this pull request Oct 28, 2026
…mits

The implementation report records the 11 Oct run of quickstart Part 1
steps 5 and 6 on a dev stack, and the test runs of T061 and T062. T050 is
ticked with opsmill/infrahub-helm#100, a draft until the chart's images
move to Infrahub 1.13. The report's commit IDs point at the commits of the
stack as it is now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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