Background
- To controll concurrency, lots of algorigthm services need to run in a separate taskqueue
- I’ve already implemenet our own DSL to support the fusion of algorithmic flows
- In go-sdk, a worker can only run in one taksqueue
- All services run on a k8s cluster
Difficulty
- One algorigthm serive per taskqueue.It need to start lots of different workers. It’s too much trouble to manage a dozen configurations and deployment manifests
- Similar to the above point, many predefined DSL workflows also need to run on a unique taskqueue
My design
Impletion our CRD controller in k8s.
Combine workflow related configuration and DSL into CRD.
Now, after we submit DSL or activity CRD , the CRD controller automatically create the worker deployment running on the assigned taskqueue.
CRD template:
name: TestWorkflow
workflowOptions:
taksqueue: test
concurrency: 3
replicas: 3
inputs:
- name: userid
template:
sequence:
- activity:
name: algo0
- activity:
name: algo1
arguments:
- userid
result: output1
- parallel:
- activity:
name: algo1
arguments:
- output1
result: output2
- activity:
expect:
op: and
val:
- key: output1
value: a
- key: output2
value: b
name: algo1
arguments:
- output1
- output2
Question
- Does anyone have a similar problem? How did you solve it?
- Is CRD a suitable solutions? Do you have any suggesetions?