forked from powerfulseal/powerfulseal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
159 lines (138 loc) · 3.47 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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
INOTIFY_CALL ?= inotifywait -e modify -r ./powerfulseal ./tests
NPM_CALL ?= cd powerfulseal/web/ui && npm install && npm run build
TOX_CALL ?= tox -r
METRICS_SERVER_URL ?= http://metrics-server.kube-system.svc.kubernetes.cluster/
CLOUD_OPTION ?= --openstack
name ?= powerfulseal
version ?= `python setup.py --version`
tag = $(name):$(version)
namespace ?= "bloomberg/"
test:
$(TOX_CALL)
watch:
$(TOX_CALL) && while $(INOTIFY_CALL); do $(TOX_CALL); done
web:
$(NPM_CALL)
upload:
rm -rfv dist
rm -rfv powerfulseal.egg-info
python setup.py sdist
twine upload dist/*
clean:
find -name '*.pyc' -delete
find -name '__pycache__' -delete
build:
docker build -t $(tag) -f ./build/Dockerfile .
tag:
docker tag $(tag) $(namespace)$(tag)
push:
docker push $(namespace)$(tag)
version:
@echo $(tag)
# EXAMPLES OF RUNNING THE SEAL
autonomous:
seal \
-vv \
autonomous \
${CLOUD_OPTION} \
--policy-file ./examples/policy_kill_random_default.yml \
--inventory-kubernetes \
--prometheus-collector \
--prometheus-host 0.0.0.0 \
--prometheus-port 9999 \
--ssh-allow-missing-host-keys \
--host 0.0.0.0 \
--port 30100
autonomous-headless:
seal \
-vv \
autonomous \
--headless \
${CLOUD_OPTION} \
--policy-file ./examples/policy_kill_random_default.yml \
--inventory-kubernetes \
--prometheus-collector \
--prometheus-host 0.0.0.0 \
--prometheus-port 9999 \
--ssh-allow-missing-host-keys
interactive:
seal \
-vv \
interactive \
${CLOUD_OPTION} \
--inventory-kubernetes \
--ssh-allow-missing-host-keys
validate:
seal \
-vv \
validate \
--policy-file ./examples/policy_kill_random_default.yml
label:
seal \
-vv \
label \
${CLOUD_OPTION} \
--inventory-kubernetes \
--prometheus-collector \
--prometheus-host 0.0.0.0 \
--prometheus-port 9999 \
--min-seconds-between-runs 3 \
--max-seconds-between-runs 10 \
--ssh-allow-missing-host-keys
demo:
HTTP_PROXY= \
http_proxy= \
seal \
-vv \
demo \
--kubeconfig ~/.kube/config \
${CLOUD_OPTION} \
--inventory-kubernetes \
--prometheus-collector \
--prometheus-host 0.0.0.0 \
--prometheus-port 9999 \
--ssh-allow-missing-host-keys \
--metrics-server-path $(METRICS_SERVER_URL)
# THE EXAMPLES BELOW SHOULD WORK FOR MINIKUBE
minikube-autonomous:
seal \
-vv \
autonomous \
--no-cloud \
--policy-file ./examples/policy_kill_random_default.yml \
--inventory-kubernetes \
--prometheus-collector \
--prometheus-host 0.0.0.0 \
--prometheus-port 9999 \
--ssh-allow-missing-host-keys \
--remote-user docker \
--ssh-path-to-private-key `minikube ssh-key` \
--override-ssh-host `minikube ip` \
--host 0.0.0.0 \
--port 30100
minikube-label:
seal \
-vv \
label \
--no-cloud \
--min-seconds-between-runs 3 \
--max-seconds-between-runs 10 \
--inventory-kubernetes \
--prometheus-collector \
--prometheus-host 0.0.0.0 \
--prometheus-port 9999 \
--ssh-allow-missing-host-keys \
--remote-user docker \
--ssh-path-to-private-key `minikube ssh-key` \
--override-ssh-host `minikube ip`
minikube-interactive:
seal \
-vv \
interactive \
--no-cloud \
--inventory-kubernetes \
--ssh-allow-missing-host-keys \
--remote-user docker \
--ssh-path-to-private-key `minikube ssh-key` \
--override-ssh-host `minikube ip`
.PHONY: test watch web upload clean build tag push version autonomous autonomous-headless interactive validate label demo minikube-autonomous minikube-label minikube-interactive