From 3e6e1e6f1014435578411a86b7dd514ec2db16b4 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Wed, 6 Mar 2024 18:54:26 +0000 Subject: [PATCH] ci: add jnb wsproxy + update dogfood template (#12440) Co-authored-by: Dean Sheather --- .github/fly-wsproxies/jnb-coder.toml | 34 ++++++++++++++++++++++++++++ .github/workflows/ci.yaml | 2 ++ dogfood/main.tf | 6 +++++ 3 files changed, 42 insertions(+) create mode 100644 .github/fly-wsproxies/jnb-coder.toml diff --git a/.github/fly-wsproxies/jnb-coder.toml b/.github/fly-wsproxies/jnb-coder.toml new file mode 100644 index 0000000000..665cf5ce2a --- /dev/null +++ b/.github/fly-wsproxies/jnb-coder.toml @@ -0,0 +1,34 @@ +app = "jnb-coder" +primary_region = "jnb" + +[experimental] + entrypoint = ["/bin/sh", "-c", "CODER_DERP_SERVER_RELAY_URL=\"http://[${FLY_PRIVATE_IP}]:3000\" /opt/coder wsproxy server"] + auto_rollback = true + +[build] + image = "ghcr.io/coder/coder-preview:main" + +[env] + CODER_ACCESS_URL = "https://jnb.fly.dev.coder.com" + CODER_HTTP_ADDRESS = "0.0.0.0:3000" + CODER_PRIMARY_ACCESS_URL = "https://dev.coder.com" + CODER_WILDCARD_ACCESS_URL = "*--apps.jnb.fly.dev.coder.com" + CODER_VERBOSE = "true" + +[http_service] + internal_port = 3000 + force_https = true + auto_stop_machines = true + auto_start_machines = true + min_machines_running = 0 + +# Ref: https://fly.io/docs/reference/configuration/#http_service-concurrency +[http_service.concurrency] + type = "requests" + soft_limit = 50 + hard_limit = 100 + +[[vm]] + cpu_kind = "shared" + cpus = 2 + memory_mb = 512 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3bb893571a..d189587b79 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -856,12 +856,14 @@ jobs: flyctl deploy --image "$IMAGE" --app paris-coder --config ./.github/fly-wsproxies/paris-coder.toml --env "CODER_PROXY_SESSION_TOKEN=$TOKEN_PARIS" --yes flyctl deploy --image "$IMAGE" --app sydney-coder --config ./.github/fly-wsproxies/sydney-coder.toml --env "CODER_PROXY_SESSION_TOKEN=$TOKEN_SYDNEY" --yes flyctl deploy --image "$IMAGE" --app sao-paulo-coder --config ./.github/fly-wsproxies/sao-paulo-coder.toml --env "CODER_PROXY_SESSION_TOKEN=$TOKEN_SAO_PAULO" --yes + flyctl deploy --image "$IMAGE" --app jnb-coder --config ./.github/fly-wsproxies/jnb-coder.toml --env "CODER_PROXY_SESSION_TOKEN=$TOKEN_JNB" --yes env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} IMAGE: ${{ needs.build.outputs.IMAGE }} TOKEN_PARIS: ${{ secrets.FLY_PARIS_CODER_PROXY_SESSION_TOKEN }} TOKEN_SYDNEY: ${{ secrets.FLY_SYDNEY_CODER_PROXY_SESSION_TOKEN }} TOKEN_SAO_PAULO: ${{ secrets.FLY_SAO_PAULO_CODER_PROXY_SESSION_TOKEN }} + TOKEN_JNB: ${{ secrets.FLY_JNB_CODER_PROXY_SESSION_TOKEN }} # sqlc-vet runs a postgres docker container, runs Coder migrations, and then # runs sqlc-vet to ensure all queries are valid. This catches any mistakes diff --git a/dogfood/main.tf b/dogfood/main.tf index 9d49ff3e03..426e433044 100644 --- a/dogfood/main.tf +++ b/dogfood/main.tf @@ -19,6 +19,7 @@ locals { "eu-helsinki" = "tcp://reinhard-hel-cdr-dev.tailscale.svc.cluster.local:2375" "ap-sydney" = "tcp://hildegard-sydney-cdr-dev.tailscale.svc.cluster.local:2375" "sa-saopaulo" = "tcp://oberstein-sao-cdr-dev.tailscale.svc.cluster.local:2375" + "za-jnb" = "tcp://siegfried-jnb-cdr-dev.tailscale.svc.cluster.local:2375" } repo_base_dir = data.coder_parameter.repo_base_dir.value == "~" ? "/home/coder" : replace(data.coder_parameter.repo_base_dir.value, "/^~\\//", "/home/coder/") @@ -76,6 +77,11 @@ data "coder_parameter" "region" { name = "São Paulo" value = "sa-saopaulo" } + option { + icon = "/emojis/1f1ff-1f1e6.png" + name = "Johannesburg" + value = "za-jnb" + } } provider "docker" {