Repository navigation
docs(storage): add Rapid Cache samples - #7346
Draft
sahusneha2004 wants to merge 2 commits into
Draft
sahusneha2004 wants to merge 2 commits into
sahusneha2004 wants to merge 2 commits into
Conversation
Adds create, get, list, update and disable Rapid Cache samples for Storage Control, with an integration test gated behind skipped-integration-tests. b/482946642 [Generated-by: AI]
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support and examples for managing Rapid Caches in the Google Cloud Storage Control service. It adds new modules and sample code for creating, disabling, getting, listing, and updating rapid caches. Additionally, it integrates these examples into the integration test suite and updates the bucket cleanup logic to handle rapid caches. I have no feedback to provide as there are no review comments and the implementation is clean.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7346 +/- ##
==========================================
- Coverage 97.53% 97.53% -0.01%
==========================================
Files 334 334
Lines 142387 142387
==========================================
- Hits 138879 138878 -1
- Misses 3508 3509 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Set the explicit cache name (ID = zone), cache_type rapid-cache-ultra and ttl 24h on create; wait for the disable LRO; tests assert running state, cache type, list membership and the updated ttl, and bound the disable wait. Aligns with googleapis/google-cloud-java#14529. b/482946642 [Generated-by: AI]
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 Storage Control samples for Rapid Cache: create, get, list, update (TTL through a
FieldMask), and disable.Region tags:
storage_control_create_rapid_cachestorage_control_get_rapid_cachestorage_control_list_rapid_cachesstorage_control_update_rapid_cachestorage_control_disable_rapid_cacheNotes:
createusescache_type = "rapid-cache-ultra"and does not set a name. The service assigns the cache ID, so the driver finds it by listing caches and parsing the name.disablestarts the long-running operation and does not wait for it. The cache reaches thedisabledstate within seconds, but the operation only completes once the cache is fully removed, which can take more than 30 minutes. The driver pollsget_rapid_cacheuntil the state isdisabled.{:?}, to match the samples in other languages.GOOGLE_CLOUD_RUST_TEST_ZONE(defaultus-central1-a).rapid_cache_examplesintegration test is gated behindskipped-integration-tests, like the Anywhere Cache examples.FAILED_PRECONDITION("The bucket you tried to delete has Rapid Cache Ultra") for a long time after the cache is disabled. The test retries for about 2 minutes, then leaves the bucket for the stale bucket cleanup, which now also disables rapid caches.google-cloud-storage1.21.0.Testing:
cargo fmt --checkandcargo clippy --all-targets --all-features -- --deny warningspass. I also ran the full integration test once against a live project:Internal bug: b/482946642
Update: aligned with googleapis/google-cloud-java#14529
The samples and the test now follow the reference integration test (
ITRapidCacheTest.java). This replaces thecreateanddisablenotes above.create: sets the cache name explicitly (projects/_/buckets/{bucket}/rapidCaches/{zone}; the backend requires the cache ID to equal the zone), withcache_type = "rapid-cache-ultra"and a 24h TTL (86400s).disable: now waits for the long-running operation with.poller().until_done()instead of returning right away.cache_id = zone(no more listing to find the service-assigned ID), and checks that the cache isrunningwith the right cache type after create, that list returns it, and that the TTL is 172800s after update.tokio::time::timeout(600s). If it times out, it callsget_rapid_cacheand accepts thedisabledstate, so the test never hangs.Testing:
cargo fmt --check,cargo clippy -p storage-samples --all-targets --all-features -- --deny warnings, and one live run ofrapid_cache_examples(passed; the disable operation hit the 600s timeout and the cache state wasdisabled).