Staging instance, all changes can be removed at any time

Skip to content

production: Deploy golang lister and loader pods

Antoine R. Dumont requested to merge staging-add-golang into production

Expectedly, diff adds the new lister and loader declarations. [1] I kept the configuration from the staging pods which was enough last time i checked.

Refs. swh/infra/sysadm-environment#4993 (closed)

[1]

$ make helm-diff
./helm-diff.sh swh
[swh] Comparing changes between branches production and staging-add-golang...
Switched to branch 'production'
Your branch is up to date with 'origin/production'.
[swh] Generate config in production branch for swh/values/default.yaml...
[swh] Generate config in production branch for swh/values/production-cassandra.yaml...
[swh] Generate config in production branch for swh/values/production.yaml...
[swh] Generate config in production branch for swh/values/staging-cassandra.yaml...
[swh] Generate config in production branch for swh/values/staging.yaml...
Switched to branch 'staging-add-golang'
[swh] Generate config in staging-add-golang branch for swh/values/default.yaml...
[swh] Generate config in staging-add-golang branch for swh/values/production-cassandra.yaml...
[swh] Generate config in staging-add-golang branch for swh/values/production.yaml...
[swh] Generate config in staging-add-golang branch for swh/values/staging-cassandra.yaml...
[swh] Generate config in staging-add-golang branch for swh/values/staging.yaml...


------------- diff for swh/values/default.yaml -------------

No differences


------------- diff for swh/values/production-cassandra.yaml -------------

No differences


------------- diff for swh/values/production.yaml -------------

--- /tmp/swh-chart.swh.A2juunb3/production.yaml.before  2023-07-27 11:33:13.842099237 +0200
+++ /tmp/swh-chart.swh.A2juunb3/production.yaml.after   2023-07-27 11:33:14.238098994 +0200
@@ -466,20 +466,118 @@
       - console



 # Set useJsonLogger to false to let the logs be plain text
 ---
 # Source: swh/templates/listers/configmap.yaml
 apiVersion: v1
 kind: ConfigMap
 metadata:
+  name: lister-golang-template
+  namespace: swh
+data:
+  config.yml.template: |
+    storage:
+      cls: pipeline
+      steps:
+      - cls: retry
+      - cls: remote
+        url: http://saam.internal.softwareheritage.org:5002
+
+    scheduler:
+      cls: remote
+      url: http://saatchi.internal.softwareheritage.org:5008/
+
+    celery:
+      task_broker: amqp://${AMQP_USERNAME}:${AMQP_PASSWORD}@rabbitmq.internal.softwareheritage.org:/
+      task_acks_late: true
+      task_queues:
+      - swh.lister.golang.tasks.FullGolangLister
+      - swh.lister.golang.tasks.IncrementalGolangLister
+      sentry_settings_for_celery_tasks:
+        __sentry-settings-for-celery-tasks__
+    credentials:
+      __lister-credentials__
+  init-container-entrypoint.sh: |
+    #!/bin/bash
+
+    set -e
+
+    CONFIG_FILE=/etc/swh/config.yml
+    CONFIG_FILE_WIP=/tmp/wip-config.yml
+
+    # substitute environment variables when creating the default config.yml
+    eval echo \""$(</etc/swh/configuration-template/config.yml.template)"\" \
+      > $CONFIG_FILE
+
+    SENTRY_SETTINGS_PATH=/etc/credentials/sentry-settings/sentry_settings_for_celery_tasks
+    if [ -f $SENTRY_SETTINGS_PATH ]; then
+      awk "/__sentry-settings-for-celery-tasks__/{system(\"sed 's/^/    /g' $SENTRY_SETTINGS_PATH\");next}1" $CONFIG_FILE > $CONFIG_FILE_WIP
+      mv $CONFIG_FILE_WIP $CONFIG_FILE
+    else
+      sed -i 's/__sentry-settings-for-celery-tasks__//g' $CONFIG_FILE
+    fi
+
+    CREDS_LISTER_PATH=/etc/credentials/listers/credentials
+    if [ -f $CREDS_LISTER_PATH ]; then
+      awk "/__lister-credentials__/{system(\"sed 's/^/  /g' $CREDS_LISTER_PATH\");next}1" $CONFIG_FILE > $CONFIG_FILE_WIP
+      mv $CONFIG_FILE_WIP $CONFIG_FILE
+    else
+      sed -i 's/__lister-credentials__//g' $CONFIG_FILE
+    fi
+
+    exit 0
+
+
+  logging-configuration.yml: |
+    version: 1
+
+    handlers:
+      console:
+        class: logging.StreamHandler
+        formatter: json
+        stream: ext://sys.stdout
+
+    formatters:
+      json:
+        class: pythonjsonlogger.jsonlogger.JsonFormatter
+        # python-json-logger parses the format argument to get the variables it actually expands into the json
+        format: "%(asctime)s:%(threadName)s:%(pathname)s:%(lineno)s:%(funcName)s:%(task_name)s:%(task_id)s:%(name)s:%(levelname)s:%(message)s"
+
+    loggers:
+      celery:
+        level: "INFO"
+      amqp:
+        level: WARNING
+      urllib3:
+        level: WARNING
+      azure.core.pipeline.policies.http_logging_policy:
+        level: WARNING
+      swh:
+        level: "INFO"
+      celery.task:
+        level: "INFO"
+
+    root:
+      level: "INFO"
+      handlers:
+      - console
+
+
+
+# Set useJsonLogger to false to let the logs be plain text
+---
+# Source: swh/templates/listers/configmap.yaml
+apiVersion: v1
+kind: ConfigMap
+metadata:
   name: lister-pagure-template
   namespace: swh
 data:
   config.yml.template: |
     storage:
       cls: pipeline
       steps:
       - cls: retry
       - cls: remote
         url: http://saam.internal.softwareheritage.org:5002
