-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (56 loc) · 1.5 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Makefile for managing Docker containers and services
# PHONY targets for avoiding conflicts with files
.PHONY: all run stop start down pull up logs ps clear-images airflow airflow-init spark spark-worker-restart spark-scale postgres pgadmin mariadb-exec minio minio-init dl-jars
# Standard target
all: run
# Combined operations for everyday use
run: minio airflow spark postgres pgadmin
# Container Management
stop:
docker-compose stop
start:
docker-compose start
down:
docker-compose down -v
pull:
docker-compose pull
up:
docker-compose up -d
logs:
docker-compose logs -f
ps:
docker-compose ps
clear-images:
docker image prune --filter="dangling=true"
# Airflow Operations
airflow: airflow-init
docker-compose up -d airflow-webserver
docker-compose up -d airflow-scheduler
docker-compose up -d airflow-worker
airflow-init:
docker-compose up airflow-init
# Spark Operations
spark:
docker-compose up -d spark-master
sleep 5 # Wait until the master is ready
docker-compose up -d spark-worker
spark-worker-restart:
docker-compose restart spark-worker
spark-scale:
docker-compose up --scale spark-worker=3 -d
# Database Management
postgres:
docker-compose up -d postgres-dw
pgadmin:
docker-compose up -d pgadmin
mariadb-exec:
docker-compose exec mariadb mysql -u root -p -h localhost
# Minio Operations
minio:
docker-compose up -d minio
minio-init:
docker-compose exec minio bash ./init/minio-init.sh
# Auxiliary operations
dl-jars:
mkdir -p ./airflow/dags/jars
sh ./airflow/download_jar_files.sh