Skip to content

Commit 7b6cf2e

Browse files
committed
Merge remote-tracking branch 'origin/main' into auth_page_be
# Conflicts: # api/src/main/java/io/kafbat/ui/service/ApplicationInfoService.java
2 parents 1e668f8 + 0ad8695 commit 7b6cf2e

File tree

69 files changed

+1385
-453
lines changed

Some content is hidden

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

69 files changed

+1385
-453
lines changed

.dev/dev_arm64.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ services:
3232
KAFKA_CLUSTERS_0_AUDIT_CONSOLEAUDITENABLED: 'true'
3333

3434
kafka0:
35-
image: confluentinc/cp-kafka:7.2.1.arm64
35+
image: confluentinc/cp-kafka:7.6.0.arm64
36+
user: "0:0"
3637
hostname: kafka0
3738
container_name: kafka0
3839
ports:
@@ -56,12 +57,10 @@ services:
5657
KAFKA_JMX_PORT: 9997
5758
# KAFKA_JMX_HOSTNAME: localhost # uncomment this line and comment the next one if running with kafka-ui as a jar
5859
KAFKA_JMX_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=kafka0 -Dcom.sun.management.jmxremote.rmi.port=9997
59-
volumes:
60-
- ../documentation/compose/scripts/update_run.sh:/tmp/update_run.sh
61-
command: "bash -c 'if [ ! -f /tmp/update_run.sh ]; then echo \"ERROR: Did you forget the update_run.sh file that came with this docker-compose.yml file?\" && exit 1 ; else /tmp/update_run.sh && /etc/confluent/docker/run ; fi'"
60+
CLUSTER_ID: 'MkU3OEVBNTcwNTJENDM2Qk'
6261

6362
schema-registry0:
64-
image: confluentinc/cp-schema-registry:7.2.1.arm64
63+
image: confluentinc/cp-schema-registry:7.6.0.arm64
6564
ports:
6665
- 8085:8085
6766
depends_on:
@@ -77,7 +76,7 @@ services:
7776
SCHEMA_REGISTRY_KAFKASTORE_TOPIC: _schemas
7877

7978
kafka-connect0:
80-
image: confluentinc/cp-kafka-connect:7.2.1.arm64
79+
image: confluentinc/cp-kafka-connect:7.6.0.arm64
8180
ports:
8281
- 8083:8083
8382
depends_on:
@@ -102,7 +101,7 @@ services:
102101
CONNECT_PLUGIN_PATH: "/usr/share/java,/usr/share/confluent-hub-components,/usr/local/share/kafka/plugins,/usr/share/filestream-connectors"
103102

104103
ksqldb0:
105-
image: confluentinc/ksqldb-server:0.18.0
104+
image: confluentinc/cp-ksqldb-server:7.6.0.arm64
106105
depends_on:
107106
- kafka0
108107
- kafka-connect0
@@ -120,7 +119,7 @@ services:
120119
KSQL_CACHE_MAX_BYTES_BUFFERING: 0
121120

122121
kafka-init-topics:
123-
image: confluentinc/cp-kafka:7.2.1.arm64
122+
image: confluentinc/cp-kafka:7.6.0.arm64
124123
volumes:
125124
- ../documentation/compose/data/message.json:/data/message.json
126125
depends_on:

.github/workflows/build-public-image.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ on:
66
types: ['labeled']
77

88
permissions:
9+
id-token: write
910
contents: read
11+
pull-requests: write
1012

1113
jobs:
1214
build:
@@ -47,12 +49,11 @@ jobs:
4749
key: ${{ runner.os }}-buildx-${{ github.sha }}
4850
restore-keys: |
4951
${{ runner.os }}-buildx-
50-
- name: Configure AWS credentials for Kafka-UI account
52+
- name: Configure AWS Credentials
5153
uses: aws-actions/configure-aws-credentials@v4
5254
with:
53-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
54-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
5555
aws-region: us-east-1
56+
role-to-assume: ${{ secrets.AWS_ROLE }}
5657
- name: Login to Amazon ECR
5758
id: login-ecr
5859
uses: aws-actions/amazon-ecr-login@v2
@@ -65,7 +66,7 @@ jobs:
6566
builder: ${{ steps.buildx.outputs.name }}
6667
context: api
6768
push: true
68-
tags: public.ecr.aws/kafbat/kafka-ui-custom-build:${{ steps.extract_branch.outputs.tag }}
69+
tags: ${{ vars.ECR_REGISTRY }}/${{ github.repository }}:${{ steps.extract_branch.outputs.tag }}
6970
build-args: |
7071
JAR_FILE=api-${{ steps.build.outputs.version }}.jar
7172
cache-from: type=local,src=/tmp/.buildx-cache
@@ -75,6 +76,6 @@ jobs:
7576
with:
7677
issue-number: ${{ github.event.pull_request.number }}
7778
body: |
78-
Image published at public.ecr.aws/kafbat/kafka-ui-custom-build:${{ steps.extract_branch.outputs.tag }}
79+
Image published at ${{ vars.ECR_REGISTRY }}/${{ github.repository }}:${{ steps.extract_branch.outputs.tag }}
7980
outputs:
8081
tag: ${{ steps.extract_branch.outputs.tag }}

