The workers on demand chart

This chart deploys a configuration for DBOS master, this configuration contains the list of on demand workers and their tasks and some execution contexts. Execution contexts are essentially Kubernetes job templates, they allow to choose the resource limits for each task independently or any custom Kubernetes job configuration you need.

Read the ‘on demand’ workers section for more details. Here is an example of a ‘values.yml’ file you could use in the command below :

global:
  target: k8s # k8s or okd
  imagestream: false
  imageRegistry: dbos-registry.decisionbrain.cloud
  imagePullSecrets:
    - name: dbos-registry.decisionbrain.cloud
  project: "cpo-wod"
  businessUnit: "IT"

refreshWod:
  failureHandling:
    #backoffLimit: 4 #https://kubernetes.io/docs/concepts/workloads/controllers/job/#pod-backoff-failure-policy
    activeDeadlineSeconds: 60 #https://kubernetes.io/docs/concepts/workloads/controllers/job/#job-termination-and-cleanup

workers:
  - image: "cplex-registry.decisionbrain.cloud/dbos/dbos-cplex-cpo-worker:3.4.1"
    defaultExecutionContext: small
    tasks:
      - id: CplexTask
        executionContexts:
          - small
          - medium
        defaultExecutionContext: small
      - id: CpoTask
        executionContexts:
          - small
        defaultExecutionContext: small
executionContexts:
  templates:
    small:
      enabled: true
      config:
        name: dbos-cplex-cpo-wod
        imagePullPolicy: IfNotPresent
        activeDeadlineSeconds: 3600 #max time between job creation and forced Termination (either if the pod is Running or Pending)
        restartPolicy: Never
        resources:
          limits:
            memory: 256Mi
          requests:
            cpu: 100m
            memory: 256Mi
      env:
        - name: JAVA_TOOL_OPTIONS
          #          value: -XX:+CrashOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/cplex-cpo-wod-heap-dump.hprof
          value: -XX:+UseParallelGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
        - name: SPRING_RABBITMQ_HOST
          value: "{{ $.Values.rabbitmq.config.name }}"
        - name: SPRING_RABBITMQ_USERNAME
          valueFrom:
            secretKeyRef:
              name: rabbitmq
              key: rabbitmq-root-username
        - name: SPRING_RABBITMQ_PASSWORD
          valueFrom:
            secretKeyRef:
              name: rabbitmq
              key: rabbitmq-root-password
        - name: MASTER_URL
          value: "http://{{ $.Values.master.config.name }}:8080/"
        - name: MASTER_JWTKEY
          valueFrom:
            secretKeyRef:
              key: master-secret-jwtkey
              name: dbos-master
    medium:
      enabled: true
      config:
        name: dbos-cplex-cpo-wod
        imagePullPolicy: IfNotPresent
        activeDeadlineSeconds: 3600 #max time between job creation and forced Termination (either if the pod is Running or Pending)
        restartPolicy: Never
        resources:
          limits:
            memory: 256Mi
          requests:
            cpu: 100m
            memory: 256Mi
      env:
        - name: JAVA_TOOL_OPTIONS
          #          value: -XX:+CrashOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/cplex-cpo-wod-heap-dump.hprof
          value: -XX:+UseParallelGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
        - name: SPRING_RABBITMQ_HOST
          value: "{{ $.Values.rabbitmq.config.name }}"
        - name: SPRING_RABBITMQ_USERNAME
          valueFrom:
            secretKeyRef:
              name: rabbitmq
              key: rabbitmq-root-username
        - name: SPRING_RABBITMQ_PASSWORD
          valueFrom:
            secretKeyRef:
              name: rabbitmq
              key: rabbitmq-root-password
        - name: MASTER_URL
          value: "http://{{ $.Values.master.config.name }}:8080/"
        - name: MASTER_JWTKEY
          valueFrom:
            secretKeyRef:
              key: master-secret-jwtkey
              name: dbos-master

This creates a ConfigMap with the name

  • ‘wod-register-request-(namespace)’

with the worker :

  • cplex-registry.decisionbrain.cloud/dbos/dbos-cplex-cpo-worker:3.4.1

and the execution contexts:

  • small
  • medium

Then the chart forces the DBOS master to load the ConfigMap. The chart assumes the DBOS master host is ‘dbos-master’ and listens at port 8080. If you want to change these default values, you can override them with the values.yaml file:

global:
...
urlRefresh: http://<my-other-host>:<my-other-port>
master:
  config:
    name: <my-other-host>

Deployment

First installation

Use the command:

helm install dbos-workers-on-demand ./dbos-workers-on-demand -f values.yaml

Or

helm install dbos-workers-on-demand decisionbrain/dbos-workers-on-demand --version 3.4.1 -f values.yaml

If you added the DecisionBrain Helm registry

Update

Use the command:

helm upgrade dbos-workers-on-demand ./dbos-workers-on-demand -f values.yaml

Or

helm upgrade dbos-workers-on-demand decisionbrain/dbos-workers-on-demand --version 3.4.1 -f values.yaml

If you added the DecisionBrain Helm registry