From def25bdaf9dd21683dbae95ca134efa23b35c1e5 Mon Sep 17 00:00:00 2001 From: Gao Binlong Date: Thu, 26 Sep 2024 13:32:54 +0800 Subject: [PATCH 1/2] Fix testHAProxyModeConnectionWorks is flaky Signed-off-by: Gao Binlong --- qa/remote-clusters/Dockerfile | 6 ++++++ qa/remote-clusters/docker-compose.yml | 11 +++++++++++ 2 files changed, 17 insertions(+) create mode 100644 qa/remote-clusters/Dockerfile diff --git a/qa/remote-clusters/Dockerfile b/qa/remote-clusters/Dockerfile new file mode 100644 index 0000000000000..717a43f9abc87 --- /dev/null +++ b/qa/remote-clusters/Dockerfile @@ -0,0 +1,6 @@ +FROM haproxy:2.1.2 + +# Install netcat +RUN apt-get update && \ + apt-get install -y netcat-traditional && \ + rm -rf /var/lib/apt/lists/* diff --git a/qa/remote-clusters/docker-compose.yml b/qa/remote-clusters/docker-compose.yml index cf6aefcf5c1a3..87d18ea8ff0f5 100644 --- a/qa/remote-clusters/docker-compose.yml +++ b/qa/remote-clusters/docker-compose.yml @@ -67,8 +67,19 @@ services: timeout: 2s retries: 5 haproxy: + build: + context: . + dockerfile: Dockerfile image: haproxy:2.1.2 ports: - "9600" volumes: - ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro + depends_on: + - opensearch-2 + healthcheck: + test: ["CMD", "nc", "-z", "localhost", "9600"] + interval: 2s + timeout: 1s + retries: 5 + start_period: 15s From ea53d79d48f7f5229ddc16fe2b09dc93dcebedfc Mon Sep 17 00:00:00 2001 From: Gao Binlong Date: Sun, 29 Sep 2024 10:29:00 +0800 Subject: [PATCH 2/2] Optimize health check method Signed-off-by: Gao Binlong --- qa/remote-clusters/Dockerfile | 6 ------ qa/remote-clusters/docker-compose.yml | 5 +---- 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 qa/remote-clusters/Dockerfile diff --git a/qa/remote-clusters/Dockerfile b/qa/remote-clusters/Dockerfile deleted file mode 100644 index 717a43f9abc87..0000000000000 --- a/qa/remote-clusters/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM haproxy:2.1.2 - -# Install netcat -RUN apt-get update && \ - apt-get install -y netcat-traditional && \ - rm -rf /var/lib/apt/lists/* diff --git a/qa/remote-clusters/docker-compose.yml b/qa/remote-clusters/docker-compose.yml index 87d18ea8ff0f5..2112da17efe6e 100644 --- a/qa/remote-clusters/docker-compose.yml +++ b/qa/remote-clusters/docker-compose.yml @@ -67,9 +67,6 @@ services: timeout: 2s retries: 5 haproxy: - build: - context: . - dockerfile: Dockerfile image: haproxy:2.1.2 ports: - "9600" @@ -78,7 +75,7 @@ services: depends_on: - opensearch-2 healthcheck: - test: ["CMD", "nc", "-z", "localhost", "9600"] + test: ["CMD", "timeout", "1", "bash", "-c", "cat < /dev/null > /dev/tcp/localhost/9600"] interval: 2s timeout: 1s retries: 5