Skip to content

Commit

Permalink
script to pull in chart
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandawsonuk committed Jul 16, 2020
1 parent f6f0a69 commit 8531183
Show file tree
Hide file tree
Showing 12 changed files with 258 additions and 51 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ scorecard:
quay-push:
operator-courier push deploy/olm-catalog/seldon-deploy-operator ${QUAY_USER} seldon-deploy-operator ${VERSION} "$$QUAY_TOKEN"

get-helm-chart:
./get-helm-chart.sh

helm-install:
./sd-install-openshift
Expand Down
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Note this directory must be named `seldon-deploy-operator`. Operator-sdk [uses t

Tested with:

operator-courier 2.7.1
operator-courier 2.1.7
operator-sdk v0.17.1

First check you can run scorecard from Makefile against empty kind cluster.
Expand All @@ -29,11 +29,13 @@ Can then run on cluster.

Each new release needs to be based on the latest seldon deploy helm chart. The release version should match a deploy release version. This involves:

1) Updating the helm chart here.
2) Create a new folder for the new version in the deploy/olm-catalog/seldon-deploy-operator directory - copy the contents from the previous.
3) Any differences between the new helm values file and the last one need to be reflected by updating the alm-examples section of the clusterserviceversion. It's basically a json version of a values file.
4) Make sure any references to the previous release version in what was copied are changed to the new version.
5) Update the version.txt, operator.yaml and osdk-scorecard.yaml to point to the new version.
6) Update PREV_VERSION in the Makefile to point to the old version.
7) Test as per the Installation section above.
8) When ready then push new image to https://connect.redhat.com/project/4805411/view
1) See redhat.md in notes in seldon-deploy repo. Make sure image is published.
2) Compare the values-redhat.yaml and values.yaml in a yaml compare tool or in goland to make sure that values-redhat.yaml has every section and points to RH images.
3) Put the deploy version in get-helm-chart.sh and get the new deploy helm chart here using `make get_helm_chart`.
4) Create a new folder for the new version in the deploy/olm-catalog/seldon-deploy-operator directory - copy the contents from the previous.
5) Any differences between the new helm values file and the last one need to be reflected by updating the alm-examples section of the clusterserviceversion. It's basically a json version of a values file.
6) Make sure any references to the previous release version in what was copied are changed to the new version.
7) Update the version.txt, operator.yaml and osdk-scorecard.yaml to point to the new version.
8) Update PREV_VERSION in the Makefile to point to the old version.
9) Test as per the Installation section above.
10) When ready then push new image to https://connect.redhat.com/project/4805411/view
26 changes: 26 additions & 0 deletions get-helm-chart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

set -o nounset
set -o errexit
set -o pipefail
set -o xtrace

STARTUP_DIR="$( cd "$( dirname "$0" )" && pwd )"

SELDON_DEPLOY_VERSION=v0.7.0

TEMPRESOURCES=${STARTUP_DIR}/tempresources

rm -rf ${TEMPRESOURCES}
rm -rf ${STARTUP_DIR}/helm-charts
mkdir -p ${TEMPRESOURCES}
cd ${TEMPRESOURCES}

git clone [email protected]:SeldonIO/seldon-deploy.git
cd seldon-deploy
git fetch --tags
git checkout ${SELDON_DEPLOY_VERSION}
cd ${STARTUP_DIR}

cp -r ${TEMPRESOURCES}/seldon-deploy/tools/seldon-deploy-install/sd-setup/helm-charts ${STARTUP_DIR}/helm-charts
cp ${STARTUP_DIR}/helm-charts/seldon-deploy/values-redhat.yaml ${STARTUP_DIR}/helm-charts/seldon-deploy/values.yaml
4 changes: 2 additions & 2 deletions helm-charts/seldon-deploy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: "0.7.0-dev"
appVersion: "0.7.0"
description: A Helm chart for Kubernetes
name: seldon-deploy
version: 0.7.0-dev
version: 0.7.0
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ metadata:
name: seldon-deploy-config
data:
prometheusSeldonUrl: {{ .Values.prometheus.seldon.url }}
{{- if .Values.prometheus.seldon.resourceMetricsUrl }}
{{- if .Values.prometheus.seldon.resourceMetricsUrl }}
prometheusSeldonResourceUrl: {{ .Values.prometheus.seldon.resourceMetricsUrl }}
{{- else }}
{{- else }}
prometheusSeldonResourceUrl: {{ .Values.prometheus.seldon.url }}
{{- end }}
{{- end }}
prometheusKnativeUrl: {{ .Values.prometheus.knative.url }}
prometheusNamespaceMetricName: {{ .Values.prometheus.seldon.namespaceMetricName }}
prometheusServiceMetricName: {{ .Values.prometheus.seldon.serviceMetricName }}
Expand Down
22 changes: 7 additions & 15 deletions helm-charts/seldon-deploy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ metadata:
helm.sh/chart: {{ include "seldon-deploy.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
annotations:
helm.sh/created: {{ date "20060102150405" .Release.Time | quote }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
Expand Down Expand Up @@ -38,10 +40,8 @@ spec:
fieldRef:
fieldPath: metadata.namespace
{{- range $key, $value := .Values.env }}
{{- if $value }}
- name: {{ $key }}
value: {{ $value }}
{{- end }}
value: {{ $value | quote }}
{{- end }}
{{- if .Values.enableAppAuth }}
- name: "ENABLE_APP_AUTH"
Expand Down Expand Up @@ -80,14 +80,6 @@ spec:
- name: "EXTERNAL_PROTOCOL"
value: "{{ .Values.external.protocol }}"
{{- end }}
{{- if .Values.external.host }}
- name: "EXTERNAL_HOST"
value: "{{ .Values.external.host }}"
{{- end }}
{{- if .Values.kfserving.protocol }}
- name: "KFSERVING_PROTOCOL"
value: "{{ .Values.kfserving.protocol }}"
{{- end }}
- name: "INFERENCESERVICES"
value: "{{ .Values.kfserving.enabled }}"
- name: "SELDONDEPLOYMENTS"
Expand All @@ -113,22 +105,22 @@ spec:
{{- if .Values.lite }}
livenessProbe:
httpGet:
path: /seldon-deploy/
path: /seldon-deploy/api/status
port: http
initialDelaySeconds: 30
readinessProbe:
httpGet:
path: /seldon-deploy/
path: /seldon-deploy/api/status
port: http
initialDelaySeconds: 30
{{- else }}
livenessProbe:
httpGet:
path: /
path: /api/status
port: http
readinessProbe:
httpGet:
path: /
path: /api/status
port: http
{{- end }}
resources:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{{- if .Values.openshiftMarketplace.seldonCore.subscription.create -}}
apiVersion: operators.coreos.com/v1alpha1
apiVersion: {{ .Values.openshiftMarketplace.seldonCore.subscription.apiVersion }}
kind: Subscription
metadata:
generation: 1
name: seldon-operator-certified
namespace: openshift-operators
spec:
channel: alpha
channel: {{ .Values.openshiftMarketplace.seldonCore.subscription.channel }}
installPlanApproval: Automatic
name: seldon-operator-certified
source: certified-operators
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/seldon-deploy/templates/request-logger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
spec:
containers:
- name: user-container
image: {{ .Values.requestLogger.image }}
image: "{{ .Values.requestLogger.image }}"
imagePullPolicy: {{ .Values.requestLogger.imagePullPolicy }}
env:
- name: ELASTICSEARCH_HOST
Expand Down
163 changes: 163 additions & 0 deletions helm-charts/seldon-deploy/values-nonkubeflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@

replicaCount: 1

image:
image: seldonio/seldon-deploy:0.0.0
pullPolicy: Always

loadtest:
image: seldonio/hey-loadtester:0.1

alibidetect:
image: seldonio/alibi-detect-server:0.0.1

nameOverride: ""
fullnameOverride: ""

service:
type: ClusterIP
port: 80

# boolean to enable app-level auth (defaults to "false")
enableAppAuth: true

# boolean to enable app-analytics (defaults to "true")
enableAppAnalytics: true

env:
GITOPS_FORMAT: "json"
USERID_CLAIM_KEY: "preferred_username" # claim to be used as userid (defaults to "preferred_username")
OIDC_PROVIDER: "" # oidc issuerURL
CLIENT_ID: "deploy-server" # oidc client ID
CLIENT_SECRET: "deploy-secret" # oidc client secret
REDIRECT_URL: "" #`${oidc_redirect_url}/seldon-deploy/auth/callback`
OIDC_SCOPES: "profile email groups" #oidc scopes (defaults to "profile email groups")
# if enableAppAnalytics enabled use token
# APP_ANALYTICS_TOKEN: ""

docker:
user: "unkown"

ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths: []

tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

serviceAccount:
create: true

github:
user: ""
token: ""
email: ""

kfserving:
protocol: "http"
enabled: true
#Change ip to hostname on AWS. Or put real cluster IP after install.
curlForm: |
MODEL_NAME={{ .ModelName }}<br>
CLUSTER_IP=$(kubectl -n {{ .IngressNamespace }} get service {{ .IngressServiceName }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')<br>
SERVICE_HOSTNAME=$(kubectl get inferenceservice {{ .ModelName }} -o jsonpath='{.status.url}' | cut -d "/" -f 3)<br>
curl -v -H "Host: ${SERVICE_HOSTNAME}" {{ .KfServingProtocol }}://$CLUSTER_IP/v1/models/$MODEL_NAME:predict -d '{{ .Payload }}'
#Form for cluster-internal calls.
requestForm: "{{ .KfServingProtocol }}://{{ .IngressServiceName }}/v1/models/{{ .ModelName }}:predict"
explainForm: "{{ .KfServingProtocol }}://{{ .IngressServiceName }}/v1/models/{{ .ModelName }}:explain"

seldon:
protocol: "http"
enabled: true
#Below are templates that can be changed to adjust how requests are made and what curl option is shown to user.
#Change ip to hostname on AWS. Or put real cluster IP after install. Shown to user for calls outside cluster.
curlForm: |
CLUSTER_IP=$(kubectl -n {{ .IngressNamespace }} get service {{ .IngressServiceName }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')<br>
curl -k -H "X-Auth-Token: {{ .Token }} " -H "Content-Type: application/json" {{ .SeldonProtocol }}://$CLUSTER_IP/seldon/{{ .Namespace }}/{{ .ModelName }}/api/v0.1/predictions -d '{{ .Payload }}'
tensorFlowCurlForm: |
CLUSTER_IP=$(kubectl -n {{ .IngressNamespace }} get service {{ .IngressServiceName }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')<br>
curl -k -H "X-Auth-Token: {{ .Token }} " -H "Content-Type: application/json" {{ .SeldonProtocol }}://$CLUSTER_IP/seldon/{{ .Namespace }}/{{ .ModelName }}/v1/models/:predict -d '{{ .Payload }}'
#Forms for cluster-internal calls.
#e.g. could be changed to skip ingress by setting to "http://{{ .ModelName }}-{{ .ModelName }}-{{ .Predictor }}.{{ .Namespace }}:8000/api/v0.1/predictions"
seldonRequestForm: "{{ .SeldonProtocol }}://{{ .IngressServiceName }}/seldon/{{ .Namespace }}/{{ .ModelName }}/api/v0.1/predictions"
tensorflowRequestForm: "{{ .SeldonProtocol }}://{{ .IngressServiceName }}/seldon/{{ .Namespace }}/{{ .ModelName }}/v1/models/:predict"
#explainer call for seldon can go straight to predictor rather than ingress as not worried about loadbalancing a canary
explainForm: "http://{{ .ModelName }}-{{ .Predictor }}-explainer.{{ .Namespace }}:9000/v1/models/{{ .ModelName }}:explain"

external:
protocol: "http"

serviceAccountName: seldon-deploy

ingressGateway:
seldonIngressService: "istio-ingressgateway"
kfServingIngressService: "istio-ingressgateway"
ingressNamespace: "istio-system"

virtualService:
create: true
prefix: "/seldon-deploy/"
gateways:
- seldon-gateway.istio-system.svc.cluster.local

rbac:
create: true
clusterWide: false

nodeSelector: {}

tolerations: []

affinity: {}

imagePullSecrets:
- name: regcred

skipVerifyGit: true
skipVerifyHttpCalls: true


prometheus:
seldon:
url: "http://seldon-core-analytics-prometheus-seldon.seldon-system/api/v1/"
# resource metrics may come from different prometheus than req metrics - set only if different
# resourceMetricsUrl: ""
# see https://github.com/openshift/cluster-monitoring-operator/issues/768
namespaceMetricName: "kubernetes_namespace"
serviceMetricName: "service"
#leave below empty/commented for prom without token-based auth
#basic auth can be handled by putting user:pass in url.
#jwtSecretName: "jwt-elastic"
#jwtSecretKey: "jwt-elastic.txt"
knative:
url: "http://prometheus-system-np.knative-monitoring.svc.cluster.local:8080/api/v1/"


elasticsearch:
url: "http://elasticsearch-master.seldon-logs.svc.cluster.local:9200"
#leave below empty/commented for elastic without token-based auth
#basic auth can be handled by putting user:pass in urls.elasticsearch
#jwtSecretName: "jwt-elastic"
#jwtSecretKey: "jwt-elastic.txt"

argocd:
url: "https://argocd-server.argocd.svc.cluster.local"
25 changes: 22 additions & 3 deletions helm-charts/seldon-deploy/values-redhat.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

replicaCount: 1

#TODO: these should be RH UBI images
image:
image: seldonio/seldon-deploy:0.0.0
pullPolicy: Always
Expand Down Expand Up @@ -56,8 +57,8 @@ ingress:
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
Expand Down Expand Up @@ -165,6 +166,24 @@ elasticsearch:
argocd:
url: "https://argocd-server.argocd.svc.cluster.local"

#only create request logger if you've not already installed it outside of helm (or first delete existing install)
#if namespace.create is false then assumes namespace existing with a knative broker (kubectl get broker -n seldon-logs)
requestLogger:
create: true
image: docker.io/seldonio/seldon-request-logger:0.3.1
imagePullPolicy: IfNotPresent
elasticsearch:
host: "elasticsearch.openshift-logging"
port: "9200"
protocol: "https"
jwtSecretName: "jwt-elastic"
jwtSecretKey: "jwt-elastic.txt"
namespace:
create: false
name: seldon-logs
trigger:
apiVersion: "eventing.knative.dev/v1alpha1"

openshiftMarketplace:
cleanupClusterServiceVersions: false
kubectlCleanupImage: docker.io/seldonio/kubectl:1.14.3
Expand All @@ -182,4 +201,4 @@ openshiftMarketplace:
namespace: "istio-system"
prometheus:
monitorSpecs:
create: true
create: true
Loading

0 comments on commit 8531183

Please sign in to comment.