-
Notifications
You must be signed in to change notification settings - Fork 1.2k
168 lines (137 loc) · 5.36 KB
/
registry-rest-api-tests.yml
File metadata and controls
168 lines (137 loc) · 5.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# .github/workflows/registry-rest-api-tests.yml
name: pr-rest-API-tests
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- labeled
jobs:
registry-rest-api-tests:
timeout-minutes: 30
if:
((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) ||
(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')))) &&
github.repository == 'feast-dev/feast'
runs-on: ubuntu-latest
services:
kind:
# Specify the Kubernetes version
image: kindest/node:v1.30.6
env:
KIND_CLUSTER: "registry-rest-api-cluster"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/[email protected]
with:
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: false
swap-storage: false
tool-cache: false
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.9
- name: Create KIND cluster
run: |
cat <<EOF | kind create cluster --name $KIND_CLUSTER --wait 10m --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraMounts:
- hostPath: /mnt/kind
containerPath: /var/lib/containerd
extraPortMappings:
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
EOF
- name: Set up kubernetes context
run: |
kubectl config use-context kind-$KIND_CLUSTER
echo "kind context is switched to cluster kind-$KIND_CLUSTER"
- name: Set up Ingress controller
run: |
echo "Installing ingress-nginx for KIND..."
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.9.5/deploy/static/provider/kind/deploy.yaml
echo "⏳ Waiting for ingress controller to become ready..."
kubectl wait --namespace ingress-nginx \
--for=condition=Ready pod \
--selector=app.kubernetes.io/component=controller \
--timeout=180s
- name: Add ingress DNS to /etc/hosts
run: |
echo "127.0.0.1 feast.kind.test" | sudo tee -a /etc/hosts
echo "Added 'feast.kind.test' to /etc/hosts"
- name: Build and Deploy Feast Operator images
run: |
# Create namespace
kubectl create ns feast-operator-system || true
# navigate to feast operator path
cd infra/feast-operator/
# Build Feast Operator Docker image
make docker-build IMG=localhost/feast-operator:v0.0.1
# Load Operator image into KIND
kind load docker-image localhost/feast-operator:v0.0.1 --name $KIND_CLUSTER
# Build Feast dev image
make feast-ci-dev-docker-img
# Tag Feast image for KIND compatibility
docker tag feastdev/feature-server:dev localhost/feastdev/feature-server:dev
# Load Feast image into KIND
kind load docker-image localhost/feastdev/feature-server:dev --name $KIND_CLUSTER
# Install CRDs
make install
# Deploy operator to the KIND cluster
make deploy IMG=localhost/feast-operator:v0.0.1 FS_IMG=localhost/feastdev/feature-server:dev
# Wait for controller manager to be ready
kubectl wait deployment feast-operator-controller-manager -n feast-operator-system --for=condition=Available=True --timeout=180s
- name: Setup Python
uses: actions/setup-python@v5
id: setup-python
with:
python-version: 3.11
architecture: x64
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install dependencies
run: make install-python-dependencies-ci
- name: Setup and Run Registry Rest API tests
run: |
echo "Running Registry REST API tests..."
cd sdk/python
pytest tests/integration/registration/rest_api/test_registry_rest_api.py --integration -s
- name: Clean up docker images
if: always()
run: |
docker images --format '{{.Repository}}:{{.Tag}}' | grep 'feast' | xargs -r docker rmi -f
docker system prune -a -f
- name: Debug KIND Cluster when there is a failure
if: failure()
run: |
kubectl get pods --all-namespaces
kubectl describe nodes
- name: Clean up
if: always()
run: |
# Delete the KIND cluster after tests
kind delete cluster --name kind-$KIND_CLUSTER