From 08bacf41903fe69612170beb37a3034f09cade60 Mon Sep 17 00:00:00 2001 From: Siyuan Zhang Date: Mon, 19 Aug 2024 18:51:18 +0800 Subject: [PATCH] chore: add affinity to graphscope-store charts (#4155) --- .../templates/coordinator/statefulset.yaml | 8 ++++++++ .../graphscope-store/templates/frontend/statefulset.yaml | 8 ++++++++ charts/graphscope-store/templates/onepod/statefulset.yaml | 8 ++++++++ charts/graphscope-store/templates/portal/statefulset.yaml | 8 ++++++++ .../templates/store/statefulset-backup.yaml | 8 ++++++++ charts/graphscope-store/templates/store/statefulset.yaml | 8 ++++++++ k8s/dockerfiles/vineyard-runtime.Dockerfile | 2 +- 7 files changed, 49 insertions(+), 1 deletion(-) diff --git a/charts/graphscope-store/templates/coordinator/statefulset.yaml b/charts/graphscope-store/templates/coordinator/statefulset.yaml index 8a088ba67a97..ec9d18396486 100644 --- a/charts/graphscope-store/templates/coordinator/statefulset.yaml +++ b/charts/graphscope-store/templates/coordinator/statefulset.yaml @@ -44,6 +44,14 @@ spec: {{- if .Values.coordinator.schedulerName }} schedulerName: {{ .Values.coordinator.schedulerName | quote }} {{- end }} + {{- if .Values.affinity }} + affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }} + {{- else }} + affinity: + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "component" "coordinator" "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "component" "coordinator" "context" $) | nindent 10 }} + nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} + {{- end }} {{- if .Values.nodeSelector }} nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }} {{- end }} diff --git a/charts/graphscope-store/templates/frontend/statefulset.yaml b/charts/graphscope-store/templates/frontend/statefulset.yaml index 4689313603c8..1cba12b122d3 100644 --- a/charts/graphscope-store/templates/frontend/statefulset.yaml +++ b/charts/graphscope-store/templates/frontend/statefulset.yaml @@ -44,6 +44,14 @@ spec: {{- if .Values.frontend.schedulerName }} schedulerName: {{ .Values.frontend.schedulerName | quote }} {{- end }} + {{- if .Values.affinity }} + affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }} + {{- else }} + affinity: + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "component" "frontend" "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "component" "frontend" "context" $) | nindent 10 }} + nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} + {{- end }} {{- if .Values.nodeSelector }} nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }} {{- end }} diff --git a/charts/graphscope-store/templates/onepod/statefulset.yaml b/charts/graphscope-store/templates/onepod/statefulset.yaml index d05c928a0a46..ae27127d0b86 100644 --- a/charts/graphscope-store/templates/onepod/statefulset.yaml +++ b/charts/graphscope-store/templates/onepod/statefulset.yaml @@ -44,6 +44,14 @@ spec: {{- if .Values.store.schedulerName }} schedulerName: {{ .Values.store.schedulerName | quote }} {{- end }} + {{- if .Values.affinity }} + affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }} + {{- else }} + affinity: + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "component" "store" "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "component" "store" "context" $) | nindent 10 }} + nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} + {{- end }} {{- if .Values.nodeSelector }} nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }} {{- end }} diff --git a/charts/graphscope-store/templates/portal/statefulset.yaml b/charts/graphscope-store/templates/portal/statefulset.yaml index c1b39d21eff7..1e8c5ee471cb 100644 --- a/charts/graphscope-store/templates/portal/statefulset.yaml +++ b/charts/graphscope-store/templates/portal/statefulset.yaml @@ -44,6 +44,14 @@ spec: {{- if .Values.portal.schedulerName }} schedulerName: {{ .Values.portal.schedulerName | quote }} {{- end }} + {{- if .Values.affinity }} + affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }} + {{- else }} + affinity: + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "component" "portal" "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "component" "portal" "context" $) | nindent 10 }} + nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} + {{- end }} {{- if .Values.nodeSelector }} nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }} {{- end }} diff --git a/charts/graphscope-store/templates/store/statefulset-backup.yaml b/charts/graphscope-store/templates/store/statefulset-backup.yaml index aedefc5b5bb1..73483e840af8 100644 --- a/charts/graphscope-store/templates/store/statefulset-backup.yaml +++ b/charts/graphscope-store/templates/store/statefulset-backup.yaml @@ -48,6 +48,14 @@ spec: {{- if .Values.store.schedulerName }} schedulerName: {{ .Values.store.schedulerName | quote }} {{- end }} + {{- if .Values.affinity }} + affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }} + {{- else }} + affinity: + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "component" "store" "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "component" "store" "context" $) | nindent 10 }} + nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} + {{- end }} {{- if .Values.nodeSelector }} nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }} {{- end }} diff --git a/charts/graphscope-store/templates/store/statefulset.yaml b/charts/graphscope-store/templates/store/statefulset.yaml index 9bb943aa27c9..9ebc14b71d3a 100644 --- a/charts/graphscope-store/templates/store/statefulset.yaml +++ b/charts/graphscope-store/templates/store/statefulset.yaml @@ -44,6 +44,14 @@ spec: {{- if .Values.store.schedulerName }} schedulerName: {{ .Values.store.schedulerName | quote }} {{- end }} + {{- if .Values.affinity }} + affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }} + {{- else }} + affinity: + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "component" "store" "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "component" "store" "context" $) | nindent 10 }} + nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} + {{- end }} {{- if .Values.nodeSelector }} nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }} {{- end }} diff --git a/k8s/dockerfiles/vineyard-runtime.Dockerfile b/k8s/dockerfiles/vineyard-runtime.Dockerfile index e619113afdc7..7bcd791fe762 100644 --- a/k8s/dockerfiles/vineyard-runtime.Dockerfile +++ b/k8s/dockerfiles/vineyard-runtime.Dockerfile @@ -33,7 +33,7 @@ RUN apt-get update -y && \ -P /tmp/ --no-check-certificate && \ sudo apt-get install -y -V /tmp/apache-arrow-apt-source-latest-jammy.deb && \ sudo apt-get update -y && \ - sudo apt-get install -y libarrow-dev libarrow-dataset-dev libarrow-acero-dev libparquet-dev && \ + sudo apt-get install -y libarrow-dev=15.0.2-1 libarrow-dataset-dev=15.0.2-1 libarrow-acero-dev=15.0.2-1 libparquet-dev=15.0.2-1 && \ rm /tmp/apache-arrow-apt-source-latest-*.deb && \ apt-get clean -y && \ rm -rf /var/lib/apt/lists/*