-
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.
Merge branch 'DataLinkDC:dev' into dev
- Loading branch information
Showing
22 changed files
with
445 additions
and
143 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 |
---|---|---|
|
@@ -155,7 +155,7 @@ jobs: | |
strategy: | ||
fail-fast: true | ||
matrix: | ||
flink: [ '1.14', '1.15', '1.16', '1.17', '1.18', '1.19', '1.20' ] | ||
flink: [ '1.15', '1.16', '1.17', '1.18', '1.19', '1.20' ] | ||
runs-on: ubuntu-latest | ||
services: | ||
registry: | ||
|
@@ -165,6 +165,9 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Init Docker Network | ||
run: | | ||
docker network create -d bridge --subnet 172.28.0.0/16 --gateway 172.28.0.1 dinky_net | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
|
@@ -189,14 +192,22 @@ jobs: | |
FLINK_VERSION=${{ matrix.flink }} | ||
tags: | | ||
localhost:5000/dinky/dinky-test:flink | ||
- name: Build Flink Image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./e2e_test/docker-compose-env/FlinkDockerfile | ||
# 是否 docker push | ||
push: true | ||
build-args: | | ||
FLINK_VERSION=${{ matrix.flink }} | ||
tags: | | ||
localhost:5000/dinky/flink:flink | ||
- name: Init Env Jar | ||
run: | | ||
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 | ||
- name: Init Docker Network | ||
run: | | ||
docker network create -d bridge dinky_net | ||
- name: Init Run Docker MySQL | ||
uses: hoverkraft-tech/[email protected] | ||
with: | ||
|
@@ -209,16 +220,53 @@ jobs: | |
uses: hoverkraft-tech/[email protected] | ||
with: | ||
compose-file: ./e2e_test/docker-compose-env/hadoop/docker-compose.yml | ||
- name: Replace Flink docker-compose yml | ||
run: | | ||
export FLINK_VERSION=${{ matrix.flink }} && envsubst < ./e2e_test/docker-compose-env/flink/docker-compose.yml > ./e2e_test/docker-compose-env/flink/docker-compose-${{ matrix.flink }}.yml | ||
- name: Init Run Docker Flink | ||
uses: hoverkraft-tech/[email protected] | ||
with: | ||
compose-file: ./e2e_test/docker-compose-env/flink/docker-compose-${{ matrix.flink }}.yml | ||
|
||
compose-file: ./e2e_test/docker-compose-env/flink/docker-compose.yml | ||
# k8s env | ||
- name: Init k3s | ||
uses: nolar/setup-k3d-k3s@v1 | ||
with: | ||
version: v1.25.16+k3s4 | ||
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 | ||
- name: Init k8s RBAC and namespace | ||
run: | | ||
kubectl create namespace dinky | ||
kubectl create serviceaccount dinky -n dinky | ||
kubectl create clusterrolebinding flink-role-binding-dinky --clusterrole=edit --serviceaccount=dinky:dinky | ||
- name: Init k3s main images | ||
run: | | ||
docker exec k3d-k3s-default-server-0 crictl pull library/busybox:latest | ||
docker exec k3d-k3s-default-server-0 crictl pull flink:${{ matrix.flink }}-scala_2.12-java8 | ||
docker pull localhost:5000/dinky/flink:flink | ||
docker tag localhost:5000/dinky/flink:flink dinky/flink:flink | ||
docker save -o flink.tar dinky/flink:flink | ||
k3d images import ./flink.tar | ||
rm -rf ./flink.tar | ||
- name: Test k3s host | ||
run: | | ||
curl -k https://172.28.0.1:6550 | ||
- name: Cp Flink Jar Deps | ||
run: docker cp dinky:/opt/dinky/ ./dinky-release | ||
run: | | ||
docker cp dinky:/opt/dinky/ ./dinky-release | ||
mv ./dinky-release/jar/dinky-app*.jar e2e_test/docker-compose-env/dinky/dinky-app.jar | ||
- name: Run python http server | ||
run: | | ||
mkdir -p logs | ||
ls e2e_test/docker-compose-env/dinky/ | ||
nohup python -m http.server -d e2e_test/docker-compose-env/dinky/ 9001 > ./logs/python_http.log & | ||
- name: Run Docker Python Script | ||
run: | | ||
docker run -v ./dinky-release/extends/flink${{ matrix.flink }}:/flink/lib -v ./e2e_test/docker-compose-env/dinky/mysql-connector-java-8.0.30.jar:/flink/lib/mysql-connector-java-8.0.30.jar -v./e2e_test/docker-compose-env/flink/conf:/flink/conf -v ./dinky-release/jar:/dinky/jar -v./e2e_test/tools:/app -w /app --net dinky_net --rm --entrypoint /bin/bash python:3.9 -c 'pip install -r requirements.txt && python main.py dinky:8888' | ||
docker run -v ./e2e_test/tools:/app -w /app -v ./kube:/kube -v ./e2e_test/docker-compose-env/dinky:/dinky/jar -v ./dinky-release/extends/flink${{ matrix.flink }}:/opt/flink/lib -v ./e2e_test/docker-compose-env/dinky/mysql-connector-java-8.0.30.jar:/opt/flink/lib/mysql-connector-java-8.0.30.jar --net dinky_net --rm --entrypoint /bin/bash python:3.9 -c 'pip install -r requirements.txt && python main.py dinky:8888 ${{ matrix.flink }}' | ||
- name: Get k8s pods info and logs | ||
if: ${{ always() }} | ||
run: | | ||
chmod -R 755 ./e2e_test/view_k8s_all_pod_logs.sh | ||
./e2e_test/view_k8s_all_pod_logs.sh dinky | ||
- name: Get Python HttpServer log | ||
if: ${{ always() }} | ||
run: | | ||
cat ./logs/python_http.log |
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
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
Oops, something went wrong.