-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
53 lines (39 loc) · 1.34 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
JOB_USER=my-user
JOB_PASS=my-password
TS=(shell date '%s')
PROCESSOR_IMAGE=stevecooperorg/work-queue-processor:latest
LOADER_IMAGE=stevecooperorg/work-queue-loader:latest
all: docker-build
docker-start-rabbit:
docker run --rm -p 5672:5672 -d --hostname work-queue --name work-queue rabbitmq:3
docker-build:
docker build loader -t $(LOADER_IMAGE)
docker build processor -t $(PROCESSOR_IMAGE)
docker-run: docker-build
docker run --rm --env JOB_USER=$(JOB_USER) --env JOB_PASS=$(JOB_PASS) $(PROCESSOR_IMAGE)
process:
export JOB_USER=$(JOB_USER) && export JOB_PASS=$(JOB_PASS) && export WORK_QUEUE_HOST=localhost && python processor/src/main.py
load:
export WORK_QUEUE_HOST=localhost && python loader/src/main.py
docker-push: docker-build
docker push $(PROCESSOR_IMAGE)
docker push $(LOADER_IMAGE)
kube-delete-job:
kubectl delete -f kubernetes/job.yaml
kube-run-job:
kubectl apply -f kubernetes/job.yaml
kube-describe-job:
kubectl describe job my-batch-job
kubectl get pods -l job-name=my-batch-job
kube-rerun-job: docker-push
kube-rerun-job: kube-delete-job
kube-rerun-job: kube-run-job
kube-rerun-job:
kubectl get job my-batch-job
kubectl get pods -l job-name=my-batch-job
kube-delete-load:
kubectl delete -f kubernetes/load.yaml
kube-run-load:
kubectl apply -f kubernetes/load.yaml
kube-rerun-load: kube-delete-load
kube-rerun-load: kube-run-load