-
Notifications
You must be signed in to change notification settings - Fork 216
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
feat(cmd/flipt-edge): lean, mean flag evaluating machine #3491
Open
GeorgeMac
wants to merge
11
commits into
main
Choose a base branch
from
gm/flipt-edge
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
45c55de
feat(cmd/flipt-edge): lean, mean flag evaluating machine
GeorgeMac b2ca095
chore(cmd/flipt-edge): remove auto check for latest release
GeorgeMac 022624a
fix(cmd/edge/test): use relevant configuration for edge storage test
GeorgeMac 467ad8c
chore: rebase on main
markphelps 48ce742
chore: add buildedge target
markphelps 5d9498f
chore: try to setup nightly build of edge
markphelps 7627a03
Merge branch 'main' into gm/flipt-edge
markphelps fc3160a
chore: try rm dagger cloud
markphelps 00602f0
Merge branch 'gm/flipt-edge' of https://github.com/flipt-io/flipt int…
markphelps 3b43e25
chore: specify cmd/flipt for base build
markphelps 2e67c3b
chore: rm sqlite for edge grpc_test
markphelps File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Release Edge (Nightly) | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "45 22 * * *" # nightly @ 10:45 PM UTC | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
env: | ||
GO_VERSION: "1.22" | ||
|
||
jobs: | ||
nightly-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
check-latest: true | ||
cache: true | ||
|
||
- uses: docker/setup-qemu-action@v3 | ||
|
||
- uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: "${{ github.repository_owner }}" | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: _tools/ | ||
key: ${{ runner.os }}-go-tools${{ hashFiles('_tools/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go-tools- | ||
|
||
- name: Install GCC for arm64 | ||
run: | | ||
sudo apt-get update && \ | ||
sudo apt-get install -y gcc-aarch64-linux-gnu | ||
|
||
- name: Install Syft | ||
run: | | ||
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin | ||
|
||
- name: Git Tag | ||
run: | | ||
echo "GORELEASER_CURRENT_TAG=$(git describe --tags --match='v[0-9]*' `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV | ||
|
||
- name: GoReleaser Edge (Nightly) Build | ||
uses: goreleaser/goreleaser-action@v6 | ||
with: | ||
distribution: goreleaser-pro | ||
version: latest | ||
args: release --clean --nightly -f .goreleaser.edge.yml | ||
env: | ||
GORELEASER_CURRENT_TAG: ${{ env.GORELEASER_CURRENT_TAG }} | ||
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,28 +23,12 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Free Disk Space | ||
uses: jlumbroso/[email protected] | ||
with: | ||
# Runs quick, run rm in background | ||
tool-cache: true | ||
|
||
# These run slower as use apt to uninstall packages | ||
# Turned on by default, so we disable them | ||
android: false | ||
dotnet: false | ||
haskell: false | ||
large-packages: false | ||
docker-images: false | ||
swap-storage: false | ||
|
||
- name: Run CLI Tests | ||
uses: dagger/dagger-for-github@v6 | ||
with: | ||
verb: call | ||
version: ${{ env.DAGGER_VERSION }} | ||
args: test --source .:default cli | ||
cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }} | ||
|
||
test: | ||
name: Integration Tests | ||
|
@@ -79,21 +63,6 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Free Disk Space | ||
uses: jlumbroso/[email protected] | ||
with: | ||
# Runs quick, run rm in background | ||
tool-cache: true | ||
|
||
# These run slower as use apt to uninstall packages | ||
# Turned on by default, so we disable them | ||
android: false | ||
dotnet: false | ||
haskell: false | ||
large-packages: false | ||
docker-images: false | ||
swap-storage: false | ||
|
||
- run: echo "INTEGRATION_TEST_NAME=${{ matrix.test }}" | tr '/' '-' >> $GITHUB_ENV | ||
|
||
- name: Run Integration Tests | ||
|
@@ -102,7 +71,6 @@ jobs: | |
verb: call | ||
version: ${{ env.DAGGER_VERSION }} | ||
args: test --source .:default integration --cases ${{ matrix.test }} | ||
cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }} | ||
|
||
- name: Upload Flipt Service Logs | ||
uses: actions/upload-artifact@v4 | ||
|
@@ -120,25 +88,9 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Free Disk Space | ||
uses: jlumbroso/[email protected] | ||
with: | ||
# Runs quick, run rm in background | ||
tool-cache: true | ||
|
||
# These run slower as use apt to uninstall packages | ||
# Turned on by default, so we disable them | ||
android: false | ||
dotnet: false | ||
haskell: false | ||
large-packages: false | ||
docker-images: false | ||
swap-storage: false | ||
|
||
- name: Run UI Tests | ||
uses: dagger/dagger-for-github@v6 | ||
with: | ||
verb: call | ||
version: ${{ env.DAGGER_VERSION }} | ||
args: test --source .:default ui | ||
cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ permissions: | |
packages: write | ||
|
||
env: | ||
GO_VERSION: "1.21" | ||
GO_VERSION: "1.22" | ||
|
||
jobs: | ||
nightly-build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,28 +21,12 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Free Disk Space | ||
uses: jlumbroso/[email protected] | ||
with: | ||
# Runs quick, run rm in background | ||
tool-cache: true | ||
|
||
# These run slower as use apt to uninstall packages | ||
# Turned on by default, so we disable them | ||
android: false | ||
dotnet: false | ||
haskell: false | ||
large-packages: false | ||
docker-images: false | ||
swap-storage: false | ||
|
||
- name: Run Unit Tests | ||
uses: dagger/dagger-for-github@v6 | ||
with: | ||
verb: call | ||
version: ${{ env.DAGGER_VERSION }} | ||
args: test --source .:default unit export --path coverage.txt | ||
cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }} | ||
|
||
- name: Upload Coverage | ||
uses: codecov/[email protected] | ||
|
@@ -93,25 +77,9 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Free Disk Space | ||
uses: jlumbroso/[email protected] | ||
with: | ||
# Runs quick, run rm in background | ||
tool-cache: true | ||
|
||
# These run slower as use apt to uninstall packages | ||
# Turned on by default, so we disable them | ||
android: false | ||
dotnet: false | ||
haskell: false | ||
large-packages: false | ||
docker-images: false | ||
swap-storage: false | ||
|
||
- name: Run Migration Tests | ||
uses: dagger/dagger-for-github@v6 | ||
with: | ||
verb: call | ||
version: ${{ env.DAGGER_VERSION }} | ||
args: test --source .:default migration | ||
cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json | ||
version: 2 | ||
|
||
project_name: flipt-edge | ||
|
||
git: | ||
tag_sort: semver | ||
|
||
monorepo: | ||
tag_prefix: v | ||
|
||
builds: | ||
- main: ./cmd/flipt-edge/. | ||
ldflags: | ||
- -s -w | ||
- -X main.version={{ .PrefixedTag }} | ||
- -X main.commit={{ .Commit }} | ||
- -X main.date={{ .Date }} | ||
- -linkmode external -extldflags "-static" | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
flags: | ||
- -tags=netgo | ||
- -trimpath | ||
overrides: | ||
- goos: linux | ||
goarch: amd64 | ||
goamd64: v1 | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=x86_64-linux-gnu-gcc | ||
|
||
- goos: linux | ||
goarch: arm64 | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=aarch64-linux-gnu-gcc | ||
|
||
changelog: | ||
disable: true | ||
|
||
dockers: | ||
- dockerfile: ./build/Dockerfile.edge | ||
use: buildx | ||
goos: linux | ||
goarch: amd64 | ||
image_templates: | ||
- "{{ if .IsNightly }}flipt/flipt-edge:v{{ incpatch .Version }}-nightly-amd64{{ else }}flipt/flipt-edge:v{{ .Tag }}-amd64{{ end }}" | ||
- "{{ if .IsNightly }}ghcr.io/flipt-io/flipt-edge:v{{ incpatch .Version }}-nightly-amd64{{ else }}ghcr.io/flipt-io/flipt-edge:v{{ .Tag }}-amd64{{ end }}" | ||
build_flag_templates: | ||
- "--platform=linux/amd64" | ||
- "--label=org.opencontainers.image.created={{.Date}}" | ||
- "--label=org.opencontainers.image.revision={{.FullCommit}}" | ||
- "--label=org.opencontainers.image.version={{.Version}}" | ||
extra_files: | ||
- config/default.yml | ||
|
||
- dockerfile: ./build/Dockerfile.edge | ||
use: buildx | ||
goos: linux | ||
goarch: arm64 | ||
image_templates: | ||
- "{{ if .IsNightly }}flipt/flipt-edge:v{{ incpatch .Version }}-nightly-arm64{{ else }}flipt/flipt-edge:v{{ .Tag }}-arm64{{ end }}" | ||
- "{{ if .IsNightly }}ghcr.io/flipt-io/flipt-edge:v{{ incpatch .Version }}-nightly-arm64{{ else }}ghcr.io/flipt-io/flipt-edge:v{{ .Tag }}-arm64{{ end }}" | ||
build_flag_templates: | ||
- "--platform=linux/arm64" | ||
- "--label=org.opencontainers.image.created={{.Date}}" | ||
- "--label=org.opencontainers.image.revision={{.FullCommit}}" | ||
- "--label=org.opencontainers.image.version={{.Version}}" | ||
extra_files: | ||
- config/default.yml | ||
|
||
docker_manifests: | ||
- name_template: "{{ if .IsNightly }}flipt/flipt-edge:v{{ incpatch .Version }}-nightly{{ else }}flipt/flipt-edge:v{{ .Tag }}{{ end }}" | ||
image_templates: | ||
- "{{ if .IsNightly }}flipt/flipt-edge:v{{ incpatch .Version }}-nightly-amd64{{ else }}flipt/flipt-edge:v{{ .Tag }}-amd64{{ end }}" | ||
- "{{ if .IsNightly }}flipt/flipt-edge:v{{ incpatch .Version }}-nightly-arm64{{ else }}flipt/flipt-edge:v{{ .Tag }}-arm64{{ end }}" | ||
|
||
- name_template: "{{ if .IsNightly }}ghcr.io/flipt-io/flipt-edge:v{{ incpatch .Version }}-nightly{{ else }}ghcr.io/flipt-io/flipt-edge:v{{ .Tag }}{{ end }}" | ||
image_templates: | ||
- "{{ if .IsNightly }}ghcr.io/flipt-io/flipt-edge:v{{ incpatch .Version }}-nightly-amd64{{ else }}ghcr.io/flipt-io/flipt-edge:v{{ .Tag }}-amd64{{ end }}" | ||
- "{{ if .IsNightly }}ghcr.io/flipt-io/flipt-edge:v{{ incpatch .Version }}-nightly-arm64{{ else }}ghcr.io/flipt-io/flipt-edge:v{{ .Tag }}-arm64{{ end }}" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i decided to remove Dagger Cloud because im not sure we're benefiting too much from it and I also don't think this free-disk-space action works incredibly well. The disk space usage is caused by Dagger Cloud downloading the entire cache history (I think) on run, which both slows down CI and blows up our disk.