jyothsnakonisa commented on code in PR #330:
URL: https://github.com/apache/cassandra-sidecar/pull/330#discussion_r3305830168
##########
scripts/build-shaded-dtest-jar-local.sh:
##########
@@ -35,6 +35,9 @@ echo "${JAVA_HOME}"
# The container that runs the script has jdk11 installed only.
# Setting the env var to build with jdk11.
export CASSANDRA_USE_JDK11=true
+# Trunk (5.1-SNAPSHOT) compiles 2700+ source files; without an explicit heap
+# limit ant hits the JVM default (~2GB) and gets OOM-killed on large executors.
+export ANT_OPTS="${ANT_OPTS:-} -Xmx4g"
Review Comment:
No, I was trying out something and this got added.
##########
docker/cdc-demo/scripts/start.sh:
##########
@@ -0,0 +1,130 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+# Builds the sidecar and starts the CDC demo stack.
+#
+# Usage (from anywhere in the repo):
+# ./scripts/start.sh # build + start in confluent mode
(default)
+# ./scripts/start.sh --bytearray # build + start in bytearray mode
+# ./scripts/start.sh --clean # wipe all data volumes before
starting
+# ./scripts/start.sh --skip-build # reuse existing
cassandra-sidecar:dev image
+# ./scripts/start.sh --clean --skip-build
+set -euo pipefail
+
+# ANSI color codes
+BOLD='\033[1m'
+GREEN='\033[0;32m'
+CYAN='\033[0;36m'
+YELLOW='\033[0;33m'
+UNDERLINE='\033[4m'
+RESET='\033[0m'
+
+SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
+DEMO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
+REPO_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
+CLEAN=false
+SKIP_BUILD=false
+SERIALIZER_MODE=confluent
+
+for arg in "$@"; do
+ case "$arg" in
+ --clean) CLEAN=true ;;
+ --skip-build) SKIP_BUILD=true ;;
+ --confluent) SERIALIZER_MODE=confluent ;;
+ --bytearray) SERIALIZER_MODE=bytearray ;;
+ *) echo "Unknown argument: $arg" >&2; exit 1 ;;
+ esac
+done
+
+# ── Stop existing stack
───────────────────────────────────────────────────────
+if $CLEAN; then
+ bash "$SCRIPT_DIR/stop.sh" --clean
+else
+ bash "$SCRIPT_DIR/stop.sh"
+fi
+
+# ── Build
─────────────────────────────────────────────────────────────────────
+if $SKIP_BUILD; then
+ if ! docker image inspect cassandra-sidecar:dev > /dev/null 2>&1; then
+ echo "ERROR: --skip-build specified but cassandra-sidecar:dev image
not found." >&2
+ echo " Run without --skip-build to build the image first." >&2
+ exit 1
+ fi
+ printf "${YELLOW}Skipping build — reusing existing cassandra-sidecar:dev
image.${RESET}\n"
+else
+ printf "${BOLD}==> Building sidecar distribution (./gradlew
installDist)...${RESET}\n"
+ "$REPO_ROOT/gradlew" -p "$REPO_ROOT" installDist \
+ -x test -x integrationTest -x containerTest \
+ --parallel --quiet
+
+ printf "${BOLD}==> Building sidecar Docker image...${RESET}\n"
+ DOCKER_BUILDKIT=1 docker build \
+ -f "$REPO_ROOT/docker/cdc-demo/Dockerfile.sidecar" \
+ -t cassandra-sidecar:dev \
+ "$REPO_ROOT"
+fi
+
+# ── Start stack
───────────────────────────────────────────────────────────────
+printf "${BOLD}==> Starting stack (serializer-mode:
${SERIALIZER_MODE})...${RESET}\n"
+cd "$DEMO_DIR"
+export SERIALIZER_MODE
+docker compose up -d
+
+# ── Wait for sidecar ─────────────────────────────────────────────────────────
+echo ""
+echo "Waiting for sidecar to be ready (follow progress: docker compose logs -f
cassandra-init sidecar)..."
+until curl -sf http://localhost:9043/api/v1/__health > /dev/null 2>&1; do
+ sleep 5
+done
+
+echo "Sidecar is up. Waiting for CDC iterators to start..."
+# timeout(1) is GNU coreutils — not available by default on macOS.
+if command -v timeout > /dev/null 2>&1; then
+ timeout 120 bash -c \
+ 'docker compose logs -f sidecar 2>&1 | grep -m 1 "CDC iterators
started successfully"' \
+ > /dev/null || echo "Warning: timed out waiting for CDC iterators —
check: docker compose logs sidecar"
+else
+ docker compose logs -f sidecar 2>&1 | grep -m 1 "CDC iterators started
successfully" > /dev/null || true
Review Comment:
Added timeout.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]