Skip to content

Commit adcb4cf

Browse files
authored
Refactoring (#87)
- Remove Kafka Ingester: We now only support the Fluent Bit output plugin for ClickHouse - Use `log/slog` instead of `zap` for logging - Update Fluent Bit to version 4.0.2 - Adjust examples for development - Adjust CI/CD Pipeline - Add Linting - Rename Docker Image - Format YAML Files
1 parent 911a49e commit adcb4cf

File tree

89 files changed

+929
-21731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+929
-21731
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
github: [ricoberger]
3+
custom: ["https://www.paypal.me/ricoberger"]

.github/codeql/codeql-config.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
version: 2
23
updates:
34
- package-ecosystem: "github-actions"

.github/release.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name-template: "$RESOLVED_VERSION"
23
tag-template: "$RESOLVED_VERSION"
34
version-template: "v$MAJOR.$MINOR.$PATCH"
@@ -15,15 +16,15 @@ version-resolver:
1516
minor:
1617
labels:
1718
- "changelog: added"
18-
- "changelog: changed"
1919
patch:
2020
labels:
21+
- "changelog: changed"
2122
- "changelog: fixed"
2223
default: patch
2324
category-template: "### $TITLE"
24-
change-template: '- #$NUMBER: $TITLE @$AUTHOR'
25+
change-template: "- #$NUMBER: $TITLE @$AUTHOR"
2526
template: |
2627
$CHANGES
2728
replacers:
28-
- search: ':warning:'
29-
replace: ':warning: _Breaking change:_ :warning:'
29+
- search: ":warning:"
30+
replace: ":warning: _Breaking change:_ :warning:"

.github/workflows/codeql.yaml

Lines changed: 0 additions & 82 deletions
This file was deleted.
Lines changed: 22 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Continuous Delivery
23

34
on:
@@ -8,90 +9,49 @@ on:
89
- v*
910

1011
jobs:
11-
plugin:
12-
name: Plugin
12+
docker:
13+
name: Docker
1314
runs-on: ubuntu-latest
1415
permissions:
1516
packages: write
16-
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@v4
2020
with:
2121
fetch-depth: 0
2222

23-
- name: Set Docker Tag
24-
id: tag
25-
run: |
26-
if [[ $GITHUB_REF == refs/tags/* ]]; then
27-
echo TAG=${GITHUB_REF:10} >> $GITHUB_ENV
28-
else
29-
echo TAG=main >> $GITHUB_ENV
30-
fi
31-
32-
- name: Set up QEMU
33-
uses: docker/setup-qemu-action@v3
34-
35-
- name: Set up Docker Buildx
36-
uses: docker/setup-buildx-action@v3
37-
38-
- name: Login to DockerHub
39-
uses: docker/login-action@v3
23+
- name: Docker Metadata
24+
id: metadata
25+
uses: docker/metadata-action@v5
4026
with:
41-
username: ${{ github.repository_owner }}
42-
password: ${{ secrets.GITHUB_TOKEN }}
43-
registry: ghcr.io
44-
45-
- name: Build and Push Docker Image
46-
id: docker_build
47-
uses: docker/build-push-action@v6
48-
with:
49-
push: true
50-
context: .
51-
file: ./cmd/plugin/Dockerfile
52-
platforms: linux/amd64,linux/arm,linux/arm64
53-
tags: ghcr.io/${{ github.repository_owner }}/klogs:${{ env.TAG }}-plugin
54-
55-
ingester:
56-
name: Ingester
57-
runs-on: ubuntu-latest
58-
permissions:
59-
packages: write
60-
61-
steps:
62-
- name: Checkout
63-
uses: actions/checkout@v4
64-
with:
65-
fetch-depth: 0
66-
67-
- name: Set Docker Tag
68-
id: tag
69-
run: |
70-
if [[ $GITHUB_REF == refs/tags/* ]]; then
71-
echo TAG=${GITHUB_REF:10} >> $GITHUB_ENV
72-
else
73-
echo TAG=main >> $GITHUB_ENV
74-
fi
27+
images: |
28+
ghcr.io/${{ github.repository }}
29+
tags: |
30+
type=ref,event=branch
31+
type=semver,pattern={{raw}}
7532
7633
- name: Set up QEMU
7734
uses: docker/setup-qemu-action@v3
7835

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

82-
- name: Login to DockerHub
39+
- name: Login to GitHub Container Registry
8340
uses: docker/login-action@v3
8441
with:
85-
username: ${{ github.repository_owner }}
86-
password: ${{ secrets.GITHUB_TOKEN }}
8742
registry: ghcr.io
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
8845

89-
- name: Build and Push Docker Image
90-
id: docker_build
46+
- name: Build and Push Docker Image (webhook)
47+
id: docker_build_webhook
9148
uses: docker/build-push-action@v6
9249
with:
9350
push: true
9451
context: .
95-
file: ./cmd/ingester/Dockerfile
96-
platforms: linux/amd64,linux/arm,linux/arm64
97-
tags: ghcr.io/${{ github.repository_owner }}/klogs:${{ env.TAG }}-ingester
52+
file: Dockerfile
53+
platforms: linux/amd64,linux/arm64
54+
cache-from: type=gha
55+
cache-to: type=gha,mode=max
56+
tags: ${{ steps.metadata.outputs.tags }}
57+
labels: ${{ steps.metadata.outputs.labels }}

.github/workflows/continuous-integration.yaml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Continuous Integration
23

34
on:
@@ -25,22 +26,37 @@ jobs:
2526
cache: true
2627
cache-dependency-path: go.sum
2728

28-
- name: Download Dependencies
29-
run: |
30-
go mod download
31-
32-
- name: Vet
33-
run: |
34-
make vet
29+
- name: Lint
30+
uses: golangci/golangci-lint-action@v7
3531

3632
- name: Test
3733
run: |
3834
make test
3935
40-
- name: Build Plugin
36+
- name: Build
4137
run: |
42-
make build-plugin
38+
make build
4339
44-
- name: Build Ingester
45-
run: |
46-
make build-ingester
40+
docker:
41+
name: Docker
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout Code
45+
uses: actions/checkout@v4
46+
with:
47+
fetch-depth: 0
48+
49+
- name: Set up QEMU
50+
uses: docker/setup-qemu-action@v3
51+
52+
- name: Set up Docker Buildx
53+
uses: docker/setup-buildx-action@v3
54+
55+
- name: Build Docker Image
56+
id: docker_build
57+
uses: docker/build-push-action@v6
58+
with:
59+
push: false
60+
context: .
61+
file: Dockerfile
62+
platforms: linux/amd64

.github/workflows/release.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Release
23

34
on:

.golangci.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
version: "2"
3+
linters:
4+
default: none
5+
enable:
6+
- bodyclose
7+
- gosec
8+
- govet
9+
- ineffassign
10+
- noctx
11+
- staticcheck
12+
- unused
13+
- whitespace
14+
exclusions:
15+
generated: lax
16+
presets:
17+
- comments
18+
- common-false-positives
19+
- legacy
20+
- std-error-handling
21+
paths:
22+
- third_party$
23+
- builtin$
24+
- examples$
25+
formatters:
26+
enable:
27+
- gofmt
28+
- goimports
29+
settings:
30+
goimports:
31+
local-prefixes:
32+
- github.com/kobsio/klogs
33+
exclusions:
34+
generated: lax
35+
paths:
36+
- third_party$
37+
- builtin$
38+
- examples$
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
# We can't go past 1.20.2 until this issue is solved: https://github.com/golang/go/issues/62130#issuecomment-1687335898
2-
FROM golang:1.20.2 as build
1+
FROM golang:1.24.3 AS build
32
WORKDIR /root
43
COPY go.mod go.sum ./
54
RUN go mod download
65
COPY . .
7-
RUN make build-plugin
6+
RUN make build
87

9-
FROM fluent/fluent-bit:3.2.8
8+
FROM fluent/fluent-bit:4.0.2
109
COPY --from=build /root/out_clickhouse.so /fluent-bit/bin/
1110
EXPOSE 2020
1211
CMD ["/fluent-bit/bin/fluent-bit", "--plugin", "/fluent-bit/bin/out_clickhouse.so", "--config", "/fluent-bit/etc/fluent-bit.conf"]

0 commit comments

Comments
 (0)