From 06a07febc7b3709e856880dc3699a70fbfa65d21 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Mon, 12 Feb 2024 13:43:00 +0000 Subject: [PATCH 1/3] chore(examples): remove deprecated startup_script_timeout --- .github/pr-deployments/template/main.tf | 7 +++---- dogfood/main.tf | 3 +-- examples/jfrog/docker/main.tf | 7 +++---- examples/parameters/main.tf | 7 +++---- examples/templates/aws-linux/main.tf | 11 +++++------ examples/templates/devcontainer-docker/main.tf | 9 ++++----- examples/templates/devcontainer-kubernetes/main.tf | 9 ++++----- examples/templates/docker/main.tf | 7 +++---- examples/templates/gcp-linux/main.tf | 9 ++++----- examples/templates/gcp-vm-container/main.tf | 10 ++++------ examples/templates/kubernetes/main.tf | 7 +++---- examples/templates/nomad-docker/main.tf | 7 +++---- scaletest/templates/scaletest-runner/main.tf | 1 - scaletest/terraform/k8s/coder.tf | 1 - 14 files changed, 40 insertions(+), 55 deletions(-) diff --git a/.github/pr-deployments/template/main.tf b/.github/pr-deployments/template/main.tf index f914089900729..978209a4e16d1 100644 --- a/.github/pr-deployments/template/main.tf +++ b/.github/pr-deployments/template/main.tf @@ -88,10 +88,9 @@ provider "kubernetes" { data "coder_workspace" "me" {} resource "coder_agent" "main" { - os = "linux" - arch = "amd64" - startup_script_timeout = 180 - startup_script = <<-EOT + os = "linux" + arch = "amd64" + startup_script = <<-EOT set -e # install and start code-server diff --git a/dogfood/main.tf b/dogfood/main.tf index 50d5655f5903d..e1cb21685c5b5 100644 --- a/dogfood/main.tf +++ b/dogfood/main.tf @@ -259,8 +259,7 @@ resource "coder_agent" "dev" { timeout = 5 } - startup_script_timeout = 60 - startup_script = <<-EOT + startup_script = <<-EOT set -eux -o pipefail # Allow synchronization between scripts. diff --git a/examples/jfrog/docker/main.tf b/examples/jfrog/docker/main.tf index 0d6b2e4dfe357..4bb807403657f 100644 --- a/examples/jfrog/docker/main.tf +++ b/examples/jfrog/docker/main.tf @@ -59,10 +59,9 @@ resource "artifactory_scoped_token" "me" { } resource "coder_agent" "main" { - arch = data.coder_provisioner.me.arch - os = "linux" - startup_script_timeout = 180 - startup_script = <<-EOT + arch = data.coder_provisioner.me.arch + os = "linux" + startup_script = <<-EOT set -e # install and start code-server diff --git a/examples/parameters/main.tf b/examples/parameters/main.tf index 10dc82f5759b6..407f09a208281 100644 --- a/examples/parameters/main.tf +++ b/examples/parameters/main.tf @@ -23,10 +23,9 @@ data "coder_workspace" "me" { } resource "coder_agent" "main" { - arch = data.coder_provisioner.me.arch - os = "linux" - startup_script_timeout = 180 - startup_script = <<-EOT + arch = data.coder_provisioner.me.arch + os = "linux" + startup_script = <<-EOT set -e # install and start code-server diff --git a/examples/templates/aws-linux/main.tf b/examples/templates/aws-linux/main.tf index 0f5bc5f0f5098..5815f27ed7340 100644 --- a/examples/templates/aws-linux/main.tf +++ b/examples/templates/aws-linux/main.tf @@ -157,12 +157,11 @@ data "aws_ami" "ubuntu" { } resource "coder_agent" "dev" { - count = data.coder_workspace.me.start_count - arch = "amd64" - auth = "aws-instance-identity" - os = "linux" - startup_script_timeout = 180 - startup_script = <<-EOT + count = data.coder_workspace.me.start_count + arch = "amd64" + auth = "aws-instance-identity" + os = "linux" + startup_script = <<-EOT set -e # install and start code-server diff --git a/examples/templates/devcontainer-docker/main.tf b/examples/templates/devcontainer-docker/main.tf index c8e78a1fc6f3c..6685b1879a18c 100644 --- a/examples/templates/devcontainer-docker/main.tf +++ b/examples/templates/devcontainer-docker/main.tf @@ -19,17 +19,16 @@ data "coder_workspace" "me" { } resource "coder_agent" "main" { - arch = data.coder_provisioner.me.arch - os = "linux" - startup_script_timeout = 180 - startup_script = <<-EOT + arch = data.coder_provisioner.me.arch + os = "linux" + startup_script = <<-EOT set -e # install and start code-server curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.11.0 /tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 & EOT - dir = "/worskpaces" + dir = "/worskpaces" # These environment variables allow you to make Git commits right away after creating a # workspace. Note that they take precedence over configuration defined in ~/.gitconfig! diff --git a/examples/templates/devcontainer-kubernetes/main.tf b/examples/templates/devcontainer-kubernetes/main.tf index 04044e6744cb0..f4a1c029336c8 100644 --- a/examples/templates/devcontainer-kubernetes/main.tf +++ b/examples/templates/devcontainer-kubernetes/main.tf @@ -44,17 +44,16 @@ data "coder_workspace" "me" { } resource "coder_agent" "main" { - arch = data.coder_provisioner.me.arch - os = "linux" - startup_script_timeout = 180 - startup_script = <<-EOT + arch = data.coder_provisioner.me.arch + os = "linux" + startup_script = <<-EOT set -e # install and start code-server curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.11.0 /tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 & EOT - dir = "/workspaces" + dir = "/workspaces" # These environment variables allow you to make Git commits right away after creating a # workspace. Note that they take precedence over configuration defined in ~/.gitconfig! diff --git a/examples/templates/docker/main.tf b/examples/templates/docker/main.tf index 96938695dbf82..baa0bbab66d3c 100644 --- a/examples/templates/docker/main.tf +++ b/examples/templates/docker/main.tf @@ -23,10 +23,9 @@ data "coder_workspace" "me" { } resource "coder_agent" "main" { - arch = data.coder_provisioner.me.arch - os = "linux" - startup_script_timeout = 180 - startup_script = <<-EOT + arch = data.coder_provisioner.me.arch + os = "linux" + startup_script = <<-EOT set -e # install and start code-server diff --git a/examples/templates/gcp-linux/main.tf b/examples/templates/gcp-linux/main.tf index 29c64393e5d2e..42e3cdcd3262d 100644 --- a/examples/templates/gcp-linux/main.tf +++ b/examples/templates/gcp-linux/main.tf @@ -73,11 +73,10 @@ resource "google_compute_disk" "root" { } resource "coder_agent" "main" { - auth = "google-instance-identity" - arch = "amd64" - os = "linux" - startup_script_timeout = 180 - startup_script = <<-EOT + auth = "google-instance-identity" + arch = "amd64" + os = "linux" + startup_script = <<-EOT set -e # install and start code-server diff --git a/examples/templates/gcp-vm-container/main.tf b/examples/templates/gcp-vm-container/main.tf index ba203e0270280..d712859d222d5 100644 --- a/examples/templates/gcp-vm-container/main.tf +++ b/examples/templates/gcp-vm-container/main.tf @@ -63,12 +63,10 @@ data "coder_workspace" "me" { } resource "coder_agent" "main" { - auth = "google-instance-identity" - arch = "amd64" - os = "linux" - - startup_script_timeout = 180 - startup_script = <<-EOT + auth = "google-instance-identity" + arch = "amd64" + os = "linux" + startup_script = <<-EOT set -e # install and start code-server diff --git a/examples/templates/kubernetes/main.tf b/examples/templates/kubernetes/main.tf index 9177b338f8109..6f08a3db25759 100644 --- a/examples/templates/kubernetes/main.tf +++ b/examples/templates/kubernetes/main.tf @@ -103,10 +103,9 @@ provider "kubernetes" { data "coder_workspace" "me" {} resource "coder_agent" "main" { - os = "linux" - arch = "amd64" - startup_script_timeout = 180 - startup_script = <<-EOT + os = "linux" + arch = "amd64" + startup_script = <<-EOT set -e # install and start code-server diff --git a/examples/templates/nomad-docker/main.tf b/examples/templates/nomad-docker/main.tf index 7ec684def2c5d..28fd675b91933 100644 --- a/examples/templates/nomad-docker/main.tf +++ b/examples/templates/nomad-docker/main.tf @@ -88,10 +88,9 @@ data "coder_parameter" "memory" { data "coder_workspace" "me" {} resource "coder_agent" "main" { - os = "linux" - arch = "amd64" - startup_script_timeout = 180 - startup_script = <<-EOT + os = "linux" + arch = "amd64" + startup_script = <<-EOT set -e # install and start code-server curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server diff --git a/scaletest/templates/scaletest-runner/main.tf b/scaletest/templates/scaletest-runner/main.tf index 2a6eb8ca21ed5..53ceabf839a5d 100644 --- a/scaletest/templates/scaletest-runner/main.tf +++ b/scaletest/templates/scaletest-runner/main.tf @@ -625,7 +625,6 @@ resource "coder_agent" "main" { vscode = false ssh_helper = false } - startup_script_timeout = 86400 shutdown_script_timeout = 7200 startup_script_behavior = "blocking" startup_script = file("startup.sh") diff --git a/scaletest/terraform/k8s/coder.tf b/scaletest/terraform/k8s/coder.tf index 401808c31308a..501d3b301c46c 100644 --- a/scaletest/terraform/k8s/coder.tf +++ b/scaletest/terraform/k8s/coder.tf @@ -304,7 +304,6 @@ resource "local_file" "kubernetes_template" { resource "coder_agent" "main" { os = "linux" arch = "amd64" - startup_script_timeout = 180 startup_script = "" } From 054265b8d70663910491dbc29c802c9e1feb8ddb Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Mon, 12 Feb 2024 13:58:13 +0000 Subject: [PATCH 2/3] Update scaletest/templates/scaletest-runner/main.tf Co-authored-by: Muhammad Atif Ali --- scaletest/templates/scaletest-runner/main.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/scaletest/templates/scaletest-runner/main.tf b/scaletest/templates/scaletest-runner/main.tf index 53ceabf839a5d..42fa785cc4732 100644 --- a/scaletest/templates/scaletest-runner/main.tf +++ b/scaletest/templates/scaletest-runner/main.tf @@ -625,7 +625,6 @@ resource "coder_agent" "main" { vscode = false ssh_helper = false } - shutdown_script_timeout = 7200 startup_script_behavior = "blocking" startup_script = file("startup.sh") shutdown_script = file("shutdown.sh") From a22a186c87e3f9c6b449fc3e487a66d062124f58 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Mon, 12 Feb 2024 14:15:48 +0000 Subject: [PATCH 3/3] Update scaletest/terraform/k8s/coder.tf Co-authored-by: Muhammad Atif Ali --- scaletest/terraform/k8s/coder.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/scaletest/terraform/k8s/coder.tf b/scaletest/terraform/k8s/coder.tf index 501d3b301c46c..7e8fcaa7128c4 100644 --- a/scaletest/terraform/k8s/coder.tf +++ b/scaletest/terraform/k8s/coder.tf @@ -304,7 +304,6 @@ resource "local_file" "kubernetes_template" { resource "coder_agent" "main" { os = "linux" arch = "amd64" - startup_script = "" } resource "kubernetes_pod" "main" {