vpg / disturb Goto Github PK
View Code? Open in Web Editor NEWDistributed Workflow Processor
License: MIT License
Distributed Workflow Processor
License: MIT License
Actually we have :
Services /
Services / TopicService
In future :
Topic /
Topic / TopicService
Check if all step have been ran then set the new workflow status.
If there is an error and the workflow is aborted, specify it too.
Because Disturb is currently ElasticSearch dependent, we need it in the CI env.
https://docs.travis-ci.com/user/database-setup/#ElasticSearch
Current :
{
"runingOn": "dev129-port",
"pid": 7220,
"status": "exited",
"startedAt": "2018-01-25 10:32:15",
"heartBeatAt": "2018-01-25 10:32:25",
"exitedAt": "2018-01-25 10:32:28",
"exitCode": 0
}
target :
{
"runingOn": "dev129-port",
"pid": 7220,
"status": "started",
"startedAt": "2018-01-25 10:32:15",
"heartBeatAt": "2018-01-25 10:32:25",
"history" : [
{
"startedAt": "2018-01-24 10:32:15",
"exitedAt": "2018-01-24 10:32:28",
"exitCode": 1
},
{
"startedAt": "2018-01-23 10:32:15",
"exitedAt": "2018-01-23 10:32:28",
"exitCode": 125
},
{
"startedAt": "2018-01-22 10:32:15",
"exitedAt": "2018-01-22 10:32:28",
"exitCode": 255
},
]
}
data: []
result: { ... }
proposition :
extend \Phalcon\Di to override get()
& set()
to deal w/ a disturbb prefix
Add try/catch block arround getStepInput and execute step method
Call function for generate a topic name in case of manager or task
We can set it into :
https://github.com/vpg/disturb/blob/poc/Library/Services/WorkflowManager.php#L36
To avoid collision if two workers are listening the same topic partition.
With #37 workers belonging to the same group consume their own message.
But when a consumer dies, some of its already processed messages are re-sent to another worker.
Before processing a message, we must check if it has not already been processed
More ... :
If for the current step there is no job to process, go to next step
https://github.com/vpg/disturb/blob/beta/Library/Workflow/ManagerWorker.php#L196
Manager log :
2018-01-31 02:32:13 [INFO] Step createOptionPrestation ack SUCCESS
2018-01-31 02:32:13 [INFO] Id jb-ad_1 is 'STARTED'
2018-01-31 02:32:13 [INFO] Workflow jb-ad_1 - Current Step status : SUCCESS
2018-01-31 02:32:13 [INFO] Nb job(s) to run for createPrestationTransport : 0
Here the WF is stuck...
jbourgeais@dev129-port:~/www/disturb/example:beta★
vendor/bin/disturb-manager start --workflow="Full/testWorkflowConfig.json" --ttl=10
2018-01-25 11:11:33 [INFO] Loading Workflow config from 'Full/testWorkflowConfig.json'
2018-01-25 11:11:33 [INFO] Loading Workflow config from 'Full/testWorkflowConfig.json'
2018-01-25 11:11:33 [INFO] Connecting to Elastic "vp-aix-elsdisturb01.aix.vpg.lan:9200"
2018-01-25 11:11:33 [INFO] Loading Workflow config from 'Full/testWorkflowConfig.json'
2018-01-25 11:11:33 [INFO] Loading Workflow config from 'Full/testWorkflowConfig.json'
2018-01-25 11:11:33 [INFO] Loading Workflow config from 'Full/testWorkflowConfig.json'
2018-01-25 11:11:33 [INFO] Loading Workflow config from 'Full/testWorkflowConfig.json'
2018-01-25 11:11:33 [INFO] Loading Workflow config from 'Full/testWorkflowConfig.json'
2018-01-25 11:11:33 [INFO] Setting consumer group to manager
2018-01-25 11:11:33 [INFO] Connecting to Elastic "vp-aix-elsdisturb01.aix.vpg.lan:9200"
2018-01-25 11:11:33 [INFO] Connecting to Elastic "vp-aix-elsdisturb01.aix.vpg.lan:9200"
2018-01-25 11:11:33 [INFO] Worker dev129-port-disturb-manager-test listening on 10.13.11.27,10.13.11.28,10.13.11.29:dev129-portdisturb-test-manager
Generic (Business-related on turbo side. ie: specific DTO for each step)
DTO context
We have in our composer.json a depency with elasticsearch. Even If we don't want using elastic, the package will be installed via composer.
The idea should be install only elastic lib if you use this adapter for your context storage.
(see example with this project : https://github.com/Superbalist/php-pubsub)
ex: getWorkflowStepList isset / empty .... key exist
adapt current code in Library directory to be ok with CS
in Library/Client, find a solution to merge the two classes (main difference is the fact bootstrap has been loaded or not)
Example :
Enter on step which needs args in input or output. Check at begin if output is not null, no need to execute step
it involves to switch from groovy to painless
workers are formerly coded to act like deamons.
Because of infra & monitoring considerations we should add them a TTL feature.
"steps" : [
{
"name" : "initLoading",
"code" : "initLoading"
}/*,
{
"name" : "checkInfraGroupLodging"
}*/
]
Workflow Config manage JSON & PHP adapter
Be able to identify worker
Monitoring heartbeat, etc.
Use infra monitoring softwares
Need to start workflow in client app easily
ElasticsearchAdapter : implement search
from /bin/disturb to Conf/DI.php to allow it to be used in Unit Test
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.