Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add deploy action #27

Merged
merged 37 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
3be8762
add deploy action
Dec 25, 2023
db1ebda
add deploy action
Dec 25, 2023
ee0efac
Merge branch 'main' into add_deploy_action
qdaxb Dec 25, 2023
079e895
add deploy action
Dec 28, 2023
51d9e28
Merge remote-tracking branch 'origin/add_deploy_action' into add_depl…
Dec 28, 2023
e7106f3
add deploy action
Dec 28, 2023
c208a2b
add deploy action
Dec 28, 2023
a5e7d21
add deploy action
Dec 28, 2023
9ccdfd1
add deploy action
Dec 28, 2023
6c90182
add deploy action
Dec 28, 2023
0be8ba1
add deploy action
Dec 28, 2023
4b6c00f
add deploy action
Dec 28, 2023
1579cb4
add deploy action
Dec 28, 2023
01b0ec0
add deploy action
Dec 28, 2023
7d9d4f4
add deploy action
Dec 28, 2023
d344346
add deploy action
Dec 29, 2023
8e63ce1
fix deploy action
Jan 10, 2024
bee3dc9
fix deploy action
Jan 11, 2024
4fb808d
fix deploy action
Jan 11, 2024
51a1942
fix deploy action
Jan 11, 2024
b65aba3
fix deploy action
Jan 11, 2024
4c878c7
fix deploy action
Jan 11, 2024
1a50e50
fix deploy action
Jan 11, 2024
c17da85
fix deploy action
Jan 11, 2024
b17eed1
fix deploy action
Jan 11, 2024
3e9b0c2
fix deploy action
Jan 11, 2024
443e3f1
add helm action
Jan 12, 2024
ec73bcd
add helm action
Jan 12, 2024
a1f9a38
fix deploy action
Jan 16, 2024
ab75e39
fix deploy action
Jan 16, 2024
61c6378
fix deploy action
Jan 16, 2024
2b694bc
fix deploy action
Jan 16, 2024
3512890
fix deploy action
Jan 16, 2024
e95a170
fix deploy action
Jan 16, 2024
2429b9e
fix deploy action
Jan 16, 2024
10d1501
fix deploy action
Jan 25, 2024
d5e29d2
Merge branch 'main' into add_deploy_action
qdaxb Feb 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
174 changes: 174 additions & 0 deletions .github/workflows/deploy-run-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
name: Deploy and Test
on:
push:
branches:
- main
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
test:
name: Deploy and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Maven
run: |
sudo apt-get update
sudo apt-get install -y maven
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setupjdk里包含maven

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'

- name: Build and package
run: mvn clean package -am && echo "Maven Build and package succeeded" || { echo "Maven Build and package failed."; exit 1; }