@@ -1189,20 +1287,122 @@

     root:
       level: "INFO"
       handlers:
       - console
 ---
 # Source: swh/templates/loaders/configmap.yaml
 apiVersion: v1
 kind: ConfigMap
 metadata:
+  name: loader-golang-template
+  namespace: swh
+data:
+  config.yml.template: |
+    storage:
+      cls: pipeline
+      steps:
+      - cls: buffer
+        min_batch_size:
+          content: 1000
+          content_bytes: 52428800
+          directory: 1000
+          directory_entries: 12000
+          extid: 1000
+          release: 1000
+          release_bytes: 52428800
+          revision: 1000
+          revision_bytes: 52428800
+          revision_parents: 2000
+      - cls: filter
+      - cls: retry
+      - cls: remote
+        url: http://saam.internal.softwareheritage.org:5002
+
+    celery:
+      task_broker: amqp://${AMQP_USERNAME}:${AMQP_PASSWORD}@rabbitmq.internal.softwareheritage.org:/
+      task_acks_late: false
+      task_queues:
+      - swh.loader.package.golang.tasks.LoadGolang
+      sentry_settings_for_celery_tasks:
+        __sentry-settings-for-celery-tasks__
+    metadata_fetcher_credentials:
+      __metadata-fetcher-credentials__
+  init-container-entrypoint.sh: |
+    #!/bin/bash
+
+    set -e
+
+    CONFIG_FILE=/etc/swh/config.yml
+    CONFIG_FILE_WIP=/tmp/wip-config.yml
+
+    # substitute environment variables when creating the default config.yml
+    eval echo \""$(</etc/swh/configuration-template/config.yml.template)"\" \
+      > $CONFIG_FILE
+
+    SENTRY_SETTINGS_PATH=/etc/credentials/sentry-settings/sentry_settings_for_celery_tasks
+    if [ -f $SENTRY_SETTINGS_PATH ]; then
+      awk "/__sentry-settings-for-celery-tasks__/{system(\"sed 's/^/    /g' $SENTRY_SETTINGS_PATH\");next}1" $CONFIG_FILE > $CONFIG_FILE_WIP
+      mv $CONFIG_FILE_WIP $CONFIG_FILE
+    else
+      sed -i 's/__sentry-settings-for-celery-tasks__//g' $CONFIG_FILE
+    fi
+
+    CREDS_LISTER_PATH=/etc/credentials/metadata-fetcher/credentials
+    if [ -f $CREDS_LISTER_PATH ]; then
+      awk "/__metadata-fetcher-credentials__/{system(\"sed 's/^/  /g' $CREDS_LISTER_PATH\");next}1" $CONFIG_FILE > $CONFIG_FILE_WIP
+      mv $CONFIG_FILE_WIP $CONFIG_FILE
+    else
+      sed -i 's/__metadata-fetcher-credentials__//g' $CONFIG_FILE
+    fi
+
+    exit 0
+
+
+  logging-configuration.yml: |
+    version: 1
+
+    handlers:
+      console:
+        class: logging.StreamHandler
+        formatter: json
+        stream: ext://sys.stdout
+
+    formatters:
+      json:
+        class: pythonjsonlogger.jsonlogger.JsonFormatter
+        # python-json-logger parses the format argument to get the variables it actually expands into the json
+        format: "%(asctime)s:%(threadName)s:%(pathname)s:%(lineno)s:%(funcName)s:%(task_name)s:%(task_id)s:%(name)s:%(levelname)s:%(message)s"
+
+    loggers:
+      celery:
+        level: "INFO"
+      amqp:
+        level: WARNING
+      urllib3:
+        level: WARNING
+      azure.core.pipeline.policies.http_logging_policy:
+        level: WARNING
+      swh:
+        level: "INFO"
+      celery.task:
+        level: "INFO"
+
+    root:
+      level: "INFO"
+      handlers:
+      - console
+---
+# Source: swh/templates/loaders/configmap.yaml
+apiVersion: v1
+kind: ConfigMap
+metadata:
   name: loader-large-repository-template
   namespace: swh
 data:
   config.yml.template: |
     storage:
       cls: pipeline
       steps:
       - cls: buffer
         min_batch_size:
           content: 1000
@@ -1752,21 +1952,21 @@
   strategy:
     type: RollingUpdate
     rollingUpdate:
       maxSurge: 1
   template:
     metadata:
       labels:
         app: lister-bower
       annotations:
         # Force a rollout upgrade if the configuration changes
