Skip to content

Commit 0057b72

Browse files
committed
add configs for fly proxies
1 parent f86f238 commit 0057b72

File tree

4 files changed

+99
-6
lines changed

4 files changed

+99
-6
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
app = "paris-coder"
2+
primary_region = "cdg"
3+
4+
[experimental]
5+
entrypoint = ["/opt/coder", "wsproxy", "server"]
6+
auto_rollback = true
7+
8+
[build]
9+
image = "ghcr.io/coder/coder-preview:main"
10+
11+
[env]
12+
CODER_ACCESS_URL = "https://paris-coder.fly.dev"
13+
CODER_HTTP_ADDRESS = "0.0.0.0:3000"
14+
CODER_PRIMARY_ACCESS_URL = "https://dev.coder.com"
15+
CODER_TELEMETRY_INSTALL_SOURCE = "fly.io"
16+
PRIMARY_REGION = "cdg"
17+
18+
[http_service]
19+
internal_port = 3000
20+
force_https = true
21+
auto_stop_machines = true
22+
auto_start_machines = true
23+
min_machines_running = 0
24+
25+
[[vm]]
26+
cpu_kind = "shared"
27+
cpus = 1
28+
memory_mb = 512
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
app = "sao-paulo-coder"
2+
primary_region = "gru"
3+
4+
[experimental]
5+
entrypoint = ["/opt/coder", "wsproxy", "server"]
6+
auto_rollback = true
7+
8+
[build]
9+
image = "ghcr.io/coder/coder-preview:main"
10+
11+
[env]
12+
CODER_ACCESS_URL = "https://sao-paulo-coder.fly.dev"
13+
CODER_HTTP_ADDRESS = "0.0.0.0:3000"
14+
CODER_PRIMARY_ACCESS_URL = "https://dev.coder.com"
15+
CODER_TELEMETRY_INSTALL_SOURCE = "fly.io"
16+
PRIMARY_REGION = "gru"
17+
18+
[http_service]
19+
internal_port = 3000
20+
force_https = true
21+
auto_stop_machines = true
22+
auto_start_machines = true
23+
min_machines_running = 0
24+
25+
[[vm]]
26+
cpu_kind = "shared"
27+
cpus = 1
28+
memory_mb = 512
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
app = "sydney-coder"
2+
primary_region = "syd"
3+
4+
[experimental]
5+
entrypoint = ["/opt/coder", "wsproxy", "server"]
6+
auto_rollback = true
7+
8+
[build]
9+
image = "ghcr.io/coder/coder-preview:main"
10+
11+
[env]
12+
CODER_ACCESS_URL = "https://sydney-coder.fly.dev"
13+
CODER_HTTP_ADDRESS = "0.0.0.0:3000"
14+
CODER_PRIMARY_ACCESS_URL = "https://dev.coder.com"
15+
CODER_TELEMETRY_INSTALL_SOURCE = "fly.io"
16+
PRIMARY_REGION = "syd"
17+
18+
[http_service]
19+
internal_port = 3000
20+
force_https = true
21+
auto_stop_machines = true
22+
auto_start_machines = true
23+
min_machines_running = 0
24+
25+
[[vm]]
26+
cpu_kind = "shared"
27+
cpus = 1
28+
memory_mb = 512

.github/workflows/ci.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ jobs:
633633
# to main branch. We are only building this for amd64 platform. (>95% pulls
634634
# are for amd64)
635635
needs: changes
636-
if: github.ref == 'refs/heads/main' && needs.changes.outputs.docs-only == 'false'
636+
# if: github.ref == 'refs/heads/main' && needs.changes.outputs.docs-only == 'false'
637637
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
638638
env:
639639
DOCKER_CLI_EXPERIMENTAL: "enabled"
@@ -688,6 +688,9 @@ jobs:
688688
docker tag "ghcr.io/coder/coder-preview:$tag" ghcr.io/coder/coder-preview:main
689689
docker push ghcr.io/coder/coder-preview:main
690690
691+
# Store the tag in an output variable so we can use it in other jobs
692+
echo "tag=$tag" >> $GITHUB_OUTPUT
693+
691694
- name: Prune old images
692695
uses: vlaurin/action-ghcr-prune@v0.5.0
693696
with:
@@ -767,11 +770,11 @@ jobs:
767770
set -euxo pipefail
768771
kubectl --namespace coder rollout restart deployment/coder
769772
kubectl --namespace coder rollout status deployment/coder
770-
773+
771774
deploy-wsproxies:
772775
runs-on: ubuntu-latest
773776
needs: build
774-
if: !github.event.pull_request.head.repo.fork
777+
# if: github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork
775778
steps:
776779
- name: Checkout
777780
uses: actions/checkout@v4
@@ -783,11 +786,17 @@ jobs:
783786

784787
- name: Deploy workspace proxies
785788
run: |
786-
flyctl deploy --image ghcr.io/coder/coder-preview:main --app paris-coder -y
787-
flyctl deploy --image ghcr.io/coder/coder-preview:main --app sydney-coder -y
788-
flyctl deploy --image ghcr.io/coder/coder-preview:main --app sao-paulo-coder -y
789+
flyctl deploy --image $IMAGE --app paris-coder --config ./.github/fly-wsproxies/paris-coder.toml --env CODER_PROXY_SESSION_TOKEN=$TOKEN_PARIS --yes
790+
flyctl deploy --image $IMAGE --app sydney-coder --config ./.github/fly-wsproxies/sydney-coder.toml --env CODER_PROXY_SESSION_TOKEN=$TOKEN_SYDNEY --yes
791+
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
789792
env:
790793
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
794+
IMAGE: "ghcr.io/coder/coder-preview:${{ needs.build.outputs.tag }}"
795+
TOKEN_PARIS: ${{ secrets.FLY_PARIS_CODER_PROXY_SESSION_TOKEN }}
796+
TOKEN_SYDNEY: ${{ secrets.FLY_SYDNEY_CODER_PROXY_SESSION_TOKEN }}
797+
TOKEN_SAO_PAULO: ${{ secrets.FLY_SAO_PAULO_CODER_PROXY_SESSION_TOKEN }}
798+
799+
791800

792801
# TODO: when we remove this, instead of removing it we need to change it so it
793802
# still upgrades workspace proxies which are not deployed on K8s

0 commit comments

Comments
 (0)