-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (42 loc) · 1.84 KB
/
Makefile
File metadata and controls
53 lines (42 loc) · 1.84 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
.PHONY: build run-embedder run-embedder-debug run-chat-cli run-chat-cli-debug clean docker-clean help
SHELL=/bin/bash
# Check if 'docker compose' is available, otherwise fall back to 'docker-compose'
ifeq ($(shell docker compose version 2>/dev/null),)
DOCKER_COMPOSE := docker-compose
else
DOCKER_COMPOSE := docker compose
endif
## Build the Docker images
build:
$(DOCKER_COMPOSE) build
## Build (if needed) and run the batch embedder in Docker
run-embedder: build
$(DOCKER_COMPOSE) up batch_embedder
## Build (if needed) and run the batch embedder in debug mode (bash shell)
run-embedder-debug: build
$(DOCKER_COMPOSE) run --rm batch_embedder-bash
## Build (if needed) and run the chat CLI in Docker (interactive)
run-chat-cli: build
$(DOCKER_COMPOSE) run --rm chat_cli
## Build (if needed) and run the chat CLI in debug mode (bash shell)
run-chat-cli-debug: build
$(DOCKER_COMPOSE) run --rm chat_cli-bash
## Remove Python cache files
clean:
find . -name "__pycache__" -type d -exec rm -r {} \+
## Remove Docker containers, networks, and volumes
docker-clean:
$(DOCKER_COMPOSE) down -v --remove-orphans
## Display help information
help:
@echo "Available commands:"
@echo " make build - Build the Docker images"
@echo " make run-embedder - Build (if needed) and run the batch embedder in Docker"
@echo " make run-embedder-debug - Build (if needed) and run the batch embedder in debug mode"
@echo " make run-chat-cli - Build (if needed) and run the chat CLI in Docker (interactive)"
@echo " make run-chat-cli-debug - Build (if needed) and run the chat CLI in debug mode"
@echo " make clean - Remove Python cache files"
@echo " make docker-clean - Remove Docker containers, networks, and volumes"
@echo " make help - Display this help information"
# Default target
.DEFAULT_GOAL := help