-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
56 lines (44 loc) · 2.12 KB
/
Makefile
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
# Default to CPU if not specified
FLAVOR ?= cpu
# Define behavior based on the flavor
ifeq ($(FLAVOR),cpu)
TORCH_GROUP := cpu
else ifeq ($(FLAVOR),gpu)
TORCH_GROUP := gpu
else
$(error Unsupported FLAVOR $(FLAVOR), must be 'cpu' or 'gpu')
endif
install-tools: ## Install required utilities/tools
@command -v pdm > /dev/null || { echo >&2 "pdm is not installed. Installing..."; pip3.11 install --upgrade pip pdm; }
pdm-lock-check: ## Check that the pdm.lock file is in a good shape
pdm lock --check --group $(TORCH_GROUP) --lockfile pdm.lock.$(TORCH_GROUP)
install-deps: install-tools pdm-lock-check ## Install all required dependencies, according to pdm.lock
pdm sync --group $(TORCH_GROUP) --lockfile pdm.lock.$(TORCH_GROUP)
install-deps-test: install-tools pdm-lock-check ## Install all required dev dependencies, according to pdm.lock
pdm sync --dev --group $(TORCH_GROUP) --lockfile pdm.lock.$(TORCH_GROUP)
update-deps: ## Check pyproject.toml for changes, update the lock file if needed, then sync.
pdm install --group $(TORCH_GROUP) --lockfile pdm.lock.$(TORCH_GROUP)
pdm install --dev --group $(TORCH_GROUP) --lockfile pdm.lock.$(TORCH_GROUP)
check-types: ## Checks type hints in sources
mypy --explicit-package-bases --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs scripts
format: ## Format the code into unified format
black scripts
ruff check scripts --fix --per-file-ignores=scripts/*:S101
verify: ## Verify the code using various linters
black --check scripts
ruff check scripts --per-file-ignores=scripts/*:S101
update-docs: ## Update the plaintext OCP docs in ocp-product-docs-plaintext/
@set -e && for OCP_VERSION in $$(ls -1 ocp-product-docs-plaintext); do \
scripts/get_ocp_plaintext_docs.sh $$OCP_VERSION; \
done
scripts/get_runbooks.sh
build-image: ## Build a rag-content container image.
podman build -t rag-content .
help: ## Show this help screen
@echo 'Usage: make <OPTIONS> ... <TARGETS>'
@echo ''
@echo 'Available targets are:'
@echo ''
@grep -E '^[ a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-25s\033[0m %s\n", $$1, $$2}'
@echo ''