-
Notifications
You must be signed in to change notification settings - Fork 186
Use Filestore over NFS to speed up and share GCS Object Storage cached slabs #955
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
Merged
Merged
Changes from 64 commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
f75b833
let's try a simpler MR to clean this up
djeebus a4e24b7
bring the tests back
djeebus f67a44f
fix test
djeebus 10655b9
linting, bring back caching
djeebus 3271334
lint, actually use the cache provider
djeebus 94b1299
finish implementation
djeebus 1b9b4cd
sort imports
djeebus 828e82f
Merge branch 'main' into nfs-file-cache
djeebus 3ca3783
add the terraform back
djeebus aeef165
test slab cache with integration tests
djeebus 86ba16d
clean up some error messages
djeebus 34cab05
dump out the expected total size so we can math
djeebus 9995842
fix silly math
djeebus 3696ef2
get body when http requests fail
djeebus f00ca7a
more silliness
djeebus 66630bd
add some more validation to see what's going on
djeebus 39beb80
fix tests
djeebus 92d9e16
Merge branch 'main' into nfs-file-cache
djeebus 6fefa2d
Merge branch 'main' into nfs-file-cache
djeebus f51a8b2
fix interface issue
djeebus d341c29
Use env var instead of '~'
djeebus aca1919
learn how to use github env vars
djeebus 4b970d1
stop being fancy
djeebus 8492e8f
only need to hash this file, really
djeebus 8917055
Merge branch 'main' into nfs-file-cache
djeebus fd50041
Merge branch 'main' into nfs-file-cache
djeebus dad9b9e
fix bug in a loop. thanks, cursor!
djeebus bf73fb8
fix some terraform
djeebus 8e96623
ignore some things
djeebus 601e15d
only cache builds, not pauses (progress)
djeebus cb16411
reduce blast radius
djeebus a1e28f1
support enabling/disabling filestore cache
djeebus 0546411
fix race condition in test
djeebus 11b40d3
remove the 'moved' block
djeebus 1b0bc50
some clean up
djeebus 0c59e24
use launch darkly to gate nfs cache usage
djeebus f19c61e
Merge branch 'main' into nfs-file-cache
djeebus 2431e32
support "make plan-only-jobs && make apply"
djeebus a922d5a
Merge remote-tracking branch 'origin/main' into nfs-file-cache
djeebus fe7d83a
Merge branch 'main' into nfs-file-cache
djeebus c204c3f
Merge remote-tracking branch 'origin/main' into nfs-file-cache
djeebus 0854a8a
fix tests
djeebus 07b1dfe
support configuration of filestore
djeebus 1f567d3
Merge branch 'main' into nfs-file-cache
djeebus 05d3b65
write to temp file, then rename file
djeebus 923dd7d
filestore maintenance script
djeebus dd8bf55
clean up messages, hcl
djeebus 153e622
cross platform is fun!
djeebus a1d9bdc
linting
djeebus 9c3233b
Merge branch 'main' into nfs-file-cache
djeebus bff3701
fix the nomad job
djeebus 7a9e172
reverse target (was based on free space, now based on used space)
djeebus 803d330
add some data about the files that were deleted
djeebus ca96079
add standard deviation, fix some logic
djeebus dc42367
fix linux version
djeebus 54e39fe
fork the upstream implementation of times to get size
djeebus 1f0b775
go work sync
djeebus 5419c3b
fix the linux version
djeebus 4006bb1
fix the osx version
djeebus df084f4
add gcp alerting to filestore
djeebus f159ab3
remove the 'import' block
djeebus b98c8ff
Merge commit '19778a715e8df3adea83858c798582d289bd7159' into nfs-file…
djeebus c0a10d4
linting
djeebus 2b67939
bring back the old version of the nomad provider
djeebus 05a0c84
remove tracing, fix a bug
djeebus 6e0f9fb
fix a test, remove an empty test
djeebus cb92317
Simplify for deployment
ValentaTomas 9750894
Fix old name
ValentaTomas 7a32e89
Add automatic protocol; Update recommended values
ValentaTomas 12e02cf
Fix job condition
ValentaTomas 7827f69
Change invalid default value
ValentaTomas f2d3df4
Add comment
ValentaTomas a485cf9
Merge branch 'main' into nfs-file-cache
ValentaTomas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| resource "google_filestore_instance" "slab-cache" { | ||
| name = var.name | ||
| description = "High performance slab cache" | ||
| tier = var.tier | ||
| protocol = "NFS_V4_1" | ||
|
|
||
| deletion_protection_enabled = true | ||
| deletion_protection_reason = "If this gets removed, the orchestrator will throw tons of errors" | ||
|
|
||
| file_shares { | ||
| capacity_gb = var.capacity_gb | ||
| name = "slabs" | ||
| } | ||
|
|
||
| networks { | ||
| modes = [ | ||
| "MODE_IPV4", | ||
| ] | ||
| network = var.network_name | ||
| } | ||
| } | ||
|
|
||
| data "google_monitoring_notification_channel" "notification" { | ||
| count = var.notification_display_name == null ? 0 : 1 | ||
| display_name = var.notification_display_name | ||
| } | ||
|
|
||
| resource "google_monitoring_alert_policy" "warning" { | ||
| count = var.free_space_warning_threshold == 0 ? 0 : 1 | ||
|
|
||
| combiner = "OR" | ||
|
|
||
| display_name = "memory-cache-disk-usage-low" | ||
|
|
||
| notification_channels = var.notification_display_name == null ? [] : [ | ||
| data.google_monitoring_notification_channel.notification[0].id | ||
| ] | ||
|
|
||
| severity = "WARNING" | ||
|
|
||
| alert_strategy { | ||
| notification_prompts = [ | ||
| "OPENED", | ||
| "CLOSED", | ||
| ] | ||
| } | ||
|
|
||
| conditions { | ||
| display_name = "Over ${var.free_space_warning_threshold}% of the memory cache disk has been used" | ||
|
|
||
| condition_threshold { | ||
| comparison = "COMPARISON_GT" | ||
| duration = "0s" | ||
| filter = <<EOT | ||
| resource.type = "filestore_instance" | ||
| AND metric.type = "file.googleapis.com/nfs/server/used_bytes_percent" | ||
| AND metric.labels.file_share = "${google_filestore_instance.slab-cache.file_shares[0].name}" | ||
| EOT | ||
| threshold_value = var.free_space_warning_threshold | ||
|
|
||
| aggregations { | ||
| alignment_period = "300s" | ||
| group_by_fields = [] | ||
| per_series_aligner = "ALIGN_MAX" | ||
| } | ||
|
|
||
| trigger { | ||
| count = 1 | ||
| percent = 0 | ||
| } | ||
| } | ||
| } | ||
|
|
||
| documentation { | ||
| mime_type = "text/markdown" | ||
| subject = "Memory cache disk usage has gone over ${var.free_space_warning_threshold}%" | ||
| content = "Your memory cache filestore instance disk usage has gone over ${var.free_space_warning_threshold}%. " | ||
| } | ||
| } | ||
|
|
||
| resource "google_monitoring_alert_policy" "error" { | ||
| count = var.free_space_error_threshold == 0 ? 0 : 1 | ||
|
|
||
| combiner = "OR" | ||
|
|
||
| display_name = "memory-cache-disk-usage-very-low" | ||
|
|
||
| notification_channels = var.notification_display_name == null ? [] : [ | ||
| data.google_monitoring_notification_channel.notification[0].id | ||
| ] | ||
|
|
||
| severity = "ERROR" | ||
|
|
||
| alert_strategy { | ||
| notification_prompts = [ | ||
| "OPENED", | ||
| "CLOSED", | ||
| ] | ||
| } | ||
|
|
||
| conditions { | ||
| display_name = "Over ${var.free_space_error_threshold}% of the memory cache disk has been used" | ||
|
|
||
| condition_threshold { | ||
| comparison = "COMPARISON_GT" | ||
| duration = "0s" | ||
| filter = <<EOT | ||
| resource.type = "filestore_instance" | ||
| AND metric.type = "file.googleapis.com/nfs/server/used_bytes_percent" | ||
| AND metric.labels.file_share = "${google_filestore_instance.slab-cache.file_shares[0].name}" | ||
| EOT | ||
| threshold_value = var.free_space_error_threshold | ||
|
|
||
| aggregations { | ||
| alignment_period = "300s" | ||
| group_by_fields = [] | ||
| per_series_aligner = "ALIGN_MAX" | ||
| } | ||
|
|
||
| trigger { | ||
| count = 1 | ||
| percent = 0 | ||
| } | ||
| } | ||
| } | ||
|
|
||
| documentation { | ||
| mime_type = "text/markdown" | ||
| subject = "Memory cache disk usage has gone over ${var.free_space_error_threshold}%" | ||
| content = "Your memory cache filestore instance disk usage has gone over ${var.free_space_error_threshold}%. " | ||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| output "nfs_ip_addresses" { | ||
| value = google_filestore_instance.slab-cache.networks[0].ip_addresses | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| variable "name" { | ||
| description = "The name of the Nomad cluster (e.g. nomad-stage). This variable is used to namespace all resources created by this module." | ||
| type = string | ||
| } | ||
|
|
||
| variable "network_name" { | ||
| description = "The name of the VPC Network where all resources should be created." | ||
| type = string | ||
| } | ||
|
|
||
| variable "tier" { | ||
| type = string | ||
| } | ||
|
|
||
| variable "capacity_gb" { | ||
| type = number | ||
| } | ||
|
|
||
| variable "notification_display_name" { | ||
| type = string | ||
| } | ||
|
|
||
| variable "free_space_warning_threshold" { | ||
| type = number | ||
| } | ||
|
|
||
| variable "free_space_error_threshold" { | ||
| type = number | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.