-
Notifications
You must be signed in to change notification settings - Fork 891
chore: deploy workspace proxies on fly.io #10983
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
Changes from all commits
da4b9bc
7447ad0
54e0fd0
3a481df
5e35de4
6dfc2e7
af7790f
f86f238
0057b72
ba051e2
ded32a3
ce8346a
d8d6d2b
52bf9e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
app = "paris-coder" | ||
primary_region = "cdg" | ||
|
||
[experimental] | ||
entrypoint = ["/opt/coder", "wsproxy", "server"] | ||
auto_rollback = true | ||
|
||
[build] | ||
image = "ghcr.io/coder/coder-preview:main" | ||
|
||
[env] | ||
CODER_ACCESS_URL = "https://paris-coder.fly.dev" | ||
CODER_HTTP_ADDRESS = "0.0.0.0:3000" | ||
CODER_PRIMARY_ACCESS_URL = "https://dev.coder.com" | ||
|
||
[http_service] | ||
internal_port = 3000 | ||
force_https = true | ||
auto_stop_machines = true | ||
auto_start_machines = true | ||
min_machines_running = 0 | ||
|
||
[[vm]] | ||
cpu_kind = "shared" | ||
cpus = 1 | ||
memory_mb = 512 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
app = "sao-paulo-coder" | ||
primary_region = "gru" | ||
|
||
[experimental] | ||
entrypoint = ["/opt/coder", "wsproxy", "server"] | ||
auto_rollback = true | ||
|
||
[build] | ||
image = "ghcr.io/coder/coder-preview:main" | ||
|
||
[env] | ||
CODER_ACCESS_URL = "https://sao-paulo-coder.fly.dev" | ||
CODER_HTTP_ADDRESS = "0.0.0.0:3000" | ||
CODER_PRIMARY_ACCESS_URL = "https://dev.coder.com" | ||
|
||
[http_service] | ||
internal_port = 3000 | ||
force_https = true | ||
auto_stop_machines = true | ||
auto_start_machines = true | ||
min_machines_running = 0 | ||
|
||
[[vm]] | ||
cpu_kind = "shared" | ||
cpus = 1 | ||
memory_mb = 512 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
app = "sydney-coder" | ||
primary_region = "syd" | ||
|
||
[experimental] | ||
entrypoint = ["/opt/coder", "wsproxy", "server"] | ||
auto_rollback = true | ||
|
||
[build] | ||
image = "ghcr.io/coder/coder-preview:main" | ||
|
||
[env] | ||
CODER_ACCESS_URL = "https://sydney-coder.fly.dev" | ||
CODER_HTTP_ADDRESS = "0.0.0.0:3000" | ||
CODER_PRIMARY_ACCESS_URL = "https://dev.coder.com" | ||
|
||
[http_service] | ||
internal_port = 3000 | ||
force_https = true | ||
auto_stop_machines = true | ||
auto_start_machines = true | ||
min_machines_running = 0 | ||
|
||
[[vm]] | ||
cpu_kind = "shared" | ||
cpus = 1 | ||
memory_mb = 512 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -639,6 +639,8 @@ jobs: | |
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} | ||
env: | ||
DOCKER_CLI_EXPERIMENTAL: "enabled" | ||
outputs: | ||
IMAGE: ghcr.io/coder/coder-preview:${{ steps.build-docker.outputs.tag }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -677,6 +679,7 @@ jobs: | |
build/coder_"$version"_linux_amd64.{tar.gz,deb} | ||
|
||
- name: Build and Push Linux amd64 Docker Image | ||
id: build-docker | ||
run: | | ||
set -euxo pipefail | ||
version="$(./scripts/version.sh)" | ||
|
@@ -694,6 +697,9 @@ jobs: | |
docker tag "ghcr.io/coder/coder-preview:$tag" ghcr.io/coder/coder-preview:main | ||
docker push ghcr.io/coder/coder-preview:main | ||
|
||
# Store the tag in an output variable so we can use it in other jobs | ||
echo "tag=$tag" >> $GITHUB_OUTPUT | ||
|
||
- name: Prune old images | ||
uses: vlaurin/action-ghcr-prune@v0.5.0 | ||
with: | ||
|
@@ -774,6 +780,31 @@ jobs: | |
kubectl --namespace coder rollout restart deployment/coder | ||
kubectl --namespace coder rollout status deployment/coder | ||
|
||
deploy-wsproxies: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup flyctl | ||
uses: superfly/flyctl-actions/setup-flyctl@master | ||
|
||
- name: Deploy workspace proxies | ||
run: | | ||
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 | ||
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 }} | ||
Comment on lines
+804
to
+806
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fly.io doesn't have a way of adding secrets in their dashboard? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They do have but I prefer we store all secrets in GitHub Actions. I can move if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fly.io has no environment section on the dashboard, so they do not appear anywhere. |
||
|
||
deploy-legacy-proxies: | ||
name: "deploy-legacy-proxies" | ||
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-16vcpu-ubuntu-2204' || 'ubuntu-latest' }} | ||
|
Uh oh!
There was an error while loading. Please reload this page.