Skip to content

Commit

Permalink
helm: make quota accounting configurable
Browse files Browse the repository at this point in the history
closes #562
  • Loading branch information
mvidalgarcia committed Oct 27, 2021
1 parent 381bd50 commit 1e6f9fc
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Expand Up @@ -5,12 +5,14 @@ Version 0.8.0 (UNRELEASED)
--------------------------

- Users:
- Adds support for Snakemake workflow engine.
- Adds support for Snakemake workflow engine.
- Administrators
- Adds new configuration to set node labels splitting workflow nodes, job nodes and session nodes
(``node_label_runtimebatch``, ``node_label_runtimejobs``, ``node_label_runtimesessions``).
- Adds a default ``kubernetes_memory_limit`` value (4Gi).
- Adds configuration environment variable to set workflow scheduling policy (``REANA_WORKFLOW_SCHEDULING_POLICY``).
- Adds new configuration ``quota.enabled`` to enable or disable quota accounting.
- Adds new configuration ``quota.termination_update_policy`` to select the resources for which the quota must be calculated.
- Changes Helm templates to use PostgreSQL 12.8 version.

Version 0.7.4 (2021-07-07)
Expand Down
4 changes: 3 additions & 1 deletion helm/reana/README.md
Expand Up @@ -96,7 +96,9 @@ This Helm automatically prefixes all names using the release name to avoid colli
| `traefik.enabled` | Install Traefik in the cluster when installing REANA | true |
| `volume_paths.root_path` | Path to the REANA directory inside the underlying storage volume | /var/reana |
| `volume_paths.shared_volume_path` | Path inside the REANA components where the shared volume will be mounted | /var/reana |
| `quota.enabled` | Enable user workflow accounting capabilities. | true |
| `quota.disk_update` | Cronjob pattern representing how often the users disk quota usage should be updated. Leave it empty to deactivate it | "0 3 * * *" |
| `quota.termination_update_policy` | Resources to calculate quotas on worflow termination. Possible values: "cpu" and "disk" | "cpu,disk" |
| `quota.default_disk_limit` | Default users disk quota limit in bytes. | None |
| `quota.default_cpu_limit` | Default users CPU quota limit in milliseconds. | None |
| `workspaces.paths` | List of additional workspace paths as strings. Each mount string is composed by a key `hostPath`(path to the directory to be mounted from the Kubernetes nodes) and a cluster_pod_mountpath (path inside the cluster containers where the `mountPath` will be mounted) e.g. `hostPath:mountPath`. The first value listed will be the default workspace root path. Any POSIX filesystem mounted on cluster nodes is supported | None |
| `workspaces.paths` | List of additional workspace paths as strings. Each mount string is composed by a key `hostPath`(path to the directory to be mounted from the Kubernetes nodes) and a cluster_pod_mountpath (path inside the cluster containers where the `mountPath` will be mounted) e.g. `hostPath:mountPath`. The first value listed will be the default workspace root path. Any POSIX filesystem mounted on cluster nodes is supported | None |
4 changes: 3 additions & 1 deletion helm/reana/templates/cronjobs.yaml
Expand Up @@ -106,7 +106,7 @@ spec:
{{- end }}
{{- end }}
---
{{- if .Values.quota.disk_update }}
{{- if and .Values.quota.enabled .Values.quota.disk_update }}
apiVersion: batch/v1beta1
kind: CronJob
metadata:
Expand All @@ -133,6 +133,8 @@ spec:
stdin: true
{{- end }}
env:
- name: REANA_WORKFLOW_TERMINATION_QUOTA_UPDATE_POLICY
value: {{ .Values.quota.termination_update_policy | default "disk,cpu" }}
{{- range $key, $value := .Values.db_env_config }}
- name: {{ $key }}
value: {{ $value | quote }}
Expand Down
6 changes: 5 additions & 1 deletion helm/reana/templates/reana-server.yaml
Expand Up @@ -79,9 +79,13 @@ spec:
- name: REANA_DEFAULT_QUOTA_DISK_LIMIT
value: {{ .Values.quota.default_disk_limit | default 0 | quote }}
- name: REANA_KUBERNETES_JOBS_MEMORY_LIMIT
value: {{ .Values.kubernetes_jobs_memory_limit | default "4Gi" }}
value: {{ .Values.kubernetes_jobs_memory_limit | default "4Gi" }}
- name: WORKSPACE_PATHS
value: {{ .Values.workspaces.paths | toJson | quote }}
{{- if .Values.quota.enabled }}
- name: REANA_WORKFLOW_TERMINATION_QUOTA_UPDATE_POLICY
value: {{ .Values.quota.termination_update_policy | default "disk,cpu" }}
{{- end }}
{{- range $key, $value := .Values.db_env_config }}
- name: {{ $key }}
value: {{ $value | quote }}
Expand Down
10 changes: 9 additions & 1 deletion helm/reana/templates/reana-workflow-controller.yaml
Expand Up @@ -71,10 +71,14 @@ spec:
value: {{ .Values.quota.default_cpu_limit | default 0 | quote }}
- name: REANA_DEFAULT_QUOTA_DISK_LIMIT
value: {{ .Values.quota.default_disk_limit | default 0 | quote }}
{{- if .Values.quota.enabled }}
- name: REANA_WORKFLOW_TERMINATION_QUOTA_UPDATE_POLICY
value: {{ .Values.quota.termination_update_policy | default "disk,cpu" }}
{{- end }}
{{- if .Values.naming_scheme }}
- name: REANA_COMPONENT_NAMING_SCHEME
value: {{ .Values.naming_scheme }}
{{- end }}
{{- end }}
- name: WORKSPACE_PATHS
value: {{ .Values.workspaces.paths | toJson | quote }}
{{- range $key, $value := .Values.db_env_config }}
Expand Down Expand Up @@ -183,6 +187,10 @@ spec:
value: {{ .Release.Namespace }}
- name: REANA_RUNTIME_KUBERNETES_NAMESPACE
value: {{ .Values.namespace_runtime | default .Release.Namespace }}
{{- if .Values.quota.enabled }}
- name: REANA_WORKFLOW_TERMINATION_QUOTA_UPDATE_POLICY
value: {{ .Values.quota.termination_update_policy | default "disk,cpu" }}
{{- end }}
{{- range $key, $value := .Values.db_env_config }}
- name: {{ $key }}
value: {{ $value | quote }}
Expand Down
1 change: 1 addition & 0 deletions helm/reana/values.yaml
Expand Up @@ -125,4 +125,5 @@ traefik:

# Quota
quota:
enabled: true
disk_update: "0 3 * * *" # everyday at 3am

0 comments on commit 1e6f9fc

Please sign in to comment.