Skip to content

Fix silent no-op when destroying the Vertex AI Feature Store - #68

Merged
shlbatra merged 1 commit into
mainfrom
fix/destroy-feature-store-rest
Aug 9, 2026
Merged

Fix silent no-op when destroying the Vertex AI Feature Store#68
shlbatra merged 1 commit into
mainfrom
fix/destroy-feature-store-rest

Conversation

@shlbatra

@shlbatra shlbatra commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Problem

./scripts/destroy_resources.sh reported success but left ml_online_store alive and billing a Bigtable node.

The feature-store deletes were guarded by:

if gcloud ai feature-online-stores describe "$ONLINE_STORE_ID" ... >/dev/null 2>&1; then

gcloud ai feature-online-stores is a beta-only command group and isn't present in a stock gcloud install. gcloud exits 2 with ERROR: (gcloud.ai) Invalid choice: 'feature-online-stores', but stderr goes to /dev/null — so the guard reads "command failed" as "resource doesn't exist" and prints:

Online store 'ml_online_store' not found — skipping.
Feature Store torn down.

No delete was ever attempted. The asymmetry is that creation goes through the Python SDK (setup_feature_store.shpython -m feature_store.setupaiplatform_v1), which hits the REST API directly and works fine.

Fix

  • Talk to the Vertex AI REST API directly (fs_get / fs_delete helpers), matching how the store is created. No dependency on the beta gcloud component.
  • fs_get succeeds only on HTTP 200, so a broken call can no longer masquerade as "not found".
  • fs_delete polls the returned long-running operation to completion instead of returning before the resource is actually gone.
  • Delete every feature view in the store rather than only the hardcoded $FEATURE_VIEW_ID — a leftover view blocks the store delete with FAILED_PRECONDITION.

Verification

bash -n passes. Dry run against the live project now discovers both resources it previously missed:

--- Feature Store ---
Deleting feature view 'iris_features'...
  [dry-run] fs_delete .../featureOnlineStores/ml_online_store/featureViews/iris_features
Deleting online store 'ml_online_store' (stops Bigtable node billing)...
  [dry-run] fs_delete .../featureOnlineStores/ml_online_store

Not yet run for real — ml_online_store is still up.

🤖 Generated with Claude Code

destroy_resources.sh guarded its deletes with
`if gcloud ai feature-online-stores describe ... >/dev/null 2>&1`.
That command group is beta-only and absent from a stock gcloud install,
so gcloud exits 2 with "Invalid choice" — which the guard misread as
"resource doesn't exist". The script printed "not found — skipping" and
"Feature Store torn down" while ml_online_store kept running a Bigtable
node and billing.

Talk to the Vertex AI REST API directly instead, matching how the store
is created (feature_store/setup.py uses the Python SDK, not gcloud).
Deletes now poll the returned LRO to completion rather than returning
before the resource is actually gone.

Also delete every feature view in the store instead of only the
hardcoded $FEATURE_VIEW_ID — any leftover view blocks the store delete
with FAILED_PRECONDITION.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@shlbatra
shlbatra merged commit 016f82d into main Aug 9, 2026
1 check failed
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