Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 214
Initial implementation of the local cache layer#3678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
75a0eabe5c1b4609d972a71de033c982a6ead7f41d6565558489cb3eea54f71bdae5a5dd6943d6acaa44de89c9be3a02396efc9419db3ee50e47cf1e48ca3da338c05a37f176e5669aae097a7375d51be8309318f0849fd06e9d56ebefd43c60339b7dcca0f4b3a48baea6b1f126719445c8234d8aab3b751953011e8702c6a1da74bbc589bcc8dc9d35727a5e8fcb044fc8458c0afb8a374a46f6d1807e31f7fdf8287ad5f1b865ef495c3782c5b1e4f03c2ac8c3615d78056127853f37bce6ecf15cd0f4af2716aab00400631644a1392b48fd2d1eddf974ef26518367a6bf010b55eae89682314852e5c2b57059b2d2a828e41660770f1bcaf66649da1e04cd6fd193d01a9be0374c88cd440ecc4e9c4fad9031c7a2da3e3777672d43b455f54388239199ae498cf6ec52191624419512433c86dfd04cfdcd5d07c05b6File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,17 @@ | ||
| RecordRequests = true | ||
| IncludeRequestHeaders = ["User-Agent"] | ||
| [Env] | ||
| DATABRICKS_CACHE_ENABLED = 'false' | ||
| [[Repls]] | ||
| Old = '"execution_time_ms": \d{1,5},' | ||
| New = '"execution_time_ms": SMALL_INT,' | ||
| [[Repls]] | ||
| Old = '(linux|darwin|windows)' | ||
| New = '[OS]' | ||
| [[Repls]] | ||
| Old = '"local_cache_measurements_ms": \[[^\]]*\]' | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if cache is disabled, should this be non-empty? Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We always measure if the cahce is disabled, with disabled cache we always compute values though anyway | ||
| New = '"local_cache_measurements_ms": [...redacted...]' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| RecordRequests = true | ||
| Local = true | ||
| IncludeRequestHeaders = ["User-Agent"] | ||
| [Env] | ||
| DATABRICKS_CACHE_ENABLED = 'false' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| bundle: | ||
| name: cache-clear-test |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| === First call in a session is expected to be a cache miss: | ||
| [DEBUG_TIMESTAMP] Debug: [Local Cache] using cache key: [SHA256_HASH] | ||
| [DEBUG_TIMESTAMP] Debug: [Local Cache] failed to stat cache file: (redacted) | ||
| [DEBUG_TIMESTAMP] Debug: [Local Cache] cache miss, computing | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: should include function name that is being computed? This maybe more relevant in the future where is more than one function. | ||
| [DEBUG_TIMESTAMP] Debug: [Local Cache] computed and stored result | ||
| === Second call in a session is expected to be a cache hit | ||
| [DEBUG_TIMESTAMP] Debug: [Local Cache] using cache key: [SHA256_HASH] | ||
| [DEBUG_TIMESTAMP] Debug: [Local Cache] cache hit | ||
| >>> [CLI] cache clear | ||
| Cache cleared successfully from [TEST_TMP_DIR]/.cache | ||
| === First call after a clear is expected to be a cache miss: | ||
| [DEBUG_TIMESTAMP] Debug: [Local Cache] using cache key: [SHA256_HASH] | ||
| [DEBUG_TIMESTAMP] Debug: [Local Cache] failed to stat cache file: (redacted) | ||
| [DEBUG_TIMESTAMP] Debug: [Local Cache] cache miss, computing | ||
| [DEBUG_TIMESTAMP] Debug: [Local Cache] computed and stored result | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| export DATABRICKS_CACHE_DIR=$(pwd)/.cache | ||
| $CLI cache clear &> /dev/null | ||
| title "First call in a session is expected to be a cache miss:\n" | ||
| trace $CLI bundle validate --debug 2>&1 | grep "Local Cache" | grep -v "cache path" | ||
| title "Second call in a session is expected to be a cache hit\n" | ||
| trace $CLI bundle validate --debug 2>&1 | grep "Local Cache" | grep -v "cache path" | ||
| trace $CLI cache clear | ||
| title "First call after a clear is expected to be a cache miss:\n" | ||
| trace $CLI bundle validate --debug 2>&1 | grep "Local Cache" | grep -v "cache path" | ||
| rm -rf "${DATABRICKS_CACHE_DIR}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| Cloud = false | ||
| Local = true | ||
| [Env] | ||
| DATABRICKS_CACHE_ENABLED = 'true' | ||
| # Redact structured logging fields from debug output | ||
| [[Repls]] | ||
| Old = ' pid=[0-9]+' | ||
| New = '' | ||
| [[Repls]] | ||
| Old = ' mutator=[A-Za-z]+' | ||
| New = '' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| bundle: | ||
| name: exploratory-cache-test |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| === First call in a session is expected to be a cache miss: | ||
| [DEBUG_TIMESTAMP] Debug: [Local Cache] using cache key: [SHA256_HASH] | ||
| [DEBUG_TIMESTAMP] Debug: [Local Cache] failed to stat cache file: (redacted) | ||
| [DEBUG_TIMESTAMP] Debug: [Local Cache] cache miss, computing | ||
| [DEBUG_TIMESTAMP] Debug: [Local Cache] computed and stored result | ||
| === Second call in a session is expected to be a cache hit | ||
| [DEBUG_TIMESTAMP] Debug: [Local Cache] using cache key: [SHA256_HASH] | ||
| [DEBUG_TIMESTAMP] Debug: [Local Cache] cache hit | ||
| === Bundle deploy should send telemetry values | ||
| >>> [CLI] bundle deploy -p dogfood | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/exploratory-cache-test/default/files... | ||
| Deploying resources... | ||
| Deployment complete! | ||
| >>> print_telemetry_bool_values | ||
| local.cache.attempt true | ||
| local.cache.hit true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| export DATABRICKS_CACHE_DIR=$(pwd)/.cache | ||
| $CLI cache clear &> /dev/null | ||
| title "First call in a session is expected to be a cache miss:\n" | ||
| trace $CLI bundle validate -p dogfood --debug 2>&1 | grep "Local Cache" | grep -v "cache path" | ||
| title "Second call in a session is expected to be a cache hit\n" | ||
| trace $CLI bundle validate -p dogfood --debug 2>&1 | grep "Local Cache" | grep -v "cache path" | ||
| title "Bundle deploy should send telemetry values\n" | ||
| trace $CLI bundle deploy -p dogfood | ||
| trace print_telemetry_bool_values | grep "local.cache" | ||
| rm out.requests.txt | ||
| rm -rf "${DATABRICKS_CACHE_DIR}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| Cloud = false | ||
| Local = true | ||
| RecordRequests = true | ||
| [Env] | ||
| DATABRICKS_CACHE_ENABLED = 'true' | ||
| # Redact structured logging fields from debug output | ||
| [[Repls]] | ||
| Old = ' pid=[0-9]+' | ||
| New = '' | ||
| [[Repls]] | ||
| Old = ' mutator=[A-Za-z]+' | ||
| New = '' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| [[Repls]] | ||
| Old = '\d\d:\d\d:\d\d' | ||
| New = "[DEBUG_TIMESTAMP]" | ||
| [[Repls]] | ||
| Old = '[a-f0-9]{64}' | ||
| New = "[SHA256_HASH]" | ||
| [[Repls]] | ||
| Old = '[a-f0-9]{12}' | ||
| New = "[CACHE_KEY]" | ||
| [[Repls]] | ||
| Old = 'failed to stat cache file: .*' | ||
| New = "failed to stat cache file: (redacted)" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -158,6 +158,7 @@ Additional Commands: | ||
| account Databricks Account Commands | ||
| api Perform Databricks API call | ||
| auth Authentication related commands | ||
| cache Local cache related commands | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From the description it's not obvious that is user-level cache (and not whatever we have in .databricks). Perhaps make it explicit "user-level cache"? cc @juliacrawf-db | ||
| completion Generate the autocompletion script for the specified shell | ||
| configure Configure authentication | ||
| help Help about any command | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(optional) maybe worth recording the keys for the int map.