- Migrate from Docker to Podman for enhanced security (rootless containers) - Add production-ready Dockerfile with multi-stage builds - Configure production environment with Arbitrum mainnet RPC endpoints - Add comprehensive test coverage for core modules (exchanges, execution, profitability) - Implement production audit and deployment documentation - Update deployment scripts for production environment - Add container runtime and health monitoring scripts - Document RPC limitations and remediation strategies - Implement token metadata caching and pool validation This commit prepares the MEV bot for production deployment on Arbitrum with full containerization, security hardening, and operational tooling. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
75 lines
2.1 KiB
Bash
Executable File
75 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Run CI pipeline inside a container (for isolation)
|
|
# Usage: ./scripts/ci-container.sh [quick|dev|full]
|
|
# Supports: Podman, Docker, and Podman-in-Podman
|
|
|
|
set -euo pipefail
|
|
|
|
MODE="${1:-dev}"
|
|
|
|
case $MODE in
|
|
quick)
|
|
echo "🐳 Running Quick CI in Container..."
|
|
SKIP_FLAGS="-e HARNESS_SKIP_DOCKER=true -e HARNESS_SKIP_MATH_AUDIT=true -e HARNESS_SKIP_SECURITY=true"
|
|
;;
|
|
dev)
|
|
echo "🐳 Running Development CI in Container..."
|
|
SKIP_FLAGS="-e HARNESS_SKIP_DOCKER=true"
|
|
;;
|
|
full)
|
|
echo "🐳 Running Full CI in Container (Podman/Docker compatible)..."
|
|
SKIP_FLAGS="-e HARNESS_SKIP_DOCKER=true"
|
|
;;
|
|
*)
|
|
echo "Usage: $0 [quick|dev|full]"
|
|
echo " quick - Fast validation (30-60s)"
|
|
echo " dev - Development pipeline (1-2min)"
|
|
echo " full - Complete validation with container support (2-3min)"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
# Load container runtime detection
|
|
source "$(dirname "$0")/container-runtime.sh" init
|
|
|
|
if [[ -z "$CONTAINER_RUNTIME" ]]; then
|
|
echo "❌ Error: No container runtime found (podman or docker required)"
|
|
echo "Install with: sudo apt install podman"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Using container runtime: $CONTAINER_RUNTIME"
|
|
echo ""
|
|
|
|
# Create cache directories for performance
|
|
mkdir -p .gocache .gomodcache
|
|
|
|
# Get DinD mount flags if inside container
|
|
DIND_MOUNTS=""
|
|
if [[ "$INSIDE_CONTAINER" == "true" ]]; then
|
|
DIND_MOUNTS="$(source "$(dirname "$0")/container-runtime.sh" socket)"
|
|
if [[ -n "$DIND_MOUNTS" ]]; then
|
|
DIND_MOUNTS="-v $DIND_MOUNTS"
|
|
fi
|
|
fi
|
|
|
|
# Run pipeline in container
|
|
$CONTAINER_RUNTIME run --rm \
|
|
-v "$(pwd)":/workspace \
|
|
-v "$(pwd)/.gocache":/root/.cache/go-build \
|
|
-v "$(pwd)/.gomodcache":/go/pkg/mod \
|
|
$DIND_MOUNTS \
|
|
-w /workspace \
|
|
$SKIP_FLAGS \
|
|
golang:1.25-alpine \
|
|
sh -c "
|
|
echo 'Installing CI tools...' &&
|
|
apk add --no-cache git make bash curl &&
|
|
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest &&
|
|
echo 'Running pipeline...' &&
|
|
./harness/local-ci-pipeline.sh
|
|
"
|
|
|
|
echo ""
|
|
echo "✅ Container CI completed successfully!"
|
|
echo "📊 Check reports in: harness/reports/" |