Skip to content

Commit

Permalink
[opt](docker)Replace healthy container with --wait (#47357)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

Problem Summary:

Docker compose `--wait` does the same things as those `hello-world`
containers: Wait main service to be health. So just replace the
`hello-world` containers to `--wait`.
  • Loading branch information
Thearas authored and Your Name committed Jan 24, 2025
1 parent bcea4fc commit dd8dbd5
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ services:
- ./init:/docker-entrypoint-initdb.d
networks:
- doris--clickhouse
doris--clickhouse-hello-world:
image: hello-world
depends_on:
doris--clickhouse:
condition: service_healthy
networks:
- doris--clickhouse

networks:
doris--clickhouse:
Expand Down
7 changes: 0 additions & 7 deletions docker/thirdparties/docker-compose/db2/db2.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ services:
restart: always
networks:
- doris--db2_network
db2-hello-world:
image: hello-world
depends_on:
doris--db2_11:
condition: service_healthy
networks:
- doris--db2_network
networks:
doris--db2_network:
ipam:
Expand Down
8 changes: 0 additions & 8 deletions docker/thirdparties/docker-compose/hive/hive-2x.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,3 @@ services:
interval: 5s
timeout: 60s
retries: 120

hive-hello-world:
image: hello-world
container_name: ${CONTAINER_UID}hive2-hello-world
depends_on:
hive-metastore:
condition: service_healthy
network_mode: "host"
8 changes: 0 additions & 8 deletions docker/thirdparties/docker-compose/hive/hive-3x.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,3 @@ services:
interval: 5s
timeout: 60s
retries: 120

hive-hello-world:
image: hello-world
container_name: ${CONTAINER_UID}hive3-hello-world
depends_on:
hive-metastore:
condition: service_healthy
network_mode: "host"
8 changes: 0 additions & 8 deletions docker/thirdparties/docker-compose/iceberg/iceberg.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,6 @@ services:
mc cp -r /mnt/data/input/minio/warehouse/* minio/warehouse/;
tail -f /dev/null
"

iceberg-hello-world:
image: hello-world
container_name: doris--iceberg-hello-world
depends_on:
spark-iceberg:
condition: service_healthy
network_mode: "host"

networks:
doris--iceberg:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ services:
- ./init:/docker-entrypoint-initdb.d
networks:
- doris--mariadb
doris--mariadb-hello-world:
image: hello-world
depends_on:
doris--mariadb:
condition: service_healthy
networks:
- doris--mariadb

networks:
doris--mariadb:
Expand Down
8 changes: 1 addition & 7 deletions docker/thirdparties/docker-compose/mysql/mysql-5.7.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,7 @@ services:
- ./my.cnf:/etc/mysql/conf.d/my.cnf
networks:
- doris--mysql_57
doris--mysql-hello-world:
image: hello-world
depends_on:
doris--mysql_57:
condition: service_healthy
networks:
- doris--mysql_57

networks:
doris--mysql_57:
ipam:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,7 @@ services:
- ./init:/root/boot/init.d
networks:
- doris--oceanbase
doris--oceanbase-hello-world:
image: hello-world
depends_on:
doris--oceanbase:
condition: service_healthy
networks:
- doris--oceanbase

networks:
doris--oceanbase:
ipam:
Expand Down
7 changes: 0 additions & 7 deletions docker/thirdparties/docker-compose/oracle/oracle-11.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ services:
- TZ=Asia/Shanghai
networks:
- doris--oracle_11
doris--oracle-hello-world:
image: hello-world
depends_on:
doris--oracle_11:
condition: service_healthy
networks:
- doris--oracle_11

networks:
doris--oracle_11:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ services:
- ./init:/docker-entrypoint-initdb.d
networks:
- doris--postgres
doris--postgres--hello-world:
image: hello-world
depends_on:
doris--postgres:
condition: service_healthy
networks:
- doris--postgres

networks:
doris--postgres:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,7 @@ services:
- SA_PASSWORD=Doris123456
networks:
- doris--sqlserver_2022
doris--sqlserver-hello-world:
image: hello-world
depends_on:
doris--sqlserver_2022:
condition: service_healthy
networks:
- doris--sqlserver_2022

networks:
doris--sqlserver_2022:
ipam:
Expand Down
22 changes: 11 additions & 11 deletions docker/thirdparties/run-thirdparties-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ start_mysql() {
if [[ "${STOP}" -ne 1 ]]; then
sudo rm "${ROOT}"/docker-compose/mysql/data/* -rf
sudo mkdir -p "${ROOT}"/docker-compose/mysql/data/
sudo docker compose -f "${ROOT}"/docker-compose/mysql/mysql-5.7.yaml --env-file "${ROOT}"/docker-compose/mysql/mysql-5.7.env up -d
sudo docker compose -f "${ROOT}"/docker-compose/mysql/mysql-5.7.yaml --env-file "${ROOT}"/docker-compose/mysql/mysql-5.7.env up -d --wait
fi
}

Expand All @@ -248,7 +248,7 @@ start_pg() {
if [[ "${STOP}" -ne 1 ]]; then
sudo rm "${ROOT}"/docker-compose/postgresql/data/* -rf
sudo mkdir -p "${ROOT}"/docker-compose/postgresql/data/data
sudo docker compose -f "${ROOT}"/docker-compose/postgresql/postgresql-14.yaml --env-file "${ROOT}"/docker-compose/postgresql/postgresql-14.env up -d
sudo docker compose -f "${ROOT}"/docker-compose/postgresql/postgresql-14.yaml --env-file "${ROOT}"/docker-compose/postgresql/postgresql-14.env up -d --wait
fi
}

Expand All @@ -260,7 +260,7 @@ start_oracle() {
if [[ "${STOP}" -ne 1 ]]; then
sudo rm "${ROOT}"/docker-compose/oracle/data/* -rf
sudo mkdir -p "${ROOT}"/docker-compose/oracle/data/
sudo docker compose -f "${ROOT}"/docker-compose/oracle/oracle-11.yaml --env-file "${ROOT}"/docker-compose/oracle/oracle-11.env up -d
sudo docker compose -f "${ROOT}"/docker-compose/oracle/oracle-11.yaml --env-file "${ROOT}"/docker-compose/oracle/oracle-11.env up -d --wait
fi
}

Expand All @@ -272,7 +272,7 @@ start_db2() {
if [[ "${STOP}" -ne 1 ]]; then
sudo rm "${ROOT}"/docker-compose/db2/data/* -rf
sudo mkdir -p "${ROOT}"/docker-compose/db2/data/
sudo docker compose -f "${ROOT}"/docker-compose/db2/db2.yaml --env-file "${ROOT}"/docker-compose/db2/db2.env up -d
sudo docker compose -f "${ROOT}"/docker-compose/db2/db2.yaml --env-file "${ROOT}"/docker-compose/db2/db2.env up -d --wait
fi
}

Expand All @@ -284,7 +284,7 @@ start_oceanbase() {
if [[ "${STOP}" -ne 1 ]]; then
sudo rm "${ROOT}"/docker-compose/oceanbase/data/* -rf
sudo mkdir -p "${ROOT}"/docker-compose/oceanbase/data/
sudo docker compose -f "${ROOT}"/docker-compose/oceanbase/oceanbase.yaml --env-file "${ROOT}"/docker-compose/oceanbase/oceanbase.env up -d
sudo docker compose -f "${ROOT}"/docker-compose/oceanbase/oceanbase.yaml --env-file "${ROOT}"/docker-compose/oceanbase/oceanbase.env up -d --wait
fi
}

Expand All @@ -296,7 +296,7 @@ start_sqlserver() {
if [[ "${STOP}" -ne 1 ]]; then
sudo rm "${ROOT}"/docker-compose/sqlserver/data/* -rf
sudo mkdir -p "${ROOT}"/docker-compose/sqlserver/data/
sudo docker compose -f "${ROOT}"/docker-compose/sqlserver/sqlserver.yaml --env-file "${ROOT}"/docker-compose/sqlserver/sqlserver.env up -d
sudo docker compose -f "${ROOT}"/docker-compose/sqlserver/sqlserver.yaml --env-file "${ROOT}"/docker-compose/sqlserver/sqlserver.env up -d --wait
fi
}

Expand All @@ -308,7 +308,7 @@ start_clickhouse() {
if [[ "${STOP}" -ne 1 ]]; then
sudo rm "${ROOT}"/docker-compose/clickhouse/data/* -rf
sudo mkdir -p "${ROOT}"/docker-compose/clickhouse/data/
sudo docker compose -f "${ROOT}"/docker-compose/clickhouse/clickhouse.yaml --env-file "${ROOT}"/docker-compose/clickhouse/clickhouse.env up -d
sudo docker compose -f "${ROOT}"/docker-compose/clickhouse/clickhouse.yaml --env-file "${ROOT}"/docker-compose/clickhouse/clickhouse.env up -d --wait
fi
}

Expand Down Expand Up @@ -379,7 +379,7 @@ start_hive2() {
envsubst <"${ROOT}"/docker-compose/hive/hadoop-hive-2x.env.tpl >> "${ROOT}"/docker-compose/hive/hadoop-hive-2x.env
sudo docker compose -p ${CONTAINER_UID}hive2 -f "${ROOT}"/docker-compose/hive/hive-2x.yaml --env-file "${ROOT}"/docker-compose/hive/hadoop-hive-2x.env down
if [[ "${STOP}" -ne 1 ]]; then
sudo docker compose -p ${CONTAINER_UID}hive2 -f "${ROOT}"/docker-compose/hive/hive-2x.yaml --env-file "${ROOT}"/docker-compose/hive/hadoop-hive-2x.env up --build --remove-orphans -d
sudo docker compose -p ${CONTAINER_UID}hive2 -f "${ROOT}"/docker-compose/hive/hive-2x.yaml --env-file "${ROOT}"/docker-compose/hive/hadoop-hive-2x.env up --build --remove-orphans -d --wait
fi
}

Expand Down Expand Up @@ -418,7 +418,7 @@ start_hive3() {
envsubst <"${ROOT}"/docker-compose/hive/hadoop-hive-3x.env.tpl >> "${ROOT}"/docker-compose/hive/hadoop-hive-3x.env
sudo docker compose -p ${CONTAINER_UID}hive3 -f "${ROOT}"/docker-compose/hive/hive-3x.yaml --env-file "${ROOT}"/docker-compose/hive/hadoop-hive-3x.env down
if [[ "${STOP}" -ne 1 ]]; then
sudo docker compose -p ${CONTAINER_UID}hive3 -f "${ROOT}"/docker-compose/hive/hive-3x.yaml --env-file "${ROOT}"/docker-compose/hive/hadoop-hive-3x.env up --build --remove-orphans -d
sudo docker compose -p ${CONTAINER_UID}hive3 -f "${ROOT}"/docker-compose/hive/hive-3x.yaml --env-file "${ROOT}"/docker-compose/hive/hadoop-hive-3x.env up --build --remove-orphans -d --wait
fi
}

Expand Down Expand Up @@ -452,7 +452,7 @@ start_iceberg() {
echo "${ICEBERG_DIR}/data exist, continue !"
fi

sudo docker compose -f "${ROOT}"/docker-compose/iceberg/iceberg.yaml --env-file "${ROOT}"/docker-compose/iceberg/iceberg.env up -d
sudo docker compose -f "${ROOT}"/docker-compose/iceberg/iceberg.yaml --env-file "${ROOT}"/docker-compose/iceberg/iceberg.env up -d --wait
fi
}

Expand Down Expand Up @@ -561,7 +561,7 @@ start_mariadb() {
if [[ "${STOP}" -ne 1 ]]; then
sudo mkdir -p "${ROOT}"/docker-compose/mariadb/data/
sudo rm "${ROOT}"/docker-compose/mariadb/data/* -rf
sudo docker compose -f "${ROOT}"/docker-compose/mariadb/mariadb-10.yaml --env-file "${ROOT}"/docker-compose/mariadb/mariadb-10.env up -d
sudo docker compose -f "${ROOT}"/docker-compose/mariadb/mariadb-10.yaml --env-file "${ROOT}"/docker-compose/mariadb/mariadb-10.env up -d --wait
fi
}

Expand Down

0 comments on commit dd8dbd5

Please sign in to comment.