Skip to content

Commit

Permalink
feat: Added yace support for aws rds and redis metrics (#140)
Browse files Browse the repository at this point in the history
Co-authored-by: Aditya Choudhari <aditya.choudhari@wandb.com>
Co-authored-by: amanpruthi <aman.pruthi@velotio.com>
  • Loading branch information
3 people authored Jun 24, 2024
1 parent 94483a7 commit b5c6eb6
Show file tree
Hide file tree
Showing 11 changed files with 399 additions and 3 deletions.
7 changes: 5 additions & 2 deletions charts/operator-wandb/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@ dependencies:
- name: stackdriver
repository: file://charts/stackdriver
version: 0.1.0
digest: sha256:9a6c69506deb6969686d5b220a0692b53cfa29642e059bdf27c440c5d7086bdb
generated: "2024-06-05T11:04:02.508473-07:00"
- name: yace
repository: file://charts/yace
version: 0.1.0
digest: sha256:c12c533a22b6f593a526e3060597ee1591bf5a2cac4ff03c588758e0dbc65d1e
generated: "2024-06-24T16:15:00.442236-07:00"
6 changes: 5 additions & 1 deletion charts/operator-wandb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: operator-wandb
description: A Helm chart for deploying W&B to Kubernetes
type: application
version: 0.13.13
version: 0.14.1
appVersion: 1.0.0
icon: https://wandb.ai/logo.svg

Expand Down Expand Up @@ -60,3 +60,7 @@ dependencies:
version: "*.*.*"
repository: file://charts/stackdriver
condition: stackdriver.install
- name: yace
version: "*.*.*"
repository: file://charts/yace
condition: yace.install
23 changes: 23 additions & 0 deletions charts/operator-wandb/charts/yace/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
5 changes: 5 additions & 0 deletions charts/operator-wandb/charts/yace/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
name: yace
description: A Helm chart for Kubernetes
version: 0.1.0
appVersion: "v0.60.0"
102 changes: 102 additions & 0 deletions charts/operator-wandb/charts/yace/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{{/* vim: set filetype=mustache: */}}

{{/*
Expand the name of the chart.
*/}}
{{- define "yace.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 "yace.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 "yace.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "yace.labels" -}}
helm.sh/chart: {{ include "yace.chart" . }}
{{ include "yace.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
wandb.com/app-name: {{ include "yace.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "yace.selectorLabels" -}}
app.kubernetes.io/name: {{ include "yace.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "yace.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "yace.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Returns the extraEnv keys and values to inject into containers.
Global values will override any chart-specific values.
*/}}
{{- define "yace.extraEnv" -}}
{{- $allExtraEnv := merge (default (dict) .local.extraEnv) .global.extraEnv -}}
{{- range $key, $value := $allExtraEnv }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end -}}
{{- end -}}

{{/*
Returns a list of _common_ labels to be shared across all
app deployments and other shared objects.
*/}}
{{- define "yace.commonLabels" -}}
{{- $commonLabels := default (dict) .Values.common.labels -}}
{{- if $commonLabels }}
{{- range $key, $value := $commonLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end -}}
{{- end -}}

{{/*
Returns a list of _pod_ labels to be shared across all
app deployments.
*/}}
{{- define "yace.podLabels" -}}
{{- range $key, $value := .Values.pod.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end -}}

18 changes: 18 additions & 0 deletions charts/operator-wandb/charts/yace/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "yace.fullname" . }}
labels:
{{- include "wandb.commonLabels" . | nindent 4 }}
{{- include "yace.commonLabels" . | nindent 4 }}
{{- include "yace.labels" . | nindent 4 }}
{{- if .Values.configMap.labels -}}
{{- toYaml .Values.configMap.labels | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.configMap.annotations -}}
{{- toYaml .Values.configMap.annotations | nindent 4 }}
{{- end }}
data:
config.yml: |
{{- (tpl .Values.config $) | nindent 4 }}
89 changes: 89 additions & 0 deletions charts/operator-wandb/charts/yace/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{{- if .Values.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "yace.fullname" . }}
labels:
{{- include "wandb.commonLabels" . | nindent 4 }}
{{- include "yace.commonLabels" . | nindent 4 }}
{{- include "yace.labels" . | nindent 4 }}
{{- if .Values.deployment.labels -}}
{{- toYaml .Values.deployment.labels | nindent 4 }}
{{- end }}
annotations:
{{- include "wandb.deploymentAnnotations" $ | nindent 4 }}
{{- if .Values.deployment.annotations -}}
{{- toYaml .Values.deployment.annotations | nindent 4 }}
{{- end }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "wandb.selectorLabels" $ | nindent 6 }}
{{- include "yace.labels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "wandb.podLabels" . | nindent 8 }}
{{- include "yace.commonLabels" . | nindent 8 }}
{{- include "yace.podLabels" . | nindent 8 }}
{{- include "yace.labels" . | nindent 8 }}
annotations:
checksum/configmap: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum | trunc 63 }}
{{- if .Values.pod.annotations -}}
{{- toYaml .Values.pod.annotations | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "yace.serviceAccountName" . }}
{{- if .tolerations }}
tolerations:
{{- toYaml .tolerations | nindent 8 }}
{{- end }}
{{- include "wandb.nodeSelector" . | nindent 6 }}
{{- include "wandb.priorityClassName" . | nindent 6 }}
{{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
command:
- yace
- --config.file=/config/config.yml
- --scraping-interval=60
ports:
- containerPort: 5000
name: http
protocol: TCP
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: http
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
readinessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: http
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- mountPath: /config
name: yace-config
volumes:
- name: config
configMap:
defaultMode: 420
name: {{ include "yace.fullname" . }}
volumes:
- configMap:
defaultMode: 420
name: {{ include "yace.fullname" . }}
name: yace-config
{{- end }}
23 changes: 23 additions & 0 deletions charts/operator-wandb/charts/yace/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "yace.fullname" . }}
labels:
{{- include "wandb.commonLabels" . | nindent 4 }}
{{- include "yace.labels" . | nindent 4 }}
{{- include "yace.commonLabels" . | nindent 4 }}
{{- if .Values.service.labels -}}
{{- toYaml .Values.service.labels | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.service.annotations -}}
{{- toYaml .Values.service.annotations | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.service.type }}
ports:
- port: 5000
protocol: TCP
name: yace
selector:
{{- include "yace.labels" . | nindent 4 }}
15 changes: 15 additions & 0 deletions charts/operator-wandb/charts/yace/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "yace.serviceAccountName" . }}
labels:
{{- include "wandb.commonLabels" . | nindent 4 }}
{{- include "yace.commonLabels" . | nindent 4 }}
{{- include "yace.labels" . | nindent 4 }}
{{- if .Values.serviceAccount.labels -}}
{{- toYaml .Values.serviceAccount.labels | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.serviceAccount.annotations -}}
{{- toYaml .Values.serviceAccount.annotations | nindent 4 }}
{{- end }}
Loading

0 comments on commit b5c6eb6

Please sign in to comment.