From f781e50203fc94c6a79a7630753b605ce5169a72 Mon Sep 17 00:00:00 2001 From: Eric Paulsen Date: Mon, 29 Aug 2022 14:40:52 -0500 Subject: [PATCH 1/6] add: code-server to template examples --- examples/templates/aws-linux/README.md | 6 ++++++ examples/templates/aws-linux/main.tf | 14 ++++++++++++++ examples/templates/docker-image-builds/README.md | 6 ++++++ examples/templates/docker-image-builds/main.tf | 14 ++++++++++++++ examples/templates/docker/README.md | 6 ++++++ 5 files changed, 46 insertions(+) diff --git a/examples/templates/aws-linux/README.md b/examples/templates/aws-linux/README.md index eb65f01cd85d8..681224cc3269b 100644 --- a/examples/templates/aws-linux/README.md +++ b/examples/templates/aws-linux/README.md @@ -68,3 +68,9 @@ instances provisioned by Coder: ] } ``` + +## code-server + +`code-server` is installed via the `startup_script` argument in the `coder_agent` +resource block. The `coder_app` resource is defined to access `code-server` through +the dashboard UI over `localhost:13337`. diff --git a/examples/templates/aws-linux/main.tf b/examples/templates/aws-linux/main.tf index fcd9b88d7b1f4..a13b5fac877f9 100644 --- a/examples/templates/aws-linux/main.tf +++ b/examples/templates/aws-linux/main.tf @@ -76,6 +76,20 @@ resource "coder_agent" "main" { arch = "amd64" auth = "aws-instance-identity" os = "linux" + startup_script = < Date: Mon, 29 Aug 2022 18:58:46 -0500 Subject: [PATCH 2/6] add: code-server to gcp templates --- examples/templates/gcp-linux/main.tf | 16 ++++++++++++++++ examples/templates/gcp-vm-container/main.tf | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/examples/templates/gcp-linux/main.tf b/examples/templates/gcp-linux/main.tf index 465441c43d2c4..270beef6dc995 100644 --- a/examples/templates/gcp-linux/main.tf +++ b/examples/templates/gcp-linux/main.tf @@ -49,6 +49,22 @@ resource "coder_agent" "main" { auth = "google-instance-identity" arch = "amd64" os = "linux" + startup_script = < Date: Mon, 29 Aug 2022 21:17:48 -0500 Subject: [PATCH 3/6] add: code-server to gcp-linux template --- examples/templates/gcp-linux/main.tf | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/examples/templates/gcp-linux/main.tf b/examples/templates/gcp-linux/main.tf index c177d673ffb10..270beef6dc995 100644 --- a/examples/templates/gcp-linux/main.tf +++ b/examples/templates/gcp-linux/main.tf @@ -6,7 +6,7 @@ terraform { } google = { source = "hashicorp/google" - version = "~> 4.34.0" + version = "~> 4.15" } } } @@ -39,16 +39,32 @@ resource "google_compute_disk" "root" { name = "coder-${lower(data.coder_workspace.me.owner)}-${lower(data.coder_workspace.me.name)}-root" type = "pd-ssd" zone = var.zone - image = "debian-cloud/debian-11" + image = "debian-cloud/debian-10" lifecycle { ignore_changes = [image] } } resource "coder_agent" "main" { - auth = "google-instance-identity" - arch = "amd64" - os = "linux" + auth = "google-instance-identity" + arch = "amd64" + os = "linux" + startup_script = < Date: Mon, 29 Aug 2022 21:21:01 -0500 Subject: [PATCH 4/6] update: READMEs --- examples/templates/gcp-linux/README.md | 6 ++++++ examples/templates/gcp-vm-container/README.md | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/examples/templates/gcp-linux/README.md b/examples/templates/gcp-linux/README.md index c69d7848cc94d..3df0571605eb4 100644 --- a/examples/templates/gcp-linux/README.md +++ b/examples/templates/gcp-linux/README.md @@ -43,3 +43,9 @@ a service account: 1. Generate a **JSON private key**, which will be what you provide to Coder during the setup process. + +## code-server + +`code-server` is installed via the `startup_script` argument in the `coder_agent` +resource block. The `coder_app` resource is defined to access `code-server` through +the dashboard UI over `localhost:13337`. diff --git a/examples/templates/gcp-vm-container/README.md b/examples/templates/gcp-vm-container/README.md index 157c4a5ff9fe1..72c5d20fc9b7f 100644 --- a/examples/templates/gcp-vm-container/README.md +++ b/examples/templates/gcp-vm-container/README.md @@ -43,3 +43,9 @@ a service account: 1. Generate a **JSON private key**, which will be what you provide to Coder during the setup process. + +## code-server + +`code-server` is installed via the `startup_script` argument in the `coder_agent` +resource block. The `coder_app` resource is defined to access `code-server` through +the dashboard UI over `localhost:13337`. From 2d9f24af0ea6e9d91b4ca64e11eaaa822545f9d7 Mon Sep 17 00:00:00 2001 From: Eric Paulsen Date: Mon, 29 Aug 2022 21:23:14 -0500 Subject: [PATCH 5/6] update: boot disk version --- examples/templates/gcp-linux/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/templates/gcp-linux/main.tf b/examples/templates/gcp-linux/main.tf index 270beef6dc995..518ae5f435f34 100644 --- a/examples/templates/gcp-linux/main.tf +++ b/examples/templates/gcp-linux/main.tf @@ -39,7 +39,7 @@ resource "google_compute_disk" "root" { name = "coder-${lower(data.coder_workspace.me.owner)}-${lower(data.coder_workspace.me.name)}-root" type = "pd-ssd" zone = var.zone - image = "debian-cloud/debian-10" + image = "debian-cloud/debian-11" lifecycle { ignore_changes = [image] } From 0044f2fc0f6919fa9cbf9a98ed00f477ab32c787 Mon Sep 17 00:00:00 2001 From: Eric Paulsen Date: Mon, 29 Aug 2022 21:28:31 -0500 Subject: [PATCH 6/6] update: google provider version --- examples/templates/gcp-linux/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/templates/gcp-linux/main.tf b/examples/templates/gcp-linux/main.tf index 518ae5f435f34..f663a31004646 100644 --- a/examples/templates/gcp-linux/main.tf +++ b/examples/templates/gcp-linux/main.tf @@ -6,7 +6,7 @@ terraform { } google = { source = "hashicorp/google" - version = "~> 4.15" + version = "~> 4.34.0" } } }