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

feat(store): add e2e action #310

Merged
merged 96 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
5d14f67
feat(store): add e2e action
TheR1sing3un Oct 18, 2023
445c832
feat: enable pr-e2e-test
wangxye Oct 23, 2023
8aeda5e
feat: support docker build in ci
wangxye Oct 23, 2023
c444eaf
feat: add rocketmq in e2e test
wangxye Oct 23, 2023
34b1943
fix: fix the download of action
wangxye Oct 23, 2023
8ae2643
fix: fix the download artifact step
wangxye Oct 23, 2023
daef16d
fix: fix the detail of unzip
wangxye Oct 23, 2023
7342c5e
fix: fix the detail of cp
wangxye Oct 23, 2023
719d4d4
feat: add token for deploy
wangxye Oct 24, 2023
31fc49b
fix: fix the detail of build-images
wangxye Oct 24, 2023
0840643
fix: add detail to test issue
wangxye Oct 24, 2023
d8be557
feat: update the docker repo
wangxye Oct 24, 2023
3768e31
feat: distinguish between e2e and release docker mirrors
wangxye Oct 24, 2023
98182cf
feat: update build images
wangxye Oct 24, 2023
0881ab9
feat: update upload versionlist
wangxye Oct 24, 2023
0353f37
feat: add helm to support deploy mysql and s3
wangxye Oct 25, 2023
f1d9b21
feat: add checkout
wangxye Oct 25, 2023
c264062
fix: replace the helm action
wangxye Oct 25, 2023
41c2bae
fix: replace the helm action
wangxye Oct 25, 2023
f01cf35
fix: add repo-alias in action
wangxye Oct 25, 2023
eaca8cc
feat: add cmd to export kubeconfig
wangxye Oct 25, 2023
cc03cae
fix: fix the kubeconfig
wangxye Oct 25, 2023
c5fd5cd
fix: fix the cluster name of kind
wangxye Oct 25, 2023
e66320d
feat: streamline ci process
wangxye Oct 25, 2023
71142ba
fix: fix the env of deploy
wangxye Oct 25, 2023
b111443
fix: format the version
wangxye Oct 25, 2023
b76abfc
fix: format the lint version
wangxye Oct 25, 2023
681be49
fix: fix the download artifact
wangxye Oct 25, 2023
8b6a4fd
fix: use minikube to deploy
wangxye Oct 25, 2023
da36f80
fix: remove kube env config
wangxye Oct 25, 2023
0c0e70c
feat: replace run in k3s
wangxye Oct 25, 2023
70c7fe1
feat: add kube config env
wangxye Oct 25, 2023
b550d70
feat: support workflow in deploy-ci
wangxye Oct 28, 2023
284e83b
feat: upload artifact to next job
wangxye Oct 28, 2023
a338d44
feat: update the path of download artifact
wangxye Oct 28, 2023
af13067
feat: update the path of docker build
wangxye Oct 28, 2023
83021f3
feat: support build-ci in action
wangxye Oct 29, 2023
ef5a829
fix: fix yaml syntax
wangxye Oct 29, 2023
c33153d
fix: fix directory of the docker build
wangxye Oct 29, 2023
be96e49
fix: fix directory of the docker build
wangxye Oct 29, 2023
ed868a4
feat: support k3s in deploy
wangxye Oct 29, 2023
4f5be3b
feat: format the versionlist
wangxye Oct 29, 2023
0503112
fix: fix the path of versionlist
wangxye Oct 29, 2023
14f22df
fix: fix the directory of deploy rocketmq
wangxye Oct 29, 2023
859e717
fix: update the path of deploy
wangxye Oct 29, 2023
e1f6fb4
feat: support deploy in k3s
wangxye Oct 29, 2023
83592ff
fix: fix ~/.kube not found
wangxye Oct 29, 2023
8c28257
fix: make the test-tool uniform in the k3s environment
wangxye Oct 29, 2023
87eb17a
fix: ensure test-tool in the k3s
wangxye Oct 29, 2023
9dca3ca
fix: ensure deploy in same namespace
wangxye Oct 29, 2023
bf8f732
fix: fix the repo name
wangxye Oct 29, 2023
449f127
fix: update the repo name in action
wangxye Oct 30, 2023
0641666
fix: update the output of namesapce
wangxye Oct 30, 2023
79bf258
fix: update output variable
wangxye Oct 30, 2023
14f2428
fix: replace action tool with shell
wangxye Oct 30, 2023
047a5b6
fix: fix the namespace and test-ci in e2e test
wangxye Oct 30, 2023
311fe7f
fix: remove build detail only to test e2e
wangxye Oct 30, 2023
1768d1f
fix: sync e2e repo in action
wangxye Oct 30, 2023
dddc26d
fix: check repo in new step
wangxye Oct 30, 2023
ccf4ab2
fix: ensure config in same namesapces
wangxye Oct 30, 2023
16009c7
fix: fix the unused code in shell
wangxye Oct 30, 2023
128de97
fix: fix the illegal dir
wangxye Oct 30, 2023
2ce1d92
fix: fix the url of repo
wangxye Oct 30, 2023
1ae4957
feat: compliete e2e test
wangxye Oct 30, 2023
7c37941
feat: support complicate e2e test
wangxye Oct 30, 2023
8051560
fix: change file permissions
wangxye Oct 30, 2023
7fb8ff3
fix: support delete while report upload
wangxye Oct 30, 2023
fdbb6cc
fix: change delete frequency to alawys
wangxye Oct 30, 2023
1db5c3a
feat: support e2e in shell
wangxye Oct 31, 2023
091ccd7
fix: add java and go env for action
wangxye Oct 31, 2023
cc01c04
fix: add rocketmq-controller in action
wangxye Oct 31, 2023
abfe2c4
fix: fix the rocketmq dependency build
wangxye Oct 31, 2023
ae514ca
fix: remove golang e2e test
wangxye Oct 31, 2023
5c8af3f
test: replace branch for e2e test
wangxye Oct 31, 2023
f16318a
fix: fix the endpoint of broker in e2e
wangxye Oct 31, 2023
7af4131
fix: remove acl in action
wangxye Oct 31, 2023
8dd9206
fix: fix dns of e2e action
wangxye Oct 31, 2023
e57c78b
feat: complete ci test
wangxye Nov 1, 2023
877e62c
fix: ensure pr-e2e-test always
wangxye Nov 1, 2023
01a39c4
fix: ensure pr-e2e after build ci
wangxye Nov 1, 2023
ce05ba0
fix: format new repo name
wangxye Nov 3, 2023
de8db8f
fix: fix the path of docker build
wangxye Nov 3, 2023
0da5a40
fix: replace repo name
wangxye Nov 3, 2023
4fff71b
fix: fix the hostname of broker in e2e
wangxye Nov 3, 2023
1fc4e5f
fix: support e2e in signal node
wangxye Nov 6, 2023
d02e24f
test: checkout e2e branch for e2e test
wangxye Nov 7, 2023
e13cd58
fix: fix the dir of broker conf
wangxye Nov 8, 2023
04eb8d3
fix: make e2e tests sequentially
wangxye Nov 8, 2023
f5b943e
fix: replace java set-up with local
wangxye Nov 10, 2023
f4de901
chore: checkout e2e branch to master
wangxye Nov 10, 2023
938e959
chore: support cluster broker in e2e
wangxye Nov 10, 2023
1e620bc
chore: checkout e2e branch for remote server test
wangxye Nov 13, 2023
eeccc5b
chore: checkout e2e branch to master
wangxye Nov 13, 2023
f90c8c3
chore: e2e test for broker cluster
wangxye Nov 17, 2023
657c3a3
chore: increase resource allocation limits in helm charts
wangxye Nov 17, 2023
b21a87b
chore: e2e test in sigle broker
wangxye Nov 17, 2023
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
18 changes: 15 additions & 3 deletions .github/workflows/build-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build with Maven
name: BUILD-CI