-        checksum/config: 91dfceff7461a00c7a73bbadc8dcc9df1405349ca7bc2ebc416a717bb6dfedae
+        checksum/config: b41fc2d817ec80c02782431c0f17b583edd1b1174bf303fbcce45f8317640b23
     spec:
       affinity:

         nodeAffinity:
           requiredDuringSchedulingIgnoredDuringExecution:
             nodeSelectorTerms:
             - matchExpressions:
               - key: swh/lister
                 operator: In
                 values:
@@ -1914,21 +2114,21 @@
   strategy:
     type: RollingUpdate
     rollingUpdate:
       maxSurge: 1
   template:
     metadata:
       labels:
         app: lister-gitiles
       annotations:
         # Force a rollout upgrade if the configuration changes
-        checksum/config: 91dfceff7461a00c7a73bbadc8dcc9df1405349ca7bc2ebc416a717bb6dfedae
+        checksum/config: b41fc2d817ec80c02782431c0f17b583edd1b1174bf303fbcce45f8317640b23
     spec:
       affinity:

         nodeAffinity:
           requiredDuringSchedulingIgnoredDuringExecution:
             nodeSelectorTerms:
             - matchExpressions:
               - key: swh/lister
                 operator: In
                 values:
@@ -2076,21 +2276,21 @@
   strategy:
     type: RollingUpdate
     rollingUpdate:
       maxSurge: 1
   template:
     metadata:
       labels:
         app: lister-gitweb
       annotations:
         # Force a rollout upgrade if the configuration changes
-        checksum/config: 91dfceff7461a00c7a73bbadc8dcc9df1405349ca7bc2ebc416a717bb6dfedae
+        checksum/config: b41fc2d817ec80c02782431c0f17b583edd1b1174bf303fbcce45f8317640b23
     spec:
       affinity:

         nodeAffinity:
           requiredDuringSchedulingIgnoredDuringExecution:
             nodeSelectorTerms:
             - matchExpressions:
               - key: swh/lister
                 operator: In
                 values:
@@ -2238,21 +2438,21 @@
   strategy:
     type: RollingUpdate
     rollingUpdate:
       maxSurge: 1
   template:
     metadata:
       labels:
         app: lister-gogs-full
       annotations:
         # Force a rollout upgrade if the configuration changes
-        checksum/config: 91dfceff7461a00c7a73bbadc8dcc9df1405349ca7bc2ebc416a717bb6dfedae
+        checksum/config: b41fc2d817ec80c02782431c0f17b583edd1b1174bf303fbcce45f8317640b23
     spec:
       affinity:

         nodeAffinity:
           requiredDuringSchedulingIgnoredDuringExecution:
             nodeSelectorTerms:
             - matchExpressions:
               - key: swh/lister
                 operator: In
                 values:
@@ -2381,40 +2581,202 @@
       - name: sentry-settings-for-celery-tasks
         secret:
           secretName: sentry-settings-for-celery-tasks
           optional: true
 # Set useJsonLogger to false to let the logs be plain text
 ---
 # Source: swh/templates/listers/deployment.yaml
 apiVersion: apps/v1
 kind: Deployment
 metadata:
