diff --git a/infra/scripts/build-and-push.sh b/infra/scripts/build-and-push.sh index b511ad86d..6ed567e17 100755 --- a/infra/scripts/build-and-push.sh +++ b/infra/scripts/build-and-push.sh @@ -11,7 +11,7 @@ set -euo pipefail # Usage: # ./infra/scripts/build-and-push.sh # Build & push all # ./infra/scripts/build-and-push.sh --no-push # Build only -# ./infra/scripts/build-and-push.sh --services "api_gateway trading_service" +# ./infra/scripts/build-and-push.sh --services "api-gateway trading-service" # ./infra/scripts/build-and-push.sh --parallel 3 # 3 concurrent builds # ./infra/scripts/build-and-push.sh --dry-run # Show what would run # --------------------------------------------------------------------------- @@ -23,12 +23,12 @@ TIMESTAMP=$(date -u +"%Y%m%d-%H%M%S") # Services built with Dockerfile.service (--build-arg SERVICE=) STANDARD_SERVICES=( - api_gateway - trading_service - trading_agent_service - ml_training_service - backtesting_service - broker_gateway_service + api-gateway + trading-service + trading-agent-service + ml-training-service + backtesting-service + broker-gateway ) # Defaults diff --git a/scripts/setup-database.sh b/scripts/setup-database.sh index 4a0c514b6..ba3df6831 100755 --- a/scripts/setup-database.sh +++ b/scripts/setup-database.sh @@ -109,7 +109,7 @@ echo "" echo "Next steps:" echo "1. Your database is now set up and migrations have been applied" echo "2. SQLx should now work for compile-time verification" -echo "3. You can start the services with: cargo run --bin trading_service" +echo "3. You can start the services with: cargo run --bin trading-service" echo "" echo "Database connection details:" echo " URL: $DATABASE_URL" diff --git a/scripts/start.sh b/scripts/start.sh index 64df94002..f344f85c2 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -82,14 +82,14 @@ BACKTESTING_PORT=50052 ML_TRAINING_PORT=50053 # Kill any existing services -pkill -f "trading_service" || true -pkill -f "backtesting_service" || true -pkill -f "ml_training_service" || true +pkill -f "trading-service" || true +pkill -f "backtesting-service" || true +pkill -f "ml-training-service" || true sleep 2 # Step 4: Build and start the 3 standalone services echo -e "${BLUE}๐Ÿ—๏ธ Building services...${NC}" -if ! cargo build --release --bin trading_service --bin backtesting_service -p ml_training_service; then +if ! cargo build --release --bin trading-service --bin backtesting-service -p ml_training_service; then echo -e "${RED}โŒ Failed to build services. Check compilation errors.${NC}" exit 1 fi @@ -101,21 +101,21 @@ echo -e "${BLUE}๐Ÿš€ Starting standalone services...${NC}" # Start Trading Service (port 50051) echo "๐Ÿ“ˆ Starting Trading Service..." -cargo run --release --bin trading_service & +cargo run --release --bin trading-service & TRADING_PID=$! -echo $TRADING_PID > .trading_service.pid +echo $TRADING_PID > .trading-service.pid # Start Backtesting Service (port 50052) echo "๐Ÿ”„ Starting Backtesting Service..." cargo run --release -p backtesting_service & BACKTESTING_PID=$! -echo $BACKTESTING_PID > .backtesting_service.pid +echo $BACKTESTING_PID > .backtesting-service.pid # Start ML Training Service (port 50053) echo "๐Ÿง  Starting ML Training Service..." cargo run --release -p ml_training_service & ML_TRAINING_PID=$! -echo $ML_TRAINING_PID > .ml_training_service.pid +echo $ML_TRAINING_PID > .ml-training-service.pid # Step 6: Wait for all services to be ready echo -e "${YELLOW}โณ Waiting for services to start...${NC}" diff --git a/scripts/stop.sh b/scripts/stop.sh index c8135468e..0a7533564 100755 --- a/scripts/stop.sh +++ b/scripts/stop.sh @@ -15,32 +15,32 @@ echo "Shutting down: 3 Services + Docker Databases" # Step 1: Stop services by PID files if they exist echo -e "${BLUE}๐Ÿ”Œ Stopping standalone services...${NC}" -if [ -f .trading_service.pid ]; then - TRADING_PID=$(cat .trading_service.pid) +if [ -f .trading-service.pid ]; then + TRADING_PID=$(cat .trading-service.pid) echo "๐Ÿ“ˆ Stopping Trading Service (PID: $TRADING_PID)" kill $TRADING_PID 2>/dev/null || true - rm -f .trading_service.pid + rm -f .trading-service.pid fi -if [ -f .backtesting_service.pid ]; then - BACKTEST_PID=$(cat .backtesting_service.pid) +if [ -f .backtesting-service.pid ]; then + BACKTEST_PID=$(cat .backtesting-service.pid) echo "๐Ÿ”„ Stopping Backtesting Service (PID: $BACKTEST_PID)" kill $BACKTEST_PID 2>/dev/null || true - rm -f .backtesting_service.pid + rm -f .backtesting-service.pid fi -if [ -f .ml_training_service.pid ]; then - ML_PID=$(cat .ml_training_service.pid) +if [ -f .ml-training-service.pid ]; then + ML_PID=$(cat .ml-training-service.pid) echo "๐Ÿง  Stopping ML Training Service (PID: $ML_PID)" kill $ML_PID 2>/dev/null || true - rm -f .ml_training_service.pid + rm -f .ml-training-service.pid fi # Step 2: Fallback - kill by process name echo -e "${YELLOW}๐Ÿงน Cleaning up any remaining service processes...${NC}" -pkill -f "trading_service" || true -pkill -f "backtesting_service" || true -pkill -f "ml_training_service" || true +pkill -f "trading-service" || true +pkill -f "backtesting-service" || true +pkill -f "ml-training-service" || true # Give processes time to shut down gracefully sleep 2 diff --git a/scripts/validate_data_quality.sh b/scripts/validate_data_quality.sh index 5cb09bcb3..46e9fd13d 100755 --- a/scripts/validate_data_quality.sh +++ b/scripts/validate_data_quality.sh @@ -106,11 +106,11 @@ echo # Build validation tool if not already built echo "Building validation tool..." -cargo build --release -p backtesting_service --bin validate_dbn_data 2>&1 | grep -v "Compiling\|Finished" || true +cargo build --release -p backtesting-service --bin validate_dbn_data 2>&1 | grep -v "Compiling\|Finished" || true echo # Run validation -VALIDATION_CMD="cargo run --release -p backtesting_service --bin validate_dbn_data --" +VALIDATION_CMD="cargo run --release -p backtesting-service --bin validate_dbn_data --" if [ -n "$SYMBOL" ]; then VALIDATION_CMD="$VALIDATION_CMD --symbol $SYMBOL"