-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathtemplate.yaml
207 lines (191 loc) · 5.44 KB
/
template.yaml
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
apiVersion: v1
kind: Template
labels:
template: f8a-hpf-insights
metadata:
name: f8a-hpf-insights
annotations:
description: f8a-hpf-insights
objects:
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
service: f8a-hpf-insights-${HPF_SCORING_REGION}
name: f8a-hpf-insights-${HPF_SCORING_REGION}
spec:
replicas: "${{REPLICAS}}"
selector:
service: f8a-hpf-insights-${HPF_SCORING_REGION}
template:
metadata:
labels:
service: f8a-hpf-insights-${HPF_SCORING_REGION}
spec:
restartPolicy: ${RESTART_POLICY}
containers:
- command:
- /bin/entrypoint.sh
env:
- name: DEPLOYMENT_PREFIX
valueFrom:
configMapKeyRef:
name: bayesian-config
key: deployment-prefix
- name: SERVICE_PORT
value: "6006"
- name: SERVICE_TIMEOUT
value: "900"
- name: AWS_S3_BUCKET_NAME
valueFrom:
secretKeyRef:
key: bucket
name: hpf-maven-insights-s3
- name: MODEL_VERSION
value: "${{MODEL_VERSION}}"
- name: FLASK_LOGGING_LEVEL
value: ${FLASK_LOGGING_LEVEL}
- name: MAX_COMPANION_REC_COUNT
value: "${MAX_COMPANION_REC_COUNT}"
- name: UNKNOWN_PACKAGES_THRESHOLD
value: "${UNKNOWN_PACKAGES_THRESHOLD}"
- name: MIN_REC_CONFIDENCE
value: "${MIN_REC_CONFIDENCE}"
- name: USE_CLOUD_SERVICES
value: "${{USE_CLOUD_SERVICES}}"
- name: AWS_S3_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
key: aws_access_key_id
name: hpf-maven-insights-s3
- name: AWS_S3_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
key: aws_secret_access_key
name: hpf-maven-insights-s3
name: f8a-hpf-insights
image: "${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${IMAGE_TAG}"
imagePullPolicy: Always
ports:
- containerPort: 6006
livenessProbe:
httpGet:
path: /api/v1/liveness
port: 6006
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 30
readinessProbe:
httpGet:
path: /api/v1/readiness
port: 6006
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 30
resources:
requests:
cpu: ${CPU_REQUEST}
memory: ${MEMORY_REQUEST}
limits:
cpu: ${CPU_LIMIT}
memory: ${MEMORY_LIMIT}
# Added so that .npy can be downloaded from s3 and saved under /tmp. Gives write permission error otherwise.
volumeMounts:
- name: s3-data
mountPath: /tmp
volumes:
- name: s3-data
emptyDir: {}
- apiVersion: v1
kind: Service
metadata:
labels:
service: f8a-hpf-insights-${HPF_SCORING_REGION}
name: f8a-hpf-insights-${HPF_SCORING_REGION}
spec:
ports:
- port: 6006
targetPort: 0
selector:
service: f8a-hpf-insights-${HPF_SCORING_REGION}
parameters:
- description: CPU request
displayName: CPU request
required: true
name: CPU_REQUEST
value: "100m"
- description: CPU limit
displayName: CPU limit
required: true
name: CPU_LIMIT
value: "700m"
- description: Memory request
displayName: Memory request
required: true
name: MEMORY_REQUEST
value: "200Mi"
- description: Memory limit
displayName: Memory limit
required: true
name: MEMORY_LIMIT
value: "1Gi"
- description: Docker registry where the image is
displayName: Docker registry
required: true
name: DOCKER_REGISTRY
value: "quay.io"
- description: Docker image to use
displayName: Docker image
required: true
name: DOCKER_IMAGE
value: "app-sre/fabric8-analytics-f8a-hpf-insights"
- description: Image tag
displayName: Image tag
required: true
name: IMAGE_TAG
value: "latest"
- description: HPF Scoring Region - pypi or maven
displayName: HPF Scoring Region
required: true
name: HPF_SCORING_REGION
value: "maven"
- description: "Flask logging level (see: https://docs.python.org/3/library/logging.html#levels)"
displayName: Flask logging level
required: false
name: FLASK_LOGGING_LEVEL
value: "INFO"
- description: Number of deployment replicas
displayName: Number of deployment replicas
required: true
name: REPLICAS
value: "1"
- description: Ratio of known/unknown packages
displayName: Ratio of known/unknown packages
required: false
name: UNKNOWN_PACKAGES_THRESHOLD
value: "0.3"
- description: Max companion recommendations to return
displayName: Max companion recommendations to return
required: false
name: MAX_COMPANION_REC_COUNT
value: "5"
- description: Minimum recommendation confidence score
displayName: Minimum recommendation confidence score
required: true
name: MIN_REC_CONFIDENCE
value: "30"
- description: Restart policy
displayName: Restart policy
required: true
name: RESTART_POLICY
value: "Always"
- description: Use S3 or Local datastore
displayName: USe S3 or Local datastore
required: true
name: USE_CLOUD_SERVICES
value: "True"
- description: "Model Version - Date Format YYYY-MM-DD"
displayName: Model Version
required: true
name: MODEL_VERSION
value: "2019-01-03"