-
Notifications
You must be signed in to change notification settings - Fork 894
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 1 commit
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
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
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" | ||
CODER_TELEMETRY_INSTALL_SOURCE = "fly.io" | ||
PRIMARY_REGION = "cdg" | ||
|
||
[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,28 @@ | ||
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" | ||
CODER_TELEMETRY_INSTALL_SOURCE = "fly.io" | ||
PRIMARY_REGION = "gru" | ||
|
||
[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,28 @@ | ||
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" | ||
CODER_TELEMETRY_INSTALL_SOURCE = "fly.io" | ||
PRIMARY_REGION = "syd" | ||
|
||
[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 |
---|---|---|
|
@@ -633,7 +633,7 @@ jobs: | |
# to main branch. We are only building this for amd64 platform. (>95% pulls | ||
# are for amd64) | ||
needs: changes | ||
if: github.ref == 'refs/heads/main' && needs.changes.outputs.docs-only == 'false' | ||
# if: github.ref == 'refs/heads/main' && needs.changes.outputs.docs-only == 'false' | ||
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} | ||
env: | ||
DOCKER_CLI_EXPERIMENTAL: "enabled" | ||
|
@@ -688,6 +688,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: | ||
|
@@ -767,11 +770,11 @@ jobs: | |
set -euxo pipefail | ||
kubectl --namespace coder rollout restart deployment/coder | ||
kubectl --namespace coder rollout status deployment/coder | ||
|
||
deploy-wsproxies: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: !github.event.pull_request.head.repo.fork | ||
# if: github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -783,11 +786,17 @@ jobs: | |
|
||
- name: Deploy workspace proxies | ||
run: | | ||
flyctl deploy --image ghcr.io/coder/coder-preview:main --app paris-coder -y | ||
flyctl deploy --image ghcr.io/coder/coder-preview:main --app sydney-coder -y | ||
flyctl deploy --image ghcr.io/coder/coder-preview:main --app sao-paulo-coder -y | ||
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 | ||
matifali marked this conversation as resolved.
Show resolved
Hide resolved
|
||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | ||
IMAGE: "ghcr.io/coder/coder-preview:${{ needs.build.outputs.tag }}" | ||
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. |
||
|
||
|
||
|
||
# TODO: when we remove this, instead of removing it we need to change it so it | ||
# still upgrades workspace proxies which are not deployed on K8s | ||
|
Uh oh!
There was an error while loading. Please reload this page.