2021-09-09 16:02:21 +08:00
name : Deploy Test
2021-09-09 14:32:27 +08:00
on :
workflow_dispatch :
schedule :
- cron : "30 20 * * *"
jobs :
test-docker-compose :
runs-on : ubuntu-latest
strategy :
fail-fast : false
matrix :
mode : [ standalone,cluster]
task : [ reinstall,upgrade]
steps :
- uses : actions/checkout@v2
- name : Set up Python
uses : actions/setup-python@v2
with :
python-version : 3.8
- name : Run deploy test
2021-10-16 19:28:35 +08:00
timeout-minutes : 15
2021-09-09 14:32:27 +08:00
shell : bash
working-directory : tests/python_client/deploy
run : |
pip install -r requirements.txt
pip install --upgrade protobuf
mkdir -p ${{ matrix.mode }}/logs
echo "test -m ${{ matrix.mode }} -t ${{ matrix.task }}" > ./${{ matrix.mode }}/logs/test_info.log
python scripts/get_tag.py >> ./${{ matrix.mode }}/logs/test_info.log
bash test.sh -m ${{ matrix.mode }} -t ${{ matrix.task }} -p ""
- name : 'Send mail'
if : ${{ failure() }}
uses : dawidd6/action-send-mail@v3
with :
server_address : ${{ secrets.EMAIL_SERVICE_NAME }}
server_port : 465
username : ${{ secrets.TEST_EMAIL_USERNAME }}
password : ${{ secrets.TEST_EMAIL_PASSWORD }}
subject : Deploy Test
2021-09-13 21:20:28 +08:00
body : "test ${{ matrix.mode }} ${{ matrix.task }} failed \n You can view it at https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
2021-09-09 14:32:27 +08:00
to : ${{ secrets.QA_EMAIL_ADDRESS }}
from : GitHub Actions
- name : Upload logs
if : ${{ always() }}
uses : actions/upload-artifact@v2
with :
name : logs-${{ matrix.mode }}-${{ matrix.task }}
path : tests/python_client/deploy/${{ matrix.mode }}/logs
2021-10-13 06:50:32 +08:00
test-helm-install :
runs-on : ubuntu-latest
strategy :
fail-fast : false
matrix :
task : [ reinstall,upgrade]
steps :
- name : Creating kind cluster
uses : helm/kind-action@v1.2.0
- name : Print cluster information
run : |
kubectl config view
kubectl cluster-info
kubectl get nodes
kubectl get pods -n kube-system
helm version
kubectl version
- uses : actions/checkout@v2
- name : Set up Python
uses : actions/setup-python@v2
with :
python-version : 3.8
- name : Install dependency
shell : bash
working-directory : tests/python_client/deploy
run : |
pip install -r requirements.txt
pip install --upgrade protobuf
- name : First Milvus Deployment
2021-10-16 19:28:35 +08:00
timeout-minutes : 15
2021-10-13 06:50:32 +08:00
shell : bash
working-directory : tests/python_client/deploy
run : |
helm repo add milvus https://milvus-io.github.io/milvus-helm
helm repo update
# if the task is reinstall, install milvus with latest image in repo milvusdb/milvus-dev
if [ ${{ matrix.task }} == "reinstall" ]; then helm install --wait --timeout 300s deploy-testing milvus/milvus -f cluster-values.yaml; fi
# if the task is upgrade, install milvus with latest rc image in repo milvusdb/milvus
if [ ${{ matrix.task }} == "upgrade" ]; then helm install --wait --timeout 300s deploy-testing milvus/milvus --set image.all.repository=milvusdb/milvus --set image.all.tag=latest -f cluster-values.yaml; fi
kubectl get pods
sleep 20s
kubectl get pods
kubectl port-forward service/deploy-testing-milvus 19530 >/dev/null 2>&1 &
sleep 20s
# check whether port-forward success
nc -vz 127.0.0.1 19530
# first test
if [ ${{ matrix.task }} == "reinstall" ]; then python scripts/action_reinstall.py; fi
if [ ${{ matrix.task }} == "upgrade" ]; then python scripts/action_before_upgrade.py; fi
# uninstall milvus
helm uninstall deploy-testing
- name : Seconde Milvus Deployment
2021-10-16 19:28:35 +08:00
timeout-minutes : 15
2021-10-13 06:50:32 +08:00
shell : bash
working-directory : tests/python_client/deploy
run : |
#
helm install --wait --timeout 300s deploy-testing milvus/milvus -f cluster-values.yaml
kubectl get pods
sleep 20s
kubectl get pods
ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9
kubectl port-forward service/deploy-testing-milvus 19530 >/dev/null 2>&1 &
sleep 20s
# check whether port-forward success
nc -vz 127.0.0.1 19530
# second test
if [ ${{ matrix.task }} == "reinstall" ]; then python scripts/action_reinstall.py; fi
if [ ${{ matrix.task }} == "upgrade" ]; then python scripts/action_after_upgrade.py; fi
2021-09-09 14:32:27 +08:00
2021-10-13 06:50:32 +08:00
- name : Export logs
if : ${{ always() }}
shell : bash
working-directory : tests/python_client/deploy
run : |
kubectl get pod
# export k8s log for milvus
bash ../../scripts/export_log_k8s.sh default deploy-testing
- name : Upload logs
if : ${{ always() }}
uses : actions/upload-artifact@v2
with :
name : logs-${{ matrix.pod }}
path : tests/python_client/deploy/k8s_logs
2021-09-09 14:32:27 +08:00