Skip to content

Commit 5f15a8e

Browse files
authored
Simplify storage variants (#3902)
* Make the app module work with sql variants * Remove sql variants and make the datasource building dynamic * Move kafka sql implementation to app module * Simplify integration tests * Simplify integration tests * Use enum with the driver class name * Add mssql unit test * Fix integration tests * Split integration tests into separate jobs * Use only one dockerfile and remove makefile * Add gitops to app module * Fix kafkasql integration tests env var * Move linter job to verify * Move python sdk to verify workflow * Close kafka producer when application is shutting down * Add image building and pushing to verify workflow * Build and push images without custom scripts in the release workflow * Remove rhtap resources * Add native build validation * Add native image release process * Implement storage cdi resolution mechanism * Update docs * Update setup minikube action version * Make kafka storage do not implement the decorator interface * Increase initial delay for kafkasql check in integration tests * Add proper information to the info annotation for the storage options * Initialize lucene and jgit classes at runtime * Regenerate docs * Initialize database drivers at runtime * Use quarkus extensions for registering elements for the native image * Add new readme information * Fix datasource description name
1 parent 9c38b81 commit 5f15a8e

File tree

187 files changed

+1655
-4040
lines changed

Some content is hidden

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

187 files changed

+1655
-4040
lines changed

.github/scripts/build-and-push-multiarch-images.sh

-72
This file was deleted.

.github/workflows/integration-tests.yaml

+74-79
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ concurrency:
2222
cancel-in-progress: true
2323

2424
jobs:
25-
prepare-sql-tests:
26-
name: Prepare for SQL Integration Tests
25+
prepare-integration-tests:
26+
name: Prepare for Integration Tests
2727
runs-on: ubuntu-20.04
2828
if: github.repository_owner == 'Apicurio' && !contains(github.event.*.labels.*.name, 'DO NOT MERGE')
2929
steps:
@@ -41,44 +41,12 @@ jobs:
4141
- name: Get maven wrapper
4242
run: mvn -N io.takari:maven:wrapper -Dmaven=3.8.2
4343

44-
- name: Build Sql Variant
45-
run: make SKIP_TESTS=true BUILD_FLAGS='-Dmaven.javadoc.skip=true --no-transfer-progress -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5' build-sql
44+
- name: Build Application
45+
run: ./mvnw -T 1.5C clean install --no-transfer-progress -Pprod -DskipTests=true -Dmaven.javadoc.skip=true -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5
4646

47-
- name: Build and Push Sql image
48-
env:
49-
IMAGE_REPO: ttl.sh/${{ github.sha }}
50-
# maximum allowed
51-
IMAGE_TAG: 1d
52-
run: make build-sql-image push-sql-image
53-
54-
prepare-kafkasql-tests:
55-
name: Prepare for KafkaSQL Integration Tests
56-
runs-on: ubuntu-20.04
57-
if: github.repository_owner == 'Apicurio' && !contains(github.event.*.labels.*.name, 'DO NOT MERGE')
58-
steps:
59-
- name: Show Actor
60-
run: echo ${{github.actor}}
61-
- name: Checkout Code
62-
uses: actions/checkout@v3
63-
- name: Set up JDK 17
64-
uses: actions/setup-java@v3
65-
with:
66-
java-version: '17'
67-
distribution: 'temurin'
68-
cache: 'maven'
69-
70-
- name: Get maven wrapper
71-
run: mvn -N io.takari:maven:wrapper -Dmaven=3.8.2
72-
73-
- name: Build kafkasql Variant
74-
run: make SKIP_TESTS=true BUILD_FLAGS='-Dmaven.javadoc.skip=true --no-transfer-progress -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5' build-kafkasql
75-
76-
- name: Build and Push kafkasql image
77-
env:
78-
IMAGE_REPO: ttl.sh/${{ github.sha }}
79-
# maximum allowed
80-
IMAGE_TAG: 1d
81-
run: make build-kafkasql-image push-kafkasql-image
47+
- name: Build and Push Application image
48+
run: |
49+
docker build --push -f ./distro/docker/target/docker/Dockerfile.jvm -t ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d ./distro/docker/target/docker
8250
8351
prepare-ui-tests:
8452
name: Prepare for UI Integration Tests
@@ -91,33 +59,13 @@ jobs:
9159
- name: Checkout Code
9260
uses: actions/checkout@v3
9361

94-
- name: Set up JDK 17
95-
uses: actions/setup-java@v3
96-
with:
97-
java-version: '17'
98-
distribution: 'temurin'
99-
cache: 'maven'
100-
10162
- name: Set up Node
10263
uses: actions/setup-node@v3
10364
with:
10465
node-version: 16
10566
cache: 'npm'
10667
cache-dependency-path: 'ui/**/package-lock.json'
10768

108-
- name: Get maven wrapper
109-
run: mvn -N io.takari:maven:wrapper -Dmaven=3.8.2
110-
111-
- name: Build In-Memory Variant
112-
run: make SKIP_TESTS=true BUILD_FLAGS='-Dmaven.javadoc.skip=true --no-transfer-progress -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5' build-in-memory
113-
114-
- name: Build and Push In-Memory image
115-
env:
116-
IMAGE_REPO: ttl.sh/${{ github.sha }}
117-
# maximum allowed
118-
IMAGE_TAG: 1d
119-
run: make build-mem-image push-mem-image
120-
12169
- name: Install UI Dependencies
12270
run: |
12371
cd ui
@@ -144,10 +92,55 @@ jobs:
14492
docker build -t $IMAGE_REPO/apicurio/apicurio-registry-ui:$IMAGE_TAG .
14593
docker push $IMAGE_REPO/apicurio/apicurio-registry-ui:$IMAGE_TAG
14694
147-
integration-tests-sql:
148-
name: Integration Tests SQL
95+
integration-tests-h2:
96+
name: Integration Tests H2
97+
runs-on: ubuntu-20.04
98+
needs: prepare-integration-tests
99+
steps:
100+
- name: Checkout Code
101+
uses: actions/checkout@v3
102+
- name: Set up JDK 17
103+
uses: actions/setup-java@v3
104+
with:
105+
java-version: '17'
106+
distribution: 'temurin'
107+
cache: 'maven'
108+
109+
- name: Setup Minikube
110+
uses: manusa/actions-setup-minikube@v2.9.0
111+
with:
112+
minikube version: 'v1.31.1'
113+
kubernetes version: 'v1.26.3'
114+
github token: ${{ secrets.GITHUB_TOKEN }}
115+
driver: docker
116+
117+
- name: Prepare minikube tunnel
118+
run: minikube tunnel &> /dev/null &
119+
120+
- name: Run Integration Tests - H2
121+
run: ./mvnw -T 1.5C verify -am --no-transfer-progress -Pintegration-tests -Pci -Dregistry-mem-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-mem -pl integration-tests -Dmaven.javadoc.skip=true
122+
123+
- name: Run Integration Tests - auth - H2
124+
run: ./mvnw -T 1.5C verify -am --no-transfer-progress -Pintegration-tests -Pauth -Dregistry-mem-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-mem -pl integration-tests -Dmaven.javadoc.skip=true
125+
126+
- name: Run Integration Tests - migration - H2
127+
run: ./mvnw -T 1.5C verify -am --no-transfer-progress -Pintegration-tests -Pmigration -Dregistry-mem-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-mem -pl integration-tests -Dmaven.javadoc.skip=true
128+
129+
- name: Collect logs
130+
if: failure()
131+
run: ./.github/scripts/collect_logs.sh
132+
133+
- name: Upload tests logs artifacts
134+
if: failure()
135+
uses: actions/upload-artifact@v1.0.0
136+
with:
137+
name: tests-logs
138+
path: artifacts
139+
140+
integration-tests-postgresql:
141+
name: Integration Tests Postgresql
149142
runs-on: ubuntu-20.04
150-
needs: prepare-sql-tests
143+
needs: prepare-integration-tests
151144
steps:
152145
- name: Checkout Code
153146
uses: actions/checkout@v3
@@ -159,7 +152,7 @@ jobs:
159152
cache: 'maven'
160153

161154
- name: Setup Minikube
162-
uses: manusa/actions-setup-minikube@v2.7.2
155+
uses: manusa/actions-setup-minikube@v2.9.0
163156
with:
164157
minikube version: 'v1.31.1'
165158
kubernetes version: 'v1.26.3'
@@ -169,14 +162,14 @@ jobs:
169162
- name: Prepare minikube tunnel
170163
run: minikube tunnel &> /dev/null &
171164

172-
- name: Run Integration Tests - sql
173-
run: make REGISTRY_IMAGE='-Dregistry-sql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-sql:1d' run-sql-integration-tests
165+
- name: Run Integration Tests - Postgresql
166+
run: ./mvnw -T 1.5C verify -am --no-transfer-progress -Pintegration-tests -Pci -Dregistry-sql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-sql -pl integration-tests -Dmaven.javadoc.skip=true
174167

175-
- name: Run Integration Tests - sql - auth
176-
run: make REGISTRY_IMAGE='-Dregistry-sql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-sql:1d' run-sql-auth-tests
168+
- name: Run Integration Tests - auth - Postgresql
169+
run: ./mvnw -T 1.5C verify -am --no-transfer-progress -Pintegration-tests -Pauth -Dregistry-sql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-sql -pl integration-tests -Dmaven.javadoc.skip=true
177170

178-
- name: Run Integration Tests - sql - migration
179-
run: make REGISTRY_IMAGE='-Dregistry-sql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-sql:1d' run-sql-migration-integration-tests
171+
- name: Run Integration Tests - migration - Postgresql
172+
run: ./mvnw -T 1.5C verify -am --no-transfer-progress -Pintegration-tests -Pmigration -Dregistry-sql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-sql -pl integration-tests -Dmaven.javadoc.skip=true
180173

181174
- name: Collect logs
182175
if: failure()
@@ -189,10 +182,11 @@ jobs:
189182
name: tests-logs
190183
path: artifacts
191184

185+
192186
integration-tests-kafkasql:
193187
name: Integration Tests KafkaSql
194188
runs-on: ubuntu-20.04
195-
needs: prepare-kafkasql-tests
189+
needs: prepare-integration-tests
196190
steps:
197191
- name: Checkout Code
198192
uses: actions/checkout@v3
@@ -204,7 +198,7 @@ jobs:
204198
cache: 'maven'
205199

206200
- name: Setup Minikube
207-
uses: manusa/actions-setup-minikube@v2.7.2
201+
uses: manusa/actions-setup-minikube@v2.9.0
208202
with:
209203
minikube version: 'v1.31.1'
210204
kubernetes version: 'v1.26.3'
@@ -214,18 +208,19 @@ jobs:
214208
- name: Prepare minikube tunnel
215209
run: minikube tunnel &> /dev/null &
216210

217-
- name: Run Integration Tests - KafkaSql
218-
run: make REGISTRY_IMAGE='-Dregistry-kafkasql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-kafkasql:1d' run-kafkasql-integration-tests
211+
- name: Run Integration Tests - Kafkasql
212+
run: ./mvnw -T 1.5C verify -am --no-transfer-progress -Pintegration-tests -Pci -Dregistry-kafkasql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-kafka -pl integration-tests -Dmaven.javadoc.skip=true
219213

220-
- name: Run Integration Tests - KafkaSql - Migration
221-
run: make REGISTRY_IMAGE='-Dregistry-kafkasql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-kafkasql:1d' run-kafkasql-migration-integration-tests
214+
- name: Run Integration Tests - auth - Kafkasql
215+
run: ./mvnw -T 1.5C verify -am --no-transfer-progress -Pintegration-tests -Pauth -Dregistry-kafkasql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-kafka -pl integration-tests -Dmaven.javadoc.skip=true
222216

223-
- name: Run Integration Tests - KafkaSql - Auth
224-
run: make REGISTRY_IMAGE='-Dregistry-kafkasql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-kafkasql:1d' run-kafkasql-auth-tests
217+
- name: Run Integration Tests - migration - Kafkasql
218+
run: ./mvnw -T 1.5C verify -am --no-transfer-progress -Pintegration-tests -Pmigration -Dregistry-kafkasql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-kafka -pl integration-tests -Dmaven.javadoc.skip=true
225219

226220
- name: Collect logs
227221
if: failure()
228222
run: ./.github/scripts/collect_logs.sh
223+
229224
- name: Upload tests logs artifacts
230225
if: failure()
231226
uses: actions/upload-artifact@v1.0.0
@@ -236,7 +231,7 @@ jobs:
236231
integration-tests-ui:
237232
name: Integration Tests UI
238233
runs-on: ubuntu-20.04
239-
needs: prepare-ui-tests
234+
needs: [prepare-ui-tests, prepare-integration-tests]
240235
steps:
241236
- name: Checkout Code
242237
uses: actions/checkout@v3
@@ -251,7 +246,7 @@ jobs:
251246
- name: Run UI tests
252247
run: |
253248
echo "Starting Registry App (In Memory)"
254-
docker run -it -p 8080:8080 -d --env CORS_ALLOWED_ORIGINS=* ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-mem:1d
249+
docker run -it -p 8080:8080 -d --env CORS_ALLOWED_ORIGINS=* ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d
255250
echo "Starting Registry UI"
256251
docker run -it -p 8888:8080 -d ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-ui:1d
257252

.github/workflows/lint.yaml

-36
This file was deleted.

.github/workflows/operator.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Checkout Code
3030
uses: actions/checkout@v3
3131
- name: Setup Minikube-Kubernetes
32-
uses: manusa/actions-setup-minikube@v2.7.2
32+
uses: manusa/actions-setup-minikube@v2.9.0
3333
with:
3434
minikube version: v1.28.0
3535
kubernetes version: v1.25.0

0 commit comments

Comments
 (0)