Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions templates/kubernetes/homelab-workspace/configmap.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ resource "kubernetes_config_map_v1" "workspace_scripts" {

data = {
"script-agent-startup.sh" = file("${path.cwd}/scripts/script-agent-startup.sh")
"script-cache-gc.sh" = file("${path.cwd}/scripts/script-cache-gc.sh")
"script-container-entrypoint.sh" = file("${path.cwd}/scripts/script-container-entrypoint.sh")
"script-dotfiles.sh" = file("${path.cwd}/scripts/script-dotfiles.sh")
"script-memory-watchdog.sh" = file("${path.cwd}/scripts/script-memory-watchdog.sh")
Expand Down
18 changes: 18 additions & 0 deletions templates/kubernetes/homelab-workspace/scripts.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,24 @@ resource "coder_script" "vscode_server_gc" {
script = "/bin/bash /scripts/script-vscode-server-gc.sh"
}

# Hourly bounding of the tool caches under the home directory, a fixed-size
# volume (a PVC, or an existing claim such as a quota'd NFS share) whose
# filling fails every write in the pod. Go's build cache alone outgrows Go's
# own five-day trim at agent build rates. Hourly,
# because that is the rate those caches fill at; the script's lock makes an
# overrunning pass skip the next tick rather than race it. Template-owned and
# invoked with no existence check, for the reason vscode_server_gc above is.
# See script-cache-gc.sh for each cache's eviction rule and why it is safe
# while other sessions use the cache.
resource "coder_script" "cache_gc" {
agent_id = coder_agent.main.id
display_name = "Cache GC"
icon = "/icon/folder.svg"
# 6-field cron, seconds first: minute 17 of every hour.
cron = "0 17 * * * *"
script = "/bin/bash /scripts/script-cache-gc.sh"
}

resource "coder_script" "supervised_services" {
agent_id = coder_agent.main.id
display_name = "Supervised Services"
Expand Down
Loading
Loading