.github/workflows/docker_build.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: "Docker build"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
sha:
7+
required: true
8+
type: string
9+
version:
10+
required: true
11+
type: string
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
ref: ${{ github.event.pull_request.head.sha }}
24+
token: ${{ github.token }}
25+
26+
- name: Download maven artifacts
27+
uses: actions/download-artifact@v4
28+
with:
29+
name: kafbat-ui-${{ inputs.version }}
30+
path: api/target
31+
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@v3
34+
35+
- name: Set up Docker Buildx
36+
id: buildx
37+
uses: docker/setup-buildx-action@v3
38+
39+
- name: Cache Docker layers
40+
uses: actions/cache@v4
41+
with:
42+
path: /tmp/.buildx-cache
43+
key: ${{ runner.os }}-buildx-${{ inputs.sha }}
44+
restore-keys: |
45+
${{ runner.os }}-buildx-
46+
47+
# Build multi platform images and loading them at the same time is not possible with default container runtime : https://github.com/docker/buildx/issues/59
48+
# So let's use containerd instead as it supports this option
49+
# Also containerd is one of the option to allow preserving provenance attestations :https://docs.docker.com/build/attestations/#creating-attestations
50+
- name: Setup docker with containerd
51+
uses: crazy-max/ghaction-setup-docker@v3
52+
with:
53+
daemon-config: |
54+
{
55+
"features": {
56+
"containerd-snapshotter": true
57+
}
58+
}
59+
60+
- name: Build docker image
61+
id: docker_build
62+
uses: docker/build-push-action@v5
63+
with:
64+
builder: ${{ steps.buildx.outputs.name }}
65+
context: api
66+
platforms: linux/amd64,linux/arm64
67+
provenance: mode=min
68+
sbom: true
69+
push: false
70+
load: true
71+
tags: |
72+
kafka-ui:temp
73+
build-args: |
74+
JAR_FILE=api-${{ inputs.version }}.jar
75+
cache-from: type=local,src=/tmp/.buildx-cache
76+
cache-to: type=local,dest=/tmp/.buildx-cache
77+
78+
- name: Dump docker image
79+
run: |
80+
docker image save kafka-ui:temp > /tmp/image.tar
81+
82+
- name: Upload docker image
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: image
86+
path: /tmp/image.tar
87+
retention-days: 1
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: "Docker publish"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
version:
7+
required: true
8+
type: string
9+
generic_tag:
10+
required: true
11+
type: string
12+
13+
permissions:
14+
packages: write
15+
id-token: write # Required to authenticate with OIDC for AWS
16+
17+
jobs:
18+
deploy:
19+
continue-on-error: true
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
registry: [ 'docker.io', 'ghcr.io', 'ecr' ]
24+
25+
runs-on: ubuntu-latest
26+
steps:
27+
28+
- name: Download docker image
29+
uses: actions/download-artifact@v4
30+
with:
31+
name: image
32+
path: /tmp
33+
34+
# setup containerd to preserve provenance attestations :https://docs.docker.com/build/attestations/#creating-attestations
35+
- name: Setup docker with containerd
36+
uses: crazy-max/ghaction-setup-docker@v3
37+
with:
38+
daemon-config: |
39+
{
40+
"features": {
41+
"containerd-snapshotter": true
42+
}
43+
}
44+
45+
- name: Load docker image into daemon
46+
run: |
47+
docker load --input /tmp/image.tar
48+
49+
- name: Login to docker.io
50+
if: matrix.registry == 'docker.io'
51+
uses: docker/login-action@v3
52+
with:
53+
registry: ${{ matrix.registry }}
54+
username: ${{ secrets.DOCKERHUB_USERNAME }}
55+
password: ${{ secrets.DOCKERHUB_TOKEN }}
56+
57+
- name: Login to ghcr.io
58+
if: matrix.registry == 'ghcr.io'
59+
uses: docker/login-action@v3
60+
with:
61+
registry: ${{ matrix.registry }}
62+
username: ${{ github.actor }}
63+
password: ${{ secrets.GITHUB_TOKEN }}
64+
65+
- name: Configure AWS credentials
66+
if: matrix.registry == 'ecr'
67+
uses: aws-actions/configure-aws-credentials@v4
68+
with:
69+
aws-region: us-east-1 # This region only for public ECR
70+
role-to-assume: ${{ secrets.AWS_ROLE }}
71+
72+
- name: Login to public ECR
73+
if: matrix.registry == 'ecr'
74+
id: login-ecr-public
75+
uses: aws-actions/amazon-ecr-login@v2
76+
with:
77+
registry-type: public
78+
79+
- name: define env vars
80+
run: |
81+
if [ ${{matrix.registry }} == 'docker.io' ]; then
82+
echo "REGISTRY=${{ matrix.registry }}" >> $GITHUB_ENV
83+
echo "REPOSITORY=${{ github.repository }}" >> $GITHUB_ENV
84+
elif [ ${{ matrix.registry }} == 'ghcr.io' ]; then
85+
echo "REGISTRY=${{ matrix.registry }}" >> $GITHUB_ENV
86+
echo "REPOSITORY=${{ github.repository }}" >> $GITHUB_ENV
87+
elif [ ${{ matrix.registry }} == 'ecr' ]; then
88+
echo "REGISTRY=${{ vars.ECR_REGISTRY }}" >> $GITHUB_ENV
89+
echo "REPOSITORY=${{ github.repository }}" >> $GITHUB_ENV
90+
else
91+
echo "REGISTRY=" >> $GITHUB_ENV
92+
echo "REPOSITORY=notworking" >> $GITHUB_ENV
93+
fi
94+
95+
- name: Push images to ${{ matrix.registry }}
96+
run: |
97+
docker tag kafka-ui:temp ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:${{ inputs.generic_tag }}
98+
docker tag kafka-ui:temp ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:${{ inputs.version }}
99+
docker push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:${{ inputs.generic_tag }}
100+
docker push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:${{ inputs.version }}

