|
8 | 8 | - main |
9 | 9 | pull_request: |
10 | 10 | paths: |
11 | | - - 'edge_orchestrator/**' |
| 11 | + - "edge_orchestrator/**" |
12 | 12 |
|
13 | 13 | jobs: |
14 | 14 | lint_and_test_on_edge_orchestrator: |
15 | 15 | name: Run Python linter and tests (unit > integration > functional) |
16 | 16 | runs-on: ubuntu-latest |
17 | 17 | strategy: |
18 | 18 | matrix: |
19 | | - python-version: [ "3.9", "3.10", "3.11" ] |
| 19 | + python-version: ["3.9", "3.10", "3.11"] |
20 | 20 | services: |
21 | | - edge_model_serving: |
22 | | - image: ghcr.io/octo-technology/vio/edge_model_serving:main |
23 | | - ports: |
24 | | - - 8501:8501 |
25 | 21 | edge_tflite_serving: |
26 | 22 | image: ghcr.io/octo-technology/vio/edge_tflite_serving:main |
27 | 23 | ports: |
28 | | - - 8502:8501 |
| 24 | + - 8501:8501 |
| 25 | + options: --platform linux/amd64 |
29 | 26 | env: |
30 | | - TENSORFLOW_SERVING_HOST: localhost |
31 | | - TENSORFLOW_SERVING_PORT: 8501 |
32 | 27 | TFLITE_SERVING_HOST: localhost |
33 | | - TFLITE_SERVING_PORT: 8502 |
| 28 | + TFLITE_SERVING_PORT: 8501 |
34 | 29 | steps: |
35 | 30 | - name: Checkout repository |
36 | 31 | uses: actions/checkout@v4 |
|
45 | 40 | working-directory: ./edge_orchestrator |
46 | 41 |
|
47 | 42 | - name: Lint with flake8 and black |
48 | | - run: make lint |
| 43 | + run: make check |
49 | 44 | working-directory: ./edge_orchestrator |
50 | 45 | - name: Run unit tests |
51 | 46 | run: make unit_tests |
|
59 | 54 | path: edge_orchestrator/reports/pytest/unit-tests-report.xml |
60 | 55 | reporter: java-junit |
61 | 56 |
|
| 57 | + - name: Wait for edge_tflite_serving to be ready |
| 58 | + run: | |
| 59 | + for i in {1..30}; do |
| 60 | + if curl -sf --max-time 2 http://localhost:8501/v1/; then |
| 61 | + echo "Service is up!" |
| 62 | + exit 0 |
| 63 | + fi |
| 64 | + echo "Waiting... ($i/30)" |
| 65 | + sleep 2 |
| 66 | + done |
| 67 | + echo "=== Container status ===" |
| 68 | + docker ps -a |
| 69 | + echo "=== edge_tflite_serving logs ===" |
| 70 | + docker logs $(docker ps -aq --filter "ancestor=ghcr.io/octo-technology/vio/edge_tflite_serving:main") 2>&1 || echo "Could not get container logs" |
| 71 | + echo "Service did not start in time" >&2 |
| 72 | + exit 1 |
| 73 | +
|
62 | 74 | - name: Run integration tests |
63 | 75 | run: make integration_tests |
64 | 76 | working-directory: ./edge_orchestrator |
@@ -100,4 +112,3 @@ jobs: |
100 | 112 | secrets: |
101 | 113 | username: ${{ github.actor }} |
102 | 114 | password: ${{ secrets.GITHUB_TOKEN }} |
103 | | - |
|
0 commit comments