Merge ~troyanov/maas:temporal-go-worker into maas:master
Status: | Merged |
---|---|
Approved by: | Anton Troyanov |
Approved revision: | c6b268dcfacd971773921250be8b0f0da14c7f44 |
Merge reported by: | MAAS Lander |
Merged at revision: | not available |
Proposed branch: | ~troyanov/maas:temporal-go-worker |
Merge into: | maas:master |
Diff against target: |
507 lines (+343/-4) 15 files modified
debian/extras/99-maas-agent-sudoers (+1/-0) debian/maas-agent.install (+3/-0) debian/maas-agent.maas-agent.service (+14/-0) debian/not-installed (+0/-3) debian/rules (+1/-0) snap/local/tree/bin/run-maas-agent (+6/-0) snap/local/tree/usr/share/maas/pebble/layers/003-maas-rack-layer.yaml (+5/-0) snap/snapcraft.yaml (+10/-0) src/maasagent/cmd/maas-agent/main.go (+65/-1) src/maasagent/internal/workflow/log/adapter.go (+45/-0) src/maasagent/internal/workflow/pool.go (+153/-0) src/maasserver/models/service.py (+2/-0) src/provisioningserver/rackdservices/external.py (+19/-0) src/provisioningserver/service_monitor.py (+9/-0) src/provisioningserver/tests/test_service_monitor.py (+10/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
MAAS Lander | Approve | ||
Christian Grabowski | Approve | ||
Review via email:
|
Commit message
feat(temporal): maas-agent with temporal worker
Add worker pool with control plane for dynamic registration of Temporal workers.
Add adapter for zerolog that allows usage of custom logger for Temporal client.
Add snap and deb packaging for maas-agent
Co-authored-by: Christian Grabowski <email address hidden>
Description of the change
Here are some examples:
1. I want to execute Workflow `CheckIP` for Task Queue `vlan-1`
`tctl --ad 10.0.0.62:5271 workflow run --taskqueue vlan-1 --workflow_type CheckIP --input '{"IPs"
Since I don't have any workers registered for that type of a Workflow and that Task Queue, nothing will happen.
2. I am triggering a *control plane* Workflow `AddWorker` on a Task Queue `amazed-asp` and pass parameter saying: I want to register new worker on a Task Queue `vlan-1` and ask that worker to register Workflow `CheckIP`
`tctl --ad 10.0.0.62:5271 workflow run --taskqueue amazed-asp --workflow_type AddWorker --input '{"TaskQueue"
3. Running command from 1 again will give me result:
```
Result:
Run Time: 1 seconds
Status: COMPLETED
Output: [{"IPs"
```
4. If I am not interested in having such Worker on certain host anymore, I simply execute `RemoveWorker` workflow with a Task Queue `amazed-asp` and that will remove the Worker completely. Note, you cannot unregister specific workflow from the worker.
`tctl --ad 10.0.0.62:5271 workflow run --taskqueue amazed-asp --workflow_type RemoveWorker --input '{"TaskQueue"
UNIT TESTS
-b temporal-go-worker lp:~troyanov/maas/+git/maas into -b master lp:~maas-committers/maas
STATUS: SUCCESS 13c8a2c1a128fa1 edf79064d7
COMMIT: 415a890a13ff725