Skip to content

Commit

Permalink
treat config as yaml in the values
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandawsonuk authored and seldondev committed Jan 3, 2020
1 parent 58d72b9 commit 62766f6
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
data:
credentials: '{{ .Values.credentials }}'
predictor_servers: '{{ .Values.predictor_servers }}'
storageInitializer: '{{ .Values.storageInitializer }}'
credentials: '{{ .Values.credentials | toJson }}'
predictor_servers: '{{ .Values.predictor_servers | toJson }}'
storageInitializer: '{{ .Values.storageInitializer | toJson }}'
kind: ConfigMap
metadata:
labels:
Expand Down
47 changes: 43 additions & 4 deletions helm-charts/seldon-core-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,46 @@ usageMetrics:
enabled: false
webhook:
port: 443
credentials: "{\n \"gcs\" : {\n \"gcsCredentialFileName\": \"gcloud-application-credentials.json\"\n },\n \"s3\" : {\n \"s3AccessKeyIDName\": \"awsAccessKeyID\",\n \"s3SecretAccessKeyName\": \"awsSecretAccessKey\"\n }\n}"
predictor_servers: "{\n \"TENSORFLOW_SERVER\": {\n \"tensorflow\": true,\n \"tfImage\": \"tensorflow/serving:latest\",\n \"rest\": {\n \"image\": \"seldonio/tfserving-proxy_rest\",\n \"defaultImageVersion\": \"0.7\"\n },\n \"grpc\": {\n \"image\": \"seldonio/tfserving-proxy_grpc\",\n \"defaultImageVersion\": \"0.7\"\n }\n },\n \"SKLEARN_SERVER\": {\n \"rest\": {\n \"image\": \"seldonio/sklearnserver_rest\",\n \"defaultImageVersion\": \"0.2\"\n },\n \"grpc\": {\n \"image\": \"seldonio/sklearnserver_grpc\",\n \"defaultImageVersion\": \"0.2\"\n }\n },\n \"XGBOOST_SERVER\": {\n \"rest\": {\n \"image\": \"seldonio/xgboostserver_rest\",\n \"defaultImageVersion\": \"0.2\"\n },\n \"grpc\": {\n \"image\": \"seldonio/xgboostserver_grpc\",\n \"defaultImageVersion\": \"0.2\"\n }\n\
\ },\n \"MLFLOW_SERVER\": {\n \"rest\": {\n \"image\": \"seldonio/mlflowserver_rest\",\n \"defaultImageVersion\": \"0.2\"\n },\n \"grpc\": {\n \"image\": \"seldonio/mlflowserver_grpc\",\n \"defaultImageVersion\": \"0.2\"\n }\n }\n}"
storageInitializer: "{\n \"image\" : \"gcr.io/kfserving/storage-initializer:0.2.1\",\n \"memoryRequest\": \"100Mi\",\n \"memoryLimit\": \"1Gi\",\n \"cpuRequest\": \"100m\",\n \"cpuLimit\": \"1\"\n}"
credentials:
gcs:
gcsCredentialFileName: gcloud-application-credentials.json
s3:
s3AccessKeyIDName: awsAccessKeyID
s3SecretAccessKeyName: awsSecretAccessKey
predictor_servers:
TENSORFLOW_SERVER:
tensorflow: true
tfImage: tensorflow/serving:latest
rest:
image: seldonio/tfserving-proxy_rest
defaultImageVersion: '0.7'
grpc:
image: seldonio/tfserving-proxy_grpc
defaultImageVersion: '0.7'
SKLEARN_SERVER:
rest:
image: seldonio/sklearnserver_rest
defaultImageVersion: '0.2'
grpc:
image: seldonio/sklearnserver_grpc
defaultImageVersion: '0.2'
XGBOOST_SERVER:
rest:
image: seldonio/xgboostserver_rest
defaultImageVersion: '0.2'
grpc:
image: seldonio/xgboostserver_grpc
defaultImageVersion: '0.2'
MLFLOW_SERVER:
rest:
image: seldonio/mlflowserver_rest
defaultImageVersion: '0.2'
grpc:
image: seldonio/mlflowserver_grpc
defaultImageVersion: '0.2'
storageInitializer:
image: gcr.io/kfserving/storage-initializer:0.2.1
memoryRequest: 100Mi
memoryLimit: 1Gi
cpuRequest: 100m
cpuLimit: '1'
2 changes: 1 addition & 1 deletion operator/config/manager/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ data:
}
storageInitializer: |-
{
"image" : "gcr.io/kfserving/storage-initializer:0.2.1",
"image" : "gcr.io/kfserving/storage-initializer:0.2.2",
"memoryRequest": "100Mi",
"memoryLimit": "1Gi",
"cpuRequest": "100m",
Expand Down
9 changes: 6 additions & 3 deletions operator/helm/split_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
def helm_value(value: str):
return '{{ .Values.' + value + ' }}'

def helm_value_json(value: str):
return '{{ .Values.' + value + ' | toJson }}'

def helm_release(value: str):
return '{{ .Release.' + value + ' }}'

Expand Down Expand Up @@ -103,9 +106,9 @@ def helm_release(value: str):


if kind == "configmap" and name == "seldon-config":
res["data"]["credentials"] = helm_value("credentials")
res["data"]["predictor_servers"] = helm_value("predictor_servers")
res["data"]["storageInitializer"] = helm_value("storageInitializer")
res["data"]["credentials"] = helm_value_json("credentials")
res["data"]["predictor_servers"] = helm_value_json("predictor_servers")
res["data"]["storageInitializer"] = helm_value_json("storageInitializer")

if kind == "serviceaccount" and name == "seldon-manager":
res["metadata"]["name"] = helm_value("serviceAccount.name")
Expand Down
47 changes: 43 additions & 4 deletions operator/helm/values-patch.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
credentials: "{\n \"gcs\" : {\n \"gcsCredentialFileName\": \"gcloud-application-credentials.json\"\n },\n \"s3\" : {\n \"s3AccessKeyIDName\": \"awsAccessKeyID\",\n \"s3SecretAccessKeyName\": \"awsSecretAccessKey\"\n }\n}"
predictor_servers: "{\n \"TENSORFLOW_SERVER\": {\n \"tensorflow\": true,\n \"tfImage\": \"tensorflow/serving:latest\",\n \"rest\": {\n \"image\": \"seldonio/tfserving-proxy_rest\",\n \"defaultImageVersion\": \"0.7\"\n },\n \"grpc\": {\n \"image\": \"seldonio/tfserving-proxy_grpc\",\n \"defaultImageVersion\": \"0.7\"\n }\n },\n \"SKLEARN_SERVER\": {\n \"rest\": {\n \"image\": \"seldonio/sklearnserver_rest\",\n \"defaultImageVersion\": \"0.2\"\n },\n \"grpc\": {\n \"image\": \"seldonio/sklearnserver_grpc\",\n \"defaultImageVersion\": \"0.2\"\n }\n },\n \"XGBOOST_SERVER\": {\n \"rest\": {\n \"image\": \"seldonio/xgboostserver_rest\",\n \"defaultImageVersion\": \"0.2\"\n },\n \"grpc\": {\n \"image\": \"seldonio/xgboostserver_grpc\",\n \"defaultImageVersion\": \"0.2\"\n }\n\
\ },\n \"MLFLOW_SERVER\": {\n \"rest\": {\n \"image\": \"seldonio/mlflowserver_rest\",\n \"defaultImageVersion\": \"0.2\"\n },\n \"grpc\": {\n \"image\": \"seldonio/mlflowserver_grpc\",\n \"defaultImageVersion\": \"0.2\"\n }\n }\n}"
storageInitializer: "{\n \"image\" : \"gcr.io/kfserving/storage-initializer:0.2.1\",\n \"memoryRequest\": \"100Mi\",\n \"memoryLimit\": \"1Gi\",\n \"cpuRequest\": \"100m\",\n \"cpuLimit\": \"1\"\n}"
credentials:
gcs:
gcsCredentialFileName: gcloud-application-credentials.json
s3:
s3AccessKeyIDName: awsAccessKeyID
s3SecretAccessKeyName: awsSecretAccessKey
predictor_servers:
TENSORFLOW_SERVER:
tensorflow: true
tfImage: tensorflow/serving:latest
rest:
image: seldonio/tfserving-proxy_rest
defaultImageVersion: '0.7'
grpc:
image: seldonio/tfserving-proxy_grpc
defaultImageVersion: '0.7'
SKLEARN_SERVER:
rest:
image: seldonio/sklearnserver_rest
defaultImageVersion: '0.2'
grpc:
image: seldonio/sklearnserver_grpc
defaultImageVersion: '0.2'
XGBOOST_SERVER:
rest:
image: seldonio/xgboostserver_rest
defaultImageVersion: '0.2'
grpc:
image: seldonio/xgboostserver_grpc
defaultImageVersion: '0.2'
MLFLOW_SERVER:
rest:
image: seldonio/mlflowserver_rest
defaultImageVersion: '0.2'
grpc:
image: seldonio/mlflowserver_grpc
defaultImageVersion: '0.2'
storageInitializer:
image: gcr.io/kfserving/storage-initializer:0.2.2
memoryRequest: 100Mi
memoryLimit: 1Gi
cpuRequest: 100m
cpuLimit: '1'

0 comments on commit 62766f6

Please sign in to comment.