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 all commits
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
7 changes: 5 additions & 2 deletions docs/ides/web-ides.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ resource "coder_agent" "main" {
#!/bin/sh
# install code-server
# add '-s -- --version x.x.x' to install a specific code-server version
curl -fsSL https://code-server.dev/install.sh | sh
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server

# start code-server on a specific port
# authn is off since the user already authn-ed into the coder deployment
code-server --auth none --port 13337
# & is used to run the process in the background
/tmp/code-server/bin/code-server --auth none --port 13337 &
EOF
}
```
Expand All @@ -67,7 +68,9 @@ For advanced use, we recommend installing code-server in your VM snapshot or con
FROM codercom/enterprise-base:ubuntu

# install the latest version
USER root
RUN curl -fsSL https://code-server.dev/install.sh | sh
USER coder

# pre-install VS Code extensions
RUN code-server --install-extension eamodio.gitlens
Expand Down
15 changes: 9 additions & 6 deletions docs/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,15 @@ resource "coder_agent" "coder" {
startup_script = <<EOT
#!/bin/bash

# install code-server 4.8.3
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3

# The & prevents the startup_script from blocking so the
# next commands can run.
code-server --auth none --port &
# 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

# 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 @@ -66,8 +66,8 @@ resource "coder_agent" "dev" {
startup_script = <<-EOT
set -eux -o pipefail
# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
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
4 changes: 2 additions & 2 deletions examples/templates/aws-ecs-container/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ resource "coder_agent" "coder" {
set -e

# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
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
4 changes: 2 additions & 2 deletions examples/templates/aws-linux/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ resource "coder_agent" "main" {
set -e

# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
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
4 changes: 2 additions & 2 deletions examples/templates/docker-image-builds/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ resource "coder_agent" "main" {
set -e

# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
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
4 changes: 2 additions & 2 deletions examples/templates/docker/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ resource "coder_agent" "main" {
set -e

# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
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
4 changes: 2 additions & 2 deletions examples/templates/gcp-linux/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ resource "coder_agent" "main" {
set -e

# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
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
4 changes: 2 additions & 2 deletions examples/templates/gcp-vm-container/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ resource "coder_agent" "main" {
set -e

# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
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
6 changes: 4 additions & 2 deletions examples/templates/kubernetes-with-podman/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ resource "coder_agent" "dev" {
dir = "/home/podman"
startup_script = <<EOF
#!/bin/sh
curl -fsSL https://code-server.dev/install.sh | sh
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
4 changes: 2 additions & 2 deletions examples/templates/kubernetes/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ resource "coder_agent" "main" {
set -e

# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh -s
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 &
EOT
}

Expand Down