|
96 | 96 | run: make test-python-integration |
97 | 97 | - name: Minimize uv cache |
98 | 98 | run: uv cache prune --ci |
| 99 | + |
| 100 | + mcp-feature-server-runtime: |
| 101 | + if: |
| 102 | + ((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) || |
| 103 | + (github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved') || contains(github.event.pull_request.labels.*.name, 'lgtm')))) && |
| 104 | + github.repository == 'feast-dev/feast' |
| 105 | + runs-on: ubuntu-latest |
| 106 | + steps: |
| 107 | + - uses: actions/checkout@v4 |
| 108 | + with: |
| 109 | + ref: refs/pull/${{ github.event.pull_request.number }}/merge |
| 110 | + submodules: recursive |
| 111 | + persist-credentials: false |
| 112 | + - name: Setup Python |
| 113 | + uses: actions/setup-python@v5 |
| 114 | + with: |
| 115 | + python-version: "3.11" |
| 116 | + architecture: x64 |
| 117 | + - name: Install the latest version of uv |
| 118 | + uses: astral-sh/setup-uv@v5 |
| 119 | + with: |
| 120 | + enable-cache: true |
| 121 | + - name: Install dependencies |
| 122 | + run: make install-python-dependencies-ci |
| 123 | + - name: Start feature server (MCP HTTP) |
| 124 | + run: | |
| 125 | + cd examples/mcp_feature_store |
| 126 | + uv run python -m feast.cli.cli serve --host 127.0.0.1 --port 6566 --workers 1 --no-access-log & |
| 127 | + SERVER_PID=$! |
| 128 | + echo $SERVER_PID > /tmp/feast_server_pid |
| 129 | + for i in $(seq 1 60); do |
| 130 | + if curl -fsS http://127.0.0.1:6566/health >/dev/null; then |
| 131 | + break |
| 132 | + fi |
| 133 | + sleep 1 |
| 134 | + done |
| 135 | + curl -fsS http://127.0.0.1:6566/health >/dev/null |
| 136 | + - name: Validate MCP endpoint |
| 137 | + run: | |
| 138 | + rm -f /tmp/mcp_headers /tmp/mcp_headers2 /tmp/mcp_body2 |
| 139 | +
|
| 140 | + curl -sS -D /tmp/mcp_headers -o /dev/null --max-time 10 \ |
| 141 | + -X POST \ |
| 142 | + -H "Accept: application/json, text/event-stream" \ |
| 143 | + -H "Content-Type: application/json" \ |
| 144 | + -H "mcp-protocol-version: 2025-03-26" \ |
| 145 | + --data '{}' \ |
| 146 | + http://127.0.0.1:6566/mcp || true |
| 147 | +
|
| 148 | + SESSION_ID=$(grep -i "^mcp-session-id:" /tmp/mcp_headers | head -1 | awk '{print $2}' | tr -d '\r') |
| 149 | + if [ -z "${SESSION_ID}" ]; then |
| 150 | + cat /tmp/mcp_headers || true |
| 151 | + exit 1 |
| 152 | + fi |
| 153 | +
|
| 154 | + curl -sS -D /tmp/mcp_headers2 -o /tmp/mcp_body2 --max-time 10 \ |
| 155 | + -X POST \ |
| 156 | + -H "Accept: application/json, text/event-stream" \ |
| 157 | + -H "Content-Type: application/json" \ |
| 158 | + -H "mcp-protocol-version: 2025-03-26" \ |
| 159 | + -H "mcp-session-id: ${SESSION_ID}" \ |
| 160 | + --data '{}' \ |
| 161 | + http://127.0.0.1:6566/mcp || true |
| 162 | +
|
| 163 | + grep -Eq "^HTTP/.* 400" /tmp/mcp_headers2 |
| 164 | + grep -Eiq "^content-type: application/json" /tmp/mcp_headers2 |
| 165 | + grep -Eiq "^mcp-session-id: ${SESSION_ID}" /tmp/mcp_headers2 |
| 166 | + - name: Stop feature server |
| 167 | + if: always() |
| 168 | + run: | |
| 169 | + if [ -f /tmp/feast_server_pid ]; then |
| 170 | + kill "$(cat /tmp/feast_server_pid)" || true |
| 171 | + fi |
| 172 | + - name: Minimize uv cache |
| 173 | + if: always() |
| 174 | + run: uv cache prune --ci |
0 commit comments