Skip to content

Commit 3ee0133

Browse files
committed
dev
1 parent c33131b commit 3ee0133

File tree

3 files changed

+77
-74
lines changed

3 files changed

+77
-74
lines changed

.github/workflows/pr_integration_tests.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,79 @@ jobs:
9696
run: make test-python-integration
9797
- name: Minimize uv cache
9898
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

.github/workflows/unit_tests.yml

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -74,78 +74,6 @@ jobs:
7474
- name: Minimize uv cache
7575
run: uv cache prune --ci
7676

77-
mcp-feature-server-runtime:
78-
runs-on: ubuntu-latest
79-
steps:
80-
- uses: actions/checkout@v4
81-
- name: Setup Python
82-
uses: actions/setup-python@v5
83-
with:
84-
python-version: "3.11"
85-
architecture: x64
86-
- name: Install the latest version of uv
87-
uses: astral-sh/setup-uv@v5
88-
with:
89-
enable-cache: true
90-
- name: Install system dependencies
91-
run: |
92-
sudo apt-get update
93-
sudo apt-get install -y make
94-
- name: Install dependencies
95-
run: make install-python-dependencies-ci
96-
- name: Start feature server (MCP HTTP)
97-
run: |
98-
cd examples/mcp_feature_store
99-
uv run python -m feast.cli.cli serve --host 127.0.0.1 --port 6566 --workers 1 --no-access-log &
100-
SERVER_PID=$!
101-
echo $SERVER_PID > /tmp/feast_server_pid
102-
for i in $(seq 1 60); do
103-
if curl -fsS http://127.0.0.1:6566/health >/dev/null; then
104-
break
105-
fi
106-
sleep 1
107-
done
108-
curl -fsS http://127.0.0.1:6566/health >/dev/null
109-
- name: Validate MCP endpoint
110-
run: |
111-
rm -f /tmp/mcp_headers /tmp/mcp_headers2 /tmp/mcp_body2
112-
113-
curl -sS -D /tmp/mcp_headers -o /dev/null --max-time 10 \
114-
-X POST \
115-
-H "Accept: application/json, text/event-stream" \
116-
-H "Content-Type: application/json" \
117-
-H "mcp-protocol-version: 2025-03-26" \
118-
--data '{}' \
119-
http://127.0.0.1:6566/mcp || true
120-
121-
SESSION_ID=$(grep -i "^mcp-session-id:" /tmp/mcp_headers | head -1 | awk '{print $2}' | tr -d '\r')
122-
if [ -z "${SESSION_ID}" ]; then
123-
cat /tmp/mcp_headers || true
124-
exit 1
125-
fi
126-
127-
curl -sS -D /tmp/mcp_headers2 -o /tmp/mcp_body2 --max-time 10 \
128-
-X POST \
129-
-H "Accept: application/json, text/event-stream" \
130-
-H "Content-Type: application/json" \
131-
-H "mcp-protocol-version: 2025-03-26" \
132-
-H "mcp-session-id: ${SESSION_ID}" \
133-
--data '{}' \
134-
http://127.0.0.1:6566/mcp || true
135-
136-
grep -Eq "^HTTP/.* 400" /tmp/mcp_headers2
137-
grep -Eiq "^content-type: application/json" /tmp/mcp_headers2
138-
grep -Eiq "^mcp-session-id: ${SESSION_ID}" /tmp/mcp_headers2
139-
- name: Stop feature server
140-
if: always()
141-
run: |
142-
if [ -f /tmp/feast_server_pid ]; then
143-
kill "$(cat /tmp/feast_server_pid)" || true
144-
fi
145-
- name: Minimize uv cache
146-
if: always()
147-
run: uv cache prune --ci
148-
14977
unit-test-ui:
15078
runs-on: ubuntu-latest
15179
env:

sdk/python/feast/ui_server.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
import threading
3+
import uvicorn
34
from importlib import resources as importlib_resources
45
from typing import Callable, Optional
56

@@ -144,8 +145,6 @@ def start_server(
144145
tls_key_path: str = "",
145146
tls_cert_path: str = "",
146147
):
147-
import uvicorn
148-
149148
app = get_app(
150149
store,
151150
project_id,

0 commit comments

Comments
 (0)