fix: bound deploy and topic storage growth
This commit is contained in:
parent
2b247c8550
commit
086ec01597
2 changed files with 13 additions and 4 deletions
|
|
@ -54,6 +54,7 @@ jobs:
|
||||||
env:
|
env:
|
||||||
REPO_TOKEN: ${{ github.token }}
|
REPO_TOKEN: ${{ github.token }}
|
||||||
run: |
|
run: |
|
||||||
|
kubectl -n "$PROJECT_NAMESPACE" delete job "$BUILD_JOB" --ignore-not-found=true
|
||||||
cat <<EOF | kubectl apply -f -
|
cat <<EOF | kubectl apply -f -
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: Job
|
kind: Job
|
||||||
|
|
@ -102,7 +103,7 @@ jobs:
|
||||||
- --context=/workspace
|
- --context=/workspace
|
||||||
- --dockerfile=/workspace/Dockerfile
|
- --dockerfile=/workspace/Dockerfile
|
||||||
- --destination=${IMAGE}
|
- --destination=${IMAGE}
|
||||||
- --cache=true
|
- --cache=false
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: workspace
|
- name: workspace
|
||||||
mountPath: /workspace
|
mountPath: /workspace
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ spec:
|
||||||
set -eu
|
set -eu
|
||||||
BROKERS="redpanda.unrip.svc.cluster.local:9092"
|
BROKERS="redpanda.unrip.svc.cluster.local:9092"
|
||||||
TOPICS="raw.near_intents.quote norm.swap_demand cmd.execute_trade exec.trade_result"
|
TOPICS="raw.near_intents.quote norm.swap_demand cmd.execute_trade exec.trade_result"
|
||||||
|
RETENTION_MS="172800000"
|
||||||
|
RETENTION_BYTES="268435456"
|
||||||
|
|
||||||
echo "waiting for Redpanda at ${BROKERS}"
|
echo "waiting for Redpanda at ${BROKERS}"
|
||||||
until rpk cluster info --brokers "$BROKERS" >/dev/null 2>&1; do
|
until rpk cluster info --brokers "$BROKERS" >/dev/null 2>&1; do
|
||||||
|
|
@ -25,10 +27,16 @@ spec:
|
||||||
|
|
||||||
for topic in $TOPICS; do
|
for topic in $TOPICS; do
|
||||||
if rpk topic describe "$topic" --brokers "$BROKERS" >/dev/null 2>&1; then
|
if rpk topic describe "$topic" --brokers "$BROKERS" >/dev/null 2>&1; then
|
||||||
echo "topic already exists: $topic"
|
echo "ensuring retention config for existing topic: $topic"
|
||||||
|
rpk topic alter-config "$topic" --brokers "$BROKERS" \
|
||||||
|
--set retention.ms="$RETENTION_MS" \
|
||||||
|
--set retention.bytes="$RETENTION_BYTES"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "creating topic: $topic"
|
echo "creating topic with bounded retention: $topic"
|
||||||
rpk topic create --brokers "$BROKERS" --partitions 1 --replicas 1 "$topic"
|
rpk topic create --brokers "$BROKERS" --partitions 1 --replicas 1 \
|
||||||
|
-c retention.ms="$RETENTION_MS" \
|
||||||
|
-c retention.bytes="$RETENTION_BYTES" \
|
||||||
|
"$topic"
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue