Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 27 additions & 25 deletions tools/make/docker.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ======== docker.mk ========
# ======== docker.mk ============
# = Docker build and management =
# ======== docker.mk ========
# ======== docker.mk ============

##@ Docker

Expand All @@ -15,40 +15,47 @@ export COMPOSE_FILE ?= deploy/docker-compose/docker-compose.yml
export COMPOSE_PROJECT_NAME ?= semantic-router

# Build all Docker images
docker-build-all: docker-build-extproc docker-build-llm-katan docker-build-dashboard docker-build-precommit ## Build all Docker images
docker-build-all: ## Build all Docker images
docker-build-all: docker-build-extproc docker-build-llm-katan docker-build-dashboard docker-build-precommit

# Build extproc Docker image
docker-build-extproc: ## Build extproc Docker image
docker-build-extproc:
@$(LOG_TARGET)
@echo "Building extproc Docker image..."
@$(CONTAINER_RUNTIME) build -f Dockerfile.extproc -t $(DOCKER_REGISTRY)/extproc:$(DOCKER_TAG) .

# Build llm-katan Docker image
docker-build-llm-katan: ## Build llm-katan Docker image
docker-build-llm-katan:
@$(LOG_TARGET)
@echo "Building llm-katan Docker image..."
@$(CONTAINER_RUNTIME) build -f e2e-tests/llm-katan/Dockerfile -t $(DOCKER_REGISTRY)/llm-katan:$(DOCKER_TAG) e2e-tests/llm-katan/

# Build dashboard Docker image
docker-build-dashboard: ## Build dashboard Docker image
docker-build-dashboard:
@$(LOG_TARGET)
@echo "Building dashboard Docker image..."
@$(CONTAINER_RUNTIME) build -f dashboard/backend/Dockerfile -t $(DOCKER_REGISTRY)/dashboard:$(DOCKER_TAG) .

# Build precommit Docker image
docker-build-precommit: ## Build precommit Docker image
docker-build-precommit:
@$(LOG_TARGET)
@echo "Building precommit Docker image..."
@$(CONTAINER_RUNTIME) build -f Dockerfile.precommit -t $(DOCKER_REGISTRY)/precommit:$(DOCKER_TAG) .

# Test llm-katan Docker image locally
docker-test-llm-katan: ## Test llm-katan Docker image locally
docker-test-llm-katan:
@$(LOG_TARGET)
@echo "Testing llm-katan Docker image..."
@curl -f http://localhost:8000/v1/models || (echo "Models endpoint failed" && exit 1)
@echo "\n✅ llm-katan Docker image test passed"

# Run llm-katan Docker image locally
docker-run-llm-katan: ## Run llm-katan Docker image locally
docker-run-llm-katan: docker-build-llm-katan
@$(LOG_TARGET)
@echo "Running llm-katan Docker image on port 8000..."
Expand All @@ -57,6 +64,7 @@ docker-run-llm-katan: docker-build-llm-katan
@$(CONTAINER_RUNTIME) run --rm -p 8000:8000 $(DOCKER_REGISTRY)/llm-katan:$(DOCKER_TAG)

# Run llm-katan with custom served model name
docker-run-llm-katan-custom: ## Run with custom served model name, by append SERVED_NAME=name
docker-run-llm-katan-custom:
@$(LOG_TARGET)
@echo "Running llm-katan with custom served model name..."
Expand All @@ -70,22 +78,26 @@ docker-run-llm-katan-custom:
llm-katan --model "Qwen/Qwen3-0.6B" --served-model-name "$(SERVED_NAME)" --host 0.0.0.0 --port 8000

# Clean up Docker images
docker-clean: ## Clean up Docker images
docker-clean:
@$(LOG_TARGET)
@echo "Cleaning up Docker images..."
@$(CONTAINER_RUNTIME) image prune -f
@echo "Docker cleanup completed"

# Push Docker images (for CI/CD)
docker-push-all: ## Build all Docker images
docker-push-all: docker-push-extproc docker-push-llm-katan
@$(LOG_TARGET)
@echo "All Docker images pushed successfully"

docker-push-extproc: ## Push extproc Docker image
docker-push-extproc:
@$(LOG_TARGET)
@echo "Pushing extproc Docker image..."
@$(CONTAINER_RUNTIME) push $(DOCKER_REGISTRY)/extproc:$(DOCKER_TAG)

docker-push-llm-katan: ## Push llm-katan Docker image
docker-push-llm-katan:
@$(LOG_TARGET)
@echo "Pushing llm-katan Docker image..."
Expand All @@ -97,81 +109,71 @@ REBUILD ?=
BUILD_FLAG=$(if $(REBUILD),--build,)

# Docker compose shortcuts (no rebuild by default)
docker-compose-up: ## Start services (default includes llm-katan; REBUILD=1 to rebuild)
docker-compose-up:
@$(LOG_TARGET)
@echo "Starting services with docker-compose (default includes llm-katan) (REBUILD=$(REBUILD))..."
@docker compose --profile llm-katan up -d $(BUILD_FLAG)

docker-compose-up-testing: ## Start with testing profile (REBUILD=1 optional)
docker-compose-up-testing:
@$(LOG_TARGET)
@echo "Starting services with testing profile (REBUILD=$(REBUILD))..."
@docker compose --profile testing up -d $(BUILD_FLAG)

docker-compose-up-llm-katan: ## Start with llm-katan profile (REBUILD=1 optional)
docker-compose-up-llm-katan:
@$(LOG_TARGET)
@echo "Starting services with llm-katan profile (REBUILD=$(REBUILD))..."
@docker compose --profile llm-katan up -d $(BUILD_FLAG)