+  name: lister-golang
+  namespace: swh
+  labels:
+    app: lister-golang
+spec:
+  revisionHistoryLimit: 2
+  selector:
+    matchLabels:
+      app: lister-golang
+  strategy:
+    type: RollingUpdate
+    rollingUpdate:
+      maxSurge: 1
+  template:
+    metadata:
+      labels:
+        app: lister-golang
+      annotations:
+        # Force a rollout upgrade if the configuration changes
+        checksum/config: b41fc2d817ec80c02782431c0f17b583edd1b1174bf303fbcce45f8317640b23
+    spec:
+      affinity:
+
+        nodeAffinity:
+          requiredDuringSchedulingIgnoredDuringExecution:
+            nodeSelectorTerms:
+            - matchExpressions:
+              - key: swh/lister
+                operator: In
+                values:
+                - "true"
+      terminationGracePeriodSeconds: 3600
+      initContainers:
+        - name: prepare-configuration
+          image: debian:bullseye
+          imagePullPolicy: Always
+          env:
+          - name: AMQP_USERNAME
+            valueFrom:
+              secretKeyRef:
+                name: common-secrets
+                key: rabbitmq-amqp-username
+                # 'name' secret must exist & include that ^ key
+                optional: false
+          - name: AMQP_PASSWORD
+            valueFrom:
+              secretKeyRef:
+                name: common-secrets
+                key: rabbitmq-amqp-password
+                # 'name' secret must exist & include that ^ key
+                optional: false
+          command:
+            - /entrypoint.sh
+          volumeMounts:
+          - name: configuration-template
+            mountPath: /entrypoint.sh
+            subPath: "init-container-entrypoint.sh"
+            readOnly: true
+          - name: configuration
+            mountPath: /etc/swh
+          - name: configuration-template
+            mountPath: /etc/swh/configuration-template
+          - name: lister-credentials-secrets
+            mountPath: /etc/credentials/listers
+            readOnly: true
+          - name: sentry-settings-for-celery-tasks
+            mountPath: /etc/credentials/sentry-settings
+            readOnly: true
+      containers:
+      - name: listers
+        resources:
+          requests:
+            memory: 256Mi
+            cpu: 250m
+        image: container-registry.softwareheritage.org/swh/infra/swh-apps/lister:20230725.1
+        imagePullPolicy: Always
+        command:
+        - /bin/bash
+        args:
+        - -c
+        - /opt/swh/entrypoint.sh
+        lifecycle:
+          preStop:
+            exec:
+              command: ["/pre-stop.sh"]
+        env:
+        - name: STATSD_HOST
+          value: prometheus-statsd-exporter
+        - name: STATSD_PORT
+          value: "9125"
+        - name: MAX_TASKS_PER_CHILD
+          value: "1"
+        - name: LOGLEVEL
+          value: "INFO"
+        - name: SWH_CONFIG_FILENAME
+          value: /etc/swh/config.yml
+
+        - name: SWH_LOG_CONFIG
+          value: /etc/swh/logging-configuration.yml
+
+        - name: SWH_SENTRY_ENVIRONMENT
+          value: production
+        volumeMounts:
+          - name: lister-utils
+            mountPath: /pre-stop.sh
+            subPath: "pre-stop.sh"
+          - name: configuration
+            mountPath: /etc/swh
+
+          - name: configuration-template
+            mountPath: /etc/swh/logging-configuration.yml
+            subPath: "logging-configuration.yml"
+            readOnly: true
+
+      volumes:
+      - name: configuration
+        ephemeral:
+          volumeClaimTemplate:
+            metadata:
+              labels:
+                type: ephemeral-volume
+            spec:
+              accessModes:
+              - ReadWriteOnce
+              resources:
+                requests:
+                  storage: 100Gi
+              storageClassName: local-path
+      - name: configuration-template
+        configMap:
+          name: lister-golang-template
+          defaultMode: 0777
+          items:
+          - key: "config.yml.template"
+            path: "config.yml.template"
+          - key: "init-container-entrypoint.sh"
+            path: "init-container-entrypoint.sh"
+
+          - key: "logging-configuration.yml"
+            path: "logging-configuration.yml"
+
+      - name: lister-utils
+        configMap:
+          name: lister-utils
+          defaultMode: 0777
+          items:
+          - key: "pre-stop-idempotent.sh"
+            path: "pre-stop.sh"
+      - name: lister-credentials-secrets
+        secret:
+          secretName: lister-credentials-secrets
+          optional: true
+      - name: sentry-settings-for-celery-tasks
+        secret:
+          secretName: sentry-settings-for-celery-tasks
+          optional: true
+# Set useJsonLogger to false to let the logs be plain text
+---
+# Source: swh/templates/listers/deployment.yaml
+apiVersion: apps/v1
+kind: Deployment
+metadata:
   name: lister-pagure
   namespace: swh
   labels:
     app: lister-pagure
 spec:
   revisionHistoryLimit: 2
   selector:
     matchLabels:
       app: lister-pagure
   strategy:
     type: RollingUpdate
     rollingUpdate:
       maxSurge: 1
   template:
     metadata:
       labels:
         app: lister-pagure
       annotations:
         # Force a rollout upgrade if the configuration changes
-        checksum/config: 91dfceff7461a00c7a73bbadc8dcc9df1405349ca7bc2ebc416a717bb6dfedae
+        checksum/config: b41fc2d817ec80c02782431c0f17b583edd1b1174bf303fbcce45f8317640b23
     spec:
       affinity:

         nodeAffinity:
           requiredDuringSchedulingIgnoredDuringExecution:
             nodeSelectorTerms:
             - matchExpressions:
               - key: swh/lister
                 operator: In
                 values:
@@ -2562,21 +2924,21 @@
   strategy:
     type: RollingUpdate
     rollingUpdate:
       maxSurge: 1
   template:
     metadata:
       labels:
         app: lister-pubdev
       annotations:
         # Force a rollout upgrade if the configuration changes
-        checksum/config: 91dfceff7461a00c7a73bbadc8dcc9df1405349ca7bc2ebc416a717bb6dfedae
+        checksum/config: b41fc2d817ec80c02782431c0f17b583edd1b1174bf303fbcce45f8317640b23
     spec:
       affinity:

         nodeAffinity:
           requiredDuringSchedulingIgnoredDuringExecution:
             nodeSelectorTerms:
             - matchExpressions:
               - key: swh/lister
                 operator: In
                 values:
@@ -2724,21 +3086,21 @@
   strategy:
     type: RollingUpdate
     rollingUpdate:
       maxSurge: 1
   template:
     metadata:
       labels:
         app: lister-stagit
       annotations:
         # Force a rollout upgrade if the configuration changes
-        checksum/config: 91dfceff7461a00c7a73bbadc8dcc9df1405349ca7bc2ebc416a717bb6dfedae
+        checksum/config: b41fc2d817ec80c02782431c0f17b583edd1b1174bf303fbcce45f8317640b23
     spec:
       affinity:

         nodeAffinity:
           requiredDuringSchedulingIgnoredDuringExecution:
             nodeSelectorTerms:
             - matchExpressions:
               - key: swh/lister
                 operator: In
                 values:
@@ -3010,21 +3372,21 @@
   strategy:
     type: RollingUpdate
     rollingUpdate:
       maxSurge: 1
   template:
     metadata:
       labels:
         app: loader-add-forge-now
       annotations:
         # Force a rollout upgrade if the configuration changes
