Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: update template examples and docs to install code-server under /tmp #6138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! chore: update template examples and docs to install code-serve…
…r under /tmp
  • Loading branch information
johnstcn committed Feb 10, 2023
commit 049218e1a9023a04d2ba7d300364ff6a1e5a60c1
12 changes: 7 additions & 5 deletions docs/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,15 @@ resource "coder_agent" "coder" {
startup_script = <<EOT
#!/bin/bash

# install code-server 4.8.3 under /tmp/code-server
# Install code-server 4.8.3 under /tmp/code-server using the "standalone" installation
# that does not require root permissions. Note that /tmp may be mounted in tmpfs which
# can lead to increased RAM usage. To avoid this, you can pre-install code-server inside
# the Docker image or VM image.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.8.3
/tmp/code-server/bin/code-server --auth none --port 13337 &

# The & prevents the startup_script from blocking so the
# next commands can run.
code-server --auth none --port 13337 &
# The & prevents the startup_script from blocking so the next commands can run.
# The stdout and stderr of code-server is redirected to /tmp/code-server.log.
/tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &

# var.repo and var.dotfiles_uri is specified
# elsewhere in the Terraform code as input
Expand Down
4 changes: 2 additions & 2 deletions dogfood/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ resource "coder_agent" "dev" {
startup_script_timeout = 60
startup_script = <<-EOT
set -eux -o pipefail
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server
/tmp/code-server/bin/code-server --auth none --port 13337 &
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.8.3
/tmp/code-server/bin/code-server --auth none --port 13337 > /tmp/code-server.log 2>&1 &
sudo service docker start
DOTFILES_URI=${var.dotfiles_uri}
rm -f ~/.personalize.log
Expand Down
7 changes: 3 additions & 4 deletions examples/templates/aws-ecs-container/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,9 @@ resource "coder_agent" "coder" {
startup_script = <<-EOT
set -e

# Install and start code-server. We install under /tmp as we may not have permission to write outside /home/coder.
# The standalone method also requires no sudo or root permissions, as opposed to the autodetect method.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server
/tmp/code-server/bin/code-server --auth none --port 13337 &
# Install and start code-server.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.8.3
/tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
EOT
}

Expand Down
7 changes: 3 additions & 4 deletions examples/templates/aws-linux/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ resource "coder_agent" "main" {
startup_script = <<-EOT
set -e

# Install and start code-server. We install under /tmp as we may not have permission to write outside /home/coder.
# The standalone method also requires no sudo or root permissions, as opposed to the autodetect method.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server
/tmp/code-server/bin/code-server --auth none --port 13337 &
# Install and start code-server.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.8.3
/tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
EOT
}

Expand Down
7 changes: 3 additions & 4 deletions examples/templates/docker-image-builds/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ resource "coder_agent" "main" {
startup_script = <<-EOT
set -e

# Install and start code-server. We install under /tmp as we may not have permission to write outside /home/coder.
# The standalone method also requires no sudo or root permissions, as opposed to the autodetect method.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server
/tmp/code-server/bin/code-server --auth none --port 13337 &
# Install and start code-server.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.8.3
/tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
EOT
}

Expand Down
7 changes: 3 additions & 4 deletions examples/templates/docker/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ resource "coder_agent" "main" {
startup_script = <<-EOT
set -e

# Install and start code-server. We install under /tmp as we may not have permission to write outside /home/coder.
# The standalone method also requires no sudo or root permissions, as opposed to the autodetect method.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server
/tmp/code-server/bin/code-server --auth none --port 13337 &
# Install and start code-server.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.8.3
/tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
EOT

# These environment variables allow you to make Git commits right away after creating a
Expand Down
7 changes: 3 additions & 4 deletions examples/templates/gcp-linux/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ resource "coder_agent" "main" {
startup_script = <<-EOT
set -e

# Install and start code-server. We install under /tmp as we may not have permission to write outside /home/coder.
# The standalone method also requires no sudo or root permissions, as opposed to the autodetect method.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server
/tmp/code-server/bin/code-server --auth none --port 13337 &
# Install and start code-server.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.8.3
/tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
EOT
}

Expand Down
7 changes: 3 additions & 4 deletions examples/templates/gcp-vm-container/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ resource "coder_agent" "main" {
startup_script = <<-EOT
set -e

# Install and start code-server. We install under /tmp as we may not have permission to write outside /home/coder.
# The standalone method also requires no sudo or root permissions, as opposed to the autodetect method.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server
/tmp/code-server/bin/code-server --auth none --port 13337 &
# Install and start code-server.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.8.3
/tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
EOT
}

Expand Down
8 changes: 4 additions & 4 deletions examples/templates/kubernetes-with-podman/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ resource "coder_agent" "dev" {
dir = "/home/podman"
startup_script = <<EOF
#!/bin/sh
# Install and start code-server. We install under /tmp as we may not have permission to write outside /home/coder.
# The standalone method also requires no sudo or root permissions, as opposed to the autodetect method.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server
/tmp/code-server/bin/code-server --auth none --port 13337 &

# Install and start code-server.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.8.3
/tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &

# Run once to avoid unnecessary warning: "/" is not a shared mount
podman ps
Expand Down
7 changes: 3 additions & 4 deletions examples/templates/kubernetes/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ resource "coder_agent" "main" {
startup_script = <<-EOT
set -e

# Install and start code-server. We install under /tmp as we may not have permission to write outside /home/coder.
# The standalone method also requires no sudo or root permissions, as opposed to the autodetect method.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server
/tmp/code-server/bin/code-server --auth none --port 13337 &
# Install and start code-server.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.8.3
/tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
EOT
}

Expand Down