Skip to content
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

Deployer: actually support Bun #4042

Merged
merged 41 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
da80051
Bump the tracing group with 5 updates (#3997)
dependabot[bot] Oct 15, 2024
4c8b94f
ci: fix pre-commit/action (#3999)
kzys Oct 15, 2024
91759e7
Bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.65.2 to 1.65.3 in…
dependabot[bot] Oct 15, 2024
eebf4b8
Restore automatically pushing new releases to Docker Hub (#4004)
clouvet Oct 15, 2024
e66b2e3
Return the original deploy error when it also fails to fetch logs (#4…
dangra Oct 15, 2024
fddc9f0
Jphenow/allow forcibly preventing extensions at launch for automation…
jphenow Oct 15, 2024
310a369
Bump github.com/getsentry/sentry-go from 0.29.0 to 0.29.1 (#4003)
dependabot[bot] Oct 15, 2024
5d47ced
Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp fr…
dependabot[bot] Oct 15, 2024
99f38a7
Remove Docker Hub image templates (#4005)
clouvet Oct 16, 2024
ea488ce
Add permissions for pushing Docker images to GitHub (#4006)
clouvet Oct 16, 2024
ee2134f
Bump github.com/prometheus/client_golang from 1.20.4 to 1.20.5 (#4007)
dependabot[bot] Oct 16, 2024
e3b617f
Bump github.com/vektah/gqlparser/v2 from 2.5.17 to 2.5.18 (#4009)
dependabot[bot] Oct 17, 2024
6431898
Bump the aws-sdk group with 2 updates (#4008)
dependabot[bot] Oct 17, 2024
83a4995
Bump github.com/depot/depot-go from 0.3.0 to 0.5.0 (#4011)
dependabot[bot] Oct 18, 2024
a3397d8
Add 'Revoked At' column to `fly tokens list` output (#4012)
asib Oct 18, 2024
4164287
Change `tokens revoke` help message to indicate that tokens to be rev…
asib Oct 18, 2024
afca912
Support https metrics endpoints (#4016)
jsierles Oct 21, 2024
4bed6b6
Fix tests for metrics (#4017)
jsierles Oct 21, 2024
01e3616
Upgrade golangci-lint (#4014)
kzys Oct 21, 2024
a6df2bb
Fix `fly launch` failing in pnpm workspace while adding `@flydotio/do…
pmrotule Oct 21, 2024
8fb314c
ci: make preflight tests available in any regions (#4013)
kzys Oct 21, 2024
983d6a9
Bump github.com/launchdarkly/go-sdk-common/v3 from 3.1.0 to 3.2.0 (#4…
dependabot[bot] Oct 22, 2024
02119df
fix: shell completion use exec's actual name (#4015)
zuisong Oct 22, 2024
995c9f2
Use existing secrets for Docker Hub auth (#4024)
clouvet Oct 22, 2024
927697c
Disable docs sync (#4026)
jsierles Oct 22, 2024
7b8546a
Run `release` and `sync_docs` jobs on master branch only (#4027)
clouvet Oct 23, 2024
4b163e8
Disable flyctl docs update until we figure what is going on (#4028)
dangra Oct 23, 2024
d123a9c
Reenable flyctl docs and fix naming bug (#4029)
dangra Oct 23, 2024
68106da
Add `--yes` flag to egress-ip commands (#4033)
gargakshit Oct 24, 2024
ab17517
Bump github.com/pkg/sftp from 1.13.6 to 1.13.7 (#4032)
dependabot[bot] Oct 24, 2024
7467ca0
Change the token used to create PR tag versions (#4030)
clouvet Oct 25, 2024
b9b83dd
resolve compute for group for "console" (#4035)
rubys Oct 26, 2024
963baa6
Debug phantom workflow events (#4038)
clouvet Oct 28, 2024
b24cb7e
Bump github.com/containerd/continuity from 0.4.3 to 0.4.4 (#4037)
dependabot[bot] Oct 28, 2024
c0f365e
Bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.66.0 to 1.66.1 in…
dependabot[bot] Oct 28, 2024
e2b1fca
Restore preflight cleanup workflow schedule (#4039)
clouvet Oct 28, 2024
7eb10f8
ci: upgrade setup-python (#4040)
kzys Oct 28, 2024
87d6db8
Bump the aws-sdk group with 3 updates (#4041)
dependabot[bot] Oct 29, 2024
f424f6a
catch SIGINT and print a thing
jeromegn Oct 28, 2024
2aa9a78
merged master
jeromegn Oct 29, 2024
ef0a862
fix bun by pre-installing it and adding a test for it:
jeromegn Oct 29, 2024
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
2 changes: 2 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ permissions:

jobs:
release:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Checkout master branch
Expand All @@ -26,6 +27,7 @@ jobs:
DEFAULT_BUMP: "patch"

sync_docs:
if: github.ref == 'refs/heads/master'
needs: release
runs-on: ubuntu-latest
steps:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Install Go since pre-commit below runs "go mod tidy".
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
check-latest: true
# pre-commit runs "pip install" which doesn't work under Debian's apt-instaled Python.
# https://packaging.python.org/en/latest/specifications/externally-managed-environments/#externally-managed-environments
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- uses: pre-commit/[email protected]
with:
extra_args: --all-files --hook-stage=manual
Expand All @@ -40,5 +46,5 @@ jobs:
# check-latest: true
- uses: golangci/golangci-lint-action@v6
with:
version: v1.54
version: v1.61.0
working-directory: .
5 changes: 2 additions & 3 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ concurrency:

jobs:
test:
uses:
./.github/workflows/test.yml
uses: ./.github/workflows/test.yml

# create a dev tag for every branch except master
tag_version:
Expand Down Expand Up @@ -68,7 +67,7 @@ jobs:
sha: context.sha
});

github-token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
github-token: ${{ secrets.FLYIO_BUILDBOT_GITHUB_TOKEN }}

# # we can remove this workflow_call once the release.yml workflow file is
# # merged into the default branch
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/preflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Preflight Tests
on:
workflow_dispatch:
inputs:
reason:
description: Brief reason for running this workflow manually
region:
description: Region
required: false
default: User initiated run
default: ord
type: string
workflow_call:

Expand All @@ -17,7 +17,6 @@ jobs:
strategy:
fail-fast: false
matrix:
vm_size: [""]
parallelism: [20]
index: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]
steps:
Expand All @@ -33,26 +32,27 @@ jobs:
run: |
curl -sfL https://raw.githubusercontent.com/Songmu/gotesplit/v0.2.1/install.sh | sh -s
echo "FLY_PREFLIGHT_TEST_APP_PREFIX=pf-gha-$(openssl rand -hex 4)" >> "$GITHUB_ENV"
# If this workflow is triggered by code changes (eg PRs), download the binary to save time.
- uses: actions/download-artifact@v4
with:
name: flyctl
path: master-build
- name: Move flyctl binary to correct directory
run: |
mv master-build/flyctl bin/flyctl
chmod +x bin/flyctl
continue-on-error: true
# But if this is a manual run, build the binary first.
- run: make
- name: Run preflight tests
id: preflight
env:
FLY_PREFLIGHT_TEST_ACCESS_TOKEN: ${{ secrets.FLYCTL_PREFLIGHT_CI_FLY_API_TOKEN }}
FLY_PREFLIGHT_TEST_FLY_ORG: flyctl-ci-preflight
# This VM size is only available in ORD.
FLY_PREFLIGHT_TEST_FLY_REGIONS: ord
FLY_PREFLIGHT_TEST_FLY_REGIONS: ${{ inputs.region }}
FLY_PREFLIGHT_TEST_NO_PRINT_HISTORY_ON_FAIL: "true"
FLY_FORCE_TRACE: "true"
FLY_PREFLIGHT_TEST_VM_SIZE: ${{ matrix.vm_size }}
FLY_PREFLIGHT_TEST_APP_PREFIX: "preflight"
run: |
(test -e master-build/flyctl) && mv master-build/flyctl bin/flyctl
chmod +x bin/flyctl
export PATH=$PWD/bin:$PATH
echo -n failed= >> $GITHUB_OUTPUT
./scripts/preflight.sh -r "${{ github.ref }}" -t "${{ matrix.parallelism }}" -i "${{ matrix.index }}" -o $GITHUB_OUTPUT
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preflight_cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Preflight Tests Cleanup

on:
schedule:
- cron: '*/30 * * * *'
- cron: "*/30 * * * *"
workflow_dispatch:
inputs:
reason:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:

permissions:
contents: write
packages: write

# concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -81,6 +82,17 @@ jobs:
with:
path: dist/${{ matrix.GOOS }}
key: ${{ matrix.GOOS }}-${{ needs.meta.outputs.sha_short }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.FLYIOBUILDS_DOCKERHUB_USERNAME }}
password: ${{ secrets.FLYIOBUILDS_DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
if: steps.cache.outputs.cache-hit != 'true' # do not run if cache hit
uses: goreleaser/goreleaser-action@v5
Expand Down
10 changes: 10 additions & 0 deletions .goreleaser.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,15 @@ archives:
wrap_in_directory: false
format: zip

dockers:
- goos: linux
goarch: amd64
image_templates:
- "flyio/flyctl:latest"
- "flyio/flyctl:v{{ .Version }}"
- "ghcr.io/superfly/flyctl:latest"
- "ghcr.io/superfly/flyctl:v{{ .Version }}"
skip_push: auto

release:
disable: false
16 changes: 9 additions & 7 deletions deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

begin

Signal.trap('INT') do
event :cancel, { signal: "SIGINT" }
exit 0
end

event :start, { ts: ts() }

# Change to a directory where we'll pull on git
Expand Down Expand Up @@ -76,7 +81,7 @@
in_step Step::GIT_PULL do
ref = get_env("GIT_REF")
artifact Artifact::GIT_INFO, { repository: GIT_REPO, reference: ref }

exec_capture("git init", log: false)

redacted_repo_url = GIT_REPO_URL.dup
Expand Down Expand Up @@ -118,10 +123,7 @@
""
end

if DEPLOY_ONLY
event :error, {type: :validation, message: "missing fly.toml" } if !HAS_FLY_CONFIG
exit 1
else
if !DEPLOY_ONLY
MANIFEST_PATH = "/tmp/manifest.json"

manifest = in_step Step::PLAN do
Expand Down Expand Up @@ -202,7 +204,7 @@
plugin = FLYCTL_TO_ASDF_PLUGIN_NAME.fetch(RUNTIME_LANGUAGE, RUNTIME_LANGUAGE)
if plugin == "elixir"
# required for elixir to work
exec_capture("asdf install erlang #{DEFAULT_ERLANG_VERSION}")
exec_capture("asdf install erlang #{DEFAULT_ERLANG_VERSION}")
end
exec_capture("asdf install #{plugin} #{version}")
else
Expand Down Expand Up @@ -445,4 +447,4 @@
$stderr.flush

sleep 1.0
end
end
3 changes: 2 additions & 1 deletion deployer.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8

ENV LANG en_US.UTF-8

Check warning on line 16 in deployer.Dockerfile

View workflow job for this annotation

GitHub Actions / build-deployer

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

# configure git a bit
RUN git config --global advice.detachedHead false && \
Expand Down Expand Up @@ -60,7 +60,8 @@
asdf install erlang $DEFAULT_ERLANG_VERSION && asdf global erlang $DEFAULT_ERLANG_VERSION && \
asdf install elixir $DEFAULT_ELIXIR_VERSION && asdf global elixir $DEFAULT_ELIXIR_VERSION && \
# bun
asdf plugin add bun https://github.com/cometkim/asdf-bun.git
asdf plugin add bun https://github.com/cometkim/asdf-bun.git && \
asdf install bun $DEFAULT_BUN_VERSION && asdf global bun $DEFAULT_BUN_VERSION

ENV MIX_ENV=dev

Expand Down
4 changes: 4 additions & 0 deletions doc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ func main() {
cmd := cli.NewRootCommand()
cmd.DisableAutoGenTag = true

// Override root command to always be `fly`,
// Otherwise it could be `main`, `flyctl` or whatever name is set to the executable
cmd.Use = "fly"

filePrepender := func(filename string) string {
return ""
}
Expand Down
5 changes: 3 additions & 2 deletions flypg/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/base64"
"encoding/json"
"errors"
"fmt"

fly "github.com/superfly/fly-go"
Expand Down Expand Up @@ -73,7 +74,7 @@ func (pc *Command) UpdateSettings(ctx context.Context, leaderIp string, config m
}

if !result.Success {
return fmt.Errorf(result.Message)
return errors.New(result.Message)
}

return nil
Expand All @@ -94,7 +95,7 @@ func (pc *Command) UnregisterMember(ctx context.Context, leaderIP string, standb
}

if !result.Success {
return fmt.Errorf(result.Message)
return errors.New(result.Message)
}

return nil
Expand Down
Loading
Loading