Skip to content

feat(operator-wandb): configure artifact GC budget and task-row sharding - #677

Open
zacharyblasczyk wants to merge 3 commits into
mainfrom
zb/artifact-gc-env-values
Open

feat(operator-wandb): configure artifact GC budget and task-row sharding#677
zacharyblasczyk wants to merge 3 commits into
mainfrom
zb/artifact-gc-env-values

Conversation

@zacharyblasczyk

@zacharyblasczyk zacharyblasczyk commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Description

Companion to wandb/core#50429, this exposes the Helm values needed for fixed, independently scheduled Artifact GC task rows.

The final artifactsGc surface is:

Value Environment variable Default
BatchSize GORILLA_ARTIFACTS_GC_BATCH_SIZE 0
NumWorkers GORILLA_ARTIFACTS_GC_NUM_WORKERS 0
DeleteFilesNumWorkers GORILLA_ARTIFACTS_GC_DELETE_FILES_NUM_WORKERS 0
ObjectStoreConcurrencyBudget GORILLA_ARTIFACTS_GC_OBJECT_STORE_CONCURRENCY_BUDGET 0
CollectionShardCount GORILLA_ARTIFACTS_GC_COLLECTION_SHARD_COUNT 0

All five values render unconditionally as quoted strings. The chart version is bumped from 0.44.5 to 0.44.6.

CollectionShardCount semantics are enforced by both the chart render guard and Core:

  • 0: preserve the existing task topology
  • 1: invalid
  • 2..32: activate or validate that many real task rows

Sharded rows enable checkpointing internally. Checkpoint and incident-specific skip-list controls are deliberately not part of the public Helm surface.

Why

The earlier design fanned shards out inside one Glue invocation, which coupled all shard completion and checkpoint persistence to the slowest shard. Real task rows give each shard its own schedule, retry lifecycle, and ordinary checkpoint.

Worker counts and the object-store budget are per row. For example, four rows with NumWorkers: 16 and ObjectStoreConcurrencyBudget: 16 permit aggregate limits of 64 outer workers and 64 object-store operations.

Proposed QA user spec:

values:
  artifactsGc:
    BatchSize: 500
    NumWorkers: 16
    DeleteFilesNumWorkers: 32
    ObjectStoreConcurrencyBudget: 16
    CollectionShardCount: 4

Validation

  • Focused Helm unit tests cover defaults, the exact QA values, absence of the removed settings, and shard-count acceptance/rejection at 0, 1, 2, 32, 33, negative, fractional, and string inputs.
  • Full Helm unit suite: 52 tests passed.
  • All operator-wandb snapshots match under the CI Helm version (v3.20.1).
  • Chart lint, template formatting, Python script tests, and maintainability checks pass.
  • An explicit Helm render confirms the five QA values and absence of checkpoint/skip-list envs.

