-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
116 lines (96 loc) · 3.64 KB
/
Makefile
File metadata and controls
116 lines (96 loc) · 3.64 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
SHELL := /usr/bin/env bash
AWS_REGION ?= us-east-1
PROJECT ?= data-platform
export AWS_REGION PROJECT
.PHONY: init plan apply destroy kubeconfig hms-port build-images build-hive build-spark-ingest build-spark-aggregate ecr-login ecr-list help
init:
terraform -chdir=./ init
plan:
terraform -chdir=./ plan -out "tfplan"
apply:
terraform -chdir=./ apply -auto-approve "tfplan"
destroy:
terraform -chdir=./ destroy -auto-approve
kubeconfig:
aws eks update-kubeconfig --region $(AWS_REGION) --name $(PROJECT)-eks
hms-port:
kubectl -n hive port-forward svc/hive-metastore 9083:9083
####################
# Docker Image Management
####################
# Build and push all custom Docker images to ECR
build-images:
@echo "🐳 Building and pushing all custom Docker images..."
./scripts/build-and-push-images.sh
# Build and push only Hive Metastore image
build-hive:
@echo "🐳 Building and pushing Hive Metastore image..."
./scripts/build-and-push-images.sh --image hive-metastore
# Build and push only Spark ingestion image
build-spark-ingest:
@echo "🐳 Building and pushing Spark ingestion image..."
./scripts/build-and-push-images.sh --image spark-ingest
# Build and push only Spark aggregation image
build-spark-aggregate:
@echo "🐳 Building and pushing Spark aggregation image..."
./scripts/build-and-push-images.sh --image spark-aggregate
# Dry run - show what would be built without actually building
build-images-dry:
@echo "🔍 Dry run - showing what images would be built..."
./scripts/build-and-push-images.sh --dry-run
####################
# ECR Management
####################
# Login to ECR
ecr-login:
@echo "🔐 Logging into AWS ECR..."
./scripts/ecr-manager.sh login
# List all ECR repositories
ecr-list:
@echo "📦 Listing ECR repositories..."
./scripts/ecr-manager.sh list
# Show ECR images in a specific repository (usage: make ecr-images REPO=data-platform/hive-metastore)
ecr-images:
@if [ -z "$(REPO)" ]; then \
echo "❌ Please specify REPO=repository-name"; \
echo "Example: make ecr-images REPO=data-platform/hive-metastore"; \
else \
echo "🐳 Listing images in $(REPO)..."; \
./scripts/ecr-manager.sh images $(REPO); \
fi
####################
# Help
####################
# Show available commands
help:
@echo "LogExaminer - Available Make Commands"
@echo "===================================="
@echo ""
@echo "🏗️ Infrastructure:"
@echo " init Initialize Terraform workspace"
@echo " plan Plan infrastructure changes"
@echo " apply Apply changes to AWS"
@echo " destroy Destroy all resources"
@echo ""
@echo "☸️ Kubernetes:"
@echo " kubeconfig Configure kubectl for EKS cluster"
@echo " hms-port Port-forward Hive Metastore (9083:9083)"
@echo ""
@echo "🐳 Docker Images:"
@echo " build-images Build and push all custom Docker images"
@echo " build-hive Build and push Hive Metastore image"
@echo " build-spark-ingest Build and push Spark ingestion image"
@echo " build-spark-aggregate Build and push Spark aggregation image"
@echo " build-images-dry Show what would be built (dry run)"
@echo ""
@echo "📦 ECR Management:"
@echo " ecr-login Login to AWS ECR"
@echo " ecr-list List all ECR repositories"
@echo " ecr-images REPO=name List images in specific repository"
@echo ""
@echo "💡 Examples:"
@echo " make build-images # Build all custom images"
@echo " make ecr-images REPO=log-ingest-spark # Show images in repository"
@echo " make build-images-dry # Preview build operations"
@echo ""
@echo "📚 For more details, see: scripts/README.md"