Repository navigation
fix: Wait for Kubernetes materialization jobs when synchronous is false - #7154
Closed
patelchaitany wants to merge 1 commit into
Closed
patelchaitany wants to merge 1 commit into
patelchaitany wants to merge 1 commit into
Conversation
With synchronous=false the Kubernetes compute engine returned a job that was still WAITING. Materialize then recorded the interval, set the feature view to AVAILABLE_ONLINE and emitted an OpenLineage COMPLETE event before any data was written, and pod failures were never reported. Now both modes wait for the Job to finish. synchronous only controls whether pods run in batches of job_batch_size or all in one Job. Also add the update/teardown_infra hooks the ComputeEngine base class requires, so the engine can be instantiated again. Each run creates and cleans up its own Job and ConfigMap, so both are no-ops. Signed-off-by: Chaitany Patel <[email protected]>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7154 +/- ##
==========================================
+ Coverage 52.32% 52.51% +0.19%
==========================================
Files 459 459
Lines 58095 58102 +7
Branches 8560 8560
==========================================
+ Hits 30397 30514 +117
+ Misses 25614 25501 -113
- Partials 2084 2087 +3
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
5 of 7 tasks
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.
What this PR does / why we need it:
With
synchronous: false, the Kubernetes compute engine created one Job for all pods and returned it right away, while the Job was stillWAITING.materialize()treats any returned job that isn'tERRORas done, so it:AVAILABLE_ONLINE,COMPLETEevent,all before a single row reached the online store. If the pods later failed, Feast never found out. The UI and lineage still showed the run as successful.
This PR makes
synchronous: falsewait for the Job too, using the same_await_path_materializationloop the synchronous path already uses.synchronousnow only decides how pods are grouped:true: run the pods in Jobs ofjob_batch_size, one Job after another.false: run all pods in a single Job.Either way, the feature view is marked materialized only after the Job succeeds. The ConfigMap cleanup and the pod-log printing on failure now also run in async mode.
It also adds the
updateandteardown_inframethods thatComputeEnginerequires. Without them,KubernetesComputeEngine(...)raisedTypeError: Can't instantiate abstract class. Each run creates and deletes its own Job and ConfigMap, so there is no long-lived infrastructure, and both methods do nothing (same as the Spark application engine).Behavior change:
feast materializewithsynchronous: falsenow blocks until the Job finishes, rather than returning right away.Which issue(s) this PR fixes:
N/A
Checks
git commit -s)Testing Strategy
sdk/python/tests/unit/infra/compute_engines/test_k8s_engine.pybuilds a realKubernetesComputeEnginewithsynchronous=Falseand a fake Job that goesWAITING → RUNNING → SUCCEEDED. It checks that one Job is created with all paths and that materialize waits untilSUCCEEDED. The test fails on master (assert 0 == 2on the poll count). It skips when thekubernetespackage isn't installed.Not tested against a real cluster.
Misc
KubernetesMaterializationJob.status()reads onlyconditions[0]of the Job. Newer Kubernetes versions (1.31+) can putSuccessCriteriaMetorFailureTargetfirst, so the wait loop might not seeComplete/Failed. I haven't checked this on a real cluster, and it's out of scope here.