|
| 1 | +name: Flows Install |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: [main] |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: flows_install-${{ github.head_ref || github.run_id }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +jobs: |
| 16 | + github_flows_install: |
| 17 | + name: Flows Install GitHub Ubuntu 24 |
| 18 | + runs-on: ubuntu-24.04 |
| 19 | + env: |
| 20 | + DATABASE_URI: postgresql+psycopg://vix_user:vix_password@localhost:5432/vix_db |
| 21 | + |
| 22 | + services: |
| 23 | + postgres: |
| 24 | + image: postgres:17 |
| 25 | + env: |
| 26 | + POSTGRES_USER: vix_user |
| 27 | + POSTGRES_PASSWORD: vix_password |
| 28 | + POSTGRES_DB: vix_db |
| 29 | + options: >- |
| 30 | + --health-cmd pg_isready |
| 31 | + --health-interval 10s |
| 32 | + --health-timeout 5s |
| 33 | + --health-retries 5 |
| 34 | + ports: |
| 35 | + - 5432:5432 |
| 36 | + |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + - name: Checkout Visionatrix (engine) |
| 40 | + uses: actions/checkout@v4 |
| 41 | + with: |
| 42 | + repository: Visionatrix/Visionatrix |
| 43 | + path: visionatrix_main |
| 44 | + |
| 45 | + - uses: actions/setup-python@v5 |
| 46 | + with: |
| 47 | + python-version: '3.12' |
| 48 | + |
| 49 | + - name: Install Visionatrix dependencies |
| 50 | + working-directory: visionatrix_main |
| 51 | + run: | |
| 52 | + python3 -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu |
| 53 | + python3 -m pip install ".[pgsql]" |
| 54 | +
|
| 55 | + - name: Export Visionatrix exclude flows |
| 56 | + run: | |
| 57 | + value=$(python3 scripts/ci/get_excludes.py flows) |
| 58 | + echo "VISIONATRIX_EXCLUDE_FLOWS=$value" >> "$GITHUB_ENV" |
| 59 | +
|
| 60 | + - name: Export Visionatrix exclude nodes |
| 61 | + run: | |
| 62 | + value=$(python3 scripts/ci/get_excludes.py nodes) |
| 63 | + echo "VISIONATRIX_INSTALL_EXCLUDE_NODES=$value" >> "$GITHUB_ENV" |
| 64 | +
|
| 65 | + - name: Run Visionatrix install |
| 66 | + working-directory: visionatrix_main |
| 67 | + run: python3 -m visionatrix install |
| 68 | + |
| 69 | + - name: Install flows from CMD |
| 70 | + working-directory: visionatrix_main |
| 71 | + run: | |
| 72 | + echo "Y" | VIX_MODE=SERVER VIX_SERVER_FULL_MODELS=0 python3 -m visionatrix install-flow --name=* |
| 73 | +
|
| 74 | + - name: Generate openapi-flows.json |
| 75 | + working-directory: visionatrix_main |
| 76 | + run: | |
| 77 | + VIX_MODE=SERVER VIX_SERVER_FULL_MODELS=0 python3 -m visionatrix openapi --flows="*" --exclude-base --file=openapi-flows.json |
| 78 | +
|
| 79 | + - name: Create test user |
| 80 | + working-directory: visionatrix_main |
| 81 | + run: | |
| 82 | + VIX_MODE=SERVER VIX_SERVER_FULL_MODELS=0 python3 -m visionatrix create-user --name=user --password=user |
| 83 | +
|
| 84 | + - name: Start Visionatrix in Server mode |
| 85 | + working-directory: visionatrix_main |
| 86 | + run: | |
| 87 | + nohup python3 -m visionatrix run --ui --mode=SERVER > visionatrix.log 2>&1 & |
| 88 | + echo "Server started in background with PID $!" |
| 89 | +
|
| 90 | + - name: Wait for Visionatrix server |
| 91 | + run: | |
| 92 | + max_attempts=30 |
| 93 | + for i in $(seq 1 $max_attempts); do |
| 94 | + echo "Attempt $i/$max_attempts: Checking Visionatrix server..." |
| 95 | + if curl -s http://localhost:8288/whoami > /dev/null; then |
| 96 | + echo "Visionatrix server is up!" |
| 97 | + exit 0 |
| 98 | + fi |
| 99 | + echo "Server not ready yet. Sleeping 10s..." |
| 100 | + sleep 10 |
| 101 | + done |
| 102 | + echo "Server not responding after 5 minutes!" |
| 103 | + exit 1 |
| 104 | +
|
| 105 | + - name: Download test image |
| 106 | + working-directory: visionatrix_main |
| 107 | + run: | |
| 108 | + wget -O tests/source-cube_rm_background.png "https://github.com/Visionatrix/VixFlowsDocs/blob/main/tests_data/source-cube_rm_background.png?raw=true" |
| 109 | +
|
| 110 | + - name: Create task for each Flow |
| 111 | + working-directory: visionatrix_main |
| 112 | + run: python3 tests/create_flow_tasks.py |
| 113 | + |
| 114 | + - name: Display logs |
| 115 | + if: ${{ always() }} |
| 116 | + working-directory: visionatrix_main |
| 117 | + run: cat visionatrix.log |
0 commit comments