-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
204 lines (171 loc) · 7.47 KB
/
Makefile
File metadata and controls
204 lines (171 loc) · 7.47 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
SHELL := /bin/bash
.PHONY: bootstrap up-db down-db up-redis down-redis run run-api-only health test ci-docs ci-unification ci-db-compat ci-db-compat-bringup ci-db-compat-bootstrap ci-retrieval-smoke ci-runtime-profile ci-runtime-delta ci-legacy-path-guard sdk-install-dev sdk-precommit-install sdk-precommit-run sdk-lint sdk-type sdk-test sdk-build sdk-ci sdk-smoke sdk-release-check sdk-release-testpypi sdk-release-pypi sdk-publish-guard sdk-dryrun-version
bootstrap:
./scripts/dev/bootstrap.sh
up-db:
@if docker ps --format '{{.Names}}' | grep -qx 'querylake_db'; then \
echo "[up-db] querylake_db already running; reusing existing container."; \
elif docker ps -a --format '{{.Names}}' | grep -qx 'querylake_db'; then \
echo "[up-db] querylake_db exists but is stopped; starting container."; \
docker start querylake_db >/dev/null; \
else \
docker compose -f docker-compose-only-db.yml up -d; \
fi
down-db:
@if docker ps -a --format '{{.Names}}' | grep -qx 'querylake_db'; then \
docker compose -f docker-compose-only-db.yml down; \
else \
echo "[down-db] querylake_db not present; nothing to do."; \
fi
up-redis:
@if docker ps --format '{{.Names}}' | grep -qx 'querylake_redis'; then \
echo "[up-redis] querylake_redis already running; reusing existing container."; \
elif docker ps -a --format '{{.Names}}' | grep -qx 'querylake_redis'; then \
echo "[up-redis] querylake_redis exists but is stopped; starting container."; \
docker start querylake_redis >/dev/null; \
else \
docker compose -f docker-compose-redis.yml up -d; \
fi
down-redis:
@if docker ps -a --format '{{.Names}}' | grep -qx 'querylake_redis'; then \
docker compose -f docker-compose-redis.yml down; \
else \
echo "[down-redis] querylake_redis not present; nothing to do."; \
fi
run:
@if [[ -f ".env" ]]; then \
set -a; source .env; set +a; \
fi; \
uv run start_querylake.py
run-api-only:
@if [[ -f ".env" ]]; then \
set -a; source .env; set +a; \
fi; \
QUERYLAKE_API_ONLY=1 uv run start_querylake.py
health:
@echo "==> /healthz"
@curl -sS http://127.0.0.1:8000/healthz || true
@echo ""
@echo "==> /readyz"
@curl -sS http://127.0.0.1:8000/readyz || true
@echo ""
@echo "==> /v1/models"
@curl -sS http://127.0.0.1:8000/v1/models || true
@echo ""
test:
uv run pytest
ci-docs:
uv run --no-project bash scripts/ci_docs_checks.sh
ci-unification:
uv run --no-project bash scripts/ci_unification_checks.sh
ci-db-compat:
uv run --no-project bash scripts/ci_db_compat_contract.sh
ci-db-compat-bringup:
python scripts/db_compat_profile_bringup_smoke.py \
--profile aws_aurora_pg_opensearch_v1 \
--env QUERYLAKE_SEARCH_BACKEND_URL=https://example-opensearch.local \
--env QUERYLAKE_SEARCH_INDEX_NAMESPACE=querylake \
--env QUERYLAKE_SEARCH_DENSE_VECTOR_DIMENSIONS=1024 \
--enable-ready-split-stack-projections \
--expect-boot-ready true \
--expect-configuration-ready true \
--expect-route-runtime-ready true \
--expect-ready-projection-count 3 \
--expect-route-runtime search_hybrid.document_chunk=true \
--expect-route-runtime search_bm25.document_chunk=true \
--expect-route-runtime search_file_chunks=true \
--expect-required-projection-status-count ready=3 \
--expect-route-lexical-support-class-count unsupported=3 \
--expect-lexical-degraded-route search_bm25.document_chunk \
--expect-lexical-gold-recommended-route search_bm25.document_chunk
ci-db-compat-bootstrap:
pytest -q tests/test_db_compat_profile_bootstrap_script.py
python scripts/db_compat_profile_bringup_smoke.py \
--profile aws_aurora_pg_opensearch_v1 \
--env QUERYLAKE_SEARCH_BACKEND_URL=https://example-opensearch.local \
--env QUERYLAKE_SEARCH_INDEX_NAMESPACE=querylake \
--env QUERYLAKE_SEARCH_DENSE_VECTOR_DIMENSIONS=1024 \
--enable-ready-split-stack-projections \
--expect-boot-ready true \
--expect-configuration-ready true \
--expect-route-runtime-ready true \
--expect-ready-projection-count 3 \
--expect-route-runtime search_hybrid.document_chunk=true \
--expect-route-runtime search_bm25.document_chunk=true \
--expect-route-runtime search_file_chunks=true \
--expect-required-projection-status-count ready=3 \
--expect-route-lexical-support-class-count unsupported=3 \
--expect-lexical-degraded-route search_bm25.document_chunk \
--expect-lexical-gold-recommended-route search_bm25.document_chunk
ci-retrieval-smoke:
CI_RETRIEVAL_OUT_DIR=docs_tmp/RAG/ci/local/make_smoke uv run --no-project bash scripts/ci_retrieval_preflight.sh smoke
CI_RETRIEVAL_OUT_DIR=docs_tmp/RAG/ci/local/make_smoke uv run --no-project bash scripts/ci_retrieval_eval.sh smoke
CI_RETRIEVAL_OUT_DIR=docs_tmp/RAG/ci/local/make_smoke uv run --no-project bash scripts/ci_retrieval_parity.sh smoke
ci-runtime-profile:
@if [[ -z "$(REPO)" ]]; then \
echo "usage: make ci-runtime-profile REPO=owner/repo [DAYS=7] [MAX_RUNS=1000] [OUT_DIR=docs_tmp/RAG/ci/runtime_profile/local]"; \
exit 2; \
fi
@OUT_DIR="$(if $(OUT_DIR),$(OUT_DIR),docs_tmp/RAG/ci/runtime_profile/local)"; \
DAYS="$(if $(DAYS),$(DAYS),7)"; \
MAX_RUNS="$(if $(MAX_RUNS),$(MAX_RUNS),1000)"; \
mkdir -p "$$OUT_DIR"; \
uv run --no-project python scripts/dev/ci_runtime_profile.py \
--repo "$(REPO)" \
--days "$$DAYS" \
--max-runs "$$MAX_RUNS" \
--out-json "$$OUT_DIR/profile.json" \
--out-md "$$OUT_DIR/profile.md"
ci-runtime-delta:
@if [[ -z "$(BEFORE)" || -z "$(AFTER)" ]]; then \
echo "usage: make ci-runtime-delta BEFORE=path/to/before.json AFTER=path/to/after.json [OUT=docs_tmp/RAG/ci/runtime_profile/local/delta.md]"; \
exit 2; \
fi
@OUT="$(if $(OUT),$(OUT),docs_tmp/RAG/ci/runtime_profile/local/delta.md)"; \
uv run --no-project python scripts/dev/ci_runtime_delta.py \
--before-json "$(BEFORE)" \
--after-json "$(AFTER)" \
--out-md "$$OUT"
ci-legacy-path-guard:
bash scripts/ci_guard_legacy_querylakebackend_refs.sh
sdk-install-dev:
uv run --project sdk/python pip install -e sdk/python
sdk-precommit-install:
uv run --project sdk/python --extra dev pre-commit install --hook-type pre-commit --hook-type pre-push
sdk-precommit-run:
uv run --project sdk/python --extra dev pre-commit run --all-files --hook-stage pre-commit
uv run --project sdk/python --extra dev pre-commit run --all-files --hook-stage pre-push
sdk-lint:
bash scripts/dev/sdk_quality_gate.sh lint
sdk-type:
bash scripts/dev/sdk_quality_gate.sh type
sdk-test:
bash scripts/dev/sdk_quality_gate.sh test
sdk-build:
uv run --project sdk/python --with build python -m build sdk/python
sdk-ci:
bash scripts/ci_sdk_checks.sh
sdk-smoke:
./scripts/dev/smoke_sdk_local.sh
sdk-release-check:
./scripts/dev/release_sdk.sh check
sdk-release-testpypi:
./scripts/dev/release_sdk.sh testpypi
sdk-release-pypi:
./scripts/dev/release_sdk.sh pypi
sdk-publish-guard:
@if [[ -z "$(TARGET)" ]]; then \
echo "usage: make sdk-publish-guard TARGET=testpypi|pypi [GITHUB_REF=refs/heads/main] [SKIP_REMOTE_CHECK=1]"; \
exit 2; \
fi
@GUARD_ARGS="--target $(TARGET) --package-name querylake-sdk"; \
if [[ -n "$(GITHUB_REF)" ]]; then GUARD_ARGS="$$GUARD_ARGS --github-ref $(GITHUB_REF)"; fi; \
if [[ "$(SKIP_REMOTE_CHECK)" == "1" ]]; then GUARD_ARGS="$$GUARD_ARGS --skip-remote-check"; fi; \
uv run --no-project python scripts/dev/verify_sdk_publish_guard.py $$GUARD_ARGS
sdk-dryrun-version:
@TOKEN_VALUE="$(TOKEN)"; \
if [[ -z "$$TOKEN_VALUE" ]]; then TOKEN_VALUE="$$(date -u +%Y%m%d%H%M%S)"; fi; \
uv run --no-project python scripts/dev/prepare_sdk_dryrun_version.py \
--version-file sdk/python/pyproject.toml \
--token "$$TOKEN_VALUE" \
$(if $(WRITE),--write,)