-        checksum/config: 4caca6b29b6c7c7c453ccc9bca153bc1f8944d1ff7917e5e84ae4e8cd912c905
+        checksum/config: e8442a6da2d17189a6872df6f82d31836a07e1fac6bb49dc8c1b28092d7909e2
     spec:
       affinity:
         nodeAffinity:
           requiredDuringSchedulingIgnoredDuringExecution:
             nodeSelectorTerms:
             - matchExpressions:
               - key: swh/loader
                 operator: In
                 values:
                 - "true"
@@ -3180,21 +3542,21 @@
   strategy:
     type: RollingUpdate
     rollingUpdate:
       maxSurge: 1
   template:
     metadata:
       labels:
         app: loader-add-forge-now-slow
       annotations:
         # Force a rollout upgrade if the configuration changes
-        checksum/config: 4caca6b29b6c7c7c453ccc9bca153bc1f8944d1ff7917e5e84ae4e8cd912c905
+        checksum/config: e8442a6da2d17189a6872df6f82d31836a07e1fac6bb49dc8c1b28092d7909e2
     spec:
       affinity:
         nodeAffinity:
           requiredDuringSchedulingIgnoredDuringExecution:
             nodeSelectorTerms:
             - matchExpressions:
               - key: swh/loader
                 operator: In
                 values:
                 - "true"
@@ -3350,21 +3712,21 @@
   strategy:
     type: RollingUpdate
     rollingUpdate:
       maxSurge: 1
   template:
     metadata:
       labels:
         app: loader-cvs
       annotations:
         # Force a rollout upgrade if the configuration changes
-        checksum/config: 4caca6b29b6c7c7c453ccc9bca153bc1f8944d1ff7917e5e84ae4e8cd912c905
+        checksum/config: e8442a6da2d17189a6872df6f82d31836a07e1fac6bb49dc8c1b28092d7909e2
     spec:
       affinity:
         nodeAffinity:
           requiredDuringSchedulingIgnoredDuringExecution:
             nodeSelectorTerms:
             - matchExpressions:
               - key: swh/loader
                 operator: In
                 values:
                 - "true"
@@ -3499,40 +3861,208 @@
           optional: true

 # if defined at the "typed" loader level
 # otherwise use the global image is defined First this needs to replace - in
 # $loader_type with "" to find the proper image name.
 ---
 # Source: swh/templates/loaders/deployment.yaml
 apiVersion: apps/v1
 kind: Deployment
 metadata:
