This is an automated email from the ASF dual-hosted git repository. yasith pushed a commit to branch feat/single-jvm in repository https://gitbox.apache.org/repos/asf/airavata.git
commit dbd71c22aa495f606b2317bfd2695c82cafca943 Author: yasithdev <[email protected]> AuthorDate: Thu Mar 26 01:40:13 2026 -0500 feat: add setup.sh and start.sh scripts setup.sh: starts docker infra, generates keystores, builds start.sh: launches AiravataUnifiedServer with correct classpath Usage: ./scripts/setup.sh # first time ./scripts/start.sh # subsequent runs --- scripts/setup.sh | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ scripts/start.sh | 19 +++++++++++++++++++ 2 files changed, 77 insertions(+) diff --git a/scripts/setup.sh b/scripts/setup.sh new file mode 100755 index 0000000000..acc24b711d --- /dev/null +++ b/scripts/setup.sh @@ -0,0 +1,58 @@ +#!/bin/bash +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" + +echo "=== Airavata Setup ===" + +# 1. Start infrastructure +echo "Starting infrastructure services..." +cd "$ROOT_DIR" +docker compose up -d +echo "Waiting for services to be ready..." +sleep 10 + +# Verify DB is up +until docker exec airavata-db mariadb -h127.0.0.1 -uairavata -p123456 -e "SELECT 1" > /dev/null 2>&1; do + echo " Waiting for MariaDB..." + sleep 2 +done +echo " MariaDB: ready" + +# Verify RabbitMQ is up +until docker exec airavata-rabbitmq rabbitmqctl status > /dev/null 2>&1; do + echo " Waiting for RabbitMQ..." + sleep 2 +done +echo " RabbitMQ: ready" + +# 2. Generate keystores if missing +if [ ! -f "$ROOT_DIR/keystores/airavata.p12" ]; then + echo "Generating keystores..." + cd "$ROOT_DIR/keystores" + keytool -genseckey -alias airavata -keyalg AES -keysize 256 \ + -keystore aes.p12 -storepass airavata -storetype PKCS12 2>/dev/null + openssl pkcs12 -export -name tls -out airavata.p12 -passout pass:airavata \ + -in server.crt -inkey server.key 2>/dev/null + keytool -importkeystore -srckeystore aes.p12 -destkeystore airavata.p12 \ + -srcstorepass airavata -deststorepass airavata -noprompt 2>/dev/null + rm -f aes.p12 + echo " Keystores generated" +fi + +# 3. Build +echo "Building Airavata..." +cd "$ROOT_DIR/airavata-api" +./mvnw package -DskipTests -q 2>&1 | tail -1 +echo " Build complete" + +# 4. Build classpath +./mvnw dependency:build-classpath -q -Dmdep.outputFile=target/cp.txt 2>/dev/null + +echo "" +echo "=== Setup Complete ===" +echo "" +echo "To start Airavata:" +echo " cd $ROOT_DIR" +echo " ./scripts/start.sh" diff --git a/scripts/start.sh b/scripts/start.sh new file mode 100755 index 0000000000..c1f719d704 --- /dev/null +++ b/scripts/start.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" + +cd "$ROOT_DIR" + +# Ensure infra is running +if ! docker compose ps --status running 2>/dev/null | grep -q airavata-db; then + echo "Infrastructure not running. Run ./scripts/setup.sh first." + exit 1 +fi + +# Build classpath +CP=$(cat airavata-api/target/cp.txt):airavata-api/target/airavata-api-0.21-SNAPSHOT.jar + +echo "Starting Airavata Unified Server..." +java -cp "$CP" org.apache.airavata.api.server.AiravataUnifiedServer "$@"
