Skip to content

Commit 263faf8

Browse files
committed
wip
1 parent 15540ff commit 263faf8

File tree

278 files changed

+182
-34038
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+182
-34038
lines changed

.codecov.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.coveragerc

Lines changed: 0 additions & 8 deletions
This file was deleted.

Containerfile.redis

Lines changed: 0 additions & 24 deletions
This file was deleted.

Makefile

Lines changed: 3 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -64,30 +64,7 @@ run: ## Run the service locally
6464
print-version: ## Print the service version
6565
python runner.py --version
6666

67-
test: test-unit test-integration test-e2e ## Run all tests
68-
69-
benchmarks: ## Run benchmarks
70-
@echo "Running benchmarks..."
71-
pdm run pytest tests/benchmarks --benchmark-histogram
72-
73-
test-unit: ## Run the unit tests
74-
@echo "Running unit tests..."
75-
@echo "Reports will be written to ${ARTIFACT_DIR}"
76-
COVERAGE_FILE="${ARTIFACT_DIR}/.coverage.unit" pdm run pytest tests/unit --cov=ols --cov=runner --cov-report term-missing --cov-report "json:${ARTIFACT_DIR}/coverage_unit.json" --junit-xml="${ARTIFACT_DIR}/junit_unit.xml"
77-
pdm run scripts/transform_coverage_report.py "${ARTIFACT_DIR}/coverage_unit.json" "${ARTIFACT_DIR}/coverage_unit.out"
78-
scripts/codecov.sh "${ARTIFACT_DIR}/coverage_unit.out"
79-
80-
test-integration: ## Run integration tests tests
81-
@echo "Running integration tests..."
82-
@echo "Reports will be written to ${ARTIFACT_DIR}"
83-
COVERAGE_FILE="${ARTIFACT_DIR}/.coverage.integration" pdm run pytest -m 'not redis' tests/integration --cov=ols --cov=runner --cov-report term-missing --cov-report "json:${ARTIFACT_DIR}/coverage_integration.json" --junit-xml="${ARTIFACT_DIR}/junit_integration.xml" --cov-fail-under=60
84-
pdm run scripts/transform_coverage_report.py "${ARTIFACT_DIR}/coverage_integration.json" "${ARTIFACT_DIR}/coverage_integration.out"
85-
scripts/codecov.sh "${ARTIFACT_DIR}/coverage_integration.out"
86-
87-
check-coverage: test-unit test-integration ## Unit tests and integration tests overall code coverage check
88-
coverage combine --keep "${ARTIFACT_DIR}/.coverage.unit" "${ARTIFACT_DIR}/.coverage.integration"
89-
# the threshold should be very high there, in theory it should reach 100%
90-
coverage report -m --fail-under=94
67+
test: test-e2e ## Run all tests
9168

9269
test-e2e: ## Run e2e tests - requires running OLS server
9370
@echo "Running e2e tests..."
@@ -101,73 +78,23 @@ test-eval: ## Run evaluation tests - requires running OLS server
10178
pdm run pytest tests/e2e/evaluation -vv -s --durations=0 -o junit_suite_name="${SUITE_ID}" --junit-prefix="${SUITE_ID}" --junit-xml="${ARTIFACT_DIR}/junit_e2e_${SUITE_ID}.xml" \
10279
--eval_out_dir ${ARTIFACT_DIR}
10380

104-
coverage-report: unit-tests-coverage-report integration-tests-coverage-report ## Export coverage reports into interactive HTML
105-
106-
unit-tests-coverage-report: test-unit ## Export unit test coverage report into interactive HTML
107-
coverage html --data-file="${ARTIFACT_DIR}/.coverage.unit" -d htmlcov-unit
108-
109-
integration-tests-coverage-report: test-integration ## Export integration test coverage report into interactive HTML
110-
coverage html --data-file="${ARTIFACT_DIR}/.coverage.integration" -d htmlcov-integration
111-
112-
check-types: ## Checks type hints in sources
113-
pdm run mypy --explicit-package-bases --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs ols/
114-
115-
security-check: ## Check the project for security issues
116-
bandit -c pyproject.toml -r .
117-
118-
format: ## Format the code into unified format
119-
pdm run black .
120-
pdm run ruff check . --fix
121-
12281
verify: install-woke install-deps-test ## Verify the code using various linters
12382
pdm run black . --check
12483
pdm run ruff check .
12584
./woke . --exit-1-on-failure
126-
pylint ols scripts tests runner.py
127-
pdm run mypy --explicit-package-bases --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs ols/
128-
129-
schema: ## Generate OpenAPI schema file
130-
python scripts/generate_openapi_schema.py docs/openapi.json
85+
pylint our_ols scripts tests runner.py
86+
pdm run mypy --explicit-package-bases --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs our_ols/
13187

13288
requirements.txt: pyproject.toml pdm.lock ## Generate requirements.txt file containing hashes for all non-devel packages
13389
pdm export --prod --format requirements --output requirements.txt --no-extras --without evaluation
13490

135-
verify-packages-completeness: requirements.txt ## Verify that requirements.txt file contains complete list of packages
136-
pip download -d /tmp/ --use-pep517 --verbose -r requirements.txt
137-
13891
get-rag: ## Download a copy of the RAG embedding model and vector database
13992
podman create --replace --name tmp-rag-container $$(grep 'ARG LIGHTSPEED_RAG_CONTENT_IMAGE' Containerfile | awk 'BEGIN{FS="="}{print $$2}') true
14093
rm -rf vector_db embeddings_model
14194
podman cp tmp-rag-container:/rag/vector_db vector_db
14295
podman cp tmp-rag-container:/rag/embeddings_model embeddings_model
14396
podman rm tmp-rag-container
14497

145-
config.puml: ## Generate PlantUML class diagram for configuration
146-
pyreverse ols/app/models/config.py --output puml --output-directory=docs/
147-
mv docs/classes.puml docs/config.puml
148-
149-
docs/config.png: docs/config.puml ## Generate an image with configuration graph
150-
pushd docs && \
151-
java -jar ${PATH_TO_PLANTUML}/plantuml.jar --theme rose config.puml && \
152-
mv classes.png config.png && \
153-
popd
154-
155-
llms.puml: ## Generate PlantUML class diagram for LLM plugin system
156-
pyreverse ols/src/llms/ --output puml --output-directory=docs/
157-
mv docs/classes.puml docs/llms_classes.uml
158-
mv docs/packages.puml docs/llms_packages.uml
159-
160-
distribution-archives: ## Generate distribution archives to be uploaded into Python registry
161-
pdm run python -m build
162-
163-
upload-distribution-archives: ## Upload distribution archives into Python registry
164-
pdm run python -m twine upload --repository ${PYTHON_REGISTRY} dist/*
165-
166-
shellcheck: ## Run shellcheck
167-
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz" | tar -xJv \
168-
shellcheck --version
169-
shellcheck -- */*.sh
170-
17198
help: ## Show this help screen
17299
@echo 'Usage: make <OPTIONS> ... <TARGETS>'
173100
@echo ''

logs/.gitkeep

Whitespace-only changes.

ols/__init__.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

ols/app/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

ols/app/endpoints/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

ols/app/endpoints/authorized.py

Lines changed: 0 additions & 64 deletions
This file was deleted.

ols/app/endpoints/feedback.py

Lines changed: 0 additions & 146 deletions
This file was deleted.

0 commit comments

Comments
 (0)