+  name: loader-golang
+  namespace: swh
+  labels:
+    app: loader-golang
+spec:
+  revisionHistoryLimit: 2
+  selector:
+    matchLabels:
+      app: loader-golang
+  strategy:
+    type: RollingUpdate
+    rollingUpdate:
+      maxSurge: 1
+  template:
+    metadata:
+      labels:
+        app: loader-golang
+      annotations:
+        # Force a rollout upgrade if the configuration changes
+        checksum/config: e8442a6da2d17189a6872df6f82d31836a07e1fac6bb49dc8c1b28092d7909e2
+    spec:
+      affinity:
+        nodeAffinity:
+          requiredDuringSchedulingIgnoredDuringExecution:
+            nodeSelectorTerms:
+            - matchExpressions:
+              - key: swh/loader
+                operator: In
+                values:
+                - "true"
+      terminationGracePeriodSeconds: 3600
+      initContainers:
+        - name: prepare-configuration
+          image: debian:bullseye
+          imagePullPolicy: Always
+          env:
+          - name: AMQP_USERNAME
+            valueFrom:
+              secretKeyRef:
+                name: common-secrets
+                key: rabbitmq-amqp-username
+                # 'name' secret must exist & include that ^ key
+                optional: false
+          - name: AMQP_PASSWORD
+            valueFrom:
+              secretKeyRef:
+                name: common-secrets
+                key: rabbitmq-amqp-password
+                # 'name' secret must exist & include that ^ key
+                optional: false
+
+          command:
+            - /entrypoint.sh
+          volumeMounts:
+          - name: configuration-template
+            mountPath: /entrypoint.sh
+            subPath: "init-container-entrypoint.sh"
+            readOnly: true
+          - name: configuration
+            mountPath: /etc/swh
+          - name: configuration-template
+            mountPath: /etc/swh/configuration-template
+          - name: metadata-fetcher-credentials
+            mountPath: /etc/credentials/metadata-fetcher
+            readOnly: true
+          - name: sentry-settings-for-celery-tasks
+            mountPath: /etc/credentials/sentry-settings
+            readOnly: true
+      containers:
+      - name: loaders
+        image: container-registry.softwareheritage.org/swh/infra/swh-apps/loader_package:20230725.1
+
+        imagePullPolicy: Always
+        command:
+          - /opt/swh/entrypoint.sh
+        resources:
+          requests:
+            memory: 256Mi
+            cpu: 200m
+        lifecycle:
+          preStop:
+            exec:
+              command: ["/pre-stop.sh"]
+        env:
+        - name: STATSD_HOST
+          value: prometheus-statsd-exporter
+        - name: STATSD_PORT
+          value: "9125"
+        - name: MAX_TASKS_PER_CHILD
+          value: "10"
+        - name: LOGLEVEL
+          value: "INFO"
+        - name: SWH_CONFIG_FILENAME
+          value: /etc/swh/config.yml
+        - name: SWH_LOG_CONFIG
+          value: /etc/swh/logging-configuration.yml
+
+        - name: SWH_SENTRY_ENVIRONMENT
+          value: production
+        - name: SWH_SENTRY_DISABLE_LOGGING_EVENTS
+          value: "yes"
+        volumeMounts:
+          - name: loader-utils
+            mountPath: /pre-stop.sh
+            subPath: "pre-stop.sh"
+          - name: configuration
+            mountPath: /etc/swh
+          - name: localstorage
+            mountPath: /tmp
+
+          - name: configuration-template
+            mountPath: /etc/swh/logging-configuration.yml
+            subPath: "logging-configuration.yml"
+            readOnly: true
+
+      volumes:
+      - name: localstorage
+        ephemeral:
+          volumeClaimTemplate:
+            metadata:
+              labels:
+                type: ephemeral-volume
+            spec:
+              accessModes:
+              - ReadWriteOnce
+              resources:
+                requests:
+                  storage: 100Gi
+              storageClassName: local-path
+      - name: configuration
+        emptyDir: {}
+      - name: configuration-template
+        configMap:
+          name: loader-golang-template
+          defaultMode: 0777
+          items:
+          - key: "config.yml.template"
+            path: "config.yml.template"
+          - key: "init-container-entrypoint.sh"
+            path: "init-container-entrypoint.sh"
+
+          - key: "logging-configuration.yml"
+            path: "logging-configuration.yml"
+
+      - name: loader-utils
+        configMap:
+          name: loader-utils
+          defaultMode: 0777
+          items:
+          - key: "pre-stop-idempotent.sh"
+            path: "pre-stop.sh"
+      - name: metadata-fetcher-credentials
+        secret:
+          secretName: metadata-fetcher-credentials
+          optional: true
+      - name: sentry-settings-for-celery-tasks
+        secret:
+          secretName: sentry-settings-for-celery-tasks
+          optional: true
+
+# if defined at the "typed" loader level
+# otherwise use the global image is defined First this needs to replace - in
+# $loader_type with "" to find the proper image name.
+---
+# Source: swh/templates/loaders/deployment.yaml
+apiVersion: apps/v1
+kind: Deployment
+metadata:
   name: loader-large-repository
   namespace: swh
   labels:
     app: loader-large-repository
 spec:
   revisionHistoryLimit: 2
   selector:
     matchLabels:
       app: loader-large-repository
   strategy:
     type: RollingUpdate
     rollingUpdate:
       maxSurge: 1
   template:
     metadata:
       labels:
         app: loader-large-repository
       annotations:
         # Force a rollout upgrade if the configuration changes
-        checksum/config: 4caca6b29b6c7c7c453ccc9bca153bc1f8944d1ff7917e5e84ae4e8cd912c905
+        checksum/config: e8442a6da2d17189a6872df6f82d31836a07e1fac6bb49dc8c1b28092d7909e2
     spec:
       affinity:
         nodeAffinity:
           requiredDuringSchedulingIgnoredDuringExecution:
             nodeSelectorTerms:
             - matchExpressions:
               - key: swh/loader
                 operator: In
                 values:
                 - "true"
@@ -3690,21 +4220,21 @@
   strategy:
     type: RollingUpdate
     rollingUpdate:
       maxSurge: 1
   template:
     metadata:
       labels:
         app: loader-pubdev
       annotations:
         # Force a rollout upgrade if the configuration changes
-        checksum/config: 4caca6b29b6c7c7c453ccc9bca153bc1f8944d1ff7917e5e84ae4e8cd912c905
+        checksum/config: e8442a6da2d17189a6872df6f82d31836a07e1fac6bb49dc8c1b28092d7909e2
     spec:
       affinity:
         nodeAffinity:
           requiredDuringSchedulingIgnoredDuringExecution:
             nodeSelectorTerms:
             - matchExpressions:
               - key: swh/loader
                 operator: In
                 values:
                 - "true"
@@ -3858,21 +4388,21 @@
   strategy:
     type: RollingUpdate
     rollingUpdate:
       maxSurge: 1
   template:
     metadata:
       labels:
         app: loader-save-code-now
       annotations:
         # Force a rollout upgrade if the configuration changes
-        checksum/config: 4caca6b29b6c7c7c453ccc9bca153bc1f8944d1ff7917e5e84ae4e8cd912c905
+        checksum/config: e8442a6da2d17189a6872df6f82d31836a07e1fac6bb49dc8c1b28092d7909e2
     spec:
       affinity:
         nodeAffinity:
           requiredDuringSchedulingIgnoredDuringExecution:
             nodeSelectorTerms:
             - matchExpressions:
               - key: swh/loader
                 operator: In
                 values:
                 - "true"
