-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Optimize][E2E] Optimize e2e code structure (#4130)
Co-authored-by: zackyoungh <[email protected]>
- Loading branch information
1 parent
06744f1
commit 4b60ab2
Showing
15 changed files
with
521 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -205,13 +205,28 @@ jobs: | |
localhost:5000/dinky/flink:flink | ||
- name: Init Env Jar | ||
run: | | ||
mkdir O e2e_test/docker-compose-env/dinky/jars | ||
wget -O e2e_test/docker-compose-env/dinky/mysql-connector-java-8.0.30.jar https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.30/mysql-connector-java-8.0.30.jar && | ||
wget -O e2e_test/docker-compose-env/flink/flink-shaded-hadoop-2-uber-2.8.3-10.0.jar https://repo1.maven.org/maven2/org/apache/flink/flink-shaded-hadoop-2-uber/2.8.3-10.0/flink-shaded-hadoop-2-uber-2.8.3-10.0.jar && | ||
wget -O e2e_test/docker-compose-env/dinky/javax.ws.rs-api-2.1.1.jar https://repo1.maven.org/maven2/javax/ws/rs/javax.ws.rs-api/2.1.1/javax.ws.rs-api-2.1.1.jar | ||
wget -O e2e_test/docker-compose-env/dinky/jars/flink-doris-connector.jar https://repo1.maven.org/maven2/org/apache/doris/flink-doris-connector-${{ matrix.flink }}/24.0.1/flink-doris-connector-${{ matrix.flink }}-24.0.1.jar | ||
wget -O e2e_test/docker-compose-env/dinky/jars/flink-sql-connector-mysql-cdc.jar https://repo1.maven.org/maven2/org/apache/flink/flink-sql-connector-mysql-cdc/3.2.0/flink-sql-connector-mysql-cdc-3.2.0.jar | ||
cp e2e_test/docker-compose-env/dinky/mysql-connector-java-8.0.30.jar e2e_test/docker-compose-env/dinky/jars/mysql-connector-java.jar | ||
- name: Init Run Docker MySQL | ||
uses: hoverkraft-tech/[email protected] | ||
with: | ||
compose-file: ./e2e_test/docker-compose-env/mysql/docker-compose.yml | ||
# - name: Init System Env And Clear Docker Build Cache | ||
# run: | | ||
# echo y | docker builder prune | ||
# df -h | ||
# ulimit -a | ||
# sudo swapoff -a | ||
# sudo sysctl -w vm.max_map_count=2000000 | ||
# - name: Init Run Docker Doris | ||
# uses: hoverkraft-tech/[email protected] | ||
# with: | ||
# compose-file: ./e2e_test/docker-compose-env/doris/docker-compose.yml | ||
- name: Init Run Docker Dinky | ||
uses: hoverkraft-tech/[email protected] | ||
with: | ||
|
@@ -228,7 +243,7 @@ jobs: | |
- name: Init k3s | ||
uses: nolar/setup-k3d-k3s@v1 | ||
with: | ||
version: v1.25.16+k3s4 | ||
version: latest | ||
k3d-args: -s 1 --network dinky_net --api-port 172.28.0.1:6550 | ||
- name: Get k3s kube config | ||
run: k3d kubeconfig get --all && mkdir ./kube && k3d kubeconfig get --all > ./kube/k3s.yaml && sed -i 's/0.0.0.0/172.28.0.1/g' ./kube/k3s.yaml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: "3" | ||
networks: | ||
dinky_net: | ||
external: true | ||
services: | ||
doris: | ||
image: yagagagaga/doris-standalone:2.1.7 | ||
hostname: doris | ||
container_name: doris | ||
networks: | ||
- dinky_net |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
set 'execution.checkpointing.interval'='5 s'; | ||
ADD CUSTOMJAR 'rs:/flink-sql-connector-mysql-cdc.jar'; | ||
ADD CUSTOMJAR 'rs:/mysql-connector-java.jar'; | ||
EXECUTE JAR WITH ( | ||
'uri'='rs:/flink-doris-connector.jar', | ||
'main-class'='org.apache.doris.flink.tools.cdc.CdcTools', | ||
'args'='base64@bXlzcWwtc3luYy1kYXRhYmFzZSAgICAgLS1kYXRhYmFzZSBkaW5reSAgICAgLS1teXNxbC1jb25mIGhvc3RuYW1lPW15c3FsICAgICAtLW15c3FsLWNvbmYgcG9ydD0zMzA2ICAgICAtLW15c3FsLWNvbmYgdXNlcm5hbWU9cm9vdCAgICAgLS1teXNxbC1jb25mIHBhc3N3b3JkPWRpbmt5ICAgICAtLW15c3FsLWNvbmYgZGF0YWJhc2UtbmFtZT1kaW5reSAgICAgLS1teXNxbC1jb25mIHNlcnZlci10aW1lLXpvbmU9QXNpYS9TaGFuZ2hhaSAgICAgLS1pbmNsdWRpbmctdGFibGVzICJkaW5reV90YXNrIiAgICAgLS1zaW5rLWNvbmYgZmVub2Rlcz1kb3Jpcy1mZTo4MDMwICAgICAtLXNpbmstY29uZiB1c2VybmFtZT1yb290ICAgICAtLXNpbmstY29uZiBqZGJjLXVybD1qZGJjOm15c3FsOi8vZG9yaXMtZmU6OTAzMCAgICAgLS1zaW5rLWNvbmYgc2luay5sYWJlbC1wcmVmaXg9bGFiZWwtMSAgICAgLS10YWJsZS1jb25mIHJlcGxpY2F0aW9uX251bT0xIA==', | ||
'allowNonRestoredState'='false' | ||
); |
59 changes: 59 additions & 0 deletions
59
e2e_test/tools/dinky_task/flink_sql/flink-sql-datagen-test.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
DROP TABLE IF EXISTS source_table3; | ||
|
||
CREATE TABLE IF NOT EXISTS source_table3 ( | ||
-- 订单id | ||
`order_id` BIGINT, | ||
--产品 | ||
`product` BIGINT, | ||
--金额 | ||
`amount` BIGINT, | ||
-- 支付时间 | ||
`order_time` as CAST(CURRENT_TIMESTAMP AS TIMESTAMP(3)), -- `在这里插入代码片` | ||
--WATERMARK | ||
WATERMARK FOR order_time AS order_time - INTERVAL '2' SECOND | ||
) | ||
WITH | ||
( | ||
'connector' = 'datagen', | ||
'rows-per-second' = '1', | ||
'fields.order_id.min' = '1', | ||
'fields.order_id.max' = '2', | ||
'fields.amount.min' = '1', | ||
'fields.amount.max' = '10', | ||
'fields.product.min' = '1', | ||
'fields.product.max' = '2' | ||
); | ||
|
||
-- SELECT * FROM source_table3 LIMIT 10; | ||
DROP TABLE IF EXISTS sink_table5; | ||
|
||
CREATE TABLE IF NOT EXISTS sink_table5 ( | ||
--产品 | ||
`product` BIGINT, | ||
--金额 | ||
`amount` BIGINT, | ||
--支付时间 | ||
`order_time` TIMESTAMP(3), | ||
-- 1分钟时间聚合总数 | ||
`one_minute_sum` BIGINT | ||
) | ||
WITH | ||
('connector' = 'print'); | ||
|
||
INSERT INTO | ||
sink_table5 | ||
SELECT | ||
product, | ||
amount, | ||
order_time, | ||
SUM(amount) OVER ( | ||
PARTITION BY | ||
product | ||
ORDER BY | ||
order_time | ||
-- 标识统计范围是1个 product 的最近 1 分钟的数据 | ||
RANGE BETWEEN INTERVAL '1' MINUTE PRECEDING | ||
AND CURRENT ROW | ||
) as one_minute_sum | ||
FROM | ||
source_table3; |
Oops, something went wrong.