Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ Climate change science has witnessed an explosion in the amount and types of dat
```bash
$ helm repo add ncsa https://opensource.ncsa.illinois.edu/charts/
$ helm repo add bitnami https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
$ helm repo add kedacore https://kedacore.github.io/charts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we create a subsection and for auto-scaling. And explain that for this to work they need to install keda first, and enable it in the pecan helm chart as well.

$ helm repo update
$ helm dependency build
$ helm install keda kedacore/keda
$ helm install pecan ncsa/pecan
```

Expand Down
2 changes: 1 addition & 1 deletion templates/models/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ kind: Deployment
metadata:
name: {{ $fullname }}-model-{{ $key }}
labels:
{{ $labels | indent 4 }}
{{ $labels | indent 4 }}
spec:
replicas: {{ .replicaCount }}
selector:
Expand Down
31 changes: 31 additions & 0 deletions templates/models/keda-scaledObject.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{- if .Values.models }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we add a {{ if .Values.keda.enabled }} then we can disable this and only add these resources if they have keda installed. Otherwise we are forcing keda to be installed.

{{- $fullname := include "pecan.fullname" . }}
{{- range $key, $val := .Values.models }}
{{- if .enabled }}
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: "{{ $fullname }}-model-{{ $key }}-scaledobject"
namespace: default
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ $fullname }}-model-{{ $key }}
envSourceContainerName: {{ $.Chart.Name }}-model-{{ $key }}
minReplicaCount: {{ .minReplicaCount }}
maxReplicaCount: {{ .maxReplicaCount }}
triggers:
- type: rabbitmq
metadata:
protocol: http
queueName: "{{ .queuename }}"
mode: MessageRate
value: "10"
vhostName: /
authenticationRef:
name: {{ $.Values.keda.rabbitmq.name }}-triger-auth
{{- end }}
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions templates/models/keda-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.keda.rabbitmq.name }}-secret
data:
host: {{ .Values.keda.rabbitmq.host }} # base64 encoded value of connection string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we can use:

{{ include "pecan.rabbitmq" . | b64enc }}

10 changes: 10 additions & 0 deletions templates/models/keda-trigger-auth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: {{ .Values.keda.rabbitmq.name }}-triger-auth
namespace: default
spec:
secretTargetRef:
- parameter: host
name: {{ .Values.keda.rabbitmq.name }}-secret
key: host
27 changes: 27 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,37 @@ models:
enabled: true
image: model-biocro-0.95
replicaCount: 1
minReplicaCount: 1
maxReplicaCount: 5
queuename: BIOCRO_0.95
ed2-2-2-0:
enabled: true
image: model-ed2-2.2.0
replicaCount: 1
minReplicaCount: 1
maxReplicaCount: 5
queuename: ED2_2.2.0
maespa-git:
enabled: true
image: model-maespa-git
replicaCount: 1
minReplicaCount: 1
maxReplicaCount: 5
queuename: MAESPA_git
sipnet-git:
enabled: true
image: model-sipnet-git
replicaCount: 1
minReplicaCount: 1
maxReplicaCount: 5
queuename: SIPNET_git
sipnet-136:
enabled: true
image: model-sipnet-r136
replicaCount: 1
minReplicaCount: 1
maxReplicaCount: 5
queuename: SIPNET_r136

## -------------------------------------------------------------------------------
## BETYDB APPLICATION
Expand Down Expand Up @@ -346,3 +361,15 @@ affinity: {}
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
hooks:
affinity: {}

## -------------------------------------------------------------------------------
## KEDA RabbitMQ Configuration
## -------------------------------------------------------------------------------

keda:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add an enabled here (default false), so we can use that to add the keda pieces.

rabbitmq:
name: "rabbitmq"
## Base64 rabbitmq host path in the form of PROTOCOL://<RABBITMQ_USER>:RABBITMQ_PASSWORD@RABBITMQ_HOST/vhost
## e.g. echo -n 'http://guest:guest@pecan-rabbitmq.default:15672//' | base64
host: aHR0cDovL2d1ZXN0Omd1ZXN0QHBlY2FuLXJhYmJpdG1xLmRlZmF1bHQ6MTU2NzIvLw==
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of hardcoding it in the url, can we compute this in the secret?