@@ -4287,20 +4817,78 @@
       vhostName: /                   # Optional. If not specified, use the vhost in the
                                      # `host` connection string. Alternatively, you can
                                      # use existing environment variables to read
                                      # configuration from: See details in "Parameter
                                      # list" section hostFromEnv: RABBITMQ_HOST%
 ---
 # Source: swh/templates/listers/keda-autoscaling.yaml
 apiVersion: keda.sh/v1alpha1
 kind: ScaledObject
 metadata:
+  name: lister-golang-operators
+  namespace: swh
+spec:
+  scaleTargetRef:
+    apiVersion:    apps/v1     # Optional. Default: apps/v1
+    kind:          Deployment  # Optional. Default: Deployment
+    # Mandatory. Must be in same namespace as ScaledObject
+    name:          lister-golang
+    # envSourceContainerName: {container-name} # Optional. Default:
+                                               # .spec.template.spec.containers[0]
+  pollingInterval:  30                         # Optional. Default: 30 seconds
+  cooldownPeriod:   3600                       # Optional. Default: 300 seconds
+  idleReplicaCount: 0                          # Optional. Must be less than
+                                               # minReplicaCount
+  minReplicaCount:  0
+  maxReplicaCount:  1
+  triggers:
+  - type: rabbitmq
+    authenticationRef:
+      name: amqp-authentication-lister-golang
+    metadata:
+      protocol: auto                 # Optional. Specifies protocol to use,
+                                     # either amqp or http, or auto to
+                                     # autodetect based on the `host` value.
+                                     # Default value is auto.
+      mode: QueueLength              # QueueLength to trigger on number of msgs in queue
+      excludeUnacknowledged: "false" # QueueLength should include unacked messages
+                                     # Implies "http" protocol is used
+      value: "1"
+      queueName: swh.lister.golang.tasks.FullGolangLister
+      vhostName: /                   # Optional. If not specified, use the vhost in the
+                                     # `host` connection string. Alternatively, you can
+                                     # use existing environment variables to read
+                                     # configuration from: See details in "Parameter
+                                     # list" section hostFromEnv: RABBITMQ_HOST%
+  - type: rabbitmq
+    authenticationRef:
+      name: amqp-authentication-lister-golang
+    metadata:
+      protocol: auto                 # Optional. Specifies protocol to use,
+                                     # either amqp or http, or auto to
+                                     # autodetect based on the `host` value.
+                                     # Default value is auto.
+      mode: QueueLength              # QueueLength to trigger on number of msgs in queue
+      excludeUnacknowledged: "false" # QueueLength should include unacked messages
+                                     # Implies "http" protocol is used
+      value: "1"
+      queueName: swh.lister.golang.tasks.IncrementalGolangLister
+      vhostName: /                   # Optional. If not specified, use the vhost in the
+                                     # `host` connection string. Alternatively, you can
+                                     # use existing environment variables to read
+                                     # configuration from: See details in "Parameter
+                                     # list" section hostFromEnv: RABBITMQ_HOST%
+---
+# Source: swh/templates/listers/keda-autoscaling.yaml
+apiVersion: keda.sh/v1alpha1
+kind: ScaledObject
+metadata:
   name: lister-pagure-operators
   namespace: swh
 spec:
   scaleTargetRef:
     apiVersion:    apps/v1     # Optional. Default: apps/v1
     kind:          Deployment  # Optional. Default: Deployment
     # Mandatory. Must be in same namespace as ScaledObject
     name:          lister-pagure
     # envSourceContainerName: {container-name} # Optional. Default:
                                                # .spec.template.spec.containers[0]
@@ -4555,20 +5143,56 @@
       excludeUnacknowledged: "false" # QueueLength should include unacked messages
                                      # Implies "http" protocol is used
       value: "10"
       queueName: swh.loader.cvs.tasks.LoadCvsRepository
       vhostName: /                   # Vhost to use for the connection
 ---
 # Source: swh/templates/loaders/keda-autoscaling.yaml
 apiVersion: keda.sh/v1alpha1
 kind: ScaledObject
 metadata:
+  name: loader-golang-operators
+  namespace: swh
+spec:
+  scaleTargetRef:
+    apiVersion:    apps/v1     # Optional. Default: apps/v1
+    kind:          Deployment  # Optional. Default: Deployment
+    # Mandatory. Must be in same namespace as ScaledObject
+    name:          loader-golang
+    # envSourceContainerName: {container-name} # Optional. Default:
+                                               # .spec.template.spec.containers[0]
+  pollingInterval:  30                         # Optional. Default: 30 seconds
+  cooldownPeriod:   300                        # Optional. Default: 300 seconds
+  idleReplicaCount: 0                          # Set to 0 to stop all the workers when there is
+                                               # no activity on the queue
+  minReplicaCount:  0
+  maxReplicaCount:  1
+  triggers:
+  - type: rabbitmq
+    authenticationRef:
+      name: amqp-authentication-loader-golang
+    metadata:
+      protocol: auto                 # Optional. Specifies protocol to use,
+                                     # either amqp or http, or auto to
+                                     # autodetect based on the `host` value.
+                                     # Default value is auto.
+      mode: QueueLength              # QueueLength to trigger on number of msgs in queue
+      excludeUnacknowledged: "false" # QueueLength should include unacked messages
+                                     # Implies "http" protocol is used
+      value: "10"
+      queueName: swh.loader.package.golang.tasks.LoadGolang
+      vhostName: /                   # Vhost to use for the connection
+---
+# Source: swh/templates/loaders/keda-autoscaling.yaml
+apiVersion: keda.sh/v1alpha1
+kind: ScaledObject
+metadata:
   name: loader-large-repository-operators
   namespace: swh
 spec:
   scaleTargetRef:
     apiVersion:    apps/v1     # Optional. Default: apps/v1
     kind:          Deployment  # Optional. Default: Deployment
     # Mandatory. Must be in same namespace as ScaledObject
     name:          loader-large-repository
     # envSourceContainerName: {container-name} # Optional. Default:
                                                # .spec.template.spec.containers[0]
