From 242d88d3853b3246e08df6db92342f89711e3ae5 Mon Sep 17 00:00:00 2001 From: Yellow Shine Date: Fri, 2 Aug 2024 10:37:21 +0800 Subject: [PATCH] enhance: use docker compose instead of docker-compose Signed-off-by: Yellow Shine --- .github/workflows/deploy-test.yaml | 20 ++++----- .github/workflows/main.yaml | 6 +-- .github/workflows/publish-test-images.yaml | 10 ++--- DEVELOPMENT.md | 8 ++-- build/README.md | 8 ++-- build/builder.sh | 10 ++--- build/builder_gpu.sh | 12 +++--- deployments/export-log/README.md | 2 +- deployments/offline/README.md | 4 +- scripts/README.md | 2 + scripts/devcontainer.sh | 12 +++--- scripts/run_docker.sh | 18 ++++---- tests/README.md | 4 +- tests/README_CN.md | 4 +- tests/integration/README.md | 2 +- tests/python_client/deploy/README.md | 2 +- tests/python_client/deploy/check_healthy.sh | 8 ++-- tests/python_client/deploy/test.sh | 46 ++++++++++----------- tests/python_client/deploy/utils.sh | 8 ++-- tests/scripts/e2e.sh | 4 +- tests/scripts/export_log_docker.sh | 2 +- tests/scripts/prepare_e2e.sh | 4 +- 22 files changed, 99 insertions(+), 97 deletions(-) diff --git a/.github/workflows/deploy-test.yaml b/.github/workflows/deploy-test.yaml index 7271b9feede6e..c5e8750d82171 100644 --- a/.github/workflows/deploy-test.yaml +++ b/.github/workflows/deploy-test.yaml @@ -102,9 +102,9 @@ jobs: wget https://github.com/milvus-io/milvus/releases/download/${{ env.PREVIOUS_RELEASE_VERSION }}/milvus-${{ matrix.mode }}-docker-compose.yml -O docker-compose.yml; replace_image_tag ${{ env.OLD_IMAGE_REPO }} ${{ env.OLD_IMAGE_TAG }}; fi - docker-compose up -d + docker compose up -d bash ../check_healthy.sh - docker-compose ps -a + docker compose ps -a sleep 10s - name: Run first test timeout-minutes: 15 @@ -130,7 +130,7 @@ jobs: shell: bash working-directory: tests/python_client/deploy/${{ matrix.mode }} run: | - docker-compose ps -a || true + docker compose ps -a || true mkdir -p logs/first_deploy bash ../../../scripts/export_log_docker.sh ./logs/first_deploy || echo "export logs failed" - name: Second Milvus deployment @@ -140,15 +140,15 @@ jobs: run: | source ../utils.sh if [ ${{ matrix.task }} == "reinstall" ]; then - docker-compose restart + docker compose restart fi if [ ${{ matrix.task }} == "upgrade" ]; then wget https://raw.githubusercontent.com/milvus-io/milvus/master/deployments/docker/${{ matrix.mode }}/docker-compose.yml -O docker-compose.yml; replace_image_tag ${{ env.NEW_IMAGE_REPO }} ${{ env.NEW_IMAGE_TAG }}; - docker-compose up -d; + docker compose up -d; fi bash ../check_healthy.sh - docker-compose ps -a + docker compose ps -a echo "sleep 120s for the second deployment to be ready" sleep 120s @@ -169,7 +169,7 @@ jobs: shell: bash working-directory: tests/python_client/deploy/${{ matrix.mode }} run: | - docker-compose ps -a || true + docker compose ps -a || true mkdir -p logs/second_deploy bash ../../../scripts/export_log_docker.sh ./logs/second_deploy || echo "export logs failed" @@ -181,9 +181,9 @@ jobs: echo "restart docker service" sudo systemctl restart docker sleep 20s - docker-compose up -d + docker compose up -d bash ../check_healthy.sh - docker-compose ps -a + docker compose ps -a echo "sleep 120s for the deployment to be ready after docker restart" sleep 120s @@ -206,7 +206,7 @@ jobs: shell: bash working-directory: tests/python_client/deploy/${{ matrix.mode }} run: | - docker-compose ps -a || true + docker compose ps -a || true mkdir -p logs/second_deploy bash ../../../scripts/export_log_docker.sh ./logs/third_deploy || echo "export logs failed" diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c139dc848fc88..aa2ca2f0ac25a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -141,7 +141,7 @@ jobs: - name: Start Service shell: bash run: | - docker-compose up -d azurite + docker compose up -d azurite - name: UT run: | chmod +x build/builder.sh @@ -193,7 +193,7 @@ jobs: - name: Start Service shell: bash run: | - docker-compose up -d pulsar etcd minio azurite + docker compose up -d pulsar etcd minio azurite - name: UT run: | chmod +x build/builder.sh @@ -245,7 +245,7 @@ jobs: - name: Start Service shell: bash run: | - docker-compose up -d pulsar etcd minio + docker compose up -d pulsar etcd minio - name: IntegrationTest run: | chmod +x build/builder.sh diff --git a/.github/workflows/publish-test-images.yaml b/.github/workflows/publish-test-images.yaml index 5587389d63f42..83a4838e48936 100644 --- a/.github/workflows/publish-test-images.yaml +++ b/.github/workflows/publish-test-images.yaml @@ -39,14 +39,14 @@ jobs: shell: bash working-directory: tests/docker run: | - docker-compose pull --ignore-pull-failures pytest + docker compose pull pytest - name: Docker Build shell: bash working-directory: tests/docker run: | - IMAGE_TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} docker-compose build pytest + IMAGE_TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} docker compose build pytest export LATEST_IMAGE_TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} - IMAGE_TAG=latest docker-compose build pytest + IMAGE_TAG=latest docker compose build pytest - name: Docker Push if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' continue-on-error: true @@ -55,8 +55,8 @@ jobs: run: | docker login -u ${{ secrets.DOCKERHUB_USER }} \ -p ${{ secrets.DOCKERHUB_TOKEN }} - IMAGE_TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} docker-compose push pytest - IMAGE_TAG=latest docker-compose push pytest + IMAGE_TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} docker compose push pytest + IMAGE_TAG=latest docker compose push pytest echo "Push pytest image Succeeded" - name: Update Pytest Image Changes if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 99bfc0f1546ae..6a4279442b363 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -389,7 +389,7 @@ For Apple Silicon users (Apple M1): ```shell $ cd deployments/docker/dev -$ docker-compose -f docker-compose-apple-silicon.yml up -d +$ docker compose -f docker-compose-apple-silicon.yml up -d $ cd ../../../ $ make unittest ``` @@ -398,7 +398,7 @@ For others: ```shell $ cd deployments/docker/dev -$ docker-compose up -d +$ docker compose up -d $ cd ../../../ $ make unittest ``` @@ -467,13 +467,13 @@ Milvus Cluster includes further component — Pulsar, to be distributed through ```shell # Running Milvus cluster $ cd deployments/docker/dev -$ docker-compose up -d +$ docker compose up -d $ cd ../../../ $ ./scripts/start_cluster.sh # Or running Milvus standalone $ cd deployments/docker/dev -$ docker-compose up -d +$ docker compose up -d $ cd ../../../ $ ./scripts/start_standalone.sh ``` diff --git a/build/README.md b/build/README.md index 1801e1a8d51d3..2b70349156e4e 100644 --- a/build/README.md +++ b/build/README.md @@ -95,7 +95,7 @@ Creating milvus_builder_1 ... done Check running state of Dev Container: ```shell -$ docker-compose -f docker-compose-devcontainer.yml ps +$ docker compose -f docker-compose-devcontainer.yml ps Name Command State Ports --------------------------------------------------------------------------------------------------------------------------------------- @@ -135,7 +135,7 @@ Milvus uses Python SDK to write test cases to verify the correctness of Milvus f ```shell cd deployments/docker/dev -docker-compose up -d +docker compose up -d cd ../../../ build/builder.sh /bin/bash -c "export ROCKSMQ_PATH='/tmp/milvus/rdb_data' && ./scripts/start_standalone.sh && cat" ``` @@ -149,9 +149,9 @@ build/builder.sh /bin/bash -c "./scripts/start_cluster.sh && cat" To run E2E tests, use these commands: ```shell -MILVUS_SERVICE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker-compose ps -q builder)) +MILVUS_SERVICE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker compose ps -q builder)) cd tests/docker -docker-compose run --rm pytest /bin/bash -c "pytest --host ${MILVUS_SERVICE_IP}" +docker compose run --rm pytest /bin/bash -c "pytest --host ${MILVUS_SERVICE_IP}" ``` ## Basic Flow diff --git a/build/builder.sh b/build/builder.sh index fdb323ab47f7f..95b074abd3fb2 100755 --- a/build/builder.sh +++ b/build/builder.sh @@ -18,12 +18,12 @@ fi pushd "${toplevel}" if [[ "${1-}" == "pull" ]]; then - docker-compose pull --ignore-pull-failures builder + docker compose pull builder exit 0 fi if [[ "${1-}" == "down" ]]; then - docker-compose down + docker compose down exit 0 fi @@ -37,11 +37,11 @@ mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-vscode-ex mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-conan" chmod -R 777 "${DOCKER_VOLUME_DIRECTORY:-.docker}" -docker-compose pull --ignore-pull-failures builder +docker compose pull builder if [[ "${CHECK_BUILDER:-}" == "1" ]]; then - docker-compose build builder + docker compose build builder fi -docker-compose run --no-deps --rm builder "$@" +docker compose run --no-deps --rm builder "$@" popd diff --git a/build/builder_gpu.sh b/build/builder_gpu.sh index 8b3c6ba30560f..37d82da544abf 100755 --- a/build/builder_gpu.sh +++ b/build/builder_gpu.sh @@ -14,12 +14,12 @@ export OS_NAME="${OS_NAME:-ubuntu22.04}" pushd "${toplevel}" if [[ "${1-}" == "pull" ]]; then - docker-compose pull --ignore-pull-failures gpubuilder + docker compose pull gpubuilder exit 0 fi if [[ "${1-}" == "down" ]]; then - docker-compose down + docker compose down exit 0 fi @@ -42,15 +42,15 @@ mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker-gpu}/amd64-${OS_NAME}-vscode-extens mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker-gpu}/amd64-${OS_NAME}-conan" chmod -R 777 "${DOCKER_VOLUME_DIRECTORY:-.docker-gpu}" -docker-compose pull --ignore-pull-failures gpubuilder +docker compose pull gpubuilder if [[ "${CHECK_BUILDER:-}" == "1" ]]; then - docker-compose build gpubuilder + docker compose build gpubuilder fi if [[ "$(id -u)" != "0" ]]; then - docker-compose run --no-deps --rm -u "$uid:$gid" gpubuilder "$@" + docker compose run --no-deps --rm -u "$uid:$gid" gpubuilder "$@" else - docker-compose run --no-deps --rm gpubuilder "$@" + docker compose run --no-deps --rm gpubuilder "$@" fi popd diff --git a/deployments/export-log/README.md b/deployments/export-log/README.md index 8df1524548ade..c213dfc4934f4 100644 --- a/deployments/export-log/README.md +++ b/deployments/export-log/README.md @@ -8,7 +8,7 @@ For better tracking and debugging Milvus, the script `export-milvus-log.sh` is p > >For milvus installed with helm-chart, if `log.persistence.enabled` is set to true (default false), the tool cannot be used to export milvus logs and the log files can be found directly under the path specified by `log.persistence.mountPath`. > -> For Milvus installed with docker-compose, you can use `docker-compose logs > milvus.log` to export the logs. +> For Milvus installed with docker-compose, you can use `docker compose logs > milvus.log` to export the logs. ## Parameter Description diff --git a/deployments/offline/README.md b/deployments/offline/README.md index 6671973e55aeb..217cfb802e24f 100644 --- a/deployments/offline/README.md +++ b/deployments/offline/README.md @@ -71,7 +71,7 @@ $ for image in $(find . -type f -wholename "./images/*.tar.gz") ; do gunzip -c $ ### With Docker Compose ```shell -$ docker-compose -f docker-compose.yml up -d +$ docker compose -f docker-compose.yml up -d ``` ### On Kubernetes @@ -85,7 +85,7 @@ $ kubectl apply -f milvus_manifest.yaml ### With Docker Compose ```shell -$ docker-compose -f docker-compose.yml down +$ docker compose -f docker-compose.yml down ``` ### On Kubernetes diff --git a/scripts/README.md b/scripts/README.md index 8cb64fbca7dc4..72044c05161b8 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -67,6 +67,7 @@ $ sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docke $ sudo chmod +x /usr/local/bin/docker-compose $ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose $ docker-compose --version +$ docker compose --version ``` ## Start service @@ -76,6 +77,7 @@ Start third-party service: ```shell $ cd [milvus project path]/deployments/docker/cluster $ docker-compose up -d +$ docker compose up -d ``` Start milvus cluster: diff --git a/scripts/devcontainer.sh b/scripts/devcontainer.sh index ba87d1a28df57..fa4814037df1d 100755 --- a/scripts/devcontainer.sh +++ b/scripts/devcontainer.sh @@ -75,20 +75,20 @@ mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/amd64-${OS_NAME}-conan" chmod -R 777 "${DOCKER_VOLUME_DIRECTORY:-.docker}" if [ "${1-}" = "build" ];then - docker-compose -f $ROOT_DIR/docker-compose-devcontainer.yml pull --ignore-pull-failures builder - docker-compose -f $ROOT_DIR/docker-compose-devcontainer.yml build builder + docker compose -f $ROOT_DIR/docker-compose-devcontainer.yml pull builder + docker compose -f $ROOT_DIR/docker-compose-devcontainer.yml build builder fi if [ "${1-}" = "up" ]; then - docker-compose -f $ROOT_DIR/docker-compose-devcontainer.yml up -d $(docker-compose config --services | grep -wv "gpubuilder") + docker compose -f $ROOT_DIR/docker-compose-devcontainer.yml up -d $(docker compose config --services | grep -wv "gpubuilder") fi if [ "${1-}" = "down" ]; then - docker-compose -f $ROOT_DIR/docker-compose-devcontainer.yml down + docker compose -f $ROOT_DIR/docker-compose-devcontainer.yml down fi if [ "${1-}" = "gpu" -a "${2-}" = "up" ]; then - docker-compose -f $ROOT_DIR/docker-compose-devcontainer.yml up -d $(docker-compose config --services | grep -wv "builder") + docker compose -f $ROOT_DIR/docker-compose-devcontainer.yml up -d $(docker compose config --services | grep -wv "builder") fi -popd \ No newline at end of file +popd diff --git a/scripts/run_docker.sh b/scripts/run_docker.sh index 3e8bf04b195da..2d55c7bfb78bb 100755 --- a/scripts/run_docker.sh +++ b/scripts/run_docker.sh @@ -17,28 +17,28 @@ cd ../build/docker/deploy/ echo "starting rootcoord docker" -nohup docker-compose -p milvus up rootcoord > ~/rootcoord_docker.log 2>&1 & +nohup docker compose -p milvus up rootcoord > ~/rootcoord_docker.log 2>&1 & echo "starting proxy docker" -nohup docker-compose -p milvus up proxy > ~/proxy_docker.log 2>&1 & +nohup docker compose -p milvus up proxy > ~/proxy_docker.log 2>&1 & echo "starting indexcoord docker" -nohup docker-compose -p milvus up indexcoord > ~/indexcoord_docker.log 2>&1 & +nohup docker compose -p milvus up indexcoord > ~/indexcoord_docker.log 2>&1 & echo "starting indexnode docker" -nohup docker-compose -p milvus up indexnode > ~/indexnode_docker.log 2>&1 & +nohup docker compose -p milvus up indexnode > ~/indexnode_docker.log 2>&1 & echo "starting querycoord docker" -nohup docker-compose -p milvus up querycoord > ~/querycoord_docker.log 2>&1 & +nohup docker compose -p milvus up querycoord > ~/querycoord_docker.log 2>&1 & echo "starting datacoord docker" -nohup docker-compose -p milvus up datacoord > ~/datacoord_docker.log 2>&1 & +nohup docker compose -p milvus up datacoord > ~/datacoord_docker.log 2>&1 & echo "starting querynode1 docker" -nohup docker-compose -p milvus run -e QUERY_NODE_ID=1 querynode > ~/querynode1_docker.log 2>&1 & +nohup docker compose -p milvus run -e QUERY_NODE_ID=1 querynode > ~/querynode1_docker.log 2>&1 & echo "starting querynode2 docker" -nohup docker-compose -p milvus run -e QUERY_NODE_ID=2 querynode > ~/querynode2_docker.log 2>&1 & +nohup docker compose -p milvus run -e QUERY_NODE_ID=2 querynode > ~/querynode2_docker.log 2>&1 & echo "starting datanode docker" -nohup docker-compose -p milvus run -e DATA_NODE_ID=3 datanode > ~/datanode_docker.log 2>&1 & +nohup docker compose -p milvus run -e DATA_NODE_ID=3 datanode > ~/datanode_docker.log 2>&1 & diff --git a/tests/README.md b/tests/README.md index 7ac76f4db9d36..f7f1fcee337f4 100644 --- a/tests/README.md +++ b/tests/README.md @@ -49,9 +49,9 @@ $ docker info 2. Check the version of Docker-Compose ```shell -$ docker-compose version +$ docker compose version -docker-compose version 1.25.5, build 8a1c60f6 +docker compose version 1.25.5, build 8a1c60f6 docker-py version: 4.1.0 CPython version: 3.7.5 OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020 diff --git a/tests/README_CN.md b/tests/README_CN.md index d7a5b4b1e2488..034f71d15f233 100644 --- a/tests/README_CN.md +++ b/tests/README_CN.md @@ -49,9 +49,9 @@ $ docker info 2. 确认 Docker Compose 版本 ```shell -$ docker-compose version +$ docker compose version -docker-compose version 1.25.5, build 8a1c60f6 +docker compose version 1.25.5, build 8a1c60f6 docker-py version: 4.1.0 CPython version: 3.7.5 OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020 diff --git a/tests/integration/README.md b/tests/integration/README.md index 448f7e8f32c3a..a8137b8a2a7ee 100644 --- a/tests/integration/README.md +++ b/tests/integration/README.md @@ -7,7 +7,7 @@ This folder contains the integration test for Milvus components. Integration test still need some thirdparty components to start: ```bash -cd [milvus-folder]/deployments/docker/dev && docker-compose up -d +cd [milvus-folder]/deployments/docker/dev && docker compose up -d ``` Run following script to start the full integration test: diff --git a/tests/python_client/deploy/README.md b/tests/python_client/deploy/README.md index 11b00f7cac31e..9f2866e27d966 100644 --- a/tests/python_client/deploy/README.md +++ b/tests/python_client/deploy/README.md @@ -59,7 +59,7 @@ $ bash run.sh -p ${Password} ``` ## Integrate deploy test into CI -Provides a way to periodically run docker-compose deployment tests through GitHub action:[deploy-test](https://github.com/milvus-io/milvus/blob/master/.github/workflows/deploy-test.yaml) +Provides a way to periodically run docker compose deployment tests through GitHub action:[deploy-test](https://github.com/milvus-io/milvus/blob/master/.github/workflows/deploy-test.yaml) - [x] Parallel testing for four deployment scenarios - [x] Upload logs to artifacts for further debug diff --git a/tests/python_client/deploy/check_healthy.sh b/tests/python_client/deploy/check_healthy.sh index e5f647ef8131b..a7f2ddb080e8d 100644 --- a/tests/python_client/deploy/check_healthy.sh +++ b/tests/python_client/deploy/check_healthy.sh @@ -4,8 +4,8 @@ function check_healthy { Expect=$(yq '.services | length' 'docker-compose.yml') Expect_health=$(yq '.services' 'docker-compose.yml' |grep 'healthcheck'|wc -l) - cnt=$(docker-compose ps | grep -E "running|Running|Up|up" | wc -l) - healthy=$(docker-compose ps | grep "healthy" | wc -l) + cnt=$(docker compose ps | grep -E "running|Running|Up|up" | wc -l) + healthy=$(docker compose ps | grep "healthy" | wc -l) time_cnt=0 echo "running num $cnt expect num $Expect" echo "healthy num $healthy expect num $Expect_health" @@ -20,8 +20,8 @@ function check_healthy { printf "timeout,there are some issues with deployment!" exit 1 fi - cnt=$(docker-compose ps | grep -E "running|Running|Up|up" | wc -l) - healthy=$(docker-compose ps | grep "healthy" | wc -l) + cnt=$(docker compose ps | grep -E "running|Running|Up|up" | wc -l) + healthy=$(docker compose ps | grep "healthy" | wc -l) echo "running num $cnt expect num $Expect" echo "healthy num $healthy expect num $Expect_health" done diff --git a/tests/python_client/deploy/test.sh b/tests/python_client/deploy/test.sh index 80f8279f45acb..33149d64989f6 100644 --- a/tests/python_client/deploy/test.sh +++ b/tests/python_client/deploy/test.sh @@ -42,7 +42,7 @@ done ROOT_FOLDER=$(cd "$(dirname "$0")";pwd) -# to export docker-compose logs before exit +# to export docker compose logs before exit function error_exit { pushd ${ROOT_FOLDER}/${Deploy_Dir} echo "test failed" @@ -51,8 +51,8 @@ function error_exit { then mkdir logs fi - docker-compose ps - docker-compose logs > ./logs/${Deploy_Dir}-${Task}-${current}.log 2>&1 + docker compose ps + docker compose logs > ./logs/${Deploy_Dir}-${Task}-${current}.log 2>&1 echo "log saved to $(pwd)/logs/${Deploy_Dir}-${Task}-${current}.log" popd exit 1 @@ -75,8 +75,8 @@ function replace_image_tag { #to check containers all running and minio is healthy function check_healthy { - cnt=$(docker-compose ps | grep -E "running|Running|Up|up" | wc -l) - healthy=$(docker-compose ps | grep "healthy" | wc -l) + cnt=$(docker compose ps | grep -E "running|Running|Up|up" | wc -l) + healthy=$(docker compose ps | grep "healthy" | wc -l) time_cnt=0 echo "running num $cnt expect num $Expect" echo "healthy num $healthy expect num $Expect_health" @@ -91,8 +91,8 @@ function check_healthy { printf "timeout,there are some issue with deployment!" error_exit fi - cnt=$(docker-compose ps | grep -E "running|Running|Up|up" | wc -l) - healthy=$(docker-compose ps | grep "healthy" | wc -l) + cnt=$(docker compose ps | grep -E "running|Running|Up|up" | wc -l) + healthy=$(docker compose ps | grep "healthy" | wc -l) echo "running num $cnt expect num $Expect" echo "healthy num $healthy expect num $Expect_health" done @@ -129,14 +129,14 @@ pushd ${Deploy_Dir} wget https://github.com/milvus-io/milvus/releases/download/${latest_rc_tag}/milvus-${Mode}-docker-compose.yml -O docker-compose.yml ls # clean env to deploy a fresh milvus -docker-compose down -docker-compose ps +docker compose down +docker compose ps echo "$pw"| sudo -S rm -rf ./volumes # first deployment if [ "$Task" == "reinstall" ]; then - printf "download latest milvus docker-compose yaml file from github\n" + printf "download latest milvus docker compose yaml file from github\n" wget https://raw.githubusercontent.com/milvus-io/milvus/master/deployments/docker/${Mode}/docker-compose.yml -O docker-compose.yml printf "start to deploy latest rc tag milvus\n" replace_image_tag "milvusdb\/milvus" $latest_tag @@ -150,9 +150,9 @@ fi cat docker-compose.yml|grep milvusdb Expect=$(grep "container_name" docker-compose.yml | wc -l) Expect_health=$(grep "healthcheck" docker-compose.yml | wc -l) -docker-compose up -d +docker compose up -d check_healthy -docker-compose ps +docker compose ps popd # test for first deployment @@ -169,10 +169,10 @@ fi pushd ${Deploy_Dir} # uninstall milvus printf "start to uninstall milvus\n" -docker-compose down +docker compose down sleep 10 printf "check all containers removed\n" -docker-compose ps +docker compose ps # second deployment if [ "$Task" == "reinstall" ]; @@ -184,16 +184,16 @@ if [ "$Task" == "upgrade" ]; then printf "start to upgrade milvus\n" # because the task is upgrade, so replace image tag to latest, like rc4-->rc5 - printf "download latest milvus docker-compose yaml file from github\n" + printf "download latest milvus docker compose yaml file from github\n" wget https://raw.githubusercontent.com/milvus-io/milvus/master/deployments/docker/${Mode}/docker-compose.yml -O docker-compose.yml printf "start to deploy latest rc tag milvus\n" replace_image_tag "milvusdb\/milvus" $latest_tag fi cat docker-compose.yml|grep milvusdb -docker-compose up -d +docker compose up -d check_healthy -docker-compose ps +docker compose ps popd # wait for milvus ready @@ -211,12 +211,12 @@ then fi -# test for third deployment(after docker-compose restart) +# test for third deployment(after docker compose restart) pushd ${Deploy_Dir} printf "start to restart milvus\n" -docker-compose restart +docker compose restart check_healthy -docker-compose ps +docker compose ps popd # wait for milvus ready @@ -234,9 +234,9 @@ fi pushd ${Deploy_Dir} # clean env -docker-compose ps -docker-compose down +docker compose ps +docker compose down sleep 10 -docker-compose ps +docker compose ps echo "$pw"|sudo -S rm -rf ./volumes popd diff --git a/tests/python_client/deploy/utils.sh b/tests/python_client/deploy/utils.sh index 3511554c19552..54a87231bbd8f 100644 --- a/tests/python_client/deploy/utils.sh +++ b/tests/python_client/deploy/utils.sh @@ -32,8 +32,8 @@ function replace_image_tag { function check_healthy { Expect=$(yq '.services | length' 'docker-compose.yml') Expect_health=$(yq '.services' 'docker-compose.yml' |grep 'healthcheck'|wc -l) - cnt=$(docker-compose ps | grep -E "running|Running|Up|up" | wc -l) - healthy=$(docker-compose ps | grep "healthy" | wc -l) + cnt=$(docker compose ps | grep -E "running|Running|Up|up" | wc -l) + healthy=$(docker compose ps | grep "healthy" | wc -l) time_cnt=0 echo "running num $cnt expect num $Expect" echo "healthy num $healthy expect num $Expect_health" @@ -48,8 +48,8 @@ function check_healthy { printf "timeout,there are some issues with deployment!" exit 1 fi - cnt=$(docker-compose ps | grep -E "running|Running|Up|up" | wc -l) - healthy=$(docker-compose ps | grep "healthy" | wc -l) + cnt=$(docker compose ps | grep -E "running|Running|Up|up" | wc -l) + healthy=$(docker compose ps | grep "healthy" | wc -l) echo "running num $cnt expect num $Expect" echo "healthy num $healthy expect num $Expect_health" done diff --git a/tests/scripts/e2e.sh b/tests/scripts/e2e.sh index 1a7cd8977520f..dcef42e71508a 100755 --- a/tests/scripts/e2e.sh +++ b/tests/scripts/e2e.sh @@ -80,12 +80,12 @@ fi export MILVUS_SERVICE_PORT="${MILVUS_SERVICE_PORT:-19530}" if [[ "${MANUAL:-}" == "true" ]]; then - docker-compose up -d + docker compose up -d else if [[ "${MILVUS_CLIENT}" == "pymilvus" ]]; then # Better to run pytest under pytest workspace export MILVUS_PYTEST_WORKSPACE="/milvus/tests/python_client" - docker-compose run --rm pytest /bin/bash -c "pytest -n ${PARALLEL_NUM} --host ${MILVUS_SERVICE_IP} --port ${MILVUS_SERVICE_PORT} \ + docker compose run --rm pytest /bin/bash -c "pytest -n ${PARALLEL_NUM} --host ${MILVUS_SERVICE_IP} --port ${MILVUS_SERVICE_PORT} \ --html=\${CI_LOG_PATH}/report.html --self-contained-html ${@:-}" fi fi diff --git a/tests/scripts/export_log_docker.sh b/tests/scripts/export_log_docker.sh index 70d37188ce587..bcb6232543357 100644 --- a/tests/scripts/export_log_docker.sh +++ b/tests/scripts/export_log_docker.sh @@ -4,7 +4,7 @@ set -e log_dir=${1:-"logs"} -array=($(docker-compose ps -a|awk 'NR == 1 {next} {print $1}')) +array=($(docker compose ps -a|awk 'NR == 1 {next} {print $1}')) echo ${array[@]} if [ ! -d $log_dir ]; then diff --git a/tests/scripts/prepare_e2e.sh b/tests/scripts/prepare_e2e.sh index 07948bdbfeca3..a83c5fc478b5d 100755 --- a/tests/scripts/prepare_e2e.sh +++ b/tests/scripts/prepare_e2e.sh @@ -31,8 +31,8 @@ done ROOT="$( cd -P "$( dirname "$SOURCE" )/../.." && pwd )" pushd "${ROOT}/tests/docker" - docker-compose pull --ignore-pull-failures pytest + docker compose pull pytest if [[ -z "${SKIP_CHECK_PYTEST_ENV:-}" ]]; then - docker-compose build pytest + docker compose build pytest fi popd