Skip to content

Commit

Permalink
fix iceberg-cdc integration_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ZENOTME committed Oct 27, 2023
1 parent 46d2ff9 commit 59396f8
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ services:
- "./mysql_prepare.sql:/mysql_prepare.sql"
container_name: prepare_mysql
restart: on-failure
datagen:
build: ../datagen
depends_on: [mysql]
command:
- /bin/sh
- -c
- /datagen --mode clickstream --qps 1 mysql --user mysqluser --password mysqlpw --host mysql --port 3306 --db mydb
container_name: datagen
restart: on-failure

rest:
image: tabulario/iceberg-rest:0.6.0
Expand Down
12 changes: 12 additions & 0 deletions integration_tests/iceberg-cdc/python/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3.8

RUN curl -sSL https://install.python-poetry.org | python3 -

WORKDIR /app

COPY script /app

RUN $HOME/.local/bin/poetry update

CMD $HOME/.local/bin/poetry run python init.py;sleep 40;$HOME/.local/bin/poetry run python check.py

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[spark]
url=sc://localhost:15002
url=sc://spark:15002

[risingwave]
db=dev
user=root
host=127.0.0.1
host=frontend-node-0
port=4566
14 changes: 4 additions & 10 deletions integration_tests/iceberg-cdc/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@ docker-compose up -d --wait
# To avoid exiting by unhealth, set it after start environment.
set -ex

# Generate data
docker build -t iceberg-cdc-datagen ../datagen
timeout 20 docker run --network=iceberg-cdc_default iceberg-cdc-datagen /datagen --mode clickstream --qps 1 mysql --user mysqluser --password mysqlpw --host mysql --port 3306 --db mydb &
sleep 20
docker stop datagen

cd python
poetry update --quiet
# Init source, mv, and sink.
poetry run python init.py
# Wait for sink to be finished.
sleep 40;
poetry run python check.py
docker build -t iceberg-cdc-python python
docker run --network=iceberg-cdc_default iceberg-cdc-python
2 changes: 1 addition & 1 deletion integration_tests/scripts/check_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def run_psql(sql):

demo = sys.argv[1]
upstream = sys.argv[2] # mysql, postgres, etc. see scripts/integration_tests.sh
if demo in ['docker', 'iceberg-sink','clickhouse-sink']:
if demo in ['docker', 'iceberg-sink','clickhouse-sink', 'iceberg-cdc']:
print('Skip for running test for `%s`' % demo)
sys.exit(0)

Expand Down

0 comments on commit 59396f8

Please sign in to comment.