Backend to schedule Bakta jobs on a Kubernetes cluster.
The Bakta-Web backend implements a simple job scheduling system for the Bakta-Web UI. It requires an S3 compatible object storage and a Kubernetes cluster with Argo Workflows to run the jobs. Jobs can be submitted via the API.
The corresponding repositories can be found here:
- S3-compatible object storage
- Kubernetes cluster
- Argo Workflows
Required workflow templates:
- V1:
bakta-job-{BAKTA_VERSION} - V2:
bakta-job-{BAKTA_VERSION} - V2:
bakta-proteins-job-{BAKTA_VERSION} - V2:
bakta-baktfold-job-{BAKTA_VERSION}-{BAKTFOLD_VERSION} - V2:
baktfold-job-{BAKTFOLD_VERSION}
The container accepts the following settings via env-vars or .env:
SOCKET_ADDR=127.0.0.1:8080METRICS_SOCKET_ADDR=127.0.0.1:9090ARGO_TOKEN=tokenARGO_URL=https://argo.example.comARGO_NAMESPACE=argoS3_ACCESS_KEY=access_keyS3_SECRET_KEY=secret_keyS3_BUCKET=bucketS3_ENDPOINT=https://s3.example.comBAKTA_VERSION=0.1.0DATABASE_VERSION=0.1.0BAKTFOLD_VERSION=0.1.0BAKTFOLD_DATABASE_VERSION=0.1.0BACKEND_VERSION=1.1.0KUBERNETES_API_URL=https://127.0.0.1:6443(only outside a pod; in a pod the service variables are used)KUBERNETES_CA_FILE=/path/to/ca.crt(optional)STATS_DATABASE_URL=postgres://...(optional)MANAGE_LEGACY_PRODUCTION_WORKFLOWS=false(optional, defaultfalse). Only for staging while production still runs the old backend. Switch it off on staging before or together with the production upgrade to this version, otherwise both backends own the unlabelled production workflows. See "Operator note" indocs/admin-api.md.
Notes:
SOCKET_ADDRis the public API listener.METRICS_SOCKET_ADDRis a separate private listener exposing only/metrics.- Swagger UI is available on the public listener at
/swagger-ui. GET /readyon the public listener answers503until the first workflow list was applied and the completed workflows were reconciled, and while the statistics database (when configured) does not answer, then200. Use it as the readiness probe.- The backend watches the Argo workflows through the Kubernetes API with
ARGO_TOKEN. Its service account needsget,listandwatchonworkflows.argoproj.ioinARGO_NAMESPACE. - With
STATS_DATABASE_URL, finished jobs are served from the database: status, results, logs and delete work for them as before, with the job secret checked against a stored hash. Without it, finished jobs are kept in memory for 35 days. Seedocs/admin-api.md, section "Workflow watch".