From 5254a6a487e3196818cc5139566fd0763018e2cc Mon Sep 17 00:00:00 2001 From: Nicholas Pease Date: Wed, 24 Jan 2024 04:04:24 +0000 Subject: [PATCH] Update to Current --- default/dockerfiles/c++/Dockerfile | 5 +- default/main.tf | 81 ++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 2 deletions(-) diff --git a/default/dockerfiles/c++/Dockerfile b/default/dockerfiles/c++/Dockerfile index 0c23488..257e4c4 100644 --- a/default/dockerfiles/c++/Dockerfile +++ b/default/dockerfiles/c++/Dockerfile @@ -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 diff --git a/default/main.tf b/default/main.tf index 60ac9ce..4395911 100644 --- a/default/main.tf +++ b/default/main.tf @@ -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 = <