@@ -4885,20 +5509,32 @@
 spec:
   secretTargetRef:
   - parameter: host            # "host" is required by the scalerObject trigger metadata
     name: common-secrets
     key: rabbitmq-http-host
 ---
 # Source: swh/templates/listers/keda-autoscaling.yaml
 apiVersion: keda.sh/v1alpha1
 kind: TriggerAuthentication
 metadata:
+  name: amqp-authentication-lister-golang
+  namespace: swh
+spec:
+  secretTargetRef:
+  - parameter: host            # "host" is required by the scalerObject trigger metadata
+    name: common-secrets
+    key: rabbitmq-http-host
+---
+# Source: swh/templates/listers/keda-autoscaling.yaml
+apiVersion: keda.sh/v1alpha1
+kind: TriggerAuthentication
+metadata:
   name: amqp-authentication-lister-pagure
   namespace: swh
 spec:
   secretTargetRef:
   - parameter: host            # "host" is required by the scalerObject trigger metadata
     name: common-secrets
     key: rabbitmq-http-host
 ---
 # Source: swh/templates/listers/keda-autoscaling.yaml
 apiVersion: keda.sh/v1alpha1
@@ -4977,20 +5613,32 @@
   namespace: swh
 spec:
   secretTargetRef:
   - parameter: host            # "host" is required by the scalerObject trigger metadata
     name: common-secrets
     key: rabbitmq-http-host
 ---
 # Source: swh/templates/loaders/keda-authentication.yaml
 apiVersion: keda.sh/v1alpha1
 kind: TriggerAuthentication
+metadata:
+  name: amqp-authentication-loader-golang
+  namespace: swh
+spec:
+  secretTargetRef:
+  - parameter: host            # "host" is required by the scalerObject trigger metadata
+    name: common-secrets
+    key: rabbitmq-http-host
+---
+# Source: swh/templates/loaders/keda-authentication.yaml
+apiVersion: keda.sh/v1alpha1
+kind: TriggerAuthentication
 metadata:
   name: amqp-authentication-loader-large-repository
   namespace: swh
 spec:
   secretTargetRef:
   - parameter: host            # "host" is required by the scalerObject trigger metadata
     name: common-secrets
     key: rabbitmq-http-host
 ---
 # Source: swh/templates/loaders/keda-authentication.yaml


------------- diff for swh/values/staging-cassandra.yaml -------------

No differences


------------- diff for swh/values/staging.yaml -------------

No differences
./helm-diff.sh cluster-configuration
[cluster-configuration] Comparing changes between branches production and staging-add-golang...
Switched to branch 'production'
Your branch is up to date with 'origin/production'.
[cluster-configuration] Generate config in production branch for cluster-configuration/values/admin.yaml...
[cluster-configuration] Generate config in production branch for cluster-configuration/values/archive-production-rke2.yaml...
[cluster-configuration] Generate config in production branch for cluster-configuration/values/archive-staging-rke2.yaml...
[cluster-configuration] Generate config in production branch for cluster-configuration/values/gitlab-production.yaml...
[cluster-configuration] Generate config in production branch for cluster-configuration/values/gitlab-staging.yaml...
[cluster-configuration] Generate config in production branch for cluster-configuration/values/rancher.yaml...
Switched to branch 'staging-add-golang'
[cluster-configuration] Generate config in staging-add-golang branch for cluster-configuration/values/admin.yaml...
[cluster-configuration] Generate config in staging-add-golang branch for cluster-configuration/values/archive-production-rke2.yaml...
[cluster-configuration] Generate config in staging-add-golang branch for cluster-configuration/values/archive-staging-rke2.yaml...
[cluster-configuration] Generate config in staging-add-golang branch for cluster-configuration/values/gitlab-production.yaml...
[cluster-configuration] Generate config in staging-add-golang branch for cluster-configuration/values/gitlab-staging.yaml...
[cluster-configuration] Generate config in staging-add-golang branch for cluster-configuration/values/rancher.yaml...


------------- diff for cluster-configuration/values/admin.yaml -------------

No differences


------------- diff for cluster-configuration/values/archive-production-rke2.yaml -------------

No differences


------------- diff for cluster-configuration/values/archive-staging-rke2.yaml -------------

No differences


------------- diff for cluster-configuration/values/gitlab-production.yaml -------------

No differences


------------- diff for cluster-configuration/values/gitlab-staging.yaml -------------

No differences


------------- diff for cluster-configuration/values/rancher.yaml -------------

No differences
cat helm-diff.sh >helm-diff
chmod a+x helm-diff

Merge request reports

Loading