From 0fe7a1ebba20da019cd32775398182d6db964767 Mon Sep 17 00:00:00 2001 From: Peter Kurfer Date: Fri, 16 Jun 2023 06:37:57 +0000 Subject: [PATCH] refactor: remove SDKs to start agent faster --- hetzner-cloud/cloud-config.yaml.tftpl | 14 +------ hetzner-cloud/main.tf | 56 --------------------------- 2 files changed, 2 insertions(+), 68 deletions(-) diff --git a/hetzner-cloud/cloud-config.yaml.tftpl b/hetzner-cloud/cloud-config.yaml.tftpl index eed15fb..6815370 100644 --- a/hetzner-cloud/cloud-config.yaml.tftpl +++ b/hetzner-cloud/cloud-config.yaml.tftpl @@ -17,6 +17,7 @@ packages: - bat - fzf - dnf-plugins-core + - icu %{ if install_podman_setup ~} - podman - podman-docker @@ -24,13 +25,6 @@ packages: - skopeo - buildah %{ endif ~} -%{ if install_go_setup ~} - - golang -%{ endif ~} -%{ if install_dotnet_setup ~} - - dotnet-sdk-6.0 - - dotnet-sdk-7.0 -%{ endif ~} mounts: - [ "${volume_path}", @@ -82,11 +76,7 @@ write_files: runcmd: - chown -R ${username}:${username} /home/${username} - systemctl enable --now coder-agent -%{ if install_terraform_setup ~} - - dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo - - dnf -y install terraform -%{ endif ~} -%{ if install_dotnet_setup ~} +%{ if install_podman_setup ~} - loginctl enable-linger ${username} - mkdir -p /home/${username}/.config/systemd/user/sockets.target.wants - ln -sf /usr/lib/systemd/system/podman.socket /home/${username}/.config/systemd/user/sockets.target.wants/ diff --git a/hetzner-cloud/main.tf b/hetzner-cloud/main.tf index 2e06b03..b2a19bc 100644 --- a/hetzner-cloud/main.tf +++ b/hetzner-cloud/main.tf @@ -195,41 +195,6 @@ data "coder_parameter" "code_server" { } } -data "coder_parameter" "install_go" { - name = "install_go" - description = "Should Go SDK be installed?" - default = "true" - type = "string" - mutable = true - option { - name = "Install" - value = "true" - } - - option { - name = "Don't install" - value = "false" - } -} - -data "coder_parameter" "install_dotnet" { - name = "install_dotnet" - description = "Should .NET SDK be installed?" - default = "true" - type = "string" - mutable = true - - option { - name = "Install" - value = "true" - } - - option { - name = "Don't install" - value = "false" - } -} - data "coder_parameter" "install_podman" { name = "install_podman" description = "Should Podman be installed?" @@ -247,24 +212,6 @@ data "coder_parameter" "install_podman" { } } -data "coder_parameter" "install_terraform" { - name = "install_terraform" - description = "Should Terraform be installed?" - default = "true" - type = "string" - mutable = true - - option { - name = "Install" - value = "true" - } - - option { - name = "Don't install" - value = "false" - } -} - data "coder_workspace" "me" { } @@ -314,10 +261,7 @@ resource "hcloud_server" "root" { init_script = base64encode(coder_agent.dev.init_script) coder_agent_token = coder_agent.dev.token code_server_setup = data.coder_parameter.code_server.value - install_go_setup = data.coder_parameter.install_go.value - install_dotnet_setup = data.coder_parameter.install_dotnet.value install_podman_setup = data.coder_parameter.install_podman.value - install_terraform_setup = data.coder_parameter.install_terraform.value user_shell = data.coder_parameter.user_shell.value })