Skip to content

Commit 2cdf00e

Browse files
authored
Merge pull request #1764 from lilai23/2.2.x
update 2.2.x
2 parents abfc06b + 3a6a884 commit 2cdf00e

File tree

161 files changed

+4466
-608
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+4466
-608
lines changed

.github/actions/common/backend/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,12 @@ runs:
4646
uses: actions/setup-python@v5
4747
with:
4848
python-version: '3.10'
49+
- name: install requests
50+
shell: bash
51+
run: |
52+
pip install requests
53+
- name: download agent
54+
uses: actions/cache@v4
55+
with:
56+
path: sermant-agent-*/
57+
key: ${{ runner.os }}-agent-${{ github.run_id }}

.github/actions/common/plugin-change-check/action.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,14 @@ runs:
530530
id: changed-dubbo-common-action
531531
with:
532532
paths: ./.github/actions/scenarios/dubbo/dubbo-common ./.github/actions/common/dubbo ./.github/workflows/dubbo_integration_test.yml
533+
- uses: ktamas77/has-changed-path@v1.0.3
534+
id: changed-dubbo3-flow-action
535+
with:
536+
paths: ./.github/actions/scenarios/dubbo/flow-dubbo3 ./.github/actions/common/dubbo ./.github/workflows/dubbo_integration_test.yml
537+
- name: env dubbo3-flow-action
538+
shell: bash
539+
run: |
540+
echo "enableDubbo3FlowActionChange=${{ steps.changed-dubbo3-flow-action.outputs.changed }}" >> $GITHUB_ENV
533541
- name: env dubbo-router-action
534542
shell: bash
535543
run: |
@@ -678,6 +686,13 @@ runs:
678686
echo "enableDubboLane=true" >> $GITHUB_ENV
679687
echo "enableDubbo3Lane=true" >> $GITHUB_ENV
680688
fi
689+
# ==========dubbo3 flow is needed to test?==========
690+
if [ ${{ env.sermantAgentCoreChanged }} == 'true' -o ${{ env.sermantFlowcontrolChanged }} == 'true' -o \
691+
${{ env.enableDubbo3FlowActionChange }} == 'true' -o \
692+
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' -o \
693+
${{ env.enableDubboTestChange }} == 'true' ];then
694+
echo "enableDubbo3Flow=true" >> $GITHUB_ENV
695+
fi
681696
682697
# *****************spring_integration_test_1.yml*****************
683698
# ==========graceful is needed to test?==========
@@ -932,13 +947,13 @@ runs:
932947
# ==========dynamic config service is needed to test?==========
933948
if [ ${{ env.sermantAgentCoreDynamicConfigServiceChanged }} == 'true' -o \
934949
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
935-
echo "enableDynamicConfigServicAction=true" >> $GITHUB_ENV
950+
echo "enableDynamicConfigServiceAction=true" >> $GITHUB_ENV
936951
fi
937952
938953
# ==========xds service is needed to test?==========
939954
if [ ${{ env.sermantAgentCoreXdsServiceChanged }} == 'true' -o \
940955
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
941-
echo "enableXdsServicAction=true" >> $GITHUB_ENV
956+
echo "enableXdsServiceAction=true" >> $GITHUB_ENV
942957
fi
943958
944959
# ==========mq grayscale rocketmq is needed to test?==========
@@ -947,3 +962,10 @@ runs:
947962
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' ];then
948963
echo "enableMqGrayscaleRocketMqAction=true" >> $GITHUB_ENV
949964
fi
965+
966+
# ==========xds service is needed to test?==========
967+
if [ ${{ env.sermantAgentCoreXdsServiceChanged }} == 'true' -o \
968+
${{ steps.changed-common-action.outputs.changed }} == 'true' -o ${{ env.triggerPushEvent }} == 'true' -o \
969+
${{ env.sermantFlowcontrolChanged }} == 'true'];then
970+
echo "enableXdsFlowControl=true" >> $GITHUB_ENV
971+
fi

.github/actions/scenarios/backend/config/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ description: "Auto test for Backend"
33
runs:
44
using: "composite"
55
steps:
6+
- name: entry
7+
uses: ./.github/actions/common/entry
8+
with:
9+
log-dir: ./logs/backend-config
610
- name: start backend with zookeeper
711
shell: bash
812
env:

.github/actions/scenarios/backend/event/memory/action.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,13 @@ description: "Auto test for Backend"
33
runs:
44
using: "composite"
55
steps:
6-
- name: download agent
7-
uses: actions/cache@v4
8-
with:
9-
path: sermant-agent-*/
10-
key: ${{ runner.os }}-agent-${{ github.run_id }}
116
- name: package dubbo 2.6.0 tests
127
shell: bash
138
run: mvn package -Dalibaba.dubbo.version=2.6.0 -DskipTests -P260 --file sermant-integration-tests/dubbo-test/pom.xml
149
- name: entry
1510
uses: ./.github/actions/common/entry
1611
with:
17-
log-dir: ./logs/backend
12+
log-dir: ./logs/backend-memory
1813
- name: start backend with memory
1914
shell: bash
2015
run: |
@@ -39,10 +34,6 @@ runs:
3934
shell: bash
4035
run: |
4136
netstat -nlp | grep :28021 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
42-
- name: install requests
43-
shell: bash
44-
run: |
45-
pip install requests
4637
- name: start test
4738
shell: bash
4839
run: |

.github/actions/scenarios/backend/event/redis/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ runs:
66
- name: entry
77
uses: ./.github/actions/common/entry
88
with:
9-
log-dir: ./logs/backend
9+
log-dir: ./logs/backend-redis
1010
- name: install redis
1111
shell: bash
1212
run: |
Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
name: "Test external agent management"
2+
description: "Auto test for external agent"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: entry
7+
uses: ./.github/actions/common/entry
8+
with:
9+
log-dir: ./logs/backend-external-agent
10+
- name: compile AgentLoader
11+
shell: bash
12+
run: |
13+
cp sermant-integration-tests/scripts/AgentLoader.java ./
14+
javac -classpath ./:${{ env.JAVA_HOME}}/lib/tools.jar AgentLoader.java
15+
- name: download opentelemetry agent
16+
uses: actions/cache@v4
17+
with:
18+
path: opentelemetry-javaagent.jar
19+
key: ${{ runner.os }}-opentelemetry-javaagent.jar
20+
restore-keys: |
21+
${{ runner.os }}-opentelemetry-javaagent.jar
22+
- name: start backend with zookeeper
23+
shell: bash
24+
env:
25+
DYNAMIC_CONFIG_SERVERADDRESS: 127.0.0.1:2181
26+
DYNAMIC_CONFIG_DYNAMICCONFIGTYPE: ZOOKEEPER
27+
DYNAMIC_CONFIG_ENABLE: true
28+
NETTY_PORT: 6894
29+
SERVER_PORT: 8910
30+
MAX_EFFECTIVE_TIME: 20000
31+
run: |
32+
nohup java -jar sermant-agent-${{ env.sermantVersion }}/server/sermant/sermant-backend-${{ env.sermantVersion }}.jar &
33+
sleep 20
34+
35+
- name: start application with sermant agent without external agent
36+
shell: bash
37+
env:
38+
dynamic.config.serverAddress: 127.0.0.1:2181
39+
dynamic.config.dynamicConfigType: ZOOKEEPER
40+
service.meta.project: TestAgentCore
41+
run: |
42+
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar \
43+
-Dserver.port=8915 \
44+
-Dagent.config.externalAgent.injection=false \
45+
-Dagent.service.heartbeat.enable=true \
46+
-Dagent.service.gateway.enable=true \
47+
-Devent.enable=true \
48+
-Dgateway.nettyPort=6894 \
49+
-Dheartbeat.interval=5000 \
50+
-jar sermant-agent-${{ env.sermantVersion }}/agent/agentcore-test-application-1.0.0-jar-with-dependencies.jar > ${{ env.logDir }}/agentcore-test.log 2>&1 &
51+
- name: waiting for application start
52+
shell: bash
53+
run: |
54+
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8915/ping 120
55+
- name: test start with sermant agent without external agent
56+
shell: bash
57+
run: |
58+
export TEST_MODE=startWithoutExternalAgent
59+
python -m unittest ./sermant-integration-tests/scripts/test_backend_external_agent.py
60+
- name: stop application
61+
shell: bash
62+
run: |
63+
netstat -nlp | grep :8915 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
64+
sleep 3
65+
- name: start application with sermant agent and external agent
66+
shell: bash
67+
env:
68+
dynamic.config.serverAddress: 127.0.0.1:2181
69+
dynamic.config.dynamicConfigType: ZOOKEEPER
70+
service.meta.project: TestAgentCore
71+
run: |
72+
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar \
73+
-Dserver.port=8916 \
74+
-Dagent.config.externalAgent.injection=true \
75+
-Dagent.config.externalAgent.name=OTEL \
76+
-Dagent.config.externalAgent.file=opentelemetry-javaagent.jar \
77+
-Dagent.service.heartbeat.enable=true \
78+
-Dagent.service.gateway.enable=true \
79+
-Devent.enable=true \
80+
-Dgateway.nettyPort=6894 \
81+
-Dheartbeat.interval=5000 \
82+
-jar sermant-agent-${{ env.sermantVersion }}/agent/agentcore-test-application-1.0.0-jar-with-dependencies.jar > ${{ env.logDir }}/agentcore-test.log 2>&1 &
83+
- name: waiting for application start
84+
shell: bash
85+
run: |
86+
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8916/ping 120
87+
- name: test start with sermant agent and external agent
88+
shell: bash
89+
run: |
90+
export TEST_MODE=startWithExternalAgent
91+
python -m unittest ./sermant-integration-tests/scripts/test_backend_external_agent.py
92+
- name: stop application
93+
shell: bash
94+
run: |
95+
netstat -nlp | grep :8916 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
96+
sleep 3
97+
- name: start application alone
98+
shell: bash
99+
env:
100+
dynamic.config.serverAddress: 127.0.0.1:2181
101+
dynamic.config.dynamicConfigType: ZOOKEEPER
102+
service.meta.project: TestAgentCore
103+
run: |
104+
nohup java -Dserver.port=8917 \
105+
-jar sermant-agent-${{ env.sermantVersion }}/agent/agentcore-test-application-1.0.0-jar-with-dependencies.jar > ${{ env.logDir }}/agentcore-test.log 2>&1 &
106+
- name: waiting for application start
107+
shell: bash
108+
run: |
109+
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8917/ping 120
110+
sleep 10
111+
- name: dynamic install external agent
112+
shell: bash
113+
run: java -classpath ./:${{ env.JAVA_HOME}}/lib/tools.jar AgentLoader sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar \
114+
command=INSTALL-EXTERNAL-AGENT:OTEL,AGENT_FILE=opentelemetry-javaagent.jar,agent.service.heartbeat.enable=true,agent.service.gateway.enable=true,event.enable=true,gateway.nettyPort=6894,heartbeat.interval=5000
115+
- name: test install external agent by attach in case of sermant agent is not installed
116+
shell: bash
117+
run: |
118+
export TEST_MODE=installByAttach
119+
python -m unittest ./sermant-integration-tests/scripts/test_backend_external_agent.py
120+
- name: stop application
121+
shell: bash
122+
run: |
123+
netstat -nlp | grep :8917 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
124+
sleep 3
125+
- name: start application with sermant agent without external agent
126+
shell: bash
127+
env:
128+
dynamic.config.serverAddress: 127.0.0.1:2181
129+
dynamic.config.dynamicConfigType: ZOOKEEPER
130+
service.meta.project: TestAgentCore
131+
run: |
132+
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar \
133+
-Dserver.port=8918 \
134+
-Dagent.config.externalAgent.injection=false \
135+
-Dagent.service.heartbeat.enable=true \
136+
-Dagent.service.gateway.enable=true \
137+
-Devent.enable=true \
138+
-Dgateway.nettyPort=6894 \
139+
-Dheartbeat.interval=5000 \
140+
-jar sermant-agent-${{ env.sermantVersion }}/agent/agentcore-test-application-1.0.0-jar-with-dependencies.jar > ${{ env.logDir }}/agentcore-test.log 2>&1 &
141+
- name: waiting for application start
142+
shell: bash
143+
run: |
144+
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8918/ping 120
145+
- name: dynamic install external agent
146+
shell: bash
147+
run: java -classpath ./:${{ env.JAVA_HOME}}/lib/tools.jar AgentLoader sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar \
148+
command=INSTALL-EXTERNAL-AGENT:OTEL,AGENT_FILE=opentelemetry-javaagent.jar,agent.service.heartbeat.enable=true,agent.service.gateway.enable=true,event.enable=true,gateway.nettyPort=6894
149+
- name: test install external agent by attach in case of sermant agent is installed
150+
shell: bash
151+
run: |
152+
export TEST_MODE=installByAttach
153+
python -m unittest ./sermant-integration-tests/scripts/test_backend_external_agent.py
154+
- name: stop application
155+
shell: bash
156+
run: |
157+
netstat -nlp | grep :8918 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
158+
sleep 3
159+
- name: start application alone
160+
shell: bash
161+
env:
162+
dynamic.config.serverAddress: 127.0.0.1:2181
163+
dynamic.config.dynamicConfigType: ZOOKEEPER
164+
service.meta.project: TestAgentCore
165+
run: |
166+
nohup java -Dserver.port=8919 \
167+
-jar sermant-agent-${{ env.sermantVersion }}/agent/agentcore-test-application-1.0.0-jar-with-dependencies.jar > ${{ env.logDir }}/agentcore-test.log 2>&1 &
168+
- name: waiting for application start
169+
shell: bash
170+
run: |
171+
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8919/ping 120
172+
sleep 10
173+
- name: dynamic install external agent
174+
shell: bash
175+
run: java -classpath ./:${{ env.JAVA_HOME}}/lib/tools.jar AgentLoader sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar \
176+
agent.config.externalAgent.injection=true,agent.config.externalAgent.name=OTEL,agent.config.externalAgent.file=opentelemetry-javaagent.jar,agent.service.heartbeat.enable=true,agent.service.gateway.enable=true,event.enable=true,gateway.nettyPort=6894,heartbeat.interval=5000
177+
- name: test install external agent by attach in case of sermant agent is not installalled and has set external agent config
178+
shell: bash
179+
run: |
180+
export TEST_MODE=installByAttach
181+
python -m unittest ./sermant-integration-tests/scripts/test_backend_external_agent.py
182+
- name: stop application
183+
shell: bash
184+
run: |
185+
netstat -nlp | grep :8919 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
186+
sleep 3
187+
- name: start application with sermant agent without external agent
188+
shell: bash
189+
env:
190+
dynamic.config.serverAddress: 127.0.0.1:2181
191+
dynamic.config.dynamicConfigType: ZOOKEEPER
192+
service.meta.project: TestAgentCore
193+
run: |
194+
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar \
195+
-Dserver.port=8920 \
196+
-Dagent.config.externalAgent.injection=false \
197+
-Dagent.service.heartbeat.enable=true \
198+
-Dagent.service.gateway.enable=true \
199+
-Devent.enable=true \
200+
-Dgateway.nettyPort=6894 \
201+
-Dheartbeat.interval=5000 \
202+
-jar sermant-agent-${{ env.sermantVersion }}/agent/agentcore-test-application-1.0.0-jar-with-dependencies.jar > ${{ env.logDir }}/agentcore-test.log 2>&1 &
203+
- name: waiting for application start
204+
shell: bash
205+
run: |
206+
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8920/ping 120
207+
- name: test install external agent by Sermant Backend
208+
shell: bash
209+
run: |
210+
export TEST_MODE=install
211+
python -m unittest ./sermant-integration-tests/scripts/test_backend_external_agent.py
212+
- name: stop application
213+
shell: bash
214+
run: |
215+
netstat -nlp | grep :8920 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
216+
sleep 3
217+
- name: stop backend
218+
shell: bash
219+
run: |
220+
netstat -nlp | grep :8910 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
221+
- name: exit
222+
if: always()
223+
uses: ./.github/actions/common/exit
224+
with:
225+
processor-keyword: agentcore|backend
226+
- name: if failure then upload error log
227+
uses: actions/upload-artifact@v4
228+
if: ${{ failure() || cancelled() }}
229+
with:
230+
name: (${{ github.job }})-backend-logs
231+
path: |
232+
./*.log
233+
./logs/**
234+
if-no-files-found: warn
235+
retention-days: 2

.github/actions/scenarios/backend/hot-plugging/action.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
name: "Test the configuration management of Backend"
1+
name: "Test the plugin hot-plugging in Backend"
22
description: "Auto test for Backend"
33
runs:
44
using: "composite"
55
steps:
6+
- name: entry
7+
uses: ./.github/actions/common/entry
8+
with:
9+
log-dir: ./logs/backend-hot-plugging
610
- name: compile AgentLoader
711
shell: bash
812
run: |
@@ -27,8 +31,7 @@ runs:
2731
service.meta.project: TestAgentCore
2832
run: |
2933
nohup java -jar \
30-
sermant-agent-${{ env.sermantVersion }}/agent/agentcore-test-application-1.0.0-jar-with-dependencies.jar > ${{ env.logDir
31-
}}/agentcore-test.log 2>&1 &
34+
sermant-agent-${{ env.sermantVersion }}/agent/agentcore-test-application-1.0.0-jar-with-dependencies.jar > ${{ env.logDir }}/agentcore-test.log 2>&1 &
3235
- name: waiting for agentcore services start
3336
shell: bash
3437
run: |
@@ -66,6 +69,14 @@ runs:
6669
run: |
6770
export TEST_MODE=unInstall
6871
python -m unittest ./sermant-integration-tests/scripts/test_backend_hot_plugging.py
72+
- name: stop application
73+
shell: bash
74+
run: |
75+
netstat -nlp | grep :8915 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
76+
- name: stop backend
77+
shell: bash
78+
run: |
79+
netstat -nlp | grep :8910 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs kill
6980
- name: exit
7081
if: always()
7182
uses: ./.github/actions/common/exit

0 commit comments

Comments
 (0)