feat(langsmith): add pre-upgrade backfill check Job#591
Draft
Bagatur (baskaryan) wants to merge 2 commits intomainfrom
Draft
feat(langsmith): add pre-upgrade backfill check Job#591Bagatur (baskaryan) wants to merge 2 commits intomainfrom
Bagatur (baskaryan) wants to merge 2 commits intomainfrom
Conversation
Introduces a Helm pre-upgrade hook Job (backfill-check.yaml) that runs the backfill_check_entrypoint.sh script from the backend image before any Alembic migrations are applied on upgrade. If any asynq backfill is still in 'running' state the Job exits non-zero, causing the Helm upgrade (and ArgoCD PreSync) to fail with a clear message instructing the operator to remain on the current version until the backfills complete. Key design decisions: - pre-upgrade only (not pre-install) — backfills don't exist on fresh installs - backoffLimit: 0 — no retries; fix the underlying issue, then re-upgrade - helm.sh/hook-delete-policy: before-hook-creation — each upgrade attempt gets a fresh Job so stale results from a previous attempt don't interfere - Enabled by default; set backend.backfillCheck.enabled: false to bypass Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The check script uses this to determine which entries in REQUIRED_BACKFILLS are active for the current upgrade (only those whose required version <= the chart's appVersion are enforced). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
no need to land till v14 release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Descriptoin
Adds a pre-upgrade Kubernetes Job that runs before Alembic migrations on every helm upgrade, blocking self-hosted customers
from upgrading to a version where backfill code has been deleted before the backfill has completed on their installation.
Companion to langchainplus PR #18179 which adds the script and
CI enforcement.
New files
charts/langsmith/templates/backend/backfill-check.yaml— a Helmpre-upgradeJob (ArgoCDPreSync) that runsbackfill_check_entrypoint.shfrom the backend image before any schema migrations are applied.Key design decisions
helm.sh/hook: pre-upgradeonly (notpre-install)backoffLimit: 0hook-delete-policy: before-hook-creationargocd.argoproj.io/hook: PreSync+BeforeHookCreationLANGSMITH_APP_VERSIONinjected from{{ .Chart.AppVersion }}backend.backfillCheck.enabled: falseto bypassTest Plan
helm templatethe chart and verify thebackfill-checkJob renders with the correct hook annotationshelm upgrade --dry-runagainst a cluster wherebackfill_jobshas arunningrow — confirm the pre-upgrade Jobfails and the upgrade is blocked
helm upgrade --dry-runwith all backfills complete — confirm it proceeds to migrationsbackend.backfillCheck.enabled: falseand confirm the Job is not rendered