Skip to content

swh-graph: Deploy swh-graph 2024-12-06 on local storage on highmem01

Nicolas Dandrimont requested to merge mr/swh-graph-2024-12-06 into production

This extends the template to support manually creating a local pv and pvc for data that's already been copied to the host.

Helm diff reports:

------------- diff for environment production namespace swh-cassandra -------------

     _        __  __
   _| |_   _ / _|/ _|  between /tmp/swh-chart.swh.b9jlug3z/production-swh-cassandra.before, 492 documents
 / _' | | | | |_| |_       and /tmp/swh-chart.swh.b9jlug3z/production-swh-cassandra.after, 503 documents
| (_| | |_| |  _|  _|
 \__,_|\__, |_| |_|   returned one difference
        |___/

(file level)
    ---
    # Source: swh/templates/graph/configmap.yaml
    apiVersion: v1
    kind: ConfigMap
    metadata:
    │ name: graph-grpc-20241206-configuration-template
    │ namespace: swh-cassandra
    data:
    │ config.yml.template: |
    │ │ graph:
    │ │   max_ram: 500g
    │ │ 
    # Source: swh/templates/graph/configmap.yaml
    apiVersion: v1
    kind: ConfigMap
    metadata:
    │ namespace: swh-cassandra
    │ name: graph-rpc-20241206-configuration-template
    data:
    │ config.yml.template: |
    │ │ graph:
    │ │   cls: remote
    │ │   grpc_server:
    │ │     port: 80
    │ │   url: graph-grpc-20241206-ingress:80
    │ │ 
    # Source: swh/templates/graph/persistent-volume-claims.yaml
    apiVersion: v1
    kind: PersistentVolume
    metadata:
    │ name: graph-20241206-persistent-local-pv
    │ namespace: swh-cassandra
    spec:
    │ capacity:
    │ │ storage: 1Gi
    │ volumeMode: Filesystem
    │ accessModes:
    │ - ReadWriteOnce
    │ persistentVolumeReclaimPolicy: Retain
    │ storageClassName: local-storage
    │ local:
    │ │ path: /srv/softwareheritage/ssd/graph/2024-12-06/compressed
    │ nodeAffinity:
    │ │ required:
    │ │ │ nodeSelectorTerms:
    │ │ │ - matchExpressions:
    │ │ │ │ - key: kubernetes.io/hostname
    │ │ │ │ │ operator: In
    │ │ │ │ │ values:
    │ │ │ │ │ - rancher-node-highmem01
    # Source: swh/templates/graph/persistent-volume-claims.yaml
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
    │ name: graph-20241206-inmemory-pvc
    │ namespace: swh-cassandra
    │ labels:
    │ │ app: graph-grpc-20241206
    spec:
    │ accessModes:
    │ - ReadWriteOnce
    │ resources:
    │ │ requests:
    │ │ │ storage: 1Gi
    │ storageClassName: local-path
    │ volumeMode: Filesystem
    # Source: swh/templates/graph/persistent-volume-claims.yaml
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
    │ name: graph-20241206-persistent-pvc
    │ namespace: swh-cassandra
    spec:
    │ volumeMode: Filesystem
    │ volumeName: graph-20241206-persistent-local-pv
    │ storageClassName: local-storage
    # Source: swh/templates/graph/service.yaml
    apiVersion: v1
    kind: Service
    metadata:
    │ name: graph-grpc-20241206
    │ namespace: swh-cassandra
    │ labels:
    │ │ app: graph-grpc-20241206
    spec:
    │ type: ClusterIP
    │ selector:
    │ │ app: graph-grpc-20241206
    │ ports:
    │ - port: 50091
    │ │ targetPort: 50091
    │ │ name: grpc
    # Source: swh/templates/graph/service.yaml
    apiVersion: v1
    kind: Service
    metadata:
    │ name: graph-rpc-20241206
    │ namespace: swh-cassandra
    │ labels:
    │ │ app: graph-rpc-20241206
    spec:
    │ type: ClusterIP
    │ selector:
    │ │ app: graph-rpc-20241206
    │ ports:
    │ - port: 5009
    │ │ targetPort: 5009
    │ │ name: rpc
    # Source: swh/templates/graph/deployment.yaml
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    │ namespace: swh-cassandra
    │ name: graph-grpc-20241206
    │ labels:
    │ │ app: graph-grpc-20241206
    spec:
    │ revisionHistoryLimit: 2
    │ selector:
    │ │ matchLabels:
    │ │ │ app: graph-grpc-20241206
    │ strategy:
    │ │ type: RollingUpdate
    │ │ rollingUpdate:
    │ │ │ maxSurge: 1
    │ template:
    │ │ metadata:
    │ │ │ labels:
    │ │ │ │ app: graph-grpc-20241206
    │ │ │ annotations:
    │ │ │ │ checksum/config: b4edb88c0bcb74769dc2f39025a598580a6d6a39cece80ba52904365cd7380eb
    │ │ │ │ checksum/config-utils: 13a26f6add17e96ce01550153c77dcd48de60241a3f4db3c93d5467234be2a7f
    │ │ │ │ checksum/backend-utils: f05e83ee23d0a6f024509f79edaa8e11d7e0829cea9481832ad0670267a3de60
    │ │ spec:
    │ │ │ affinity:
    │ │ │ │ nodeAffinity:
    │ │ │ │ │ requiredDuringSchedulingIgnoredDuringExecution:
    │ │ │ │ │ │ nodeSelectorTerms:
    │ │ │ │ │ │ - matchExpressions:
    │ │ │ │ │ │ │ - key: swh/graph
    │ │ │ │ │ │ │ │ operator: In
    │ │ │ │ │ │ │ │ values:
    │ │ │ │ │ │ │ │ - "true"
    │ │ │ priorityClassName: swh-cassandra-frontend-rpc
    │ │ │ initContainers:
    │ │ │ - name: prepare-configuration
    │ │ │ │ image: "container-registry.softwareheritage.org/swh/infra/swh-apps/utils:20231211.1"
    │ │ │ │ imagePullPolicy: IfNotPresent
    │ │ │ │ command:
    │ │ │ │ - /entrypoints/prepare-configuration.sh
    │ │ │ │ env:
    │ │ │ │ volumeMounts:
    │ │ │ │ - name: configuration
    │ │ │ │ │ mountPath: /etc/swh
    │ │ │ │ - name: configuration-template
    │ │ │ │ │ mountPath: /etc/swh/configuration-template
    │ │ │ │ - name: config-utils
    │ │ │ │ │ mountPath: /entrypoints
    │ │ │ │ │ readOnly: true
    │ │ │ - name: graph-prepare-memory-volume
    │ │ │ │ image: "container-registry.softwareheritage.org/swh/infra/swh-apps/utils:20231211.1"
    │ │ │ │ imagePullPolicy: IfNotPresent
    │ │ │ │ command:
    │ │ │ │ - /entrypoints/graph-prepare-memory-volume.sh
    │ │ │ │ env:
    │ │ │ │ - name: WITNESS_FILE
    │ │ │ │ │ value: /srv/graph/2024-12-06/compressed/.graph-is-initialized
    │ │ │ │ - name: WITNESS_SOURCE_FILE
    │ │ │ │ │ value: /srv/dataset/2024-12-06/compressed/.graph-is-initialized
    │ │ │ │ - name: WITNESS_REINDEX_FILE
    │ │ │ │ │ value:
    │ │ │ │ - name: PERIOD
    │ │ │ │ │ value: 3
    │ │ │ │ - name: GRAPH_NAME
    │ │ │ │ │ value: graph
    │ │ │ │ - name: DATASET_SOURCE
    │ │ │ │ │ value: /srv/dataset/2024-12-06/compressed
    │ │ │ │ - name: DATASET_LOCATION
    │ │ │ │ │ value: /srv/graph/2024-12-06/compressed
    │ │ │ │ volumeMounts:
    │ │ │ │ - name: backend-utils
    │ │ │ │ │ mountPath: /entrypoints
    │ │ │ │ │ readOnly: true
    │ │ │ │ - name: graph-20241206-inmemory
    │ │ │ │ │ mountPath: /srv/graph
    │ │ │ │ │ readOnly: false
    │ │ │ │ - name: graph-20241206-persistent
    │ │ │ │ │ mountPath: /srv/dataset/2024-12-06/compressed
    │ │ │ │ │ readOnly: false
    │ │ │ containers:
    │ │ │ - name: graph-grpc-20241206
    │ │ │ │ resources:
    │ │ │ │ │ requests:
    │ │ │ │ │ │ memory: 400Gi
    │ │ │ │ │ │ cpu: 500m
    │ │ │ │ image: "container-registry.softwareheritage.org/swh/infra/swh-apps/graph:20241015.1"
    │ │ │ │ imagePullPolicy: IfNotPresent
    │ │ │ │ ports:
    │ │ │ │ - containerPort: 50091
    │ │ │ │ │ name: grpc
    │ │ │ │ readinessProbe:
    │ │ │ │ │ tcpSocket:
    │ │ │ │ │ │ port: grpc
    │ │ │ │ │ initialDelaySeconds: 15
    │ │ │ │ │ failureThreshold: 30
    │ │ │ │ │ periodSeconds: 5
    │ │ │ │ livenessProbe:
    │ │ │ │ │ tcpSocket:
    │ │ │ │ │ │ port: grpc
    │ │ │ │ │ initialDelaySeconds: 10
    │ │ │ │ │ periodSeconds: 5
    │ │ │ │ command:
    │ │ │ │ - /bin/bash
    │ │ │ │ args:
    │ │ │ │ - "-c"
    │ │ │ │ - /opt/swh/entrypoint.sh
    │ │ │ │ env:
    │ │ │ │ - name: PORT
    │ │ │ │ │ value: 50091
    │ │ │ │ - name: GRAPH_TYPE
    │ │ │ │ │ value: grpc
    │ │ │ │ - name: GRAPH_PATH
    │ │ │ │ │ value: /srv/graph/2024-12-06/compressed/graph
    │ │ │ │ - name: STATSD_HOST
    │ │ │ │ │ value: prometheus-statsd-exporter
    │ │ │ │ - name: STATSD_PORT
    │ │ │ │ │ value: 9125
    │ │ │ │ - name: STATSD_TAGS
    │ │ │ │ │ value: "deployment:graph-grpc-20241206"
    │ │ │ │ - name: STATSD_SERVICE_TYPE
    │ │ │ │ │ value: graph-grpc-20241206
    │ │ │ │ - name: SWH_LOG_LEVEL
    │ │ │ │ │ value: INFO
    │ │ │ │ - name: SWH_CONFIG_FILENAME
    │ │ │ │ │ value: /etc/swh/config.yml
    │ │ │ │ - name: SWH_SENTRY_ENVIRONMENT
    │ │ │ │ │ value: production
    │ │ │ │ - name: SWH_MAIN_PACKAGE
    │ │ │ │ │ value: swh.graph
    │ │ │ │ - name: SWH_SENTRY_DSN
    │ │ │ │ │ valueFrom:
    │ │ │ │ │ │ secretKeyRef:
    │ │ │ │ │ │ │ name: common-secrets
    │ │ │ │ │ │ │ key: storage-sentry-dsn
    │ │ │ │ │ │ │ # 'name' secret should exist & include key
    # if the setting doesn't exist, sentry pushes will be disabled
    optional: true
    │ │ │ │ - name: SWH_SENTRY_DISABLE_LOGGING_EVENTS
    │ │ │ │ │ value: "true"
    │ │ │ │ volumeMounts:
    │ │ │ │ - name: configuration
    │ │ │ │ │ mountPath: /etc/swh
    │ │ │ │ - name: graph-20241206-inmemory
    │ │ │ │ │ mountPath: /srv/graph
    │ │ │ │ │ readOnly: false
    │ │ │ │ - name: graph-20241206-persistent
    │ │ │ │ │ mountPath: /srv/dataset/2024-12-06/compressed
    │ │ │ │ │ readOnly: false
    │ │ │ volumes:
    │ │ │ - name: configuration
    │ │ │ │ emptyDir: {}
    │ │ │ - name: configuration-template
    │ │ │ │ configMap:
    │ │ │ │ │ name: graph-grpc-20241206-configuration-template
    │ │ │ │ │ items:
    │ │ │ │ │ - key: config.yml.template
    │ │ │ │ │ │ path: config.yml.template
    │ │ │ - name: config-utils
    │ │ │ │ configMap:
    │ │ │ │ │ name: config-utils
    │ │ │ │ │ defaultMode: 0555
    │ │ │ - name: backend-utils
    │ │ │ │ configMap:
    │ │ │ │ │ name: backend-utils
    │ │ │ │ │ defaultMode: 0555
    │ │ │ - name: graph-20241206-inmemory
    │ │ │ │ persistentVolumeClaim:
    │ │ │ │ │ claimName: graph-20241206-inmemory-pvc
    │ │ │ - name: graph-20241206-persistent
    │ │ │ │ persistentVolumeClaim:
    │ │ │ │ │ claimName: graph-20241206-persistent-pvc
    # Source: swh/templates/graph/deployment.yaml
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    │ namespace: swh-cassandra
    │ name: graph-rpc-20241206
    │ labels:
    │ │ app: graph-rpc-20241206
    spec:
    │ revisionHistoryLimit: 2
    │ selector:
    │ │ matchLabels:
    │ │ │ app: graph-rpc-20241206
    │ strategy:
    │ │ type: RollingUpdate
    │ │ rollingUpdate:
    │ │ │ maxSurge: 1
    │ template:
    │ │ metadata:
    │ │ │ labels:
    │ │ │ │ app: graph-rpc-20241206
    │ │ │ annotations:
    │ │ │ │ checksum/config: 095d223956d75728c8f8a26368053a8882cb3026736517767d8aacfc9895e159
    │ │ │ │ checksum/config-utils: 13a26f6add17e96ce01550153c77dcd48de60241a3f4db3c93d5467234be2a7f
    │ │ │ │ checksum/backend-utils: f05e83ee23d0a6f024509f79edaa8e11d7e0829cea9481832ad0670267a3de60
    │ │ spec:
    │ │ │ affinity:
    │ │ │ │ nodeAffinity:
    │ │ │ │ │ requiredDuringSchedulingIgnoredDuringExecution:
    │ │ │ │ │ │ nodeSelectorTerms:
    │ │ │ │ │ │ - matchExpressions:
    │ │ │ │ │ │ │ - key: swh/graph
    │ │ │ │ │ │ │ │ operator: In
    │ │ │ │ │ │ │ │ values:
    │ │ │ │ │ │ │ │ - "true"
    │ │ │ priorityClassName: swh-cassandra-frontend-rpc
    │ │ │ initContainers:
    │ │ │ - name: prepare-configuration
    │ │ │ │ image: "container-registry.softwareheritage.org/swh/infra/swh-apps/utils:20231211.1"
    │ │ │ │ imagePullPolicy: IfNotPresent
    │ │ │ │ command:
    │ │ │ │ - /entrypoints/prepare-configuration.sh
    │ │ │ │ env:
    │ │ │ │ volumeMounts:
    │ │ │ │ - name: configuration
    │ │ │ │ │ mountPath: /etc/swh
    │ │ │ │ - name: configuration-template
    │ │ │ │ │ mountPath: /etc/swh/configuration-template
    │ │ │ │ - name: config-utils
    │ │ │ │ │ mountPath: /entrypoints
    │ │ │ │ │ readOnly: true
    │ │ │ containers:
    │ │ │ - name: graph-rpc-20241206
    │ │ │ │ resources:
    │ │ │ │ │ requests:
    │ │ │ │ │ │ memory: 512Mi
    │ │ │ │ │ │ cpu: 500m
    │ │ │ │ image: "container-registry.softwareheritage.org/swh/infra/swh-apps/graph:20241015.1"
    │ │ │ │ imagePullPolicy: IfNotPresent
    │ │ │ │ ports:
    │ │ │ │ - containerPort: 5009
    │ │ │ │ │ name: rpc
    │ │ │ │ readinessProbe:
    │ │ │ │ │ httpGet:
    │ │ │ │ │ │ path: /
    │ │ │ │ │ │ port: rpc
    │ │ │ │ │ initialDelaySeconds: 15
    │ │ │ │ │ failureThreshold: 30
    │ │ │ │ │ periodSeconds: 5
    │ │ │ │ livenessProbe:
    │ │ │ │ │ tcpSocket:
    │ │ │ │ │ │ port: rpc
    │ │ │ │ │ initialDelaySeconds: 10
    │ │ │ │ │ periodSeconds: 5
    │ │ │ │ command:
    │ │ │ │ - /bin/bash
    │ │ │ │ args:
    │ │ │ │ - "-c"
    │ │ │ │ - /opt/swh/entrypoint.sh
    │ │ │ │ env:
    │ │ │ │ - name: PORT
    │ │ │ │ │ value: 5009
    │ │ │ │ - name: GRAPH_TYPE
    │ │ │ │ │ value: rpc
    │ │ │ │ - name: STATSD_HOST
    │ │ │ │ │ value: prometheus-statsd-exporter
    │ │ │ │ - name: STATSD_PORT
    │ │ │ │ │ value: 9125
    │ │ │ │ - name: STATSD_TAGS
    │ │ │ │ │ value: "deployment:graph-rpc-20241206"
    │ │ │ │ - name: STATSD_SERVICE_TYPE
    │ │ │ │ │ value: graph-rpc-20241206
    │ │ │ │ - name: SWH_LOG_LEVEL
    │ │ │ │ │ value: INFO
    │ │ │ │ - name: SWH_CONFIG_FILENAME
    │ │ │ │ │ value: /etc/swh/config.yml
    │ │ │ │ - name: SWH_SENTRY_ENVIRONMENT
    │ │ │ │ │ value: production
    │ │ │ │ - name: SWH_MAIN_PACKAGE
    │ │ │ │ │ value: swh.graph
    │ │ │ │ - name: SWH_SENTRY_DSN
    │ │ │ │ │ valueFrom:
    │ │ │ │ │ │ secretKeyRef:
    │ │ │ │ │ │ │ name: common-secrets
    │ │ │ │ │ │ │ key: storage-sentry-dsn
    │ │ │ │ │ │ │ # 'name' secret should exist & include key
    # if the setting doesn't exist, sentry pushes will be disabled
    optional: true
    │ │ │ │ - name: SWH_SENTRY_DISABLE_LOGGING_EVENTS
    │ │ │ │ │ value: "true"
    │ │ │ │ volumeMounts:
    │ │ │ │ - name: configuration
    │ │ │ │ │ mountPath: /etc/swh
    │ │ │ volumes:
    │ │ │ - name: configuration
    │ │ │ │ emptyDir: {}
    │ │ │ - name: configuration-template
    │ │ │ │ configMap:
    │ │ │ │ │ name: graph-rpc-20241206-configuration-template
    │ │ │ │ │ items:
    │ │ │ │ │ - key: config.yml.template
    │ │ │ │ │ │ path: config.yml.template
    │ │ │ - name: config-utils
    │ │ │ │ configMap:
    │ │ │ │ │ name: config-utils
    │ │ │ │ │ defaultMode: 0555
    │ │ │ - name: backend-utils
    │ │ │ │ configMap:
    │ │ │ │ │ name: backend-utils
    │ │ │ │ │ defaultMode: 0555
    # Source: swh/templates/graph/ingress.yaml
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
    │ namespace: swh-cassandra
    │ name: graph-grpc-20241206-ingress-default
    │ labels:
    │ │ app: graph-grpc-20241206
    │ │ endpoint-definition: default
    │ annotations:
    │ │ nginx.ingress.kubernetes.io/backend-protocol: GRPC
    │ │ nginx.ingress.kubernetes.io/client-body-buffer-size: 128K
    │ │ nginx.ingress.kubernetes.io/proxy-body-size: 4G
    │ │ nginx.ingress.kubernetes.io/proxy-buffering: on
    │ │ nginx.ingress.kubernetes.io/service-upstream: "true"
    │ │ nginx.ingress.kubernetes.io/ssl-redirect: "true"
    │ │ nginx.ingress.kubernetes.io/whitelist-source-range: "10.42.0.0/16,10.43.0.0/16,127.0.0.0/8,192.168.100.0/24,192.168.100.29/32,192.168.101.0/24,192.168.200.0/22,192.168.50.0/24"
    spec:
    │ ingressClassName: nginx
    │ rules:
    │ - host: graph-grpc-20241206-ingress
    │ │ http:
    │ │ │ paths:
    │ │ │ - path: /
    │ │ │ │ pathType: Prefix
    │ │ │ │ backend:
    │ │ │ │ │ service:
    │ │ │ │ │ │ name: graph-grpc-20241206
    │ │ │ │ │ │ port:
    │ │ │ │ │ │ │ number: 50091
    # Source: swh/templates/graph/ingress.yaml
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
    │ namespace: swh-cassandra
    │ name: graph-rpc-20241206-ingress-default
    │ labels:
    │ │ app: graph-rpc-20241206
    │ │ endpoint-definition: default
    │ annotations:
    │ │ nginx.ingress.kubernetes.io/client-body-buffer-size: 128K
    │ │ nginx.ingress.kubernetes.io/proxy-body-size: 4G
    │ │ nginx.ingress.kubernetes.io/proxy-buffering: on
    │ │ nginx.ingress.kubernetes.io/service-upstream: "true"
    │ │ nginx.ingress.kubernetes.io/whitelist-source-range: "10.42.0.0/16,10.43.0.0/16,127.0.0.0/8,192.168.100.0/24,192.168.100.29/32,192.168.101.0/24,192.168.200.0/22,192.168.50.0/24"
    spec:
    │ rules:
    │ - host: graph-rpc-20241206-ingress
    │ │ http:
    │ │ │ paths:
    │ │ │ - path: /
    │ │ │ │ pathType: Prefix
    │ │ │ │ backend:
    │ │ │ │ │ service:
    │ │ │ │ │ │ name: graph-rpc-20241206
    │ │ │ │ │ │ port:
    │ │ │ │ │ │ │ number: 5009

Merge request reports

Loading