on:
pull_request:
Expand All @@ -24,5 +24,17 @@ jobs:
uses: ScribeMD/[email protected]
with:
key: docker-${{ runner.os }}
- name: Build with Maven
run: mvn clean install -U
- name: Build distribution tar
run: |
mvn -Prelease-all clean install -U
- uses: actions/upload-artifact@v3
name: Upload distribution tar
with:
name: rocketmq
path: distribution/target/automq-for-rocketmq.zip

pr-e2e:
name: PR e2e test
uses: ./.github/workflows/pr-e2e-test.yml
secrets: inherit
needs: dist-tar
245 changes: 245 additions & 0 deletions .github/workflows/pr-e2e-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
name: E2E test for pull request

# read-write repo token
# access to secrets
#on:
# workflow_run:
# workflows: ["BUILD-CI"]
# types:
# - completed
# branches: ['**']
on:
workflow_call:


env:
HELM_NAME: automq-for-rocketmq
DOCKER_REPO: automqinc/rocketmq_e2e

jobs:
docker:
runs-on: ubuntu-latest
if: always()
# if: >
# github.event.workflow_run.event == 'pull_request' &&
# github.event.workflow_run.conclusion == 'success'
timeout-minutes: 30
strategy:
matrix:
java-version: ["17"]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: 'Download artifact'
uses: actions/download-artifact@v2
with:
name: rocketmq
path: ${{github.workspace}}/distribution/target
- name: docker-login
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and save docker images
id: build-images
working-directory: ./distribution/docker
run: |
mkdir versionlist
full_node_version=$(git ls-remote --tags | awk -F '/' 'END{print $3}')
commit_version=$(git rev-parse --short HEAD)
version=${full_node_version}-${commit_version}
touch versionlist/"${version}"
echo "version=${version}"
ls versionlist/
sh build-ci.sh ${DOCKER_REPO} ${version}
docker push ${DOCKER_REPO}:${version}
- uses: actions/upload-artifact@v3
name: Upload distribution versionlist
with:
name: versionlist
path: ./distribution/docker/versionlist/*

list-version:
if: always()
name: List version
needs: [docker]
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
version-json: ${{ steps.show_versions.outputs.version-json }}
steps:
- uses: actions/download-artifact@v3
name: Download versionlist
with:
name: versionlist
path: versionlist
- name: Show versions
id: show_versions
run: |
a=(`ls versionlist`)
printf '%s\n' "${a[@]}" | jq -R . | jq -s .
echo version-json=`printf '%s\n' "${a[@]}" | jq -R . | jq -s .` >> $GITHUB_OUTPUT
deploy:
if: ${{ success() }}
name: Deploy RocketMQ
needs: [list-version,docker]
runs-on: private-k3s
timeout-minutes: 60
outputs:
namespace: ${{ steps.create_namespace.outputs.namespace }}
strategy:
matrix:
version: ${{ fromJSON(needs.list-version.outputs.version-json) }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true
- name: Get kubeconfig
env:
KUBECONFIG_FILE: '${{ secrets.KUBE_CONFIG }}'
run: |
mkdir -p ~/.kube
echo $KUBECONFIG_FILE | base64 -d > ~/.kube/config
- name: Create Namespace
id: create_namespace
env:
JOB_INDEX: ${{ strategy.job-index }}
run: |
REPO_NAME=`echo ${GITHUB_REPOSITORY#*/} | sed -e "s/\//-/g" | cut -c1-36 | tr '[A-Z]' '[a-z]'`
NAMESPACE=${REPO_NAME}-${GITHUB_RUN_ID}-${JOB_INDEX}
kubectl create namespace $NAMESPACE
echo "namespace=$NAMESPACE" >> $GITHUB_OUTPUT
- name: Deploy RocketMQ
working-directory: distribution/helm
env:
NAMESPACE: ${{ steps.create_namespace.outputs.namespace }}
DOCKER_REPO: ${{ env.DOCKER_REPO }}
run: |
sh deploy-ci.sh ${DOCKER_REPO} ${{ matrix.version }} ${NAMESPACE}

test-e2e-grpc-java:
if: ${{ success() }}
name: Test E2E grpc java
needs: [list-version, deploy]
runs-on: private-k3s
timeout-minutes: 60
strategy:
matrix:
version: ${{ fromJSON(needs.list-version.outputs.version-json) }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install flatc
run: sudo bash install_flatc.sh
- name: Build rocketmq dependency
run: |
mvn clean install -U -DskipTests
- uses: actions/checkout@v3
if: always()
with:
repository: AutoMQ/rocketmq-e2e
ref: master
path: rocketmq-e2e
token: ${{ secrets.PAT_E2E }}
- name: e2e test
env:
HELM_NAME: ${{ env.HELM_NAME }}
NAMESPACE: ${{ needs.deploy.outputs.namespace }}
run: |
cd rocketmq-e2e
cd java/e2e && mvn -B test -DnamesrvAddr=${HELM_NAME}-broker.${NAMESPACE}.svc.pve1.local:8081 -DendPoint=${HELM_NAME}-broker.${NAMESPACE}.svc.pve1.local:8081
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: '**/surefire-reports/TEST-*.xml'
annotate_only: true
include_passed: true
detailed_summary: true
- uses: actions/upload-artifact@v3
if: always()
name: Upload test log
with:
name: test-e2e-grpc-java-log.txt
path: testlog.txt

test-e2e-remoting-java:
if: ${{ success() }}
name: Test E2E remoting java
needs: [ list-version, deploy ]
runs-on: private-k3s
timeout-minutes: 60
strategy:
matrix:
version: ${{ fromJSON(needs.list-version.outputs.version-json) }}
steps:
- name: Delay
env:
DELAY_SECONDS: 30
run: |
sleep $DELAY_SECONDS
- uses: actions/checkout@v3
with:
submodules: true
- name: Install flatc
run: sudo bash install_flatc.sh
- name: Build rocketmq dependency
run: |
mvn clean install -U -DskipTests
- uses: actions/checkout@v3
if: always()
with:
repository: AutoMQ/rocketmq-e2e
ref: master
path: rocketmq-e2e
token: ${{ secrets.PAT_E2E }}
- name: e2e test
env:
HELM_NAME: ${{ env.HELM_NAME }}
NAMESPACE: ${{ needs.deploy.outputs.namespace }}
run: |
cd rocketmq-e2e
cd java/e2e-v4 && mvn -B test -DnamesrvAddr=${HELM_NAME}-broker.${NAMESPACE}.svc.pve1.local:8081
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: '**/surefire-reports/TEST-*.xml'
annotate_only: true
include_passed: true
detailed_summary: true
- uses: actions/upload-artifact@v3
if: always()
name: Upload test log
with:
name: test-e2e-remoting-java-log.txt
path: testlog.txt

clean:
if: always()
name: Clean
needs: [deploy, list-version, test-e2e-grpc-java, test-e2e-remoting-java]
runs-on: private-k3s
timeout-minutes: 60
strategy:
matrix:
version: ${{ fromJSON(needs.list-version.outputs.version-json) }}
steps:
- uses: apache/rocketmq-test-tool@7d84d276ad7755b1dc5cf9657a7a9bff6ae6d288
name: clean
with:
action: "clean"
ask-config: "${{ secrets.KUBE_CONFIG }}"
test-version: "${{ matrix.version }}"
job-id: ${{ strategy.job-index }}
- name: clean Rocketmq
working-directory: distribution/helm
env:
NAMESPACE: ${{ needs.deploy.outputs.namespace }}
DOCKER_REPO: ${{ env.DOCKER_REPO }}
run: |
sh clean-ci.sh ${NAMESPACE}
2 changes: 1 addition & 1 deletion distribution/docker/Dockerfile-ci
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ENV ROCKETMQ_VERSION ${version}
ARG ROCKETMQ_DIR

ENV ROCKETMQ_NAME automq-for-rocketmq
ENV ROCKETMQ_HOME /home/rocketmq/${ROCKETMQ_NAME}-${ROCKETMQ_VERSION}
ENV ROCKETMQ_HOME /home/rocketmq/${ROCKETMQ_NAME}

WORKDIR ${ROCKETMQ_HOME}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
imagePullPolicy: {{ $.Values.broker.image.pullPolicy }}
{{- end }}
command: [ "/bin/sh" ]
args: [ "-c", "./run-server.sh com.automq.rocketmq.broker.BrokerStartup -c /home/rocketmq/automq-for-rocketmq-5.1.3/conf/broker/$(CLUSTER_NAME)-$(POD_NAME)" ]
args: [ "-c", "./run-server.sh com.automq.rocketmq.broker.BrokerStartup -c /home/rocketmq/automq-for-rocketmq/conf/broker/$(CLUSTER_NAME)-$(POD_NAME)" ]
env:
- name: POD_NAME
valueFrom:
Expand Down Expand Up @@ -81,7 +81,7 @@ spec:
resources:
{{- toYaml .Values.broker.resources | nindent 12 }}
volumeMounts:
- mountPath: /home/rocketmq/automq-for-rocketmq-5.1.3/conf/broker
- mountPath: /home/rocketmq/automq-for-rocketmq/conf/broker
name: broker-config
- mountPath: /root/logs/rocketmqlogs
name: broker-storage
Expand Down
8 changes: 4 additions & 4 deletions distribution/helm/charts/automq-for-rocketmq/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ broker:
jvmMemory: " -Xms4g -Xmx4g -Xmn2g -XX:MaxDirectMemorySize=8g "
resources:
limits:
cpu: 2
memory: 4Gi
cpu: 4
memory: 8Gi
requests:
cpu: 2
memory: 4Gi
cpu: 4
memory: 8Gi

nodeSelector: { }

Expand Down
2 changes: 1 addition & 1 deletion distribution/helm/deploy/helm_sample_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

broker:
replicaCount: 2
replicaCount: 1
conf:
clusterNameOverride: "automq"
s3Stream:
Expand Down
5 changes: 3 additions & 2 deletions distribution/helm/deploy/mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ image:

auth:
rootPassword: "passward"
database: "metadata"
createDatabase: true
database: metadata

service:
type: LoadBalancer
Expand All @@ -33,4 +34,4 @@ primary:
extraVolumes: |
- name: init
configMap:
name: mysql-initdb-config
name: mysql-initdb-config
Loading
Loading