From e20a2e575d54509928ca157b6c83cec52ca9db96 Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Sat, 23 Dec 2023 18:16:41 -0500 Subject: [PATCH 1/2] Make it a non-fatal error if we are unable to get slot information (#891) --- flow/activities/slot.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flow/activities/slot.go b/flow/activities/slot.go index cf1375b4e4..117dbecea3 100644 --- a/flow/activities/slot.go +++ b/flow/activities/slot.go @@ -23,6 +23,11 @@ func (a *FlowableActivity) handleSlotInfo( return err } + if slotInfo == nil || len(slotInfo) == 0 { + slog.WarnContext(ctx, "warning: unable to get slot info", slog.Any("slotName", slotName)) + return nil + } + deploymentUIDPrefix := "" if peerdbenv.PeerDBDeploymentUID() != "" { deploymentUIDPrefix = fmt.Sprintf("[%s] ", peerdbenv.PeerDBDeploymentUID()) From 7e1813a68bc3749dcc83e82b7a9d16062f8d0833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Sat, 23 Dec 2023 23:47:23 +0000 Subject: [PATCH 2/2] be compatible with podman-compose (#892) podman complains if multiple arguments are passed to `CMD-SHELL`. Turns out we don't need it. podman doesn't support `--no-attach`. Otherwise everything works. Adjust `dev-peerdb.sh` to support podman-compose fallback or being invoked with `USE_PODMAN=1 ./dev-peerdb.sh` --- dev-peerdb.sh | 29 ++++++++++++++++++++++------- docker-compose-dev.yml | 2 +- docker-compose.yml | 2 +- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/dev-peerdb.sh b/dev-peerdb.sh index 2305884213..796425f3dd 100755 --- a/dev-peerdb.sh +++ b/dev-peerdb.sh @@ -1,12 +1,27 @@ -#!/bin/bash -set -Eeuo pipefail +#!/bin/sh +if test -z "$USE_PODMAN" +then + if ! command -v docker &> /dev/null + then + if command -v podman-compose + then + echo "docker could not be found on PATH, using podman-compose" + USE_PODMAN=1 + else + echo "docker could not be found on PATH" + exit 1 + fi + fi +fi -if ! command -v docker &> /dev/null +if test -z "$USE_PODMAN" then - echo "docker could not be found on PATH" - exit 1 + DOCKER="docker compose" + EXTRA_ARGS="--no-attach temporal --no-attach pyroscope --no-attach temporal-ui" +else + DOCKER="podman-compose --podman-run-args=--replace" + EXTRA_ARGS="" fi export PEERDB_VERSION_SHA_SHORT=local-$(git rev-parse --short HEAD) -docker compose -f docker-compose-dev.yml up --build \ - --no-attach temporal --no-attach pyroscope --no-attach temporal-ui +exec $DOCKER -f docker-compose-dev.yml up --build $EXTRA_ARGS diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 158483a7eb..cc6c50b77d 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -44,7 +44,7 @@ services: volumes: - pgdata:/var/lib/postgresql/data healthcheck: - test: ["CMD-SHELL", "pg_isready", "-d", "postgres", "-U", "postgres"] + test: ["CMD", "pg_isready", "-d", "postgres", "-U", "postgres"] interval: 10s timeout: 30s retries: 5 diff --git a/docker-compose.yml b/docker-compose.yml index add4bb2db1..b5d37dbdc1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,7 +37,7 @@ services: volumes: - pgdata:/var/lib/postgresql/data healthcheck: - test: ["CMD-SHELL", "pg_isready", "-d", "postgres", "-U", "postgres"] + test: ["CMD", "pg_isready", "-d", "postgres", "-U", "postgres"] interval: 10s timeout: 30s retries: 5