Merge pull request #27 from raywangau/dev #59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Docker Compose Demos | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - '.github/workflows/main.yaml' | |
| - 'demo/demo-1-basics/**' | |
| - 'demo/demo-2-otel/**' | |
| - 'demo/demo-3-mlflow/**' | |
| - '!README.md' | |
| - '!README.MD' | |
| - '!docs/**' | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - '.github/workflows/main.yaml' | |
| - 'demo/demo-1-basics/**' | |
| - 'demo/demo-2-otel/**' | |
| - 'demo/demo-3-mlflow/**' | |
| - '!README.md' | |
| - '!README.MD' | |
| - '!docs/**' | |
| workflow_dispatch: | |
| jobs: | |
| docker-compose: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # -------------------------------------------------- | |
| # 1️⃣ Checkout | |
| # -------------------------------------------------- | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| fetch-depth: 1 | |
| clean: true | |
| # -------------------------------------------------- | |
| # 2️⃣ Free disk space | |
| # -------------------------------------------------- | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc || true | |
| docker system prune -a -f || true | |
| df -h | |
| # ================================================== | |
| # 🔹 DEMO 1 | |
| # ================================================== | |
| - name: Run demo-1-basics | |
| working-directory: demo/demo-1-basics | |
| run: | | |
| docker compose up -d --build | |
| sleep 10 | |
| docker ps | |
| docker compose down -v | |
| # ================================================== | |
| # 🔹 DEMO 2 | |
| # ================================================== | |
| - name: Run demo-2-otel | |
| working-directory: demo/demo-2-otel | |
| run: | | |
| docker compose up -d --build | |
| sleep 15 | |
| docker ps | |
| docker compose down -v | |
| # ================================================== | |
| # 🔹 DEMO 3 (MLflow Stack) | |
| # ================================================== | |
| - name: Run demo-3-mlflow | |
| working-directory: demo/demo-3-mlflow | |
| run: | | |
| echo "Creating .env file" | |
| cat <<EOF > .env | |
| POSTGRES_DB=mlflowdb | |
| POSTGRES_USER=mlflow | |
| POSTGRES_PASSWORD=mlflow123 | |
| MINIO_ROOT_USER=minio | |
| MINIO_ROOT_PASSWORD=minio123 | |
| MINIO_STORAGE_BUCKET=mlflow | |
| MLFLOW_PORT=5000 | |
| EOF | |
| docker compose up -d --build | |
| echo "Waiting for MLflow stack..." | |
| sleep 40 | |
| docker ps | |
| echo "Testing MLflow endpoint..." | |
| curl --fail http://localhost:5000 || exit 1 | |
| docker compose down -v | |
| # -------------------------------------------------- | |
| # Final Cleanup | |
| # -------------------------------------------------- | |
| - name: Final cleanup | |
| if: always() | |
| run: docker system prune -a -f |