Skip to content

Commit

Permalink
DBZ-3226: Cover kinesis sink in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Sgitario committed Dec 18, 2024
1 parent 4c214e2 commit e8bfea2
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/cross-maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
strategy:
fail-fast: false
matrix:
sink: [ redis ]
sink: [ redis, kinesis ]
needs: build
steps:
- name: Set up JDK
Expand All @@ -109,12 +109,18 @@ jobs:
# Start Up dependant services
docker compose -f $CONFIG_FOLDER/docker-compose.yml up -d
if [[ -f "$CONFIG_FOLDER/post-script.sh" ]]; then
$CONFIG_FOLDER/post-script.sh
fi
# Copy configuration file
cp $CONFIG_FOLDER/application.properties $DISTRIBUTION_FOLDER/config/application.properties
# Run debezium server at background
docker run --name server-$SINK -d -v $DISTRIBUTION_FOLDER:/opt:z -p 8080:8080 --network debezium-backend -w /opt registry.access.redhat.com/ubi8/openjdk-21 ./run.sh
if [[ -f "$CONFIG_FOLDER/.env" ]]; then
ENV_ARGS="--env-file $CONFIG_FOLDER/.env"
fi
docker run --name server-$SINK -d -v $DISTRIBUTION_FOLDER:/opt:z -p 8080:8080 --network debezium-backend -w /opt $ENV_ARGS registry.access.redhat.com/ubi8/openjdk-21 ./run.sh
# Verify
timeout 60 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8080/q/health)" != "200" ]]; do sleep 5; done' || false
Expand Down
2 changes: 2 additions & 0 deletions debezium-server-dist/src/test/resources/kinesis/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
AWS_ACCESS_KEY_ID=test
AWS_SECRET_ACCESS_KEY=test
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Docker file used by GitHub actions to verify the debezium-server-dist works.
debezium.sink.type=kinesis
debezium.sink.kinesis.region=eu-central-1
debezium.source.connector.class=io.debezium.connector.postgresql.PostgresConnector
debezium.source.offset.storage.file.filename=data/offsets.dat
debezium.source.offset.flush.interval.ms=0
debezium.source.database.hostname=postgres
debezium.source.database.port=5432
debezium.source.database.user=postgres
debezium.source.database.password=postgres
debezium.source.database.dbname=postgres
debezium.source.topic.prefix=tutorial
debezium.source.schema.include.list=inventory
quarkus.log.console.json=false
21 changes: 21 additions & 0 deletions debezium-server-dist/src/test/resources/kinesis/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Docker file used by GitHub actions to verify the debezium-server-dist works.
services:
postgres:
image: quay.io/debezium/example-postgres:3.0
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
networks:
- backend
localstack:
image: localstack/localstack:4.0
ports:
- "4566:4566" # LocalStack Gateway
- "4510-4559:4510-4559" # external services port range
networks:
- backend
networks:
backend:
name: debezium-backend
17 changes: 17 additions & 0 deletions debezium-server-dist/src/test/resources/kinesis/post-script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

STREAMS=('tutorial.inventory.customers'
'tutorial.inventory.products'
'tutorial.inventory.geom'
'tutorial.inventory.products_on_hand'
'tutorial.inventory.orders')
REGION=eu-central-1

for stream in ${STREAMS[@]}
do
echo "Creating stream '$stream' in Kinesis"
docker exec kinesis-localstack-1 awslocal kinesis create-stream --stream-name $stream --region $REGION
done

echo "List all the streams in Kinesis"
docker exec kinesis-localstack-1 awslocal kinesis list-streams --region $REGION

0 comments on commit e8bfea2

Please sign in to comment.