- name: Run Internal Test
run: mvn test && echo "Maven Run Internal Test succeeded"|| { echo "Run Internal Test failed."; exit 1; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package包含test


- name: Install Docker Compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

- name: Deploy with Docker Compose
run: |
cd docker
docker-compose up -d

- name: Wait for service to start
run: sleep 2s

- name: Run API Test
run: |
set response $(curl --location 'http://localhost:8080/flow/bg/manage/descriptor/add_descriptor.json?business_id=rillFlowSample&feature_name=choiceSample&alias=release' \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该用测试框架执行测试。

--header 'Content-Type: text/plain' \
--data-raw "$(cat docs/samples/choice-sample.yaml)")

if [[ "$?" -ne 0 ]]; then
echo "Failed to connect to server. API choiceSample add descriptor test failed."
exit 1
fi

if [[ "$response" != *"\"error_code\":"* ]]; then
echo "API choiceSample add descriptor test succeeded."
else
echo "API choiceSample add descriptor test failed. Response: $response"
exit 1
fi

set response $(curl --location 'http://localhost:8080/flow/submit.json?descriptor_id=rillFlowSample:choiceSample' \
--header 'Content-Type: application/json' \
--data '{"input_num":10}')

if [[ "$?" -ne 0 ]]; then
echo "Failed to connect to server. API choiceSample submit test failed."
exit 1
fi

if [[ "$response" != *"\"error_code\":"* ]]; then
echo "API choiceSample submit test succeeded."
else
echo "API choiceSample submit test failed. Response: $response"
exit 1
fi

set response $(curl --location 'http://localhost:8080/flow/bg/manage/descriptor/add_descriptor.json?business_id=rillFlowSample&feature_name=callApiSample&alias=release' \
--header 'Content-Type: text/plain' \
--data-raw "$(cat docs/samples/call-api-sample.yaml)")

if [[ "$?" -ne 0 ]]; then
echo "Failed to connect to server. API callApiSample add descriptor test failed."
exit 1
fi

if [[ "$response" != *"\"error_code\":"* ]]; then
echo "API callApiSample add descriptor test succeeded."
else
echo "API callApiSample add descriptor test failed. Response: $response"
exit 1
fi

set response $(curl --location 'http://localhost:8080/flow/submit.json?descriptor_id=rillFlowSample:callApiSample' \
--header 'Content-Type: application/json' \
--data '{"input_num":10}')

if [[ "$?" -ne 0 ]]; then
echo "Failed to connect to server. API callApiSample submit test failed."
exit 1
fi

if [[ "$response" != *"\"error_code\":"* ]]; then
echo "API callApiSample submit test succeeded."
else
echo "API callApiSample submit test failed. Response: $response"
exit 1
fi

set response $(curl --location 'http://localhost:8080/flow/bg/manage/descriptor/add_descriptor.json?business_id=rillFlowSample&feature_name=parallelAsyncTask&alias=release' \
--header 'Content-Type: text/plain' \
--data-raw "$(cat docs/samples/parallel-async-dag.yaml)")

if [[ "$?" -ne 0 ]]; then
echo "Failed to connect to server. API parallelAsyncTask add descriptor test failed."
exit 1
fi

if [[ "$response" != *"\"error_code\":"* ]]; then
echo "API parallelAsyncTask add descriptor test succeeded."
else
echo "API parallelAsyncTask add descriptor test failed. Response: $response"
exit 1
fi

set response $(curl --location 'http://localhost:8080/flow/submit.json?descriptor_id=rillFlowSample:parallelAsyncTask' \
--header 'Content-Type: application/json' \
--data '{"rand_num":20}')

if [[ "$?" -ne 0 ]]; then
echo "Failed to connect to server. API parallelAsyncTask submit test failed."
exit 1
fi

if [[ "$response" != *"\"error_code\":"* ]]; then
echo "API parallelAsyncTask submit test succeeded."
else
echo "API parallelAsyncTask submit test failed. Response: $response"
exit 1
fi

set response $(curl --location 'http://localhost:8080/flow/bg/manage/descriptor/add_descriptor.json?business_id=rillFlowSample&feature_name=subdagTask&alias=release' \
--header 'Content-Type: text/plain' \
--data-raw "$(cat docs/samples/ref-dag.yaml)")

if [[ "$?" -ne 0 ]]; then
echo "Failed to connect to server. API subdagTask add descriptor test failed."
exit 1
fi

if [[ "$response" != *"\"error_code\":"* ]]; then
echo "API subdagTask add descriptor test succeeded."
else
echo "API subdagTask add descriptor test failed. Response: $response"
exit 1
fi

set response $(curl --location 'http://localhost:8080/flow/submit.json?descriptor_id=rillFlowSample:subdagTask' \
--header 'Content-Type: application/json' \
--data '{"parent_rand_num":20}')

if [[ "$?" -ne 0 ]]; then
echo "Failed to connect to server. API subdagTask submit test failed."
exit 1
fi

if [[ "$response" != *"\"error_code\":"* ]]; then
echo "API subdagTask submit test succeeded."
else
echo "API subdagTask submit test failed. Response: $response"
exit 1
fi

35 changes: 35 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: '3'
services:
rill-flow:
image: weibocom/rill-flow
depends_on:
- cache
- jaeger
ports:
- "8080:8080"
environment:
- RILL_FLOW_DESCRIPTOR_REDIS_HOST=cache
- RILL_FLOW_DEFAULT_REDIS_HOST=cache
- RILL_FLOW_TRACE_ENDPOINT=http://jaeger:4317
- RILL_FLOW_CALLBACK_URL=http://rill-flow:8080/flow/finish.json
- RILL_FLOW_TRACE_QUERY_HOST=http://jaeger:16686
cache:
image: redis:6.2-alpine
restart: always
command: redis-server --save 20 1 --loglevel warning
jaeger:
image: jaegertracing/all-in-one:1.39
restart: always
environment:
- COLLECTOR_OTLP_ENABLED=true
ui:
image: weibocom/rill-flow-ui
ports:
- "8088:80"
depends_on:
- rill-flow
- jaeger
environment:
- BACKEND_SERVER=http://rill-flow:8080
sample-executor:
image: weibocom/rill-flow-sample:sample-executor