Summary by CodeRabbit

  • New Features

    • Added optional artifact garbage-collection controls for object-store concurrency budgeting and collection sharding.
    • Configure limits per task and split collection processing across 2–32 shards when enabled.
    • Defaults preserve existing behavior when these options are not configured.
  • Bug Fixes

    • Added validation to reject unsupported collection shard counts.
    • Removed unsupported checkpoint and skipped-collection settings.
  • Chores

    • Updated the Helm chart version to 0.44.6.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aef4a9cbc1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +33 to +37
{{- if or (kindIs "bool" .Values.artifactsGc.EnableCheckpoint) (ne (toString .Values.artifactsGc.EnableCheckpoint) "") }}
GORILLA_ARTIFACTS_GC_ENABLE_CHECKPOINT: {{ .Values.artifactsGc.EnableCheckpoint | toString | quote }}
{{- end }}
{{- if .Values.artifactsGc.SkippedReadyCollectionIds }}
GORILLA_ARTIFACTS_GC_SKIPPED_READY_COLLECTION_IDS: {{ .Values.artifactsGc.SkippedReadyCollectionIds | quote }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add render coverage for the conditional GC values

The snapshots added here exercise only the default omitted path: no test config sets EnableCheckpoint or SkippedReadyCollectionIds. Consequently, the non-empty branches—and especially the supported boolean false override in this compound condition—can regress without any chart test detecting the rendered environment variables. Add focused render or snapshot cases covering boolean false, a non-empty string value, and a populated skip list.

AGENTS.md reference: AGENTS.md:L17-L20

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
charts/operator-wandb/templates/glue.yaml (1)

33-35: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Name the tri-state checkpoint condition.

Extract the compound expression into a variable such as $checkpointOverrideConfigured. The name makes the empty-string versus boolean false behavior explicit.

As per coding guidelines, give compound conditions a name when that name communicates intent better than the inline expression.

Suggested refactor
-{{- if or (kindIs "bool" .Values.artifactsGc.EnableCheckpoint) (ne (toString .Values.artifactsGc.EnableCheckpoint) "") }}
+{{- $checkpointOverrideConfigured := or (kindIs "bool" .Values.artifactsGc.EnableCheckpoint) (ne (toString .Values.artifactsGc.EnableCheckpoint) "") }}
+{{- if $checkpointOverrideConfigured }}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@charts/operator-wandb/templates/glue.yaml` around lines 33 - 35, In the Helm
template condition guarding GORILLA_ARTIFACTS_GC_ENABLE_CHECKPOINT, assign the
compound bool-or-nonempty check to a clearly named variable such as
checkpointOverrideConfigured, then use that variable in the if statement while
preserving the existing tri-state behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@charts/operator-wandb/templates/glue.yaml`:
- Around line 33-35: In the Helm template condition guarding
GORILLA_ARTIFACTS_GC_ENABLE_CHECKPOINT, assign the compound bool-or-nonempty
check to a clearly named variable such as checkpointOverrideConfigured, then use
that variable in the if statement while preserving the existing tri-state
behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2788885e-034e-4999-b1ea-5c9388317356

📥 Commits

Reviewing files that changed from the base of the PR and between a95d4cd and aef4a9c.

⛔ Files ignored due to path filters (54)
  • test-configs/operator-wandb/__snapshots__/activity-store-disabled.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/activity-store-serve-backfill-off.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/azure-byob-access-key.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/azure-workload-identity-refs.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/azure-workload-identity.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/default.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/fmb.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/glue-leader-election.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/history-reader.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/historystore-parquet-grpc.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/historystore-parquet-only.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/keda-api-prometheus.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/keda-executor.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/keda-frfu.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/keda-parquet.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/local-bypass-no-app.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/local-bypass-with-app.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/mcp-server-empty-trace-url.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/mcp-server-external-trace.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/mcp-server-no-weave.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/mcp-server.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/no-local-bypass.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/oidc-secret-from-k8s.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/olap-features-enabled.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/olap-multi-feature.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/run-store-accelerator-run-updater.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/runs-v2-bufstream.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-api-rate-limits.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-ch-migration-job-no-olap.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-ch-migration-job.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-console-env-defaults.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-console-env.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-console-extraEnv.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-enable-backfill.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-image-digest-override.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-image-tag-override.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-lumen-aws.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-lumen-azure.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-lumen-gcp.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-lumen-onprem-custom-bucket.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-lumen-onprem-default-bucket.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-mysql-cacert-inline.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-no-oidc-settings-extra-cors.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-oidc-settings-default.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-oidc-settings-extra-cors.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-priority-classes.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-smtp-mail-from-secret.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-smtp-mail-from.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/snap-tolerations-and-selectors.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/url-encoded-password.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/user-defined-clickhouse-secret.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/user-defined-secrets.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/weave-trace-with-worker.snap is excluded by !**/*.snap
  • test-configs/operator-wandb/__snapshots__/weave-trace.snap is excluded by !**/*.snap
📒 Files selected for processing (3)
  • charts/operator-wandb/Chart.yaml
  • charts/operator-wandb/templates/glue.yaml
  • charts/operator-wandb/values.yaml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@charts/operator-wandb/values.yaml`:
- Around line 646-654: Add validation for the CollectionShardCount value in the
chart’s schema or template guard, allowing only 0 or integers from 2 through 32
and rejecting 1 and values outside that range. Add coverage for values 0, 1, 2,
32, and 33, preserving valid configuration rendering and preventing invalid
values from reaching the environment.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3ffded90-2e62-4f12-ae29-cccd0eed129c

📥 Commits

Reviewing files that changed from the base of the PR and between aef4a9c and f35fd2e.

📒 Files selected for processing (3)
  • charts/operator-wandb/templates/glue.yaml
  • charts/operator-wandb/tests/artifacts_gc_env_test.yaml
  • charts/operator-wandb/values.yaml

Comment thread charts/operator-wandb/values.yaml
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