From 72cb54557b9b495775eb0bbe07e01101bc137c8e Mon Sep 17 00:00:00 2001 From: hyi Date: Mon, 26 Jan 2026 17:06:15 -0500 Subject: [PATCH 01/10] added memgraph deployment helm chart --- helm/memgraph/Chart.yaml | 24 ++++++++++ helm/memgraph/litcoin-values.yaml | 16 +++++++ helm/memgraph/templates/_helpers.tpl | 37 ++++++++++++++ helm/memgraph/templates/deployment.yaml | 64 +++++++++++++++++++++++++ helm/memgraph/templates/pvc-data.yaml | 13 +++++ helm/memgraph/templates/service.yaml | 18 +++++++ helm/memgraph/values.yaml | 22 +++++++++ 7 files changed, 194 insertions(+) create mode 100644 helm/memgraph/Chart.yaml create mode 100644 helm/memgraph/litcoin-values.yaml create mode 100644 helm/memgraph/templates/_helpers.tpl create mode 100644 helm/memgraph/templates/deployment.yaml create mode 100644 helm/memgraph/templates/pvc-data.yaml create mode 100644 helm/memgraph/templates/service.yaml create mode 100644 helm/memgraph/values.yaml diff --git a/helm/memgraph/Chart.yaml b/helm/memgraph/Chart.yaml new file mode 100644 index 000000000..edda6485f --- /dev/null +++ b/helm/memgraph/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: memgraphkg +description: A Helm chart for deploying KG in memgraph + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1-0-0" diff --git a/helm/memgraph/litcoin-values.yaml b/helm/memgraph/litcoin-values.yaml new file mode 100644 index 000000000..b5114c123 --- /dev/null +++ b/helm/memgraph/litcoin-values.yaml @@ -0,0 +1,16 @@ +deployment: + name: litcoin-memgraph-deployment + +memgraph: + dataUrl: "https://stars.renci.org/var/data_services/litcoin/graphs/LitCoin_Validation_with_200_abstracts/c88f1c87993ef433/memgraph_graph.cypher" + +resources: + limits: + cpu: "2" + memory: "6Gi" + requests: + cpu: "300m" + memory: "512Mi" + +dumpPVC: + size: "5Gi" diff --git a/helm/memgraph/templates/_helpers.tpl b/helm/memgraph/templates/_helpers.tpl new file mode 100644 index 000000000..59ddd1e40 --- /dev/null +++ b/helm/memgraph/templates/_helpers.tpl @@ -0,0 +1,37 @@ +{{/* +Base name for the chart +*/}} +{{- define "memgraph.name" -}} +memgraph +{{- end }} + +{{/* +Full name for resources (release-safe) +*/}} +{{- define "memgraph.fullname" -}} +{{- printf "%s-%s" .Release.Name (include "memgraph.name" .) | trunc 63 | trimSuffix "-" -}} +{{- end }} + +{{/* +Dump PVC name +*/}} +{{- define "memgraph.dumpPVCName" -}} +{{- printf "%s-dump" (include "memgraph.fullname" .) -}} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "memgraph.labels" -}} +app.kubernetes.io/name: {{ include "memgraph.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Selector labels (must match exactly) +*/}} +{{- define "memgraph.selectorLabels" -}} +app.kubernetes.io/name: {{ include "memgraph.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + diff --git a/helm/memgraph/templates/deployment.yaml b/helm/memgraph/templates/deployment.yaml new file mode 100644 index 000000000..f7b6101d5 --- /dev/null +++ b/helm/memgraph/templates/deployment.yaml @@ -0,0 +1,64 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "memgraph.fullname" . }} + labels: + {{- include "memgraph.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "memgraph.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "memgraph.selectorLabels" . | nindent 8 }} + spec: + initContainers: + - name: download-dump + image: curlimages/curl:8.16.0 + command: + - sh + - -c + - | + echo "Downloading Memgraph dump..." + curl -L -o /data/memgraph.cypher {{ required "memgraph.dataUrl must be set" .Values.memgraph.dataUrl }} + volumeMounts: + - name: dump-data + mountPath: /data + containers: + - name: memgraph + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: {{ .Values.service.portBolt }} + name: bolt + command: ["/bin/sh", "-c"] + args: + - | + /usr/lib/memgraph/memgraph & + echo "Waiting for Memgraph to start..." + until echo "RETURN 1;" | /usr/bin/mgconsole --host localhost --port 7687 >/dev/null 2>&1; do + sleep 1 + done + if [ -f /data/memgraph.cypher ]; then + echo "Loading dump into Memgraph..." + /usr/bin/mgconsole --host localhost --port 7687 < /data/memgraph.cypher + fi + wait + volumeMounts: + - name: dump-data + mountPath: /data + resources: + requests: + memory: {{ .Values.resources.requests.memory }} + cpu: {{ .Values.resources.requests.cpu }} + limits: + memory: {{ .Values.resources.limits.memory }} + cpu: {{ .Values.resources.limits.cpu }} + volumes: + - name: dump-data + persistentVolumeClaim: + claimName: {{ include "memgraph.dumpPVCName" . }} +--- + diff --git a/helm/memgraph/templates/pvc-data.yaml b/helm/memgraph/templates/pvc-data.yaml new file mode 100644 index 000000000..cd2f7fa70 --- /dev/null +++ b/helm/memgraph/templates/pvc-data.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "memgraph.dumpPVCName" . }} + labels: + {{- include "memgraph.labels" . | nindent 4 }} +spec: + accessModes: + - {{ .Values.dumpPVC.accessMode | quote }} + resources: + requests: + storage: {{ required "dumpPVC.size must be set (e.g. 5Gi, 10Gi)" .Values.dumpPVC.size }} + storageClassName: {{ .Values.dumpPVC.storageClass | quote }} diff --git a/helm/memgraph/templates/service.yaml b/helm/memgraph/templates/service.yaml new file mode 100644 index 000000000..fbe4e5d45 --- /dev/null +++ b/helm/memgraph/templates/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "memgraph.fullname" . }} + labels: + {{- include "memgraph.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + {{ if .Values.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.service.loadBalancerIP | quote }} + {{ end }} + ports: + - name: bolt + port: {{ .Values.service.portBolt }} + targetPort: {{ .Values.service.portBolt }} + selector: + {{- include "memgraph.selectorLabels" . | nindent 4 }} + diff --git a/helm/memgraph/values.yaml b/helm/memgraph/values.yaml new file mode 100644 index 000000000..1a64e57e4 --- /dev/null +++ b/helm/memgraph/values.yaml @@ -0,0 +1,22 @@ +replicaCount: 1 +image: + repository: memgraph/memgraph + tag: "3.5.1" + pullPolicy: IfNotPresent + +service: + type: LoadBalancer + name: memgraph-svc + portBolt: 7687 + +deployment: + name: memgraph-deployment + +memgraph: + dataUrl: "" + +resources: {} + +dumpPVC: + storageClass: "basic" + accessMode: "ReadWriteOnce" From c097d1e3a06a663874b2718e2f73957a25e2b0dc Mon Sep 17 00:00:00 2001 From: hyi Date: Thu, 29 Jan 2026 22:32:12 -0500 Subject: [PATCH 02/10] intermediate work to add memgraph option in plater helm chart --- helm/plater/templates/configmap.yaml | 26 +++++- helm/plater/templates/env-config-map.yaml | 29 ++++-- .../plater/templates/memgraph-deployment.yaml | 90 +++++++++++++++++++ helm/plater/templates/neo4j-deployment.yaml | 8 +- helm/plater/templates/service.yaml | 17 ++++ 5 files changed, 157 insertions(+), 13 deletions(-) create mode 100644 helm/plater/templates/memgraph-deployment.yaml diff --git a/helm/plater/templates/configmap.yaml b/helm/plater/templates/configmap.yaml index 71f5a4692..dd2d16dcc 100644 --- a/helm/plater/templates/configmap.yaml +++ b/helm/plater/templates/configmap.yaml @@ -14,11 +14,35 @@ data: echo " -- Neo4j is unavailable - sleeping" sleep 3 done - download_data.sh: |- + download_data_neo4j.sh: |- #!/bin/bash set -x wget -O /data/neo4j.dump ${NEO4J_DATA_URL} touch /data/done + + run_memgraph.sh: |- + #!/bin/sh + set -e + + echo "Starting Memgraph..." + /usr/lib/memgraph/memgraph & + MEMGRAPH_PID=$! + + echo "Waiting for Memgraph to accept connections..." + until echo "RETURN 1;" | /usr/bin/mgconsole --host localhost --port 7687 >/dev/null 2>&1; do + sleep 1 + done + + if [ -f /data/memgraph.cypher ]; then + echo "Loading Memgraph dump..." + /usr/bin/mgconsole --host localhost --port 7687 < /data/memgraph.cypher + echo "Memgraph dump loaded" + else + echo "No memgraph.cypher found, skipping load" + fi + + wait ${MEMGRAPH_PID} + health_check.sh: |- #!/usr/bin/env bash response=$(wget --server-response "${PUBLIC_URL}/openapi.json" 2>&1 | awk '/^ HTTP/{print $2}') diff --git a/helm/plater/templates/env-config-map.yaml b/helm/plater/templates/env-config-map.yaml index d5876e413..26280104c 100644 --- a/helm/plater/templates/env-config-map.yaml +++ b/helm/plater/templates/env-config-map.yaml @@ -5,19 +5,32 @@ metadata: data: WEB_HOST: "0.0.0.0" WEB_PORT: "{{ .Values.app.port }}" - {{ if not .Values.externalNeo4j }} + {{- if eq .Values.graph.backend "neo4j" }} + NEO4J_QUERY_TIMEOUT: "{{ .Values.app.Neo4jQueryTimeout }}" + {{- if .Values.graph.external }} + NEO4J_HOST: { { .Values.externalNeo4j.hostName } } + NEO4J_HTTP_PORT: "{{ .Values.externalNeo4j.port }}" + NEO4J_PASSWORD: "{{ .Values.externalNeo4j.password }}" + NEO4J_USERNAME: "{{ .Values.externalNeo4j.username }}" + {{- else }} NEO4J_HOST: {{ include "plater.fullname" . }}-neo4j-service NEO4J_HTTP_PORT: "{{ .Values.app.neo4j.httpPort }}" NEO4J_BOLT_PORT: "{{ .Values.app.neo4j.boltPort }}" NEO4J_PASSWORD: "{{ .Values.app.neo4j.password }}" NEO4J_USERNAME: "{{ .Values.app.neo4j.username }}" - {{ else }} - NEO4J_HOST: {{ .Values.externalNeo4j.hostName }} - NEO4J_HTTP_PORT: "{{ .Values.externalNeo4j.port }}" - NEO4J_PASSWORD: "{{ .Values.externalNeo4j.password }}" - NEO4J_USERNAME: "{{ .Values.externalNeo4j.username }}" - {{ end }} - NEO4J_QUERY_TIMEOUT: "{{ .Values.app.Neo4jQueryTimeout }}" + {{- end }} + {{- end }} + + {{- if eq .Values.graph.backend "memgraph" }} + {{- if .Values.graph.external }} + MEMGRAPH_HOST: {{ .Values.externalMemgraph.hostName | quote }} + MEMGRAPH_BOLT_PORT: "{{ .Values.externalMemgraph.boltPort }}" + {{- else }} + MEMGRAPH_HOST: {{ include "plater.fullname" . }}-memgraph-service + MEMGRAPH_BOLT_PORT: "{{ .Values.memgraph.boltPort }}" + {{- end }} + {{- end }} + PLATER_SERVICE_ADDRESS: "{{ include "plater.fullname" . }}-plater-service" AUTOMAT_HOST: {{ .Values.app.automatAddress }} PLATER_TITLE: {{ .Release.Name }} diff --git a/helm/plater/templates/memgraph-deployment.yaml b/helm/plater/templates/memgraph-deployment.yaml new file mode 100644 index 000000000..f3caa80dc --- /dev/null +++ b/helm/plater/templates/memgraph-deployment.yaml @@ -0,0 +1,90 @@ +{{- if eq .Values.graph.backend "memgraph" }} +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "plater.fullname" . }}-memgraph + labels: + {{- include "plater.labels" . | nindent 4 }} +spec: + serviceName: {{ include "plater.fullname" . }}-memgraph-service + selector: + matchLabels: + {{- include "plater.selectorLabels" . | nindent 6 }} + service-type: database + template: + metadata: + labels: + {{ - include "plater.selectorLabels" . | nindent 8 }} + service-type: database + spec: + {{- if .Values.memgraph.dataUrl }} + initContainers: + - name: {{ include "plater.fullname" . }}-memgraph-download-container + image: curlimages/curl:8.16.0 + command: + - sh + - -c + - | + echo "Downloading Memgraph dump..." + curl -L -o /data/memgraph.cypher {{ .Values.memgraph.dataUrl }} + volumeMounts: + - name: {{ include "plater.fullname" . }}-memgraph-pvc + mountPath: /data + subPath: memgraph_data + resources: + {{ - toYaml .Values.app.memgraph.initresources | nindent 12 }} + {{- end }} + + containers: + - name: {{ include "plater.fullname" . }}-memgraph-container + image: "{{ .Values.image.memgraph.repository }}:{{ .Values.image.memgraph.tag }}" + imagePullPolicy: {{ .Values.image.memgraph.imagePullPolicy }} + ports: + - name: memgraph-bolt + - containerPort: {{ .Values.app.memgraph.boltPort }} + - protocol: TCP + command: + - /run_memgraph.sh + {{ - with .Values.app.memgraph.resources }} + resources: + {{ - toYaml . | nindent 12 }} + {{ - end }} + volumeMounts: + - name: {{ include "plater.fullname" . }}-memgraph-pvc + mountPath: /data + subPath: memgraph_data + startupProbe: +{{ toYaml .Values.memgraph.startupProbe | indent 12 }} + readinessProbe: +{{ toYaml .Values.memgraph.readinessProbe | indent 12 }} + livenessProbe: +{{ toYaml .Values.memgraph.livenessProbe | indent 12 }} + + restartPolicy: Always + {{ with .Values.memgraph.nodeSelector }} + nodeSelector: + {{ toYaml . | nindent 8 }} + {{ end }} + {{ with .Values.memgraph.affinity }} + affinity: + {{ toYaml . | nindent 8 }} + {{ end }} + {{ with .Values.memgraph.tolerations }} + tolerations: + {{ toYaml . | nindent 8 }} + {{ end }} + volumes: + - name: {{ include "plater.fullname" . }}-scripts + configMap: + name: {{ include "plater.fullname" . }}-configmap + defaultMode: 0777 + volumeClaimTemplates: + - metadata: + name: {{ include "plater.fullname" . }}-memgraph-pvc + spec: + accessModes: [ "ReadWriteOnce" ] + resources: + requests: + storage: {{ .Values.app.memgraph.storage.size }} +{{ end }} + diff --git a/helm/plater/templates/neo4j-deployment.yaml b/helm/plater/templates/neo4j-deployment.yaml index 927874cfc..cffd2f4ca 100644 --- a/helm/plater/templates/neo4j-deployment.yaml +++ b/helm/plater/templates/neo4j-deployment.yaml @@ -1,4 +1,4 @@ -{{ if not .Values.externalNeo4j }} +{{- if eq .Values.graph.backend "neo4j" }} apiVersion: apps/v1 kind: StatefulSet metadata: @@ -22,7 +22,7 @@ spec: - name: {{ include "plater.fullname" . }}-neo4j-download-container image: {{ .Values.image.neo4j.repository }}:{{ .Values.image.neo4j.tag }} command: - - '/download_data.sh' + - '/download_data_neo4j.sh' env: - name: NEO4J_DATA_URL value: {{ .Values.dataUrl }} @@ -33,8 +33,8 @@ spec: name: {{ include "plater.fullname" . }}-neo4jkp-pvc subPath: neo4j_data - name: {{ include "plater.fullname" . }}-scripts - mountPath: /download_data.sh - subPath: download_data.sh + mountPath: /download_data_neo4j.sh + subPath: download_data_neo4j.sh - name: {{ include "plater.fullname" . }}-neo4j-seed-container image: {{ .Values.image.neo4j.repository }}:{{ .Values.image.neo4j.tag }} command: diff --git a/helm/plater/templates/service.yaml b/helm/plater/templates/service.yaml index 0db7c5d92..19b8ed94b 100644 --- a/helm/plater/templates/service.yaml +++ b/helm/plater/templates/service.yaml @@ -32,6 +32,23 @@ spec: targetPort: {{ .Values.app.neo4j.boltPort }} protocol: TCP name: neo4j-bolt + selector: + {{- include "plater.selectorLabels" . | nindent 4 }} + service-type: database +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "plater.fullname" . }}-memgraph-service + labels: + {{- include "plater.labels" . | nindent 4 }} +spec: + type: {{ .Values.app.memgraph.service.type }} + ports: + - port: {{ .Values.app.memgraph.boltPort }} + targetPort: {{ .Values.app.memgraph.boltPort }} + protocol: TCP + name: memgraph-bolt selector: {{- include "plater.selectorLabels" . | nindent 4 }} service-type: database \ No newline at end of file From 65d0441986b7a29978a0d29768467a474227f478 Mon Sep 17 00:00:00 2001 From: hyi Date: Fri, 30 Jan 2026 22:14:58 -0500 Subject: [PATCH 03/10] intermediate work --- helm/plater/templates/deployment.yaml | 10 +++-- helm/plater/templates/env-config-map.yaml | 5 ++- .../plater/templates/memgraph-deployment.yaml | 31 +++++++------- helm/plater/values.yaml | 42 ++++++++++++++++++- 4 files changed, 65 insertions(+), 23 deletions(-) diff --git a/helm/plater/templates/deployment.yaml b/helm/plater/templates/deployment.yaml index 9fa88582d..8bb6841fb 100644 --- a/helm/plater/templates/deployment.yaml +++ b/helm/plater/templates/deployment.yaml @@ -39,17 +39,19 @@ spec: command: - './check_neo.sh' env: - {{ if not .Values.externalNeo4j }} + {{- if eq .Values.graph.backend "neo4j" }} + {{- if not .Values.graph.external }} - name: NEO4J_HOST value: {{ include "plater.fullname" . }}-neo4j-service - name: NEO4J_HTTP_PORT value: "{{ .Values.app.neo4j.httpPort }}" - {{ else }} + {{- else }} - name: NEO4J_HOST value: {{ .Values.externalNeo4j.hostName }} - name: NEO4J_HTTP_PORT - value: "{{ .Values.externalNeo4j.port }}" - {{ end }} + value: "{{ .Values.externalNeo4j.httpPort }}" + {{- end }} + {{- end }} volumeMounts: - name: {{ include "plater.fullname" . }}-config-files mountPath: /check_neo.sh diff --git a/helm/plater/templates/env-config-map.yaml b/helm/plater/templates/env-config-map.yaml index 26280104c..5e271fce8 100644 --- a/helm/plater/templates/env-config-map.yaml +++ b/helm/plater/templates/env-config-map.yaml @@ -9,7 +9,8 @@ data: NEO4J_QUERY_TIMEOUT: "{{ .Values.app.Neo4jQueryTimeout }}" {{- if .Values.graph.external }} NEO4J_HOST: { { .Values.externalNeo4j.hostName } } - NEO4J_HTTP_PORT: "{{ .Values.externalNeo4j.port }}" + NEO4J_HTTP_PORT: "{{ .Values.externalNeo4j.httpPort }}" + NEO4J_BOLT_PORT: "{{ .Values.externalNeo4j.boltPort }}" NEO4J_PASSWORD: "{{ .Values.externalNeo4j.password }}" NEO4J_USERNAME: "{{ .Values.externalNeo4j.username }}" {{- else }} @@ -27,7 +28,7 @@ data: MEMGRAPH_BOLT_PORT: "{{ .Values.externalMemgraph.boltPort }}" {{- else }} MEMGRAPH_HOST: {{ include "plater.fullname" . }}-memgraph-service - MEMGRAPH_BOLT_PORT: "{{ .Values.memgraph.boltPort }}" + MEMGRAPH_BOLT_PORT: "{{ .Values.app.memgraph.boltPort }}" {{- end }} {{- end }} diff --git a/helm/plater/templates/memgraph-deployment.yaml b/helm/plater/templates/memgraph-deployment.yaml index f3caa80dc..502f32cd2 100644 --- a/helm/plater/templates/memgraph-deployment.yaml +++ b/helm/plater/templates/memgraph-deployment.yaml @@ -14,10 +14,10 @@ spec: template: metadata: labels: - {{ - include "plater.selectorLabels" . | nindent 8 }} + {{- include "plater.selectorLabels" . | nindent 8 }} service-type: database spec: - {{- if .Values.memgraph.dataUrl }} + {{- if .Values.app.memgraph.dataUrl }} initContainers: - name: {{ include "plater.fullname" . }}-memgraph-download-container image: curlimages/curl:8.16.0 @@ -26,13 +26,13 @@ spec: - -c - | echo "Downloading Memgraph dump..." - curl -L -o /data/memgraph.cypher {{ .Values.memgraph.dataUrl }} + curl -L -o /data/memgraph.cypher {{ .Values.app.memgraph.dataUrl }} volumeMounts: - name: {{ include "plater.fullname" . }}-memgraph-pvc mountPath: /data subPath: memgraph_data resources: - {{ - toYaml .Values.app.memgraph.initresources | nindent 12 }} + {{- toYaml .Values.app.memgraph.initresources | nindent 12 }} {{- end }} containers: @@ -41,35 +41,35 @@ spec: imagePullPolicy: {{ .Values.image.memgraph.imagePullPolicy }} ports: - name: memgraph-bolt - - containerPort: {{ .Values.app.memgraph.boltPort }} - - protocol: TCP + containerPort: {{ .Values.app.memgraph.boltPort }} + protocol: TCP command: - /run_memgraph.sh - {{ - with .Values.app.memgraph.resources }} + {{- with .Values.app.memgraph.resources }} resources: - {{ - toYaml . | nindent 12 }} - {{ - end }} + {{- toYaml . | nindent 12 }} + {{- end }} volumeMounts: - name: {{ include "plater.fullname" . }}-memgraph-pvc mountPath: /data subPath: memgraph_data startupProbe: -{{ toYaml .Values.memgraph.startupProbe | indent 12 }} +{{ toYaml .Values.app.memgraph.startupProbe | indent 12 }} readinessProbe: -{{ toYaml .Values.memgraph.readinessProbe | indent 12 }} +{{ toYaml .Values.app.memgraph.readinessProbe | indent 12 }} livenessProbe: -{{ toYaml .Values.memgraph.livenessProbe | indent 12 }} +{{ toYaml .Values.app.memgraph.livenessProbe | indent 12 }} restartPolicy: Always - {{ with .Values.memgraph.nodeSelector }} + {{ with .Values.app.memgraph.nodeSelector }} nodeSelector: {{ toYaml . | nindent 8 }} {{ end }} - {{ with .Values.memgraph.affinity }} + {{ with .Values.app.memgraph.affinity }} affinity: {{ toYaml . | nindent 8 }} {{ end }} - {{ with .Values.memgraph.tolerations }} + {{ with .Values.app.memgraph.tolerations }} tolerations: {{ toYaml . | nindent 8 }} {{ end }} @@ -87,4 +87,3 @@ spec: requests: storage: {{ .Values.app.memgraph.storage.size }} {{ end }} - diff --git a/helm/plater/values.yaml b/helm/plater/values.yaml index 0d0be5205..eb1064d1d 100644 --- a/helm/plater/values.yaml +++ b/helm/plater/values.yaml @@ -4,6 +4,9 @@ replicaCount: 1 +graph: + backend: memgraph # neo4j or memgraph + external: false busybox: image: @@ -18,12 +21,16 @@ bash: image: plater: repository: ghcr.io/translatorsri/plater-clustered - tag: "v2.1.4" + tag: "v2.3.0" imagePullPolicy: Always neo4j: repository: ghcr.io/translatorsri/plater-neo4j tag: "neo4j-5.26" imagePullPolicy: Always + memgraph: + repository: memgraph/memgraph + tag: "3.5.1" + pullPolicy: IfNotPresent nameOverride: "" fullnameOverride: "" @@ -157,10 +164,43 @@ app: # this value should match chart installation name # https://automat-dev.renci.org/ url: "" + + memgraph: + storage: + size: 20Mi + service: + type: ClusterIP + boltPort: 7687 + dataUrl: "https://stars.renci.org/var/data_services/litcoin/graphs/LitCoin_Validation_with_200_abstracts/c88f1c87993ef433/memgraph_graph.cypher" # URL to memgraph cypher file to populate the database, if deploying internally + initresources: + requests: + memory: 5Gi + cpu: 500m + limits: + memory: 10Gi + cpu: 2000m + resources: + requests: + cpu: 2000m + limits: + ephemeral-storage: 256Mi + cpu: 2500m + nodeSelector: {} tolerations: [] affinity: {} +externalNeo4j: + hostName: "" + boltPort: 7687 + httpPort: 7474 + username: neo4j + password: "" + +externalMemgraph: + hostName: "" + boltPort: 7687 + skipAttributes: dataUrl: "" metadataUrl: "" From fd097e1f71ef153dd2b6849426937201d1b56459 Mon Sep 17 00:00:00 2001 From: hyi Date: Sat, 31 Jan 2026 14:34:51 -0500 Subject: [PATCH 04/10] split service.yaml file into 3 --- .../plater/templates/memgraph-deployment.yaml | 2 +- helm/plater/templates/memgraph-service.yaml | 18 +++++++++ helm/plater/templates/neo4j-deployment.yaml | 2 +- helm/plater/templates/neo4j-service.yaml | 22 +++++++++++ helm/plater/templates/service.yaml | 38 ------------------- 5 files changed, 42 insertions(+), 40 deletions(-) create mode 100644 helm/plater/templates/memgraph-service.yaml create mode 100644 helm/plater/templates/neo4j-service.yaml diff --git a/helm/plater/templates/memgraph-deployment.yaml b/helm/plater/templates/memgraph-deployment.yaml index 502f32cd2..a87bbd646 100644 --- a/helm/plater/templates/memgraph-deployment.yaml +++ b/helm/plater/templates/memgraph-deployment.yaml @@ -1,4 +1,4 @@ -{{- if eq .Values.graph.backend "memgraph" }} +{{- if and (eq .Values.graph.backend "memgraph") (not .Values.graph.external) }} apiVersion: apps/v1 kind: StatefulSet metadata: diff --git a/helm/plater/templates/memgraph-service.yaml b/helm/plater/templates/memgraph-service.yaml new file mode 100644 index 000000000..c7db171dc --- /dev/null +++ b/helm/plater/templates/memgraph-service.yaml @@ -0,0 +1,18 @@ +{{- if and (eq .Values.graph.backend "memgraph") (not .Values.graph.external) }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "plater.fullname" . }}-memgraph-service + labels: + {{- include "plater.labels" . | nindent 4 }} +spec: + type: {{ .Values.app.memgraph.service.type }} + ports: + - port: {{ .Values.app.memgraph.boltPort }} + targetPort: {{ .Values.app.memgraph.boltPort }} + protocol: TCP + name: memgraph-bolt + selector: + {{- include "plater.selectorLabels" . | nindent 4 }} + service-type: database +{{ end }} diff --git a/helm/plater/templates/neo4j-deployment.yaml b/helm/plater/templates/neo4j-deployment.yaml index cffd2f4ca..0ce9e6cd4 100644 --- a/helm/plater/templates/neo4j-deployment.yaml +++ b/helm/plater/templates/neo4j-deployment.yaml @@ -1,4 +1,4 @@ -{{- if eq .Values.graph.backend "neo4j" }} +{{- if and (eq .Values.graph.backend "neo4j") (not .Values.graph.external) }} apiVersion: apps/v1 kind: StatefulSet metadata: diff --git a/helm/plater/templates/neo4j-service.yaml b/helm/plater/templates/neo4j-service.yaml new file mode 100644 index 000000000..8bbf9c467 --- /dev/null +++ b/helm/plater/templates/neo4j-service.yaml @@ -0,0 +1,22 @@ +{{- if and (eq .Values.graph.backend "memgraph") (not .Values.graph.external) }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "plater.fullname" . }}-neo4j-service + labels: + {{- include "plater.labels" . | nindent 4 }} +spec: + type: {{ .Values.app.neo4j.service.type }} + ports: + - port: {{ .Values.app.neo4j.httpPort }} + targetPort: {{ .Values.app.neo4j.httpPort }} + protocol: TCP + name: neo4j-http + - port: {{ .Values.app.neo4j.boltPort }} + targetPort: {{ .Values.app.neo4j.boltPort }} + protocol: TCP + name: neo4j-bolt + selector: + {{- include "plater.selectorLabels" . | nindent 4 }} + service-type: database +{{ end }} diff --git a/helm/plater/templates/service.yaml b/helm/plater/templates/service.yaml index 19b8ed94b..ebc48ce34 100644 --- a/helm/plater/templates/service.yaml +++ b/helm/plater/templates/service.yaml @@ -14,41 +14,3 @@ spec: selector: {{- include "plater.selectorLabels" . | nindent 4 }} service-type: web-server ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ include "plater.fullname" . }}-neo4j-service - labels: - {{- include "plater.labels" . | nindent 4 }} -spec: - type: {{ .Values.app.neo4j.service.type }} - ports: - - port: {{ .Values.app.neo4j.httpPort }} - targetPort: {{ .Values.app.neo4j.httpPort }} - protocol: TCP - name: neo4j-http - - port: {{ .Values.app.neo4j.boltPort }} - targetPort: {{ .Values.app.neo4j.boltPort }} - protocol: TCP - name: neo4j-bolt - selector: - {{- include "plater.selectorLabels" . | nindent 4 }} - service-type: database ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ include "plater.fullname" . }}-memgraph-service - labels: - {{- include "plater.labels" . | nindent 4 }} -spec: - type: {{ .Values.app.memgraph.service.type }} - ports: - - port: {{ .Values.app.memgraph.boltPort }} - targetPort: {{ .Values.app.memgraph.boltPort }} - protocol: TCP - name: memgraph-bolt - selector: - {{- include "plater.selectorLabels" . | nindent 4 }} - service-type: database \ No newline at end of file From 339c6170406cf8d81a94eb4daee7009daa0a0246 Mon Sep 17 00:00:00 2001 From: hyi Date: Sat, 31 Jan 2026 21:03:15 -0500 Subject: [PATCH 05/10] intermediate work --- helm/plater/templates/configmap.yaml | 11 ++++++++--- helm/plater/templates/deployment.yaml | 4 ++-- helm/plater/templates/env-config-map.yaml | 3 ++- helm/plater/templates/memgraph-deployment.yaml | 5 ++++- helm/plater/templates/memgraph-service.yaml | 2 +- helm/plater/templates/neo4j-deployment.yaml | 2 +- helm/plater/templates/neo4j-service.yaml | 4 ++-- 7 files changed, 20 insertions(+), 11 deletions(-) diff --git a/helm/plater/templates/configmap.yaml b/helm/plater/templates/configmap.yaml index dd2d16dcc..778360a6d 100644 --- a/helm/plater/templates/configmap.yaml +++ b/helm/plater/templates/configmap.yaml @@ -25,10 +25,15 @@ data: set -e echo "Starting Memgraph..." - /usr/lib/memgraph/memgraph & + /usr/lib/memgraph/memgraph \ + --bolt-port=7687 \ + --bolt-address=0.0.0.0 \ + --log-level=INFO \ + --also-log-to-stderr \ + & MEMGRAPH_PID=$! - - echo "Waiting for Memgraph to accept connections..." + + echo "Waiting for Memgraph to accept connections...${MEMGRAPH_PID}" until echo "RETURN 1;" | /usr/bin/mgconsole --host localhost --port 7687 >/dev/null 2>&1; do sleep 1 done diff --git a/helm/plater/templates/deployment.yaml b/helm/plater/templates/deployment.yaml index 8bb6841fb..d8290153a 100644 --- a/helm/plater/templates/deployment.yaml +++ b/helm/plater/templates/deployment.yaml @@ -34,12 +34,12 @@ spec: - name: {{ include "plater.fullname" . }}-metadata-pvc mountPath: /home/plater/Plater/PLATER/metadata subPath: plater-metadata/ + {{- if eq .Values.graph.backend "neo4j" }} - name: {{ include "plater.fullname" . }}-init-container image: "{{ .Values.busybox.image.repository }}:{{ .Values.busybox.image.tag }}" command: - './check_neo.sh' env: - {{- if eq .Values.graph.backend "neo4j" }} {{- if not .Values.graph.external }} - name: NEO4J_HOST value: {{ include "plater.fullname" . }}-neo4j-service @@ -51,11 +51,11 @@ spec: - name: NEO4J_HTTP_PORT value: "{{ .Values.externalNeo4j.httpPort }}" {{- end }} - {{- end }} volumeMounts: - name: {{ include "plater.fullname" . }}-config-files mountPath: /check_neo.sh subPath: check_neo.sh + {{- end }} containers: - name: {{ include "plater.fullname" . }}-web-container image: "{{ .Values.image.plater.repository }}:{{ .Values.image.plater.tag }}" diff --git a/helm/plater/templates/env-config-map.yaml b/helm/plater/templates/env-config-map.yaml index 5e271fce8..c6ecd5764 100644 --- a/helm/plater/templates/env-config-map.yaml +++ b/helm/plater/templates/env-config-map.yaml @@ -5,8 +5,9 @@ metadata: data: WEB_HOST: "0.0.0.0" WEB_PORT: "{{ .Values.app.port }}" + GRAPH_DB: "{{ .Values.graph.backend }}" + GRAPH_QUERY_TIMEOUT: "{{ .Values.app.GRAPH_QUERY_TIMEOUT }}" {{- if eq .Values.graph.backend "neo4j" }} - NEO4J_QUERY_TIMEOUT: "{{ .Values.app.Neo4jQueryTimeout }}" {{- if .Values.graph.external }} NEO4J_HOST: { { .Values.externalNeo4j.hostName } } NEO4J_HTTP_PORT: "{{ .Values.externalNeo4j.httpPort }}" diff --git a/helm/plater/templates/memgraph-deployment.yaml b/helm/plater/templates/memgraph-deployment.yaml index a87bbd646..0a26247d3 100644 --- a/helm/plater/templates/memgraph-deployment.yaml +++ b/helm/plater/templates/memgraph-deployment.yaml @@ -44,7 +44,7 @@ spec: containerPort: {{ .Values.app.memgraph.boltPort }} protocol: TCP command: - - /run_memgraph.sh + - '/run_memgraph.sh' {{- with .Values.app.memgraph.resources }} resources: {{- toYaml . | nindent 12 }} @@ -53,6 +53,9 @@ spec: - name: {{ include "plater.fullname" . }}-memgraph-pvc mountPath: /data subPath: memgraph_data + - name: {{ include "plater.fullname" . }}-scripts + mountPath: /run_memgraph.sh + subPath: run_memgraph.sh startupProbe: {{ toYaml .Values.app.memgraph.startupProbe | indent 12 }} readinessProbe: diff --git a/helm/plater/templates/memgraph-service.yaml b/helm/plater/templates/memgraph-service.yaml index c7db171dc..0aa48e345 100644 --- a/helm/plater/templates/memgraph-service.yaml +++ b/helm/plater/templates/memgraph-service.yaml @@ -14,5 +14,5 @@ spec: name: memgraph-bolt selector: {{- include "plater.selectorLabels" . | nindent 4 }} - service-type: database + service-type: memgraph-database {{ end }} diff --git a/helm/plater/templates/neo4j-deployment.yaml b/helm/plater/templates/neo4j-deployment.yaml index 0ce9e6cd4..8553180b3 100644 --- a/helm/plater/templates/neo4j-deployment.yaml +++ b/helm/plater/templates/neo4j-deployment.yaml @@ -88,7 +88,7 @@ spec: - name: NEO4J_server_jvm_additional value: "-XX:+ExitOnOutOfMemoryError -XX:+UseCompressedOops -Dlog4j2.disable.jmx=true -Dlog4j2.formatMsgNoLookups=true" - name: NEO4J_db_transaction_timeout - value: "{{ .Values.app.Neo4jQueryTimeout }}s" + value: "{{ .Values.app.GRAPH_QUERY_TIMEOUT }}s" ports: - name: neo4j-http containerPort: 7474 diff --git a/helm/plater/templates/neo4j-service.yaml b/helm/plater/templates/neo4j-service.yaml index 8bbf9c467..8ad899f7a 100644 --- a/helm/plater/templates/neo4j-service.yaml +++ b/helm/plater/templates/neo4j-service.yaml @@ -1,4 +1,4 @@ -{{- if and (eq .Values.graph.backend "memgraph") (not .Values.graph.external) }} +{{- if and (eq .Values.graph.backend "neo4j") (not .Values.graph.external) }} apiVersion: v1 kind: Service metadata: @@ -18,5 +18,5 @@ spec: name: neo4j-bolt selector: {{- include "plater.selectorLabels" . | nindent 4 }} - service-type: database + service-type: neo4j-database {{ end }} From ff9ab756081f64f5114e68005ae86e2c90960ce8 Mon Sep 17 00:00:00 2001 From: hyi Date: Sat, 31 Jan 2026 21:25:29 -0500 Subject: [PATCH 06/10] get memgraph+plater working --- .../plater/templates/memgraph-deployment.yaml | 4 +-- helm/plater/templates/neo4j-deployment.yaml | 4 +-- helm/plater/values.yaml | 36 ++++++++++--------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/helm/plater/templates/memgraph-deployment.yaml b/helm/plater/templates/memgraph-deployment.yaml index 0a26247d3..053a39e54 100644 --- a/helm/plater/templates/memgraph-deployment.yaml +++ b/helm/plater/templates/memgraph-deployment.yaml @@ -10,12 +10,12 @@ spec: selector: matchLabels: {{- include "plater.selectorLabels" . | nindent 6 }} - service-type: database + service-type: memgraph-database template: metadata: labels: {{- include "plater.selectorLabels" . | nindent 8 }} - service-type: database + service-type: memgraph-database spec: {{- if .Values.app.memgraph.dataUrl }} initContainers: diff --git a/helm/plater/templates/neo4j-deployment.yaml b/helm/plater/templates/neo4j-deployment.yaml index 8553180b3..71eb52626 100644 --- a/helm/plater/templates/neo4j-deployment.yaml +++ b/helm/plater/templates/neo4j-deployment.yaml @@ -10,12 +10,12 @@ spec: selector: matchLabels: {{- include "plater.selectorLabels" . | nindent 6 }} - service-type: database + service-type: neo4j-database template: metadata: labels: {{- include "plater.selectorLabels" . | nindent 8 }} - service-type: database + service-type: neo4j-database spec: {{- if .Values.dataUrl }} initContainers: diff --git a/helm/plater/values.yaml b/helm/plater/values.yaml index eb1064d1d..bd3e98de8 100644 --- a/helm/plater/values.yaml +++ b/helm/plater/values.yaml @@ -30,7 +30,7 @@ image: memgraph: repository: memgraph/memgraph tag: "3.5.1" - pullPolicy: IfNotPresent + pullPolicy: Always nameOverride: "" fullnameOverride: "" @@ -83,24 +83,24 @@ service: type: ClusterIP app: otel: - enabled: "True" + enabled: "False" jaegerHost: "http://jaeger-otel-collector" jaegerPort: "4317" - profiler_on: "True" + profiler_on: "False" gunicorn: worker_timeout: 3600 num_workers: 4 # this is the timeout used for the http request made to neo4j # and also controls the https://neo4j.com/docs/operations-manual/4.2/reference/configuration-settings/#config_dbms.transaction.timeout - Neo4jQueryTimeout: 1600 + GRAPH_QUERY_TIMEOUT: 1600 web: resources: requests: memory: 1Gi cpu: 500m limits: - memory: 3Gi - cpu: 2000m + memory: 2Gi + cpu: 1000m port: 8080 automatAddress: http://automat @@ -130,13 +130,13 @@ app: cpu: 500m limits: memory: 10Gi - cpu: 2000m + cpu: 1000m resources: requests: - cpu: 2000m + cpu: 1000m limits: ephemeral-storage: 256Mi - cpu: 2500m + cpu: 1500m openapi_config: # Adds more configs to default open api config x-trapi: @@ -171,20 +171,22 @@ app: service: type: ClusterIP boltPort: 7687 - dataUrl: "https://stars.renci.org/var/data_services/litcoin/graphs/LitCoin_Validation_with_200_abstracts/c88f1c87993ef433/memgraph_graph.cypher" # URL to memgraph cypher file to populate the database, if deploying internally + dataUrl: "" # URL to memgraph cypher file to populate the database, if deploying internally initresources: requests: - memory: 5Gi + memory: 1Gi cpu: 500m limits: - memory: 10Gi - cpu: 2000m + memory: 1Gi + cpu: 1000m resources: requests: - cpu: 2000m + memory: 5Gi + cpu: 500m limits: ephemeral-storage: 256Mi - cpu: 2500m + memory: 6Gi + cpu: 1000m nodeSelector: {} tolerations: [] @@ -202,7 +204,7 @@ externalMemgraph: boltPort: 7687 skipAttributes: -dataUrl: "" +dataUrl: "" # this dataUrl is for neo4j data dump. Although it is better to move it to app.neo4j block, it could introduce breaking changes, so keep it here for now. metadataUrl: "" metaKGUrl: "" testingDataUrl: "" @@ -220,4 +222,4 @@ x_trapi: maturity: value: "maturity" location: - value: "location" \ No newline at end of file + value: "location" From 440a3e89f08deacbf49af827035d39a745851ff1 Mon Sep 17 00:00:00 2001 From: hyi Date: Mon, 2 Feb 2026 12:08:46 -0500 Subject: [PATCH 07/10] removed original memgraph helm chart now that it is integrated in plater --- helm/memgraph/Chart.yaml | 24 ---------- helm/memgraph/litcoin-values.yaml | 16 ------- helm/memgraph/templates/_helpers.tpl | 37 -------------- helm/memgraph/templates/deployment.yaml | 64 ------------------------- helm/memgraph/templates/pvc-data.yaml | 13 ----- helm/memgraph/templates/service.yaml | 18 ------- helm/memgraph/values.yaml | 22 --------- 7 files changed, 194 deletions(-) delete mode 100644 helm/memgraph/Chart.yaml delete mode 100644 helm/memgraph/litcoin-values.yaml delete mode 100644 helm/memgraph/templates/_helpers.tpl delete mode 100644 helm/memgraph/templates/deployment.yaml delete mode 100644 helm/memgraph/templates/pvc-data.yaml delete mode 100644 helm/memgraph/templates/service.yaml delete mode 100644 helm/memgraph/values.yaml diff --git a/helm/memgraph/Chart.yaml b/helm/memgraph/Chart.yaml deleted file mode 100644 index edda6485f..000000000 --- a/helm/memgraph/Chart.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: v2 -name: memgraphkg -description: A Helm chart for deploying KG in memgraph - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1-0-0" diff --git a/helm/memgraph/litcoin-values.yaml b/helm/memgraph/litcoin-values.yaml deleted file mode 100644 index b5114c123..000000000 --- a/helm/memgraph/litcoin-values.yaml +++ /dev/null @@ -1,16 +0,0 @@ -deployment: - name: litcoin-memgraph-deployment - -memgraph: - dataUrl: "https://stars.renci.org/var/data_services/litcoin/graphs/LitCoin_Validation_with_200_abstracts/c88f1c87993ef433/memgraph_graph.cypher" - -resources: - limits: - cpu: "2" - memory: "6Gi" - requests: - cpu: "300m" - memory: "512Mi" - -dumpPVC: - size: "5Gi" diff --git a/helm/memgraph/templates/_helpers.tpl b/helm/memgraph/templates/_helpers.tpl deleted file mode 100644 index 59ddd1e40..000000000 --- a/helm/memgraph/templates/_helpers.tpl +++ /dev/null @@ -1,37 +0,0 @@ -{{/* -Base name for the chart -*/}} -{{- define "memgraph.name" -}} -memgraph -{{- end }} - -{{/* -Full name for resources (release-safe) -*/}} -{{- define "memgraph.fullname" -}} -{{- printf "%s-%s" .Release.Name (include "memgraph.name" .) | trunc 63 | trimSuffix "-" -}} -{{- end }} - -{{/* -Dump PVC name -*/}} -{{- define "memgraph.dumpPVCName" -}} -{{- printf "%s-dump" (include "memgraph.fullname" .) -}} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "memgraph.labels" -}} -app.kubernetes.io/name: {{ include "memgraph.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Selector labels (must match exactly) -*/}} -{{- define "memgraph.selectorLabels" -}} -app.kubernetes.io/name: {{ include "memgraph.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - diff --git a/helm/memgraph/templates/deployment.yaml b/helm/memgraph/templates/deployment.yaml deleted file mode 100644 index f7b6101d5..000000000 --- a/helm/memgraph/templates/deployment.yaml +++ /dev/null @@ -1,64 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "memgraph.fullname" . }} - labels: - {{- include "memgraph.labels" . | nindent 4 }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "memgraph.selectorLabels" . | nindent 6 }} - template: - metadata: - labels: - {{- include "memgraph.selectorLabels" . | nindent 8 }} - spec: - initContainers: - - name: download-dump - image: curlimages/curl:8.16.0 - command: - - sh - - -c - - | - echo "Downloading Memgraph dump..." - curl -L -o /data/memgraph.cypher {{ required "memgraph.dataUrl must be set" .Values.memgraph.dataUrl }} - volumeMounts: - - name: dump-data - mountPath: /data - containers: - - name: memgraph - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - containerPort: {{ .Values.service.portBolt }} - name: bolt - command: ["/bin/sh", "-c"] - args: - - | - /usr/lib/memgraph/memgraph & - echo "Waiting for Memgraph to start..." - until echo "RETURN 1;" | /usr/bin/mgconsole --host localhost --port 7687 >/dev/null 2>&1; do - sleep 1 - done - if [ -f /data/memgraph.cypher ]; then - echo "Loading dump into Memgraph..." - /usr/bin/mgconsole --host localhost --port 7687 < /data/memgraph.cypher - fi - wait - volumeMounts: - - name: dump-data - mountPath: /data - resources: - requests: - memory: {{ .Values.resources.requests.memory }} - cpu: {{ .Values.resources.requests.cpu }} - limits: - memory: {{ .Values.resources.limits.memory }} - cpu: {{ .Values.resources.limits.cpu }} - volumes: - - name: dump-data - persistentVolumeClaim: - claimName: {{ include "memgraph.dumpPVCName" . }} ---- - diff --git a/helm/memgraph/templates/pvc-data.yaml b/helm/memgraph/templates/pvc-data.yaml deleted file mode 100644 index cd2f7fa70..000000000 --- a/helm/memgraph/templates/pvc-data.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ include "memgraph.dumpPVCName" . }} - labels: - {{- include "memgraph.labels" . | nindent 4 }} -spec: - accessModes: - - {{ .Values.dumpPVC.accessMode | quote }} - resources: - requests: - storage: {{ required "dumpPVC.size must be set (e.g. 5Gi, 10Gi)" .Values.dumpPVC.size }} - storageClassName: {{ .Values.dumpPVC.storageClass | quote }} diff --git a/helm/memgraph/templates/service.yaml b/helm/memgraph/templates/service.yaml deleted file mode 100644 index fbe4e5d45..000000000 --- a/helm/memgraph/templates/service.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "memgraph.fullname" . }} - labels: - {{- include "memgraph.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - {{ if .Values.service.loadBalancerIP }} - loadBalancerIP: {{ .Values.service.loadBalancerIP | quote }} - {{ end }} - ports: - - name: bolt - port: {{ .Values.service.portBolt }} - targetPort: {{ .Values.service.portBolt }} - selector: - {{- include "memgraph.selectorLabels" . | nindent 4 }} - diff --git a/helm/memgraph/values.yaml b/helm/memgraph/values.yaml deleted file mode 100644 index 1a64e57e4..000000000 --- a/helm/memgraph/values.yaml +++ /dev/null @@ -1,22 +0,0 @@ -replicaCount: 1 -image: - repository: memgraph/memgraph - tag: "3.5.1" - pullPolicy: IfNotPresent - -service: - type: LoadBalancer - name: memgraph-svc - portBolt: 7687 - -deployment: - name: memgraph-deployment - -memgraph: - dataUrl: "" - -resources: {} - -dumpPVC: - storageClass: "basic" - accessMode: "ReadWriteOnce" From 4fbf4ec42cecf997c1e0a1997322f549ca2470a6 Mon Sep 17 00:00:00 2001 From: hyi Date: Mon, 2 Feb 2026 15:08:37 -0500 Subject: [PATCH 08/10] get neo4j deployment with plater working --- helm/plater/templates/configmap.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/helm/plater/templates/configmap.yaml b/helm/plater/templates/configmap.yaml index 778360a6d..a7adef12e 100644 --- a/helm/plater/templates/configmap.yaml +++ b/helm/plater/templates/configmap.yaml @@ -95,9 +95,9 @@ data: fi seed_db.sh: |- #!/bin/bash - set -x + set -ex FILE=/data/neo4j.dump - DATADIR=/data/databases + NEO4J_DATA=/data until [ -f "$FILE" ]; do echo "$FILE doesn't exist. Please copy to database dump file to $FILE" echo "sleeping..." @@ -106,15 +106,15 @@ data: echo "$FILE found" echo "clearing previous database file if any..." # Make dir if they don't exist - mkdir -p /data/databases - mkdir -p /data/transactions - mkdir -p /data/dbms + mkdir -p ${NEO4J_DATA}/databases + mkdir -p ${NEO4J_DATA}/transactions + mkdir -p ${NEO4J_DATA}/dbms # clear out data from dir if they were present - rm -rf /data/dbms/* - rm -rf /data/databases/* - rm -rf /data/transactions/* + rm -rf ${NEO4J_DATA}/dbms/* + rm -rf ${NEO4J_DATA}/databases/* + rm -rf ${NEO4J_DATA}/transactions/* # load dump file - neo4j-admin database load --from-path=/data/ neo4j + neo4j-admin database load --from-path=/data/ neo4j --overwrite-destination=true --verbose dataset-desc.json: | {{ .Values.datasetDesc | toJson }} openapi-config.yaml: |- From dc8d8e831f532ba6932a308b68bc58bd42fb88af Mon Sep 17 00:00:00 2001 From: hyi Date: Mon, 2 Feb 2026 16:23:44 -0500 Subject: [PATCH 09/10] get neo4j external working --- helm/plater/templates/deployment.yaml | 9 +-------- helm/plater/templates/env-config-map.yaml | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/helm/plater/templates/deployment.yaml b/helm/plater/templates/deployment.yaml index d8290153a..7eeaa8674 100644 --- a/helm/plater/templates/deployment.yaml +++ b/helm/plater/templates/deployment.yaml @@ -34,23 +34,16 @@ spec: - name: {{ include "plater.fullname" . }}-metadata-pvc mountPath: /home/plater/Plater/PLATER/metadata subPath: plater-metadata/ - {{- if eq .Values.graph.backend "neo4j" }} + {{- if and (eq .Values.graph.backend "neo4j") (not .Values.graph.external) }} - name: {{ include "plater.fullname" . }}-init-container image: "{{ .Values.busybox.image.repository }}:{{ .Values.busybox.image.tag }}" command: - './check_neo.sh' env: - {{- if not .Values.graph.external }} - name: NEO4J_HOST value: {{ include "plater.fullname" . }}-neo4j-service - name: NEO4J_HTTP_PORT value: "{{ .Values.app.neo4j.httpPort }}" - {{- else }} - - name: NEO4J_HOST - value: {{ .Values.externalNeo4j.hostName }} - - name: NEO4J_HTTP_PORT - value: "{{ .Values.externalNeo4j.httpPort }}" - {{- end }} volumeMounts: - name: {{ include "plater.fullname" . }}-config-files mountPath: /check_neo.sh diff --git a/helm/plater/templates/env-config-map.yaml b/helm/plater/templates/env-config-map.yaml index c6ecd5764..199549265 100644 --- a/helm/plater/templates/env-config-map.yaml +++ b/helm/plater/templates/env-config-map.yaml @@ -9,7 +9,7 @@ data: GRAPH_QUERY_TIMEOUT: "{{ .Values.app.GRAPH_QUERY_TIMEOUT }}" {{- if eq .Values.graph.backend "neo4j" }} {{- if .Values.graph.external }} - NEO4J_HOST: { { .Values.externalNeo4j.hostName } } + NEO4J_HOST: {{ .Values.externalNeo4j.hostName }} NEO4J_HTTP_PORT: "{{ .Values.externalNeo4j.httpPort }}" NEO4J_BOLT_PORT: "{{ .Values.externalNeo4j.boltPort }}" NEO4J_PASSWORD: "{{ .Values.externalNeo4j.password }}" From 696ac6321466163255c93b590f15023072b294de Mon Sep 17 00:00:00 2001 From: hyi Date: Mon, 2 Feb 2026 16:59:27 -0500 Subject: [PATCH 10/10] everything appears to work now --- helm/plater/values.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/helm/plater/values.yaml b/helm/plater/values.yaml index bd3e98de8..b9388a3ea 100644 --- a/helm/plater/values.yaml +++ b/helm/plater/values.yaml @@ -114,8 +114,8 @@ app: # additional jvm parameters for large query strings jvmStackSize: 1g # These are jvm based values hence suffix with one of the following G, M etc... - heapSize: - pageCacheSize: + heapSize: 1g + pageCacheSize: 1g # It's used to request the cluster for memory capable of running neo4j per the heap and PageCache values above # Compute this value by summing up heapSize + pageCacheSize + (1G for os) + jvmStackSize # https://neo4j.com/docs/operations-manual/current/performance/memory-configuration/ @@ -134,8 +134,10 @@ app: resources: requests: cpu: 1000m + memory: 5Gi limits: ephemeral-storage: 256Mi + memory: 6Gi cpu: 1500m openapi_config: # Adds more configs to default open api config