# Start core services only (closer to production; excludes llm-katan)
docker-compose-up-core: ## Start core services only (no llm-katan)
docker-compose-up-core:
@$(LOG_TARGET)
@echo "Starting core services (no llm-katan) (REBUILD=$(REBUILD))..."
@docker compose up -d $(BUILD_FLAG)

# Explicit rebuild targets for convenience
docker-compose-rebuild: ## Force rebuild then start
docker-compose-rebuild: REBUILD=1
docker-compose-rebuild: docker-compose-up

docker-compose-rebuild-testing: ## Force rebuild (testing profile)
docker-compose-rebuild-testing: REBUILD=1
docker-compose-rebuild-testing: docker-compose-up-testing

docker-compose-rebuild-llm-katan: ## Force rebuild (llm-katan profile)
docker-compose-rebuild-llm-katan: REBUILD=1
docker-compose-rebuild-llm-katan: docker-compose-up-llm-katan

docker-compose-down:
docker-compose-down: ## Stop services (default includes llm-katan)
@$(LOG_TARGET)
@echo "Stopping docker-compose services (default includes llm-katan)..."
@docker compose --profile llm-katan down

docker-compose-down-core: ## Stop core services only (no llm-katan)
docker-compose-down-core:
@$(LOG_TARGET)
@echo "Stopping core services only (no llm-katan)..."
@docker compose down

docker-compose-down-testing: ## Stop services with testing profile
docker-compose-down-testing:
@$(LOG_TARGET)
@echo "Stopping services with testing profile..."
@docker compose --profile testing down

docker-compose-down-llm-katan: ## Stop services with llm-katan profile
docker-compose-down-llm-katan:
@$(LOG_TARGET)
@echo "Stopping services with llm-katan profile..."
@docker compose --profile llm-katan down

# Help target for Docker commands
docker-help:
@echo "Docker Make Targets:"
@echo " docker-build-all - Build all Docker images"
@echo " docker-build-extproc - Build extproc Docker image"
@echo " docker-build-llm-katan - Build llm-katan Docker image"
@echo " docker-build-dashboard - Build dashboard Docker image"
@echo " docker-build-precommit - Build precommit Docker image"
@echo " docker-test-llm-katan - Test llm-katan Docker image"
@echo " docker-run-llm-katan - Run llm-katan Docker image locally"
@echo " docker-run-llm-katan-custom SERVED_NAME=name - Run with custom served model name"
@echo " docker-clean - Clean up Docker images"
@echo " docker-compose-up - Start services (default includes llm-katan; REBUILD=1 to rebuild)"
@echo " docker-compose-up-core - Start core services only (no llm-katan)"
@echo " docker-compose-up-testing - Start with testing profile (REBUILD=1 optional)"
@echo " docker-compose-up-llm-katan - Start with llm-katan profile (REBUILD=1 optional)"
@echo " docker-compose-rebuild - Force rebuild then start"
@echo " docker-compose-rebuild-testing - Force rebuild (testing profile)"
@echo " docker-compose-rebuild-llm-katan - Force rebuild (llm-katan profile)"
@echo " docker-compose-down - Stop services (default includes llm-katan)"
@echo " docker-compose-down-core - Stop core services only (no llm-katan)"
@echo " docker-compose-down-testing - Stop services with testing profile"
@echo " docker-compose-down-llm-katan - Stop services with llm-katan profile"
@echo ""
docker-help: ## Show help for Docker-related make targets and environment variables
@echo "Environment Variables:"
@echo " DOCKER_REGISTRY - Docker registry (default: ghcr.io/vllm-project/semantic-router)"
@echo " DOCKER_TAG - Docker tag (default: latest)"
Expand Down
19 changes: 1 addition & 18 deletions tools/make/kube.mk
Original file line number Diff line number Diff line change
Expand Up @@ -167,24 +167,7 @@ cleanup: undeploy delete-cluster ## Complete cleanup: undeploy and delete cluste
@echo "$(GREEN)[SUCCESS]$(NC) Complete cleanup finished!"

# Help target
help-kube:
@echo "$(BLUE)Kubernetes targets:$(NC)"
@echo " create-cluster - Create kind cluster with optimized configuration"
@echo " delete-cluster - Delete kind cluster"
@echo " cluster-info - Show cluster information and resource usage"
@echo " deploy - Deploy semantic-router to the cluster"
@echo " undeploy - Remove semantic-router from the cluster"
@echo " load-image - Load Docker image into kind cluster"
@echo " test-deployment - Test the deployment"
@echo " test-api - Test the Classification API"
@echo " port-forward-api - Port forward Classification API (8080)"
@echo " port-forward-grpc - Port forward gRPC API (50051)"
@echo " port-forward-metrics - Port forward metrics (9190)"
@echo " logs - Show application logs"
@echo " status - Show deployment status"
@echo " setup - Complete setup (create-cluster + deploy)"
@echo " cleanup - Complete cleanup (undeploy + delete-cluster)"
@echo ""
help-kube: ## Show Kubernetes makefile help
@echo "$(BLUE)Configuration variables:$(NC)"
@echo " KIND_CLUSTER_NAME - Kind cluster name (default: $(KIND_CLUSTER_NAME))"
@echo " KIND_CONFIG_FILE - Kind config file (default: $(KIND_CONFIG_FILE))"
Expand Down
Loading