.github/workflows/e2e-run.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ jobs:
103103
run: |
104104
mkdir -p ./e2e-tests/target/selenoid-results/video
105105
mkdir -p ./e2e-tests/target/selenoid-results/logs
106-
docker-compose -f ./e2e-tests/selenoid/selenoid-ci.yaml up -d
107-
docker-compose -f ./documentation/compose/e2e-tests.yaml up -d
106+
docker compose -f ./e2e-tests/selenoid/selenoid-ci.yaml up -d
107+
docker compose -f ./documentation/compose/e2e-tests.yaml up -d
108108
109109
- name: Dump Docker logs on failure
110110
if: failure()

.github/workflows/frontend_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
- uses: pnpm/[email protected]
2525
with:
26-
version: 9.1.2
26+
version: 9.11.0
2727

2828
- name: Install node
2929
uses: actions/[email protected]

.github/workflows/main.yml

Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ permissions:
99
contents: read
1010

1111
jobs:
12-
build:
12+
jar-build:
1313
runs-on: ubuntu-latest
14+
1415
permissions:
1516
contents: read
16-
packages: write
17+
18+
outputs:
19+
version: ${{steps.build.outputs.version}}
1720

1821
steps:
1922
- name: Checkout
@@ -37,42 +40,30 @@ jobs:
3740
export VERSION=$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
3841
echo "version=${VERSION}" >> $GITHUB_OUTPUT
3942
40-
# docker images
41-
42-
- name: Set up QEMU
43-
uses: docker/setup-qemu-action@v3
44-
45-
- name: Set up Docker Buildx
46-
uses: docker/setup-buildx-action@v3
47-
48-
- name: Cache Docker layers
49-
uses: actions/cache@v4
43+
- name: Upload jar
44+
uses: actions/upload-artifact@v4
5045
with:
51-
path: /tmp/.buildx-cache
52-
key: ${{ runner.os }}-buildx-${{ github.sha }}
53-
restore-keys: |
54-
${{ runner.os }}-buildx-
46+
name: kafbat-ui-${{ steps.build.outputs.version }}
47+
path: api/target/api-${{ steps.build.outputs.version }}.jar
48+
retention-days: 1
5549

56-
- name: Login to GitHub Container Registry
57-
uses: docker/login-action@v3
58-
with:
59-
registry: ghcr.io
60-
username: ${{ github.actor }}
61-
password: ${{ secrets.GITHUB_TOKEN }}
50+
docker-build:
51+
needs: jar-build
52+
permissions:
53+
contents: read
54+
uses: ./.github/workflows/docker_build.yml
55+
secrets: inherit
56+
with:
57+
sha: ${{ github.sha }}
58+
version: ${{ needs.jar-build.outputs.version }}
6259

63-
- name: Build & push docker image
64-
id: docker_build_and_push
65-
uses: docker/build-push-action@v5
66-
with:
67-
builder: ${{ steps.buildx.outputs.name }}
68-
context: api
69-
platforms: linux/amd64,linux/arm64
70-
provenance: false
71-
push: true
72-
tags: |
73-
ghcr.io/kafbat/kafka-ui:${{ steps.build.outputs.version }}
74-
ghcr.io/kafbat/kafka-ui:main
75-
build-args: |
76-
JAR_FILE=api-${{ steps.build.outputs.version }}.jar
77-
cache-from: type=local,src=/tmp/.buildx-cache
78-
cache-to: type=local,dest=/tmp/.buildx-cache
60+
docker-deploy:
61+
needs: [ jar-build, docker-build ]
62+
permissions:
63+
packages: write
64+
id-token: write # Required to authenticate with OIDC for AWS
65+
uses: ./.github/workflows/docker_publish.yml
66+
secrets: inherit
67+
with:
68+
version: ${{ needs.jar-build.outputs.version }}
69+
generic_tag: main

0 commit comments

Comments
 (0)