From 0404797f46e9a2572ca1c7a0cad77389bdd76f47 Mon Sep 17 00:00:00 2001 From: Tim Pansino Date: Thu, 28 May 2026 16:47:16 -0700 Subject: [PATCH 1/3] Move firestore to non-hacky solution --- .../containers/firestore/docker-compose.yml | 26 +++++++++++++ .github/workflows/tests.yml | 37 +++++++++---------- 2 files changed, 43 insertions(+), 20 deletions(-) create mode 100644 .github/containers/firestore/docker-compose.yml diff --git a/.github/containers/firestore/docker-compose.yml b/.github/containers/firestore/docker-compose.yml new file mode 100644 index 000000000..771e6a4a9 --- /dev/null +++ b/.github/containers/firestore/docker-compose.yml @@ -0,0 +1,26 @@ +# Copyright 2010 New Relic, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +services: + firestore: + image: gcr.io/google.com/cloudsdktool/google-cloud-cli:437.0.1-emulators + command: ["/bin/bash", "-c", "gcloud emulators firestore start --host-port=0.0.0.0:8080"] + ports: + - 8080:8080 + healthcheck: + test: ["CMD-SHELL", "curl -fsS http://localhost:8080/ || exit 1"] + interval: 5s + timeout: 3s + retries: 12 + start_period: 10s diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e15e467f1..9abfe1d58 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -751,26 +751,6 @@ jobs: options: >- --add-host=host.docker.internal:host-gateway timeout-minutes: 30 - services: - firestore: - # Image set here MUST be repeated down below in options. See comment below. - image: gcr.io/google.com/cloudsdktool/google-cloud-cli:437.0.1-emulators - ports: - - 8080:8080 - # Set health checks to wait until container has started - options: >- - --health-cmd "echo success" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - --health-start-period 5s - gcr.io/google.com/cloudsdktool/google-cloud-cli:437.0.1-emulators /bin/bash -c "gcloud emulators firestore start --host-port=0.0.0.0:8080" || - # This is a very hacky solution. GitHub Actions doesn't provide APIs for setting commands on services, but allows adding arbitrary options. - # --entrypoint won't work as it only accepts an executable and not the [] syntax. - # Instead, we specify the image again the command afterwards like a call to docker create. The result is a few environment variables - # and the original command being appended to our hijacked docker create command. We can avoid any issues by adding || to prevent that - # from every being executed as bash commands. - steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 @@ -784,6 +764,18 @@ jobs: mkdir -p /github/home/.cache/pip chown -R "$(whoami)" /github/home/.cache/pip + - name: Start firestore + run: | + docker compose \ + -f .github/containers/firestore/docker-compose.yml \ + up -d \ + --wait \ + --wait-timeout 60 \ + && exit 0 + echo "firestore did not become healthy in time" + docker compose -f .github/containers/firestore/docker-compose.yml logs + exit 1 + - name: Get Environments id: get-envs run: | @@ -821,6 +813,11 @@ jobs: if-no-files-found: error retention-days: 1 + - name: Stop firestore + if: always() + run: | + docker compose -f .github/containers/firestore/docker-compose.yml down + grpc: env: TOTAL_GROUPS: 1 From 3d4b88491ed6d8e3324a5678feebb79a94e949c9 Mon Sep 17 00:00:00 2001 From: Tim Pansino Date: Thu, 28 May 2026 16:48:04 -0700 Subject: [PATCH 2/3] Codify rediscluster setup and build at runtime --- .github/containers/rediscluster/Dockerfile | 28 ++++++ .../rediscluster/docker-compose.yml | 85 +++++++++++++++++++ .github/workflows/tests.yml | 76 +++++------------ 3 files changed, 135 insertions(+), 54 deletions(-) create mode 100644 .github/containers/rediscluster/Dockerfile create mode 100644 .github/containers/rediscluster/docker-compose.yml diff --git a/.github/containers/rediscluster/Dockerfile b/.github/containers/rediscluster/Dockerfile new file mode 100644 index 000000000..c393cd62c --- /dev/null +++ b/.github/containers/rediscluster/Dockerfile @@ -0,0 +1,28 @@ +# syntax=docker/dockerfile:1.4 +# Copyright 2010 New Relic, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM redis:7.0.12 + +COPY <<"EOF" /etc/redis.conf +cluster-announce-hostname 'host.docker.internal' +bind 0.0.0.0 +port 6379 +cluster-enabled yes +cluster-config-file nodes.conf +cluster-node-timeout 5000 +appendonly yes +EOF + +CMD ["redis-server", "/etc/redis.conf"] diff --git a/.github/containers/rediscluster/docker-compose.yml b/.github/containers/rediscluster/docker-compose.yml new file mode 100644 index 000000000..5713596ff --- /dev/null +++ b/.github/containers/rediscluster/docker-compose.yml @@ -0,0 +1,85 @@ +# Copyright 2010 New Relic, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +x-redis-node: &redis-node + build: . + image: redis-cluster-node:local + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 2s + timeout: 3s + retries: 15 + +services: + redis1: + <<: *redis-node + ports: + - 6379:6379 + - 16379:16379 + + redis2: + <<: *redis-node + ports: + - 6380:6379 + - 16380:16379 + + redis3: + <<: *redis-node + ports: + - 6381:6379 + - 16381:16379 + + redis4: + <<: *redis-node + ports: + - 6382:6379 + - 16382:16379 + + redis5: + <<: *redis-node + ports: + - 6383:6379 + - 16383:16379 + + redis6: + <<: *redis-node + ports: + - 6384:6379 + - 16384:16379 + + cluster-setup: + image: redis-cluster-node:local + restart: "no" + command: + - bash + - -c + - >- + redis-cli --cluster create + redis1:6379 redis2:6379 redis3:6379 redis4:6379 redis5:6379 redis6:6379 + --cluster-replicas 1 + --cluster-yes && + exec sleep infinity + healthcheck: + test: ["CMD-SHELL", "redis-cli -h redis1 cluster info | grep -q cluster_state:ok"] + interval: 2s + timeout: 3s + retries: 30 + start_period: 30s + depends_on: + redis1: {condition: service_healthy} + redis2: {condition: service_healthy} + redis3: {condition: service_healthy} + redis4: {condition: service_healthy} + redis5: {condition: service_healthy} + redis6: {condition: service_healthy} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9abfe1d58..769e526f8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1871,60 +1871,6 @@ jobs: options: >- --add-host=host.docker.internal:host-gateway timeout-minutes: 30 - services: - redis1: - image: hmstepanek/redis-cluster-node:1.0.0 - ports: - - 6379:6379 - - 16379:16379 - options: >- - --add-host=host.docker.internal:host-gateway - - redis2: - image: hmstepanek/redis-cluster-node:1.0.0 - ports: - - 6380:6379 - - 16380:16379 - options: >- - --add-host=host.docker.internal:host-gateway - - redis3: - image: hmstepanek/redis-cluster-node:1.0.0 - ports: - - 6381:6379 - - 16381:16379 - options: >- - --add-host=host.docker.internal:host-gateway - - redis4: - image: hmstepanek/redis-cluster-node:1.0.0 - ports: - - 6382:6379 - - 16382:16379 - options: >- - --add-host=host.docker.internal:host-gateway - - redis5: - image: hmstepanek/redis-cluster-node:1.0.0 - ports: - - 6383:6379 - - 16383:16379 - options: >- - --add-host=host.docker.internal:host-gateway - - redis6: - image: hmstepanek/redis-cluster-node:1.0.0 - ports: - - 6384:6379 - - 16384:16379 - options: >- - --add-host=host.docker.internal:host-gateway - - cluster-setup: - image: hmstepanek/redis-cluster:1.0.0 - options: >- - --add-host=host.docker.internal:host-gateway - steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 @@ -1938,6 +1884,23 @@ jobs: mkdir -p /github/home/.cache/pip chown -R "$(whoami)" /github/home/.cache/pip + - name: Start rediscluster + run: | + # Build only the redis1 image to prevent fighting, then start the entire cluster + docker compose \ + -f .github/containers/rediscluster/docker-compose.yml \ + build \ + redis1 && \ + docker compose \ + -f .github/containers/rediscluster/docker-compose.yml \ + up -d \ + --wait \ + --wait-timeout 120 \ + && exit 0 + echo "rediscluster did not become healthy in time" + docker compose -f .github/containers/rediscluster/docker-compose.yml logs + exit 1 + - name: Get Environments id: get-envs run: | @@ -1975,6 +1938,11 @@ jobs: if-no-files-found: error retention-days: 1 + - name: Stop rediscluster + if: always() + run: | + docker compose -f .github/containers/rediscluster/docker-compose.yml down + solr: env: TOTAL_GROUPS: 1 From 4439da173fe94f59235b2011dd4975ba4236d2a8 Mon Sep 17 00:00:00 2001 From: TimPansino <11214426+TimPansino@users.noreply.github.com> Date: Fri, 29 May 2026 23:49:45 +0000 Subject: [PATCH 3/3] [MegaLinter] Apply linters fixes --- .../containers/firestore/docker-compose.yml | 7 ++++++- .../containers/rediscluster/docker-compose.yml | 18 +++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/containers/firestore/docker-compose.yml b/.github/containers/firestore/docker-compose.yml index 771e6a4a9..56c68687b 100644 --- a/.github/containers/firestore/docker-compose.yml +++ b/.github/containers/firestore/docker-compose.yml @@ -15,7 +15,12 @@ services: firestore: image: gcr.io/google.com/cloudsdktool/google-cloud-cli:437.0.1-emulators - command: ["/bin/bash", "-c", "gcloud emulators firestore start --host-port=0.0.0.0:8080"] + command: + [ + "/bin/bash", + "-c", + "gcloud emulators firestore start --host-port=0.0.0.0:8080", + ] ports: - 8080:8080 healthcheck: diff --git a/.github/containers/rediscluster/docker-compose.yml b/.github/containers/rediscluster/docker-compose.yml index 5713596ff..59c56d4fb 100644 --- a/.github/containers/rediscluster/docker-compose.yml +++ b/.github/containers/rediscluster/docker-compose.yml @@ -71,15 +71,19 @@ services: --cluster-yes && exec sleep infinity healthcheck: - test: ["CMD-SHELL", "redis-cli -h redis1 cluster info | grep -q cluster_state:ok"] + test: + [ + "CMD-SHELL", + "redis-cli -h redis1 cluster info | grep -q cluster_state:ok", + ] interval: 2s timeout: 3s retries: 30 start_period: 30s depends_on: - redis1: {condition: service_healthy} - redis2: {condition: service_healthy} - redis3: {condition: service_healthy} - redis4: {condition: service_healthy} - redis5: {condition: service_healthy} - redis6: {condition: service_healthy} + redis1: { condition: service_healthy } + redis2: { condition: service_healthy } + redis3: { condition: service_healthy } + redis4: { condition: service_healthy } + redis5: { condition: service_healthy } + redis6: { condition: service_healthy }