Repository navigation
Conversation
indexedSearch.continuity.enabled replaces the zoekt-webserver and zoekt-indexserver containers with one continuity webserver per indexed-search pod, adds an indexer Deployment that publishes shards through object storage, and passes the continuity settings to frontend, worker, searcher, and gitserver. Off by default; disabled renders are unchanged. Amp-Thread-ID: https://ampcode.com/threads/T-597f342f-9754-47be-8f3e-3c5ffc344e41
Continuity no longer swaps the indexed-search containers in place. It runs as its own fleet, so an instance can index every repository and warm the new webservers before searches move to them: - indexed-searcher StatefulSet and headless Service (plus optional PDB and ServiceAccount) run zoekt-continuity-webserver, configured under a new top-level indexedSearcher block. The frontend's default continuity endpoint, k8s+rpc://indexed-searcher:6070?kind=sts, finds them without extra settings. - The indexer Deployment and metrics Service are now indexed-searcher-indexer, so they no longer collide with the old fleet's indexed-search-indexer Service. - indexedSearch.continuity.routing (default true) sets SRC_INDEXED_SEARCH_CONTINUITY_ROUTING. Migrating instances set it to false until src_zoekt_continuity_ready_to_route is 1. - indexedSearch.enabled (default true) gates every indexed-search object, so the old fleet can be removed after the switch. indexed-search renders exactly as before; with continuity off the whole chart renders unchanged. Amp-Thread-ID: https://ampcode.com/threads/T-597f342f-9754-47be-8f3e-3c5ffc344e41
Switching indexedSearch.continuity.routing restarted the indexed-searcher webservers, the indexers and gitserver, none of which read SRC_INDEXED_SEARCH_CONTINUITY_ROUTING. On kind the routing flip then rolled the new webservers at the same moment the frontends started routing to them. Render the variable only for the frontend, worker and searcher. Amp-Thread-ID: https://ampcode.com/threads/T-597f342f-9754-47be-8f3e-3c5ffc344e41
A starting webserver stays unready until it has loaded all its slots, so a rolling restart waits for it, but it serves each slot as soon as that slot is loaded. Publishing its address while it is unready lets the frontend route those slots meanwhile. Amp-Thread-ID: https://ampcode.com/threads/T-597f342f-9754-47be-8f3e-3c5ffc344e41
Follows sourcegraph/sourcegraph#20044, which drops the continuity name: - Values: indexedSearch.continuity becomes zoekt, indexedSearcher becomes zoektSearcher. - Workloads and images: zoekt-indexer and zoekt-searcher. - Environment: SRC_ZOEKT_INDEXER_ENABLED, SRC_ZOEKT_SEARCHER_ROUTING and SRC_ZOEKT_* for the rest. Gitserver no longer gets the settings, since the worker now queues index jobs after fetches. Amp-Thread-ID: https://ampcode.com/threads/T-597f342f-9754-47be-8f3e-3c5ffc344e41
The searchers now report readiness on the debug server, which fails as soon as a shutdown starts, like the other services. Amp-Thread-ID: https://ampcode.com/threads/T-597f342f-9754-47be-8f3e-3c5ffc344e41
With indexedSearch.enabled false, the frontend still defaults to Kubernetes discovery of the indexed-search StatefulSet. Set INDEXED_SEARCH_SERVERS and INDEXED_SEARCH_INDEXER to empty for it, unless frontend.env sets them. Amp-Thread-ID: https://ampcode.com/threads/T-597f342f-9754-47be-8f3e-3c5ffc344e41
Neither the Zoekt indexer nor the searchers read DATA_DIR, and SRC_FRONTEND_INTERNAL had its default value. The indexer's scratch directory comes from TMPDIR, which stays. Amp-Thread-ID: https://ampcode.com/threads/T-597f342f-9754-47be-8f3e-3c5ffc344e41
The Zoekt indexer now requires SRC_ZOEKT_INDEXER_SCRATCH_DIR instead of defaulting to the temporary directory. Point it at /data/scratch on the scratch volume. Amp-Thread-ID: https://ampcode.com/threads/T-597f342f-9754-47be-8f3e-3c5ffc344e41
The indexer's scratch directory was a 20Gi emptyDir with no ephemeral-storage request, too small for monorepos such as Chromium, whose fetch and shards take 8 to 14 GB per job. Each indexer pod now gets its own PersistentVolumeClaim, a generic ephemeral volume of 100Gi by default, which Kubernetes deletes with the pod. Its storage class defaults to a new <storageClass.name>-scratch class, created like storageClass but with the Delete reclaim policy, so the disk goes away on scale-down and rollouts instead of being retained like the chart's other volumes. scratch.persistentVolume=false keeps an emptyDir instead, with a matching ephemeral-storage request. Amp-Thread-ID: https://ampcode.com/threads/T-597f342f-9754-47be-8f3e-3c5ffc344e41
Both Zoekt workloads now render SRC_PRE_SHUTDOWN_PAUSE and SRC_GRACEFUL_SHUTDOWN_TIMEOUT and take the usual preShutdownPause, gracefulShutdownTimeout and terminationGracePeriodSeconds overrides. The searcher no longer has its own 15 s drain, so its 60 s termination grace and the check that it is at least 30 s are gone. The helpers also accept a values map for nested services like zoekt.indexer. Amp-Thread-ID: https://ampcode.com/threads/T-597f342f-9754-47be-8f3e-3c5ffc344e41
This branch has not been deployed
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.
Adds opt-in indexed search continuity to the chart behind
indexedSearch.continuity.enabled, which defaults tofalse. With it off,helm templaterenders byte-identical manifests to this branch's base onmain.Continuity is a new indexed search architecture being prototyped in sourcegraph/sourcegraph: stateless indexers publish each repository's index generations to object storage, webservers download them and activate new versions only once enough replicas have them, and the frontend searches each repository on exactly one ready replica. This chart change is a draft: the continuity images (
zoekt-continuity-webserver,zoekt-continuity-indexer) and the application settings it relies on (SRC_INDEXED_SEARCH_CONTINUITY_ROUTING,SRC_INDEXED_SEARCH_CONTINUITY_WEBSERVERS) aren't released yet.Side-by-side design
Continuity runs as a separate fleet next to the existing
indexed-searchStatefulSet, with different workload, Service, and PVC names, so an existing instance can switch over without users noticing.indexed-search(StatefulSet,indexed-searchandindexed-search-indexerServices, PDB, ServiceAccount) renders exactly as onmainwhether continuity is on or off.Enabling continuity adds:
indexed-searcherStatefulSet and headless Service: onezoekt-continuity-webservercontainer per pod (gRPC 6070, metrics 6060). ReadinessGET /ready, livenessGET /healthz,OrderedReady, rolling updates, 60 s termination grace period, its owndataPVCs. Prometheus scrapes port 6060. The frontend's default continuity endpoint,k8s+rpc://indexed-searcher:6070?kind=sts, finds it, so the chart doesn't setSRC_INDEXED_SEARCH_CONTINUITY_WEBSERVERS. Optional PDB and ServiceAccount, likeindexed-search. Configured under a new top-levelindexedSearcherblock modelled onindexedSearch.indexed-searcher-indexerDeployment (2 replicas, emptyDir scratch) plus a headless metrics Service on 6060. Named so it doesn't collide with the old fleet'sindexed-search-indexerService. UsesindexedSearcher's scheduling, security context, and ServiceAccount settings; its own settings stay underindexedSearch.continuity.indexer.SRC_INDEXED_SEARCH_CONTINUITY_ENABLED,_ROUTING,_WARM_REPLICAS,_ACTIVATION_TOLERANCE,_REPLICATION_FACTORS, plusindexedSearch.continuity.env. Their settings for the old fleet are unchanged.New values:
indexedSearch.continuity.routing(defaulttrue) setsSRC_INDEXED_SEARCH_CONTINUITY_ROUTING.falsekeeps searches onindexed-searchwhile continuity indexes and warms.indexedSearch.enabled(defaulttrue) gates everyindexed-searchobject, so the old fleet can be removed after the switch.indexedSearcher.*for the webservers (the formerindexedSearch.continuity.webserverImage,webserverCommand/webserverArgs, andterminationGracePeriodSecondsmoved here asimage,command/args,terminationGracePeriodSeconds).Validation:
indexedSearch.continuity.replicasmust not exceedindexedSearcher.replicaCount;activationTolerancemust be less thanreplicas;indexedSearcher.terminationGracePeriodSecondsat least 30;routing: falseis rejected whenindexedSearch.enabledisfalse, since searches would go to the removed fleet.The frontend Role already allows get/list/watch on
endpointsandstatefulsetsin the namespace, which coverskind=stsdiscovery ofindexed-searcher.Migration
indexedSearch.continuity.enabled: trueandindexedSearch.continuity.routing: false. The new fleet runs next toindexed-search, indexes every repository from scratch, and warms its webservers; searches still go toindexed-search.src_zoekt_continuity_ready_to_routeto be 1 (every indexable repository has an active generation and every slot is ready on its whole placement).indexedSearch.continuity.routing: true. Searches go toindexed-searcher.indexedSearch.enabled: falseto remove theindexed-searchStatefulSet, then delete itsdata-indexed-search-*PVCs, which Kubernetes keeps after a StatefulSet is deleted.New installations set
indexedSearch.enabled: falsewith continuity enabled and routingtrue. Both paths are documented in the README's new "Indexed search continuity" section.Test plan
helm unittest charts/sourcegraph: 43 suites, 277 tests pass, includingtests/indexedSearchContinuity_test.yaml(default renders no continuity objects and the old layout; both fleets with distinct names;indexedSearchersettings; routing reaches env;indexedSearch.enabled: falseremoves the old objects; validation failures).helm lint charts/sourcegraphpasses with continuity off, on with routing off, and on withindexedSearch.enabled: false.helm templatewith continuity off is byte-identical to the merge base withmain; against currentmainonly the release image tags and chart version differ (the branch predates the v8.2.1283 bump). With continuity on, theindexed-searchobjects render identically to continuity off.