ADAPT-Chase's picture
Add files using upload-large-folder tool
b8bb38f verified
#!/usr/bin/env bash
set -euo pipefail
DBOPS=${DBOPS_ROOT:-/data/adaptai/platform/dbops}
BIN_DIR=$DBOPS/binaries/pulsar
DIR=$BIN_DIR/pulsar
mkdir -p "$BIN_DIR"
if [ ! -x "$DIR/bin/pulsar" ]; then
echo "[pulsar] fetching binary"
ver=3.1.2
url="https://archive.apache.org/dist/pulsar/pulsar-$ver/apache-pulsar-$ver-bin.tar.gz"
tmp=$(mktemp -d)
curl -fsSL "$url" -o "$tmp/pulsar.tgz"
tar -xzf "$tmp/pulsar.tgz" -C "$tmp"
src=$(find "$tmp" -maxdepth 1 -type d -name "apache-pulsar-*" | head -n1)
mv "$src" "$DIR"
rm -rf "$tmp"
fi
# Ports per dbops/ports.yaml
export PULSAR_PREFIX_brokerServicePort=${PULSAR_BROKER_PORT:-18650}
export PULSAR_PREFIX_webServicePort=${PULSAR_HTTP_PORT:-18880}
cd "$DIR"
exec bin/pulsar standalone -nss