Skip to content

Commit

Permalink
Merge branch 'master' into fix--prettyCQL
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeLieutenant committed Nov 5, 2024
2 parents a491dc6 + 294ab49 commit 40c63d3
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 7 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Docker Build

on:
workflow_call:
inputs:
version:
default: ""
required: true
type: string
workflow_dispatch:
inputs:
version:
default: ""
required: true
type: string

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

# Needed for ARM64 Docker builds
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push API
uses: docker/build-push-action@v5
with:
file: ./Dockerfile
context: .
push: true
pull: true
platforms: 'linux/amd64,linux/arm64/v8'
target: production
cache-from: type=gha
cache-to: type=gha,mode=max
tags: scylladb/gemini:${{ inputs.version }}
7 changes: 3 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ jobs:
needs: [build]
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
gemini-features: ["basic", "normal", "all"]
gemini-concurrency: [16]
gemini-concurrency: [4]
duration: ["5m"]
dataset-size: [large, small]
oracle-scylla-version: ["6.1"]
test-scylla-version: ["6.1"]
test-scylla-version: ["6.2"]
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -69,4 +68,4 @@ jobs:
name: results-${{ matrix.gemini-features }}-${{ matrix.gemini-concurrency }}-${{ matrix.duration }}-${{ matrix.dataset-size }}-${{ matrix.test-scylla-version }}-${{ matrix.oracle-scylla-version }}-${{ github.run_number }}
path: ./results
if-no-files-found: error
retention-days: 30
retention-days: 1
2 changes: 2 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ dockers:
id: gemini-amd64
build_flag_templates:
- '--platform=linux/amd64'
- '--target=production-goreleaser'

- image_templates:
- scylladb/gemini:{{ .Version }}-arm64v8
Expand All @@ -65,6 +66,7 @@ dockers:
goos: linux
build_flag_templates:
- '--platform=linux/arm64/v8'
- '--target=production-goreleaser'

docker_manifests:
- name_template: 'scylladb/gemini:{{ .Version }}'
Expand Down
30 changes: 29 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
FROM busybox
FROM golang:1.23-bookworm AS build

ENV GO111MODULE=on
ENV CGO_ENABLED=0
ENV GOAMD64=v3
ENV GOARM64=v8.0,crypto
ENV CFLAGS="-O3"
ENV CXXFLAGS="-O3"

WORKDIR /gemini

COPY . .

RUN apt-get update \
&& apt-get install -y build-essential ca-certificates \
&& make build

FROM busybox AS production

WORKDIR /gemini

COPY --from=build gemini .

ENV PATH="/gemini:${PATH}"

ENTRYPOINT ["gemini"]


FROM busybox AS production-goreleaser

WORKDIR /gemini

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ fix: $(GOBIN)/golangci-lint

.PHONY: build
build:
@CGO_ENABLED=0 go build -o bin/gemini ./cmd/gemini
@CGO_ENABLED=0 go build -ldflags="-s -w" -o bin/gemini ./cmd/gemini

debug-build:
@CGO_ENABLED=0 go build -ldflags="-asan" -gcflags "all=-N -l" -o bin/gemini ./cmd/gemini
@CGO_ENABLED=0 go build -gcflags "all=-N -l" -o bin/gemini ./cmd/gemini

.PHONY: build-docker
build-docker:
Expand Down

0 comments on commit 40c63d3

Please sign in to comment.