Update to Current

This commit is contained in:
2024-01-24 04:04:24 +00:00
parent 9e753f60df
commit 5254a6a487
2 changed files with 84 additions and 2 deletions
+3 -2
View File
@@ -8,8 +8,9 @@ RUN apt-get update \
vim \
nano \
wget \
build-essential \
gdb \
gcc \
cmake \
make \
&& rm -rf /var/lib/apt/lists/*
ARG USER=coder
+81
View File
@@ -51,6 +51,7 @@ data "coder_parameter" "git_repo" {
display_name= "Git Repo"
description = "Git Repo to Clone"
default = " "
icon = "/icon/github.svg"
}
data "coder_parameter" "language" {
@@ -62,44 +63,58 @@ data "coder_parameter" "language" {
option {
name = "No Language (Pure Image)"
value = "default"
icon = "/icon/terminal.svg"
}
option {
name = "C"
value = "c"
icon = "https://i.imgur.com/eVh9nSG.png"
}
option {
name = "C++"
value = "c++"
icon = "https://i.imgur.com/WCRrHje.png"
}
option {
name = "Java"
value = "java"
icon = "/icon/java.svg"
}
option {
name = "Node"
value = "node"
icon = "/icon/javascript.svg"
}
option {
name = "Python 3"
value = "python3"
icon = "/icon/python.svg"
}
option {
name = "Go"
value = "golang"
icon = "/icon/go.svg"
}
option {
name = "Web"
value = "web"
icon = "/icon/terminal.svg"
}
}
module "filebrowser" {
source = "registry.coder.com/modules/filebrowser/coder"
version = "1.0.0"
agent_id = coder_agent.main
}
resource "coder_agent" "main" {
arch = data.coder_provisioner.me.arch
os = "linux"
@@ -133,6 +148,72 @@ resource "coder_agent" "main" {
GIT_AUTHOR_EMAIL = "me@nicholaspease.com"
GIT_COMMITTER_EMAIL = "me@nicholaspease.com"
}
# The following metadata blocks are optional. They are used to display
# information about your workspace in the dashboard. You can remove them
# if you don't want to display any information.
# For basic resources, you can use the `coder stat` command.
# If you need more control, you can write your own script.
metadata {
display_name = "CPU Usage"
key = "0_cpu_usage"
script = "coder stat cpu"
interval = 10
timeout = 1
}
metadata {
display_name = "RAM Usage"
key = "1_ram_usage"
script = "coder stat mem"
interval = 10
timeout = 1
}
metadata {
display_name = "Home Disk"
key = "3_home_disk"
script = "coder stat disk --path $${HOME}"
interval = 60
timeout = 1
}
metadata {
display_name = "CPU Usage (Host)"
key = "4_cpu_usage_host"
script = "coder stat cpu --host"
interval = 10
timeout = 1
}
metadata {
display_name = "Memory Usage (Host)"
key = "5_mem_usage_host"
script = "coder stat mem --host"
interval = 10
timeout = 1
}
metadata {
display_name = "Load Average (Host)"
key = "6_load_host"
# get load avg scaled by number of cores
script = <<EOT
echo "`cat /proc/loadavg | awk '{ print $1 }'` `nproc`" | awk '{ printf "%0.2f", $1/$2 }'
EOT
interval = 60
timeout = 1
}
metadata {
display_name = "Swap Usage (Host)"
key = "7_swap_host"
script = <<EOT
free -b | awk '/^Swap/ { printf("%.1f/%.1f", $3/1024.0/1024.0/1024.0, $2/1024.0/1024.0/1024.0) }'
EOT
interval = 10
timeout = 1
}
}
resource "docker_volume" "home_volume" {