Visitar URL original
docker ci test · feast-dev/feast@75cba67 · GitHub
Skip to content

Commit 75cba67

Browse files
committed
docker ci test
1 parent 0b3eaf6 commit 75cba67

2 files changed

Lines changed: 102 additions & 0 deletions

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: docker-smoke-tests
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "sdk/python/feast/infra/feature_servers/multicloud/**"
7+
- "sdk/python/feast/feature_server.py"
8+
- "infra/scripts/feature_server_docker_smoke.py"
9+
- "Makefile"
10+
- ".github/workflows/publish_images.yml"
11+
workflow_dispatch:
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
feature-server-docker-smoke:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
arch: [amd64, arm64]
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Set up QEMU
27+
uses: docker/setup-qemu-action@v3
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
with:
31+
install: true
32+
- name: Build feature-server image
33+
env:
34+
ARCH: ${{ matrix.arch }}
35+
run: |
36+
make build-feature-server-docker REGISTRY=feastdev VERSION=smoke-${ARCH} DOCKER_PLATFORMS=linux/${ARCH}
37+
- name: Run container
38+
env:
39+
ARCH: ${{ matrix.arch }}
40+
run: |
41+
docker run -d --rm \
42+
--name feature-server-smoke-${ARCH} \
43+
--platform linux/${ARCH} \
44+
-p 6566:6566 \
45+
-v "${GITHUB_WORKSPACE}/infra/scripts/feature_server_docker_smoke.py:/smoke.py:ro" \
46+
feastdev/feature-server:smoke-${ARCH} \
47+
python /smoke.py
48+
- name: Wait for /health
49+
run: |
50+
for i in $(seq 1 60); do
51+
if curl -fsS http://localhost:6566/health >/dev/null; then
52+
exit 0
53+
fi
54+
sleep 2
55+
done
56+
echo "feature-server /health did not become ready"
57+
docker logs feature-server-smoke-${{ matrix.arch }} || true
58+
exit 1
59+
- name: Cleanup
60+
if: always()
61+
env:
62+
ARCH: ${{ matrix.arch }}
63+
run: |
64+
docker stop feature-server-smoke-${ARCH} || true
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
from types import SimpleNamespace
2+
3+
import uvicorn
4+
5+
from feast.feature_server import get_app
6+
7+
8+
class _FakeRegistry:
9+
def proto(self):
10+
return object()
11+
12+
13+
class _FakeStore:
14+
def __init__(self):
15+
self.config = SimpleNamespace()
16+
self.registry = _FakeRegistry()
17+
self._provider = SimpleNamespace(
18+
async_supported=SimpleNamespace(
19+
online=SimpleNamespace(read=False, write=False)
20+
)
21+
)
22+
23+
def _get_provider(self):
24+
return self._provider
25+
26+
async def initialize(self):
27+
return None
28+
29+
def refresh_registry(self):
30+
return None
31+
32+
async def close(self):
33+
return None
34+
35+
36+
if __name__ == "__main__":
37+
app = get_app(_FakeStore())
38+
uvicorn.run(app, host="0.0.0.0", port=6566, log_level="error")

0 commit comments

Comments
 (0)