From b95b1e76491340a92945b3dbd7b56e774499a52f Mon Sep 17 00:00:00 2001 From: Tsotne Tabidze Date: Wed, 21 Oct 2020 12:53:27 +0400 Subject: [PATCH 1/6] Add helm charts for feast jobservice Signed-off-by: Tsotne Tabidze --- Makefile | 1 + .../feast/charts/feast-jobservice/Chart.yaml | 4 + .../feast/charts/feast-jobservice/README.md | 71 ++++++++ .../feast-jobservice/templates/_helpers.tpl | 45 +++++ .../feast-jobservice/templates/_ingress.yaml | 68 ++++++++ .../feast-jobservice/templates/configmap.yaml | 36 ++++ .../templates/deployment.yaml | 156 ++++++++++++++++++ .../feast-jobservice/templates/ingress.yaml | 7 + .../feast-jobservice/templates/secret.yaml | 15 ++ .../feast-jobservice/templates/service.yaml | 41 +++++ .../feast/charts/feast-jobservice/values.yaml | 154 +++++++++++++++++ infra/docker/jobservice/Dockerfile | 12 +- .../grpc/health/v1/HealthService.proto | 11 +- sdk/python/feast/client.py | 6 +- sdk/python/feast/job_service.py | 8 + 15 files changed, 625 insertions(+), 10 deletions(-) create mode 100644 infra/charts/feast/charts/feast-jobservice/Chart.yaml create mode 100644 infra/charts/feast/charts/feast-jobservice/README.md create mode 100644 infra/charts/feast/charts/feast-jobservice/templates/_helpers.tpl create mode 100644 infra/charts/feast/charts/feast-jobservice/templates/_ingress.yaml create mode 100644 infra/charts/feast/charts/feast-jobservice/templates/configmap.yaml create mode 100644 infra/charts/feast/charts/feast-jobservice/templates/deployment.yaml create mode 100644 infra/charts/feast/charts/feast-jobservice/templates/ingress.yaml create mode 100644 infra/charts/feast/charts/feast-jobservice/templates/secret.yaml create mode 100644 infra/charts/feast/charts/feast-jobservice/templates/service.yaml create mode 100644 infra/charts/feast/charts/feast-jobservice/values.yaml rename protos/{ => feast}/third_party/grpc/health/v1/HealthService.proto (80%) diff --git a/Makefile b/Makefile index d88cbf66d86..de0a1b1c4c0 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,7 @@ compile-protos-python: install-python-ci-dependencies @$(foreach dir,$(PROTO_TYPE_SUBDIRS),cd ${ROOT_DIR}/protos; python -m grpc_tools.protoc -I. --python_out=../sdk/python/ --mypy_out=../sdk/python/ feast/$(dir)/*.proto;) @$(foreach dir,$(PROTO_SERVICE_SUBDIRS),cd ${ROOT_DIR}/protos; python -m grpc_tools.protoc -I. --grpc_python_out=../sdk/python/ feast/$(dir)/*.proto;) cd ${ROOT_DIR}/protos; python -m grpc_tools.protoc -I. --python_out=../sdk/python/ --mypy_out=../sdk/python/ tensorflow_metadata/proto/v0/*.proto + cd ${ROOT_DIR}/protos; python -m grpc_tools.protoc -I. --python_out=../sdk/python/ --grpc_python_out=../sdk/python/ --mypy_out=../sdk/python/ feast/third_party/grpc/health/v1/*.proto install-python: compile-protos-python cd sdk/python; python setup.py develop diff --git a/infra/charts/feast/charts/feast-jobservice/Chart.yaml b/infra/charts/feast/charts/feast-jobservice/Chart.yaml new file mode 100644 index 00000000000..f0e1c4e581b --- /dev/null +++ b/infra/charts/feast/charts/feast-jobservice/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: Feast Job Coontroller manage ingestion jobs. +name: feast-jobservice +version: 0.8-SNAPSHOT diff --git a/infra/charts/feast/charts/feast-jobservice/README.md b/infra/charts/feast/charts/feast-jobservice/README.md new file mode 100644 index 00000000000..a10fcae8861 --- /dev/null +++ b/infra/charts/feast/charts/feast-jobservice/README.md @@ -0,0 +1,71 @@ +feast-jobcontroller +========== +Feast Job Controller manage ingestion jobs. + +Current chart version is `0.8-SNAPSHOT` + + + + + +## Chart Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| "application-generated.yaml".enabled | bool | `true` | Flag to include Helm generated configuration for http port, Feast database URL, Kafka bootstrap servers and jobs metrics host. This is useful for deployment that uses default configuration for Kafka, Postgres and StatsD exporter. Please set `application-override.yaml` to override this configuration. | +| "application-override.yaml" | object | `{"enabled":true}` | Configuration to override the default [application.yaml](https://github.com/feast-dev/feast/blob/master/job-controller/src/main/resources/application.yml). Will be created as a ConfigMap. `application-override.yaml` has a higher precedence than `application-secret.yaml` | +| "application-secret.yaml" | object | `{"enabled":true}` | Configuration to override the default [application.yaml](https://github.com/feast-dev/feast/blob/master/job-controller/src/main/resources/application.yml). Will be created as a Secret. `application-override.yaml` has a higher precedence than `application-secret.yaml`. It is recommended to either set `application-override.yaml` or `application-secret.yaml` only to simplify config management. | +| "application.yaml".enabled | bool | `true` | Flag to include the default [configuration](https://github.com/feast-dev/feast/blob/master/job-controller/src/main/resources/application.yml). Please set `application-override.yaml` to override this configuration. | +| envOverrides | object | `{}` | Extra environment variables to set | +| gcpProjectId | string | `""` | Project ID to use when using Google Cloud services such as BigQuery, Cloud Storage and Dataflow | +| gcpServiceAccount.enabled | bool | `false` | Flag to use [service account](https://cloud.google.com/iam/docs/creating-managing-service-account-keys) JSON key | +| gcpServiceAccount.existingSecret.key | string | `"credentials.json"` | Key in the secret data (file name of the service account) | +| gcpServiceAccount.existingSecret.name | string | `"feast-gcp-service-account"` | Name of the existing secret containing the service account | +| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | +| image.repository | string | `"gcr.io/kf-feast/feast-jobcontroller"` | Docker image repository | +| image.tag | string | `"develop"` | Image tag | +| ingress.grpc.annotations | object | `{}` | Extra annotations for the ingress | +| ingress.grpc.auth.enabled | bool | `false` | Flag to enable auth | +| ingress.grpc.class | string | `"nginx"` | Which ingress controller to use | +| ingress.grpc.enabled | bool | `false` | Flag to create an ingress resource for the service | +| ingress.grpc.hosts | list | `[]` | List of hostnames to match when routing requests | +| ingress.grpc.https.enabled | bool | `true` | Flag to enable HTTPS | +| ingress.grpc.https.secretNames | object | `{}` | Map of hostname to TLS secret name | +| ingress.grpc.whitelist | string | `""` | Allowed client IP source ranges | +| ingress.http.annotations | object | `{}` | Extra annotations for the ingress | +| ingress.http.auth.authUrl | string | `"http://auth-server.auth-ns.svc.cluster.local/auth"` | URL to an existing authentication service | +| ingress.http.auth.enabled | bool | `false` | Flag to enable auth | +| ingress.http.class | string | `"nginx"` | Which ingress controller to use | +| ingress.http.enabled | bool | `false` | Flag to create an ingress resource for the service | +| ingress.http.hosts | list | `[]` | List of hostnames to match when routing requests | +| ingress.http.https.enabled | bool | `true` | Flag to enable HTTPS | +| ingress.http.https.secretNames | object | `{}` | Map of hostname to TLS secret name | +| ingress.http.whitelist | string | `""` | Allowed client IP source ranges | +| javaOpts | string | `nil` | [JVM options](https://docs.oracle.com/cd/E22289_01/html/821-1274/configuring-the-default-jvm-and-java-arguments.html). For better performance, it is advised to set the min and max heap:
`-Xms2048m -Xmx2048m` | +| livenessProbe.enabled | bool | `false` | Flag to enabled the probe | +| livenessProbe.failureThreshold | int | `5` | Min consecutive failures for the probe to be considered failed | +| livenessProbe.initialDelaySeconds | int | `60` | Delay before the probe is initiated | +| livenessProbe.periodSeconds | int | `10` | How often to perform the probe | +| livenessProbe.successThreshold | int | `1` | Min consecutive success for the probe to be considered successful | +| livenessProbe.timeoutSeconds | int | `5` | When the probe times out | +| logLevel | string | `"WARN"` | Default log level, use either one of `DEBUG`, `INFO`, `WARN` or `ERROR` | +| logType | string | `"Console"` | Log format, either `JSON` or `Console` | +| nodeSelector | object | `{}` | Node labels for pod assignment | +| podLabels | object | `{}` | Labels to be added to Feast Job Controller pods | +| postgresql.existingSecret | string | `""` | Existing secret to use for authenticating to Postgres | +| prometheus.enabled | bool | `true` | Flag to enable scraping of Feast Job Controller metrics | +| readinessProbe.enabled | bool | `true` | Flag to enabled the probe | +| readinessProbe.failureThreshold | int | `5` | Min consecutive failures for the probe to be considered failed | +| readinessProbe.initialDelaySeconds | int | `20` | Delay before the probe is initiated | +| readinessProbe.periodSeconds | int | `10` | How often to perform the probe | +| readinessProbe.successThreshold | int | `1` | Min consecutive success for the probe to be considered successful | +| readinessProbe.timeoutSeconds | int | `10` | When the probe times out | +| replicaCount | int | `1` | Number of pods that will be created | +| resources | object | `{}` | CPU/memory [resource requests/limit](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) | +| service.grpc.nodePort | string | `nil` | Port number that each cluster node will listen to | +| service.grpc.port | int | `6565` | Service port for GRPC requests | +| service.grpc.targetPort | int | `6565` | Container port serving GRPC requests | +| service.http.nodePort | string | `nil` | Port number that each cluster node will listen to | +| service.http.port | int | `80` | Service port for HTTP requests | +| service.http.targetPort | int | `8080` | Container port serving HTTP requests and Prometheus metrics | +| service.type | string | `"ClusterIP"` | Kubernetes service type | diff --git a/infra/charts/feast/charts/feast-jobservice/templates/_helpers.tpl b/infra/charts/feast/charts/feast-jobservice/templates/_helpers.tpl new file mode 100644 index 00000000000..0d677103631 --- /dev/null +++ b/infra/charts/feast/charts/feast-jobservice/templates/_helpers.tpl @@ -0,0 +1,45 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "feast-jobservice.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "feast-jobservice.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "feast-jobservice.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "feast-jobservice.labels" -}} +app.kubernetes.io/name: {{ include "feast-jobservice.name" . }} +helm.sh/chart: {{ include "feast-jobservice.chart" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} diff --git a/infra/charts/feast/charts/feast-jobservice/templates/_ingress.yaml b/infra/charts/feast/charts/feast-jobservice/templates/_ingress.yaml new file mode 100644 index 00000000000..5bed6df0470 --- /dev/null +++ b/infra/charts/feast/charts/feast-jobservice/templates/_ingress.yaml @@ -0,0 +1,68 @@ +{{- /* +This takes an array of three values: +- the top context +- the feast component +- the service protocol +- the ingress context +*/ -}} +{{- define "feast.ingress" -}} +{{- $top := (index . 0) -}} +{{- $component := (index . 1) -}} +{{- $protocol := (index . 2) -}} +{{- $ingressValues := (index . 3) -}} +apiVersion: extensions/v1beta1 +kind: Ingress +{{ include "feast.ingress.metadata" . }} +spec: + rules: + {{- range $host := $ingressValues.hosts }} + - host: {{ $host }} + http: + paths: + - path: / + backend: + serviceName: {{ include (printf "feast-%s.fullname" $component) $top }} + servicePort: {{ index $top.Values "service" $protocol "port" }} + {{- end }} +{{- if $ingressValues.https.enabled }} + tls: + {{- range $host := $ingressValues.hosts }} + - secretName: {{ index $ingressValues.https.secretNames $host | default (splitList "." $host | rest | join "-" | printf "%s-tls") }} + hosts: + - {{ $host }} + {{- end }} +{{- end -}} +{{- end -}} + +{{- define "feast.ingress.metadata" -}} +{{- $commonMetadata := fromYaml (include "common.metadata" (first .)) }} +{{- $overrides := fromYaml (include "feast.ingress.metadata-overrides" .) -}} +{{- toYaml (merge $overrides $commonMetadata) -}} +{{- end -}} + +{{- define "feast.ingress.metadata-overrides" -}} +{{- $top := (index . 0) -}} +{{- $component := (index . 1) -}} +{{- $protocol := (index . 2) -}} +{{- $ingressValues := (index . 3) -}} +{{- $commonFullname := include "common.fullname" $top }} +metadata: + name: {{ $commonFullname }}-{{ $component }}-{{ $protocol }} + annotations: + kubernetes.io/ingress.class: {{ $ingressValues.class | quote }} + {{- if (and (eq $ingressValues.class "nginx") $ingressValues.auth.enabled) }} + nginx.ingress.kubernetes.io/auth-url: {{ $ingressValues.auth.authUrl | quote }} + nginx.ingress.kubernetes.io/auth-response-headers: "x-auth-request-email, x-auth-request-user" + nginx.ingress.kubernetes.io/auth-signin: "https://{{ $ingressValues.auth.signinHost | default (splitList "." (index $ingressValues.hosts 0) | rest | join "." | printf "auth.%s")}}/oauth2/start?rd=/r/$host/$request_uri" + {{- end }} + {{- if (and (eq $ingressValues.class "nginx") $ingressValues.whitelist) }} + nginx.ingress.kubernetes.io/whitelist-source-range: {{ $ingressValues.whitelist | quote -}} + {{- end }} + {{- if (and (eq $ingressValues.class "nginx") (eq $protocol "grpc") ) }} + # TODO: Allow choice of GRPC/GRPCS + nginx.ingress.kubernetes.io/backend-protocol: "GRPC" + {{- end }} + {{- if $ingressValues.annotations -}} + {{ include "common.annote" $ingressValues.annotations | indent 4 }} + {{- end }} +{{- end -}} diff --git a/infra/charts/feast/charts/feast-jobservice/templates/configmap.yaml b/infra/charts/feast/charts/feast-jobservice/templates/configmap.yaml new file mode 100644 index 00000000000..82e1410b6a8 --- /dev/null +++ b/infra/charts/feast/charts/feast-jobservice/templates/configmap.yaml @@ -0,0 +1,36 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "feast-jobservice.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "feast-jobservice.name" . }} + component: jobservice + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: + application-generated.yaml: | +{{- if index .Values "application-generated.yaml" "enabled" }} + feast: + core-host: {{ .Release.Name }}-feast-core + stream: + type: kafka + options: + bootstrapServers: {{ .Release.Name }}-kafka:9092 + topic: feast + jobs: + metrics: + enabled: true + type: statsd + host: {{ .Release.Name }}-prometheus-statsd-exporter-udp + port: 9125 + + server: + port: {{ .Values.service.http.targetPort }} +{{- end }} + + application-override.yaml: | +{{- if index .Values "application-override.yaml" "enabled" }} +{{- toYaml (index .Values "application-override.yaml") | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/infra/charts/feast/charts/feast-jobservice/templates/deployment.yaml b/infra/charts/feast/charts/feast-jobservice/templates/deployment.yaml new file mode 100644 index 00000000000..752753beec4 --- /dev/null +++ b/infra/charts/feast/charts/feast-jobservice/templates/deployment.yaml @@ -0,0 +1,156 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ template "feast-jobservice.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "feast-jobservice.name" . }} + component: jobservice + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ template "feast-jobservice.name" . }} + component: jobservice + release: {{ .Release.Name }} + template: + metadata: + annotations: + checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} + {{- if .Values.prometheus.enabled }} + prometheus.io/path: /metrics + prometheus.io/port: "{{ .Values.service.http.targetPort }}" + prometheus.io/scrape: "true" + {{- end }} + labels: + app: {{ template "feast-jobservice.name" . }} + component: jobservice + release: {{ .Release.Name }} + {{- if .Values.podLabels }} + {{ toYaml .Values.podLabels | nindent 8 }} + {{- end }} + spec: + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + + volumes: + - name: {{ template "feast-jobservice.fullname" . }}-config + configMap: + name: {{ template "feast-jobservice.fullname" . }} + - name: {{ template "feast-jobservice.fullname" . }}-secret + secret: + secretName: {{ template "feast-jobservice.fullname" . }} + {{- if .Values.gcpServiceAccount.enabled }} + - name: {{ template "feast-jobservice.fullname" . }}-gcp-service-account + secret: + secretName: {{ .Values.gcpServiceAccount.existingSecret.name }} + {{- end }} + + containers: + - name: {{ .Chart.Name }} + image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + + volumeMounts: + - name: {{ template "feast-jobservice.fullname" . }}-config + mountPath: /etc/feast + - name: {{ template "feast-jobservice.fullname" . }}-secret + mountPath: /etc/secrets/feast + readOnly: true + {{- if .Values.gcpServiceAccount.enabled }} + - name: {{ template "feast-jobservice.fullname" . }}-gcp-service-account + mountPath: /etc/secrets/google + readOnly: true + {{- end }} + + env: + - name: LOG_TYPE + value: {{ .Values.logType | quote }} + - name: LOG_LEVEL + value: {{ .Values.logLevel | quote }} + + {{- if .Values.postgresql.existingSecret }} + - name: SPRING_DATASOURCE_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.postgresql.existingSecret }} + key: postgresql-password + {{- end }} + + {{- if .Values.gcpServiceAccount.enabled }} + - name: GOOGLE_APPLICATION_CREDENTIALS + value: /etc/secrets/google/{{ .Values.gcpServiceAccount.existingSecret.key }} + {{- end }} + + {{- if .Values.gcpProjectId }} + - name: GOOGLE_CLOUD_PROJECT + value: {{ .Values.gcpProjectId | quote }} + {{- end }} + + {{- if .Values.javaOpts }} + - name: JAVA_TOOL_OPTIONS + value: {{ .Values.javaOpts }} + {{- end }} + + {{- range $key, $value := .Values.envOverrides }} + - name: {{ printf "%s" $key | replace "." "_" | upper | quote }} + {{- if eq (kindOf $value) "map" }} + valueFrom: + {{- toYaml $value | nindent 12 }} + {{- else }} + value: {{ $value | quote }} + {{- end }} + {{- end }} + + command: + - feast + - server + # - --spring.config.location= + # {{- if index .Values "application.yaml" "enabled" -}} + # classpath:/application.yml + # {{- end }} + # {{- if index .Values "application-generated.yaml" "enabled" -}} + # ,file:/etc/feast/application-generated.yaml + # {{- end }} + # {{- if index .Values "application-secret.yaml" "enabled" -}} + # ,file:/etc/secrets/feast/application-secret.yaml + # {{- end }} + # {{- if index .Values "application-override.yaml" "enabled" -}} + # ,file:/etc/feast/application-override.yaml + # {{- end }} + ports: + - name: http + containerPort: {{ .Values.service.http.targetPort }} + - name: grpc + containerPort: {{ .Values.service.grpc.targetPort }} + + {{- if .Values.livenessProbe.enabled }} + livenessProbe: + exec: + command: ["/usr/bin/grpc-health-probe", "-addr=:{{ .Values.service.grpc.targetPort }}"] + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.livenessProbe.periodSeconds }} + successThreshold: {{ .Values.livenessProbe.successThreshold }} + timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} + failureThreshold: {{ .Values.livenessProbe.failureThreshold }} + {{- end }} + + {{- if .Values.readinessProbe.enabled }} + readinessProbe: + exec: + command: ["/usr/bin/grpc-health-probe", "-addr=:{{ .Values.service.grpc.targetPort }}"] + initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.readinessProbe.periodSeconds }} + successThreshold: {{ .Values.readinessProbe.successThreshold }} + timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} + failureThreshold: {{ .Values.readinessProbe.failureThreshold }} + {{- end }} + + resources: + {{- toYaml .Values.resources | nindent 10 }} diff --git a/infra/charts/feast/charts/feast-jobservice/templates/ingress.yaml b/infra/charts/feast/charts/feast-jobservice/templates/ingress.yaml new file mode 100644 index 00000000000..bdb71232374 --- /dev/null +++ b/infra/charts/feast/charts/feast-jobservice/templates/ingress.yaml @@ -0,0 +1,7 @@ +{{- if .Values.ingress.http.enabled -}} +{{ template "feast.ingress" (list . "jobservice" "http" .Values.ingress.http) }} +{{- end }} +--- +{{ if .Values.ingress.grpc.enabled -}} +{{ template "feast.ingress" (list . "jobservice" "grpc" .Values.ingress.grpc) }} +{{- end }} diff --git a/infra/charts/feast/charts/feast-jobservice/templates/secret.yaml b/infra/charts/feast/charts/feast-jobservice/templates/secret.yaml new file mode 100644 index 00000000000..8bf2397fbf2 --- /dev/null +++ b/infra/charts/feast/charts/feast-jobservice/templates/secret.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "feast-jobservice.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "feast-jobservice.name" . }} + component: jobservice + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +type: Opaque +stringData: + application-secret.yaml: | +{{- toYaml (index .Values "application-secret.yaml") | nindent 4 }} diff --git a/infra/charts/feast/charts/feast-jobservice/templates/service.yaml b/infra/charts/feast/charts/feast-jobservice/templates/service.yaml new file mode 100644 index 00000000000..6effd1e5709 --- /dev/null +++ b/infra/charts/feast/charts/feast-jobservice/templates/service.yaml @@ -0,0 +1,41 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "feast-jobservice.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "feast-jobservice.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + {{- with .Values.service.annotations }} + annotations: + {{ toYaml . | nindent 4 }} + {{- end }} +spec: + type: {{ .Values.service.type }} + {{- if .Values.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} + {{- end }} + {{- if .Values.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: + {{ toYaml .Values.service.loadBalancerSourceRanges | nindent 2 }} + {{- end }} + ports: + - name: http + port: {{ .Values.service.http.port }} + targetPort: {{ .Values.service.http.targetPort }} + {{- if .Values.service.http.nodePort }} + nodePort: {{ .Values.service.http.nodePort }} + {{- end }} + - name: grpc + port: {{ .Values.service.grpc.port }} + targetPort: {{ .Values.service.grpc.targetPort }} + {{- if .Values.service.grpc.nodePort }} + nodePort: {{ .Values.service.grpc.nodePort }} + {{- end }} + selector: + app: {{ template "feast-jobservice.name" . }} + component: jobservice + release: {{ .Release.Name }} + diff --git a/infra/charts/feast/charts/feast-jobservice/values.yaml b/infra/charts/feast/charts/feast-jobservice/values.yaml new file mode 100644 index 00000000000..8dbd3a1ace3 --- /dev/null +++ b/infra/charts/feast/charts/feast-jobservice/values.yaml @@ -0,0 +1,154 @@ +# replicaCount -- Number of pods that will be created +replicaCount: 1 + +image: + # image.repository -- Docker image repository + repository: gcr.io/kf-feast/feast-jobservice + # image.tag -- Image tag + tag: develop + # image.pullPolicy -- Image pull policy + pullPolicy: IfNotPresent + +application.yaml: + # "application.yaml".enabled -- Flag to include the default [configuration](https://github.com/feast-dev/feast/blob/master/job-controller/src/main/resources/application.yml). Please set `application-override.yaml` to override this configuration. + enabled: true + +application-generated.yaml: + # "application-generated.yaml".enabled -- Flag to include Helm generated configuration for http port, Feast database URL, Kafka bootstrap servers and jobs metrics host. This is useful for deployment that uses default configuration for Kafka, Postgres and StatsD exporter. Please set `application-override.yaml` to override this configuration. + enabled: true + +# "application-secret.yaml" -- Configuration to override the default [application.yaml](https://github.com/feast-dev/feast/blob/master/job-controller/src/main/resources/application.yml). Will be created as a Secret. `application-override.yaml` has a higher precedence than `application-secret.yaml`. It is recommended to either set `application-override.yaml` or `application-secret.yaml` only to simplify config management. +application-secret.yaml: + enabled: true + +# "application-override.yaml" -- Configuration to override the default [application.yaml](https://github.com/feast-dev/feast/blob/master/job-controller/src/main/resources/application.yml). Will be created as a ConfigMap. `application-override.yaml` has a higher precedence than `application-secret.yaml` +application-override.yaml: + enabled: true + +gcpServiceAccount: + # gcpServiceAccount.enabled -- Flag to use [service account](https://cloud.google.com/iam/docs/creating-managing-service-account-keys) JSON key + enabled: false + existingSecret: + # gcpServiceAccount.existingSecret.name -- Name of the existing secret containing the service account + name: feast-gcp-service-account + # gcpServiceAccount.existingSecret.key -- Key in the secret data (file name of the service account) + key: credentials.json + +postgresql: + # postgresql.existingSecret -- Existing secret to use for authenticating to Postgres + existingSecret: "" + +# gcpProjectId -- Project ID to use when using Google Cloud services such as BigQuery, Cloud Storage and Dataflow +gcpProjectId: "" + +# javaOpts -- [JVM options](https://docs.oracle.com/cd/E22289_01/html/821-1274/configuring-the-default-jvm-and-java-arguments.html). For better performance, it is advised to set the min and max heap:
`-Xms2048m -Xmx2048m` +javaOpts: + +# logType -- Log format, either `JSON` or `Console` +logType: Console +# logLevel -- Default log level, use either one of `DEBUG`, `INFO`, `WARN` or `ERROR` +logLevel: WARN + +prometheus: + # prometheus.enabled -- Flag to enable scraping of metrics + enabled: true + +livenessProbe: + # livenessProbe.enabled -- Flag to enabled the probe + enabled: true + # livenessProbe.initialDelaySeconds -- Delay before the probe is initiated + initialDelaySeconds: 60 + # livenessProbe.periodSeconds -- How often to perform the probe + periodSeconds: 10 + # livenessProbe.timeoutSeconds -- When the probe times out + timeoutSeconds: 5 + # livenessProbe.successThreshold -- Min consecutive success for the probe to be considered successful + successThreshold: 1 + # livenessProbe.failureThreshold -- Min consecutive failures for the probe to be considered failed + failureThreshold: 5 + +readinessProbe: + # readinessProbe.enabled -- Flag to enabled the probe + enabled: true + # readinessProbe.initialDelaySeconds -- Delay before the probe is initiated + initialDelaySeconds: 20 + # readinessProbe.periodSeconds -- How often to perform the probe + periodSeconds: 10 + # readinessProbe.timeoutSeconds -- When the probe times out + timeoutSeconds: 10 + # readinessProbe.successThreshold -- Min consecutive success for the probe to be considered successful + successThreshold: 1 + # readinessProbe.failureThreshold -- Min consecutive failures for the probe to be considered failed + failureThreshold: 5 + +service: + # service.type -- Kubernetes service type + type: ClusterIP + http: + # service.http.port -- Service port for HTTP requests + port: 80 + # service.http.targetPort -- Container port serving HTTP requests and Prometheus metrics + targetPort: 8080 + # service.http.nodePort -- Port number that each cluster node will listen to + nodePort: + grpc: + # service.grpc.port -- Service port for GRPC requests + port: 6568 + # service.grpc.targetPort -- Container port serving GRPC requests + targetPort: 6568 + # service.grpc.nodePort -- Port number that each cluster node will listen to + nodePort: + +ingress: + grpc: + # ingress.grpc.enabled -- Flag to create an ingress resource for the service + enabled: false + # ingress.grpc.class -- Which ingress controller to use + class: nginx + # ingress.grpc.hosts -- List of hostnames to match when routing requests + hosts: [] + # ingress.grpc.annotations -- Extra annotations for the ingress + annotations: {} + https: + # ingress.grpc.https.enabled -- Flag to enable HTTPS + enabled: true + # ingress.grpc.https.secretNames -- Map of hostname to TLS secret name + secretNames: {} + # ingress.grpc.whitelist -- Allowed client IP source ranges + whitelist: "" + auth: + # ingress.grpc.auth.enabled -- Flag to enable auth + enabled: false + http: + # ingress.http.enabled -- Flag to create an ingress resource for the service + enabled: false + # ingress.http.class -- Which ingress controller to use + class: nginx + # ingress.http.hosts -- List of hostnames to match when routing requests + hosts: [] + # ingress.http.annotations -- Extra annotations for the ingress + annotations: {} + https: + # ingress.http.https.enabled -- Flag to enable HTTPS + enabled: true + # ingress.http.https.secretNames -- Map of hostname to TLS secret name + secretNames: {} + # ingress.http.whitelist -- Allowed client IP source ranges + whitelist: "" + auth: + # ingress.http.auth.enabled -- Flag to enable auth + enabled: false + # ingress.http.auth.authUrl -- URL to an existing authentication service + authUrl: http://auth-server.auth-ns.svc.cluster.local/auth + +# resources -- CPU/memory [resource requests/limit](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) +resources: {} + +# nodeSelector -- Node labels for pod assignment +nodeSelector: {} + +# envOverrides -- Extra environment variables to set +envOverrides: {} + +# podLabels -- Labels to be added to Feast Job Service pods +podLabels: {} diff --git a/infra/docker/jobservice/Dockerfile b/infra/docker/jobservice/Dockerfile index 1f1d3031571..e536b2e0dfe 100644 --- a/infra/docker/jobservice/Dockerfile +++ b/infra/docker/jobservice/Dockerfile @@ -7,8 +7,8 @@ COPY sdk/python sdk/python COPY Makefile Makefile COPY protos protos -# Install make -RUN apt-get update && apt-get -y install make git +# Install necessary tools for later steps +RUN apt-get update && apt-get -y install make git wget # Install Python dependencies RUN make compile-protos-python @@ -18,4 +18,12 @@ COPY .git .git COPY README.md README.md RUN pip install -e sdk/python -U +# +# Download grpc_health_probe to run health checks +# https://kubernetes.io/blog/2018/10/01/health-checking-grpc-servers-on-kubernetes/ +# +RUN wget -q https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.3.1/grpc_health_probe-linux-amd64 \ + -O /usr/bin/grpc-health-probe && \ + chmod +x /usr/bin/grpc-health-probe + CMD ["feast", "server"] diff --git a/protos/third_party/grpc/health/v1/HealthService.proto b/protos/feast/third_party/grpc/health/v1/HealthService.proto similarity index 80% rename from protos/third_party/grpc/health/v1/HealthService.proto rename to protos/feast/third_party/grpc/health/v1/HealthService.proto index c1cbd418dbe..342db35d4c3 100644 --- a/protos/third_party/grpc/health/v1/HealthService.proto +++ b/protos/feast/third_party/grpc/health/v1/HealthService.proto @@ -9,12 +9,13 @@ message HealthCheckRequest { string service = 1; } +enum ServingStatus { + UNKNOWN = 0; + SERVING = 1; + NOT_SERVING = 2; +} + message HealthCheckResponse { - enum ServingStatus { - UNKNOWN = 0; - SERVING = 1; - NOT_SERVING = 2; - } ServingStatus status = 1; } diff --git a/sdk/python/feast/client.py b/sdk/python/feast/client.py index 94703e6af5a..8c6bc6998a1 100644 --- a/sdk/python/feast/client.py +++ b/sdk/python/feast/client.py @@ -32,9 +32,6 @@ CONFIG_CORE_URL_KEY, CONFIG_ENABLE_AUTH_KEY, CONFIG_GRPC_CONNECTION_TIMEOUT_DEFAULT_KEY, - CONFIG_JOB_SERVICE_ENABLE_SSL_KEY, - CONFIG_JOB_SERVICE_SERVER_SSL_CERT_KEY, - CONFIG_JOB_SERVICE_URL_KEY, CONFIG_PROJECT_KEY, CONFIG_SERVING_ENABLE_SSL_KEY, CONFIG_SERVING_SERVER_SSL_CERT_KEY, @@ -42,6 +39,9 @@ CONFIG_SPARK_HISTORICAL_FEATURE_OUTPUT_FORMAT, CONFIG_SPARK_HISTORICAL_FEATURE_OUTPUT_LOCATION, CONFIG_SPARK_STAGING_LOCATION, + CONFIG_JOB_SERVICE_ENABLE_SSL_KEY, + CONFIG_JOB_SERVICE_SERVER_SSL_CERT_KEY, + CONFIG_JOB_SERVICE_URL_KEY, FEAST_DEFAULT_OPTIONS, ) from feast.core.CoreService_pb2 import ( diff --git a/sdk/python/feast/job_service.py b/sdk/python/feast/job_service.py index a8d3712a7ff..be99a39bea1 100644 --- a/sdk/python/feast/job_service.py +++ b/sdk/python/feast/job_service.py @@ -4,6 +4,8 @@ import feast from feast.core import JobService_pb2_grpc +from feast.third_party.grpc.health.v1 import HealthService_pb2_grpc +from feast.third_party.grpc.health.v1.HealthService_pb2 import HealthCheckResponse, ServingStatus class JobServiceServicer(JobService_pb2_grpc.JobServiceServicer): @@ -47,12 +49,18 @@ def GetJob(self, request, context): raise NotImplementedError("Method not implemented!") +class HealthServicer(HealthService_pb2_grpc.HealthServicer): + def Check(self, request, context): + return HealthCheckResponse(status=ServingStatus.SERVING) + + def start_job_service(): """ Start Feast Job Service """ server = grpc.server(ThreadPoolExecutor()) JobService_pb2_grpc.add_JobServiceServicer_to_server(JobServiceServicer(), server) + HealthService_pb2_grpc.add_HealthServicer_to_server(HealthServicer(), server) server.add_insecure_port("[::]:6568") server.start() print("Feast job server listening on port :6568") From fd8084e21ae04c661f89568c6ad91da7ef967624 Mon Sep 17 00:00:00 2001 From: Tsotne Tabidze Date: Thu, 22 Oct 2020 01:02:18 +0400 Subject: [PATCH 2/6] Clean up job service helm stuff Signed-off-by: Tsotne Tabidze --- .../feast/charts/feast-jobservice/README.md | 20 +++------ .../feast-jobservice/templates/configmap.yaml | 36 --------------- .../templates/deployment.yaml | 45 ++----------------- .../feast-jobservice/templates/secret.yaml | 15 ------- .../feast/charts/feast-jobservice/values.yaml | 23 ---------- 5 files changed, 10 insertions(+), 129 deletions(-) delete mode 100644 infra/charts/feast/charts/feast-jobservice/templates/configmap.yaml delete mode 100644 infra/charts/feast/charts/feast-jobservice/templates/secret.yaml diff --git a/infra/charts/feast/charts/feast-jobservice/README.md b/infra/charts/feast/charts/feast-jobservice/README.md index a10fcae8861..21ff10bef77 100644 --- a/infra/charts/feast/charts/feast-jobservice/README.md +++ b/infra/charts/feast/charts/feast-jobservice/README.md @@ -1,6 +1,6 @@ -feast-jobcontroller +feast-jobservice ========== -Feast Job Controller manage ingestion jobs. +Feast Job Service manage ingestion jobs. Current chart version is `0.8-SNAPSHOT` @@ -12,17 +12,13 @@ Current chart version is `0.8-SNAPSHOT` | Key | Type | Default | Description | |-----|------|---------|-------------| -| "application-generated.yaml".enabled | bool | `true` | Flag to include Helm generated configuration for http port, Feast database URL, Kafka bootstrap servers and jobs metrics host. This is useful for deployment that uses default configuration for Kafka, Postgres and StatsD exporter. Please set `application-override.yaml` to override this configuration. | -| "application-override.yaml" | object | `{"enabled":true}` | Configuration to override the default [application.yaml](https://github.com/feast-dev/feast/blob/master/job-controller/src/main/resources/application.yml). Will be created as a ConfigMap. `application-override.yaml` has a higher precedence than `application-secret.yaml` | -| "application-secret.yaml" | object | `{"enabled":true}` | Configuration to override the default [application.yaml](https://github.com/feast-dev/feast/blob/master/job-controller/src/main/resources/application.yml). Will be created as a Secret. `application-override.yaml` has a higher precedence than `application-secret.yaml`. It is recommended to either set `application-override.yaml` or `application-secret.yaml` only to simplify config management. | -| "application.yaml".enabled | bool | `true` | Flag to include the default [configuration](https://github.com/feast-dev/feast/blob/master/job-controller/src/main/resources/application.yml). Please set `application-override.yaml` to override this configuration. | | envOverrides | object | `{}` | Extra environment variables to set | | gcpProjectId | string | `""` | Project ID to use when using Google Cloud services such as BigQuery, Cloud Storage and Dataflow | | gcpServiceAccount.enabled | bool | `false` | Flag to use [service account](https://cloud.google.com/iam/docs/creating-managing-service-account-keys) JSON key | | gcpServiceAccount.existingSecret.key | string | `"credentials.json"` | Key in the secret data (file name of the service account) | | gcpServiceAccount.existingSecret.name | string | `"feast-gcp-service-account"` | Name of the existing secret containing the service account | | image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | -| image.repository | string | `"gcr.io/kf-feast/feast-jobcontroller"` | Docker image repository | +| image.repository | string | `"gcr.io/kf-feast/feast-jobservice"` | Docker image repository | | image.tag | string | `"develop"` | Image tag | | ingress.grpc.annotations | object | `{}` | Extra annotations for the ingress | | ingress.grpc.auth.enabled | bool | `false` | Flag to enable auth | @@ -41,7 +37,6 @@ Current chart version is `0.8-SNAPSHOT` | ingress.http.https.enabled | bool | `true` | Flag to enable HTTPS | | ingress.http.https.secretNames | object | `{}` | Map of hostname to TLS secret name | | ingress.http.whitelist | string | `""` | Allowed client IP source ranges | -| javaOpts | string | `nil` | [JVM options](https://docs.oracle.com/cd/E22289_01/html/821-1274/configuring-the-default-jvm-and-java-arguments.html). For better performance, it is advised to set the min and max heap:
`-Xms2048m -Xmx2048m` | | livenessProbe.enabled | bool | `false` | Flag to enabled the probe | | livenessProbe.failureThreshold | int | `5` | Min consecutive failures for the probe to be considered failed | | livenessProbe.initialDelaySeconds | int | `60` | Delay before the probe is initiated | @@ -51,9 +46,8 @@ Current chart version is `0.8-SNAPSHOT` | logLevel | string | `"WARN"` | Default log level, use either one of `DEBUG`, `INFO`, `WARN` or `ERROR` | | logType | string | `"Console"` | Log format, either `JSON` or `Console` | | nodeSelector | object | `{}` | Node labels for pod assignment | -| podLabels | object | `{}` | Labels to be added to Feast Job Controller pods | -| postgresql.existingSecret | string | `""` | Existing secret to use for authenticating to Postgres | -| prometheus.enabled | bool | `true` | Flag to enable scraping of Feast Job Controller metrics | +| podLabels | object | `{}` | Labels to be added to Feast Job Service pods | +| prometheus.enabled | bool | `true` | Flag to enable scraping of Feast Job Service metrics | | readinessProbe.enabled | bool | `true` | Flag to enabled the probe | | readinessProbe.failureThreshold | int | `5` | Min consecutive failures for the probe to be considered failed | | readinessProbe.initialDelaySeconds | int | `20` | Delay before the probe is initiated | @@ -63,8 +57,8 @@ Current chart version is `0.8-SNAPSHOT` | replicaCount | int | `1` | Number of pods that will be created | | resources | object | `{}` | CPU/memory [resource requests/limit](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) | | service.grpc.nodePort | string | `nil` | Port number that each cluster node will listen to | -| service.grpc.port | int | `6565` | Service port for GRPC requests | -| service.grpc.targetPort | int | `6565` | Container port serving GRPC requests | +| service.grpc.port | int | `6568` | Service port for GRPC requests | +| service.grpc.targetPort | int | `6568` | Container port serving GRPC requests | | service.http.nodePort | string | `nil` | Port number that each cluster node will listen to | | service.http.port | int | `80` | Service port for HTTP requests | | service.http.targetPort | int | `8080` | Container port serving HTTP requests and Prometheus metrics | diff --git a/infra/charts/feast/charts/feast-jobservice/templates/configmap.yaml b/infra/charts/feast/charts/feast-jobservice/templates/configmap.yaml deleted file mode 100644 index 82e1410b6a8..00000000000 --- a/infra/charts/feast/charts/feast-jobservice/templates/configmap.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "feast-jobservice.fullname" . }} - namespace: {{ .Release.Namespace }} - labels: - app: {{ template "feast-jobservice.name" . }} - component: jobservice - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: - application-generated.yaml: | -{{- if index .Values "application-generated.yaml" "enabled" }} - feast: - core-host: {{ .Release.Name }}-feast-core - stream: - type: kafka - options: - bootstrapServers: {{ .Release.Name }}-kafka:9092 - topic: feast - jobs: - metrics: - enabled: true - type: statsd - host: {{ .Release.Name }}-prometheus-statsd-exporter-udp - port: 9125 - - server: - port: {{ .Values.service.http.targetPort }} -{{- end }} - - application-override.yaml: | -{{- if index .Values "application-override.yaml" "enabled" }} -{{- toYaml (index .Values "application-override.yaml") | nindent 4 }} -{{- end }} \ No newline at end of file diff --git a/infra/charts/feast/charts/feast-jobservice/templates/deployment.yaml b/infra/charts/feast/charts/feast-jobservice/templates/deployment.yaml index 752753beec4..d26ec446f97 100644 --- a/infra/charts/feast/charts/feast-jobservice/templates/deployment.yaml +++ b/infra/charts/feast/charts/feast-jobservice/templates/deployment.yaml @@ -18,10 +18,8 @@ spec: release: {{ .Release.Name }} template: metadata: - annotations: - checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} - checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} {{- if .Values.prometheus.enabled }} + annotations: prometheus.io/path: /metrics prometheus.io/port: "{{ .Values.service.http.targetPort }}" prometheus.io/scrape: "true" @@ -39,14 +37,8 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} - volumes: - - name: {{ template "feast-jobservice.fullname" . }}-config - configMap: - name: {{ template "feast-jobservice.fullname" . }} - - name: {{ template "feast-jobservice.fullname" . }}-secret - secret: - secretName: {{ template "feast-jobservice.fullname" . }} {{- if .Values.gcpServiceAccount.enabled }} + volumes: - name: {{ template "feast-jobservice.fullname" . }}-gcp-service-account secret: secretName: {{ .Values.gcpServiceAccount.existingSecret.name }} @@ -57,13 +49,8 @@ spec: image: {{ .Values.image.repository }}:{{ .Values.image.tag }} imagePullPolicy: {{ .Values.image.pullPolicy }} - volumeMounts: - - name: {{ template "feast-jobservice.fullname" . }}-config - mountPath: /etc/feast - - name: {{ template "feast-jobservice.fullname" . }}-secret - mountPath: /etc/secrets/feast - readOnly: true {{- if .Values.gcpServiceAccount.enabled }} + volumeMounts: - name: {{ template "feast-jobservice.fullname" . }}-gcp-service-account mountPath: /etc/secrets/google readOnly: true @@ -75,14 +62,6 @@ spec: - name: LOG_LEVEL value: {{ .Values.logLevel | quote }} - {{- if .Values.postgresql.existingSecret }} - - name: SPRING_DATASOURCE_PASSWORD - valueFrom: - secretKeyRef: - name: {{ .Values.postgresql.existingSecret }} - key: postgresql-password - {{- end }} - {{- if .Values.gcpServiceAccount.enabled }} - name: GOOGLE_APPLICATION_CREDENTIALS value: /etc/secrets/google/{{ .Values.gcpServiceAccount.existingSecret.key }} @@ -93,11 +72,6 @@ spec: value: {{ .Values.gcpProjectId | quote }} {{- end }} - {{- if .Values.javaOpts }} - - name: JAVA_TOOL_OPTIONS - value: {{ .Values.javaOpts }} - {{- end }} - {{- range $key, $value := .Values.envOverrides }} - name: {{ printf "%s" $key | replace "." "_" | upper | quote }} {{- if eq (kindOf $value) "map" }} @@ -111,19 +85,6 @@ spec: command: - feast - server - # - --spring.config.location= - # {{- if index .Values "application.yaml" "enabled" -}} - # classpath:/application.yml - # {{- end }} - # {{- if index .Values "application-generated.yaml" "enabled" -}} - # ,file:/etc/feast/application-generated.yaml - # {{- end }} - # {{- if index .Values "application-secret.yaml" "enabled" -}} - # ,file:/etc/secrets/feast/application-secret.yaml - # {{- end }} - # {{- if index .Values "application-override.yaml" "enabled" -}} - # ,file:/etc/feast/application-override.yaml - # {{- end }} ports: - name: http containerPort: {{ .Values.service.http.targetPort }} diff --git a/infra/charts/feast/charts/feast-jobservice/templates/secret.yaml b/infra/charts/feast/charts/feast-jobservice/templates/secret.yaml deleted file mode 100644 index 8bf2397fbf2..00000000000 --- a/infra/charts/feast/charts/feast-jobservice/templates/secret.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: {{ template "feast-jobservice.fullname" . }} - namespace: {{ .Release.Namespace }} - labels: - app: {{ template "feast-jobservice.name" . }} - component: jobservice - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -type: Opaque -stringData: - application-secret.yaml: | -{{- toYaml (index .Values "application-secret.yaml") | nindent 4 }} diff --git a/infra/charts/feast/charts/feast-jobservice/values.yaml b/infra/charts/feast/charts/feast-jobservice/values.yaml index 8dbd3a1ace3..9fcf36ad939 100644 --- a/infra/charts/feast/charts/feast-jobservice/values.yaml +++ b/infra/charts/feast/charts/feast-jobservice/values.yaml @@ -9,22 +9,6 @@ image: # image.pullPolicy -- Image pull policy pullPolicy: IfNotPresent -application.yaml: - # "application.yaml".enabled -- Flag to include the default [configuration](https://github.com/feast-dev/feast/blob/master/job-controller/src/main/resources/application.yml). Please set `application-override.yaml` to override this configuration. - enabled: true - -application-generated.yaml: - # "application-generated.yaml".enabled -- Flag to include Helm generated configuration for http port, Feast database URL, Kafka bootstrap servers and jobs metrics host. This is useful for deployment that uses default configuration for Kafka, Postgres and StatsD exporter. Please set `application-override.yaml` to override this configuration. - enabled: true - -# "application-secret.yaml" -- Configuration to override the default [application.yaml](https://github.com/feast-dev/feast/blob/master/job-controller/src/main/resources/application.yml). Will be created as a Secret. `application-override.yaml` has a higher precedence than `application-secret.yaml`. It is recommended to either set `application-override.yaml` or `application-secret.yaml` only to simplify config management. -application-secret.yaml: - enabled: true - -# "application-override.yaml" -- Configuration to override the default [application.yaml](https://github.com/feast-dev/feast/blob/master/job-controller/src/main/resources/application.yml). Will be created as a ConfigMap. `application-override.yaml` has a higher precedence than `application-secret.yaml` -application-override.yaml: - enabled: true - gcpServiceAccount: # gcpServiceAccount.enabled -- Flag to use [service account](https://cloud.google.com/iam/docs/creating-managing-service-account-keys) JSON key enabled: false @@ -34,16 +18,9 @@ gcpServiceAccount: # gcpServiceAccount.existingSecret.key -- Key in the secret data (file name of the service account) key: credentials.json -postgresql: - # postgresql.existingSecret -- Existing secret to use for authenticating to Postgres - existingSecret: "" - # gcpProjectId -- Project ID to use when using Google Cloud services such as BigQuery, Cloud Storage and Dataflow gcpProjectId: "" -# javaOpts -- [JVM options](https://docs.oracle.com/cd/E22289_01/html/821-1274/configuring-the-default-jvm-and-java-arguments.html). For better performance, it is advised to set the min and max heap:
`-Xms2048m -Xmx2048m` -javaOpts: - # logType -- Log format, either `JSON` or `Console` logType: Console # logLevel -- Default log level, use either one of `DEBUG`, `INFO`, `WARN` or `ERROR` From 4d7c9e4f13e851f1140a304d02d5b4b7f146b83f Mon Sep 17 00:00:00 2001 From: Tsotne Tabidze Date: Thu, 22 Oct 2020 01:49:35 +0400 Subject: [PATCH 3/6] Format python code Signed-off-by: Tsotne Tabidze --- sdk/python/feast/client.py | 6 +++--- sdk/python/feast/job_service.py | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sdk/python/feast/client.py b/sdk/python/feast/client.py index 8c6bc6998a1..94703e6af5a 100644 --- a/sdk/python/feast/client.py +++ b/sdk/python/feast/client.py @@ -32,6 +32,9 @@ CONFIG_CORE_URL_KEY, CONFIG_ENABLE_AUTH_KEY, CONFIG_GRPC_CONNECTION_TIMEOUT_DEFAULT_KEY, + CONFIG_JOB_SERVICE_ENABLE_SSL_KEY, + CONFIG_JOB_SERVICE_SERVER_SSL_CERT_KEY, + CONFIG_JOB_SERVICE_URL_KEY, CONFIG_PROJECT_KEY, CONFIG_SERVING_ENABLE_SSL_KEY, CONFIG_SERVING_SERVER_SSL_CERT_KEY, @@ -39,9 +42,6 @@ CONFIG_SPARK_HISTORICAL_FEATURE_OUTPUT_FORMAT, CONFIG_SPARK_HISTORICAL_FEATURE_OUTPUT_LOCATION, CONFIG_SPARK_STAGING_LOCATION, - CONFIG_JOB_SERVICE_ENABLE_SSL_KEY, - CONFIG_JOB_SERVICE_SERVER_SSL_CERT_KEY, - CONFIG_JOB_SERVICE_URL_KEY, FEAST_DEFAULT_OPTIONS, ) from feast.core.CoreService_pb2 import ( diff --git a/sdk/python/feast/job_service.py b/sdk/python/feast/job_service.py index be99a39bea1..53acb630665 100644 --- a/sdk/python/feast/job_service.py +++ b/sdk/python/feast/job_service.py @@ -5,7 +5,10 @@ import feast from feast.core import JobService_pb2_grpc from feast.third_party.grpc.health.v1 import HealthService_pb2_grpc -from feast.third_party.grpc.health.v1.HealthService_pb2 import HealthCheckResponse, ServingStatus +from feast.third_party.grpc.health.v1.HealthService_pb2 import ( + HealthCheckResponse, + ServingStatus, +) class JobServiceServicer(JobService_pb2_grpc.JobServiceServicer): From d6adf2ec452ddaf5ceb19cb07b29e6d1a4312390 Mon Sep 17 00:00:00 2001 From: Tsotne Tabidze Date: Thu, 22 Oct 2020 15:58:21 +0400 Subject: [PATCH 4/6] Delete unnecessary symlink in datatypes Signed-off-by: Tsotne Tabidze --- datatypes/java/src/main/proto/third_party | 1 - 1 file changed, 1 deletion(-) delete mode 120000 datatypes/java/src/main/proto/third_party diff --git a/datatypes/java/src/main/proto/third_party b/datatypes/java/src/main/proto/third_party deleted file mode 120000 index f015f8477d1..00000000000 --- a/datatypes/java/src/main/proto/third_party +++ /dev/null @@ -1 +0,0 @@ -../../../../../protos/third_party \ No newline at end of file From b3aca8d7eaeb72f62001ed91298c5d1b409001da Mon Sep 17 00:00:00 2001 From: Tsotne Tabidze Date: Thu, 22 Oct 2020 21:06:21 +0400 Subject: [PATCH 5/6] Fix java compilation & python lint errors Signed-off-by: Tsotne Tabidze --- core/src/main/java/feast/core/grpc/HealthServiceImpl.java | 2 +- .../java/feast/jobcontroller/grpc/HealthServiceImpl.java | 2 +- sdk/python/pyproject.toml | 3 ++- sdk/python/setup.cfg | 6 +++--- .../feast/serving/controller/HealthServiceController.java | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/feast/core/grpc/HealthServiceImpl.java b/core/src/main/java/feast/core/grpc/HealthServiceImpl.java index 0a1f10109ca..ed6e0a1c728 100644 --- a/core/src/main/java/feast/core/grpc/HealthServiceImpl.java +++ b/core/src/main/java/feast/core/grpc/HealthServiceImpl.java @@ -21,7 +21,7 @@ import io.grpc.health.v1.HealthGrpc.HealthImplBase; import io.grpc.health.v1.HealthProto.HealthCheckRequest; import io.grpc.health.v1.HealthProto.HealthCheckResponse; -import io.grpc.health.v1.HealthProto.HealthCheckResponse.ServingStatus; +import io.grpc.health.v1.HealthProto.ServingStatus; import io.grpc.stub.StreamObserver; import lombok.extern.slf4j.Slf4j; import net.devh.boot.grpc.server.service.GrpcService; diff --git a/job-controller/src/main/java/feast/jobcontroller/grpc/HealthServiceImpl.java b/job-controller/src/main/java/feast/jobcontroller/grpc/HealthServiceImpl.java index dfc69a37a59..19724517a3a 100644 --- a/job-controller/src/main/java/feast/jobcontroller/grpc/HealthServiceImpl.java +++ b/job-controller/src/main/java/feast/jobcontroller/grpc/HealthServiceImpl.java @@ -22,7 +22,7 @@ import io.grpc.health.v1.HealthGrpc.HealthImplBase; import io.grpc.health.v1.HealthProto.HealthCheckRequest; import io.grpc.health.v1.HealthProto.HealthCheckResponse; -import io.grpc.health.v1.HealthProto.HealthCheckResponse.ServingStatus; +import io.grpc.health.v1.HealthProto.ServingStatus; import io.grpc.stub.StreamObserver; import lombok.extern.slf4j.Slf4j; import net.devh.boot.grpc.server.service.GrpcService; diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.toml index 12073607100..f258e86af77 100644 --- a/sdk/python/pyproject.toml +++ b/sdk/python/pyproject.toml @@ -21,6 +21,7 @@ exclude = ''' | serving | storage | types + | third_party )/ ) -''' \ No newline at end of file +''' diff --git a/sdk/python/setup.cfg b/sdk/python/setup.cfg index f0f48049e0c..49da5ff13a0 100644 --- a/sdk/python/setup.cfg +++ b/sdk/python/setup.cfg @@ -4,7 +4,7 @@ include_trailing_comma=True force_grid_wrap=0 use_parentheses=True line_length=88 -skip=feast/types,feast/core,feast/serving,feast/storage +skip=feast/types,feast/core,feast/serving,feast/storage,feast/third_party known_first_party=feast,feast_serving_server,feast_core_server default_section=THIRDPARTY @@ -13,8 +13,8 @@ ignore = E203, E266, E501, W503 max-line-length = 88 max-complexity = 20 select = B,C,E,F,W,T4 -exclude = .git,__pycache__,docs/conf.py,dist,feast/core,feast/serving,feast/types,feast/storage +exclude = .git,__pycache__,docs/conf.py,dist,feast/core,feast/serving,feast/types,feast/storage,feast/third_party [mypy] files=feast,test -ignore_missing_imports=true \ No newline at end of file +ignore_missing_imports=true diff --git a/serving/src/main/java/feast/serving/controller/HealthServiceController.java b/serving/src/main/java/feast/serving/controller/HealthServiceController.java index 5225a7ea2ed..97a5fd9f93a 100644 --- a/serving/src/main/java/feast/serving/controller/HealthServiceController.java +++ b/serving/src/main/java/feast/serving/controller/HealthServiceController.java @@ -24,7 +24,7 @@ import io.grpc.health.v1.HealthGrpc.HealthImplBase; import io.grpc.health.v1.HealthProto.HealthCheckRequest; import io.grpc.health.v1.HealthProto.HealthCheckResponse; -import io.grpc.health.v1.HealthProto.HealthCheckResponse.ServingStatus; +import io.grpc.health.v1.HealthProto.ServingStatus; import io.grpc.stub.StreamObserver; import net.devh.boot.grpc.server.service.GrpcService; import org.springframework.beans.factory.annotation.Autowired; From 5ad7a3d9c0bbd87350be42476e6fafa620df1072 Mon Sep 17 00:00:00 2001 From: Tsotne Tabidze Date: Fri, 23 Oct 2020 07:32:24 +0400 Subject: [PATCH 6/6] Remove logLevel & logType from job service helm charts Signed-off-by: Tsotne Tabidze --- infra/charts/feast/charts/feast-jobservice/README.md | 2 -- .../feast/charts/feast-jobservice/templates/deployment.yaml | 5 ----- infra/charts/feast/charts/feast-jobservice/values.yaml | 5 ----- 3 files changed, 12 deletions(-) diff --git a/infra/charts/feast/charts/feast-jobservice/README.md b/infra/charts/feast/charts/feast-jobservice/README.md index 21ff10bef77..c8502080a5f 100644 --- a/infra/charts/feast/charts/feast-jobservice/README.md +++ b/infra/charts/feast/charts/feast-jobservice/README.md @@ -43,8 +43,6 @@ Current chart version is `0.8-SNAPSHOT` | livenessProbe.periodSeconds | int | `10` | How often to perform the probe | | livenessProbe.successThreshold | int | `1` | Min consecutive success for the probe to be considered successful | | livenessProbe.timeoutSeconds | int | `5` | When the probe times out | -| logLevel | string | `"WARN"` | Default log level, use either one of `DEBUG`, `INFO`, `WARN` or `ERROR` | -| logType | string | `"Console"` | Log format, either `JSON` or `Console` | | nodeSelector | object | `{}` | Node labels for pod assignment | | podLabels | object | `{}` | Labels to be added to Feast Job Service pods | | prometheus.enabled | bool | `true` | Flag to enable scraping of Feast Job Service metrics | diff --git a/infra/charts/feast/charts/feast-jobservice/templates/deployment.yaml b/infra/charts/feast/charts/feast-jobservice/templates/deployment.yaml index d26ec446f97..5a3429c5f11 100644 --- a/infra/charts/feast/charts/feast-jobservice/templates/deployment.yaml +++ b/infra/charts/feast/charts/feast-jobservice/templates/deployment.yaml @@ -57,11 +57,6 @@ spec: {{- end }} env: - - name: LOG_TYPE - value: {{ .Values.logType | quote }} - - name: LOG_LEVEL - value: {{ .Values.logLevel | quote }} - {{- if .Values.gcpServiceAccount.enabled }} - name: GOOGLE_APPLICATION_CREDENTIALS value: /etc/secrets/google/{{ .Values.gcpServiceAccount.existingSecret.key }} diff --git a/infra/charts/feast/charts/feast-jobservice/values.yaml b/infra/charts/feast/charts/feast-jobservice/values.yaml index 9fcf36ad939..03b8296a265 100644 --- a/infra/charts/feast/charts/feast-jobservice/values.yaml +++ b/infra/charts/feast/charts/feast-jobservice/values.yaml @@ -21,11 +21,6 @@ gcpServiceAccount: # gcpProjectId -- Project ID to use when using Google Cloud services such as BigQuery, Cloud Storage and Dataflow gcpProjectId: "" -# logType -- Log format, either `JSON` or `Console` -logType: Console -# logLevel -- Default log level, use either one of `DEBUG`, `INFO`, `WARN` or `ERROR` -logLevel: WARN - prometheus: # prometheus.enabled -- Flag to enable scraping of metrics enabled: true