HomeSoftware Heritage

helm: Install parametrized deployment for loaders

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

helm: Install parametrized deployment for loaders

Dry run install check:

helm install --dry-run stuff ./worker
NAME: stuff
LAST DEPLOYED: Thu Sep 23 17:01:19 2021
NAMESPACE: default
STATUS: pending-install
REVISION: 1
TEST SUITE: None
HOOKS:
MANIFEST:
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: loaders
data:
  config.yml: |
    storage:
      cls: pipeline
      steps:
      - cls: buffer
        min_batch_size:
          content: 10000
          content_bytes: 104857600
          directory: 10000
          revision: 10000
      - cls: filter
      - cls: retry
      - cls: remote
        url: http://storage:5002/

    celery:
      task_broker: amqp://guest:guest@amqp//
      task_queues:
       - swh.loader.git.tasks.UpdateGitRepository
  entrypoint.sh: |
    #!/bin/bash

    set -e

    echo Starting the swh Celery worker
    exec python -m celery \
                --app=swh.scheduler.celery_backend.config.app \
                worker \
                --pool=prefork --events \
                --concurrency=${CONCURRENCY} \
                --max-tasks-per-child=${MAX_TASKS_PER_CHILD} \
                -Ofair --loglevel=${LOGLEVEL} \
                --hostname "${HOSTNAME}"
---
apiVersion: v1
kind: Service
metadata:
  name: storage
spec:
  type: ExternalName
  externalName: swh-storage
---
apiVersion: v1
kind: Service
metadata:
  name: amqp
spec:
  type: ExternalName
  externalName: amqp
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: loaders
  labels:
    app: loaders
spec:
  replicas: 1
  selector:
    matchLabels:
      app: loaders
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
  template:
    metadata:
      labels:
        app: loaders
    spec:
      containers:
      - name: loaders
        image: swh-loaders:latest
        imagePullPolicy: Always
        command:
          - /entrypoint.sh
        resources:
          requests:
            memory: "256Mi"
            cpu: "200m"
          limits:
            memory: "4000Mi"
            cpu: "1200m"
        lifecycle:
          preStop:
           exec:
             command: ["kill", "1"]
        env:
        - name: CONCURRENCY
          value: "1"
        - name: MAX_TASKS_PER_CHILD
          value: "5"
        - name: LOGLEVEL
          value: "INFO"
        - name: SWH_CONFIG_FILENAME
          value: /etc/softwareheritage/config.yml
        volumeMounts:
          - name: config
            mountPath: /etc/softwareheritage/config.yml
            subPath: config.yml
            readOnly: true
          - name: config
            mountPath: /entrypoint.sh
            subPath: entrypoint.sh
            readOnly: true
      volumes:
        - name: config
          configMap:
            name: loaders
            defaultMode: 0777$ helm install --dry-run stuff ./worker
...

Related to T3592

Details

Provenance
ardumontAuthored on Sep 23 2021, 5:05 PM
ardumontPushed on Sep 29 2021, 5:48 PM

Commit No Longer Exists

This commit no longer exists in the repository.