Comments (11)
Another recent idea is to define job dependencies in JobMetadata and do the automated ordering via topological sorting of the dependency graph.. Worth a discussion...
from bootique-job.
I'd say the most simple and straight-forward solution would be to add an extra option for --exec
command, which will trigger sequential execution. @andrus , you OK with this?
from bootique-job.
I don't think it even needs to be an option. It can be the default and only behavior.
from bootique-job.
from bootique-job.
you are right ... parallel execution is the default. Forgot about that (I only focused on the order of command line flags). So yeah, a "--serial" option is a good idea.
from bootique-job.
As discussed, we're going to add a notion of "job groups". A job group is a collection of jobs, which may (optionally) depend on each other and should be executed as a batch. The particular order of execution is going to be determined by Bootique based on the job group definition. Job group definition is basically a directed acyclic graph and may be represented in YAML in the following way:
jobs:
j1:
param1: x
param2: y
g1:
type: group
jobs:
j1:
dependsOn:
- j2
- j3
j2:
dependsOn:
- j3
Running a job group is similar to running a single job:
--exec -job=g1
Or --g1
, when we switch to using jobs as commands.
from bootique-job.
After taking a closer look at Jackson's deserialization possibilities, it looks like it's not possible to deserialize this kind of config natively. The reason being that Jackson can't "unflatten" j1's params. This would not be a problem if we used an explicit params
property, like:
jobs:
j1:
params:
param1: x
param2: y
As a bonus, this would also allow us to:
- Specify
params
for elements of a job group
jobs:
g1:
type: group
jobs:
j1:
params:
p1: x
p2: y
dependsOn:
- j2
- j3
j2:
dependsOn:
- j3
- Specify "default" dependencies for stand-alone jobs:
jobs:
j1:
params:
param1: x
param2: y
dependsOn:
- j2
- j3
- Combine (1) and (2) to provide "default" job configurations to make job group definitions more compact
@andrus , let me know your thoughts
from bootique-job.
let's do it. Please update the central UPGRADE.md so that the users are aware of this change
from bootique-job.
@andrus , our idea turns out to be really AWESOME! Can't stop generating ideas, my todo list is growing :) But even the basics that I've managed to implement today already solve Tony's problems with 14 yaml configs. See config example and ExecutionIT test in my recent commit.
from bootique-job.
@atomashpolskiy : I just added an upgrade note to https://github.com/bootique/bootique/blob/master/UPGRADE.md for this task with a note on 'jobPropertiesPrefix' removed property. If there's anything else we need to mention about upgrading existing job configs or code, let's add it as well.
from bootique-job.
Yep, one thing that immediately comes to mind is that params should be declared in params
section now. I'll add this info as soon as I have time
from bootique-job.
Related Issues (20)
- Job listeners are not notified when a job throws an exception
- Jobs with dependencies and job groups cause deadlocks on pool starvation HOT 3
- Job group to reuse the group dispatch thread when possible
- @SerialJob should be part of the Job metadata
- Reorg JobFuture hierarchy HOT 1
- Refactoring to classic module layout
- Upgrade Consul client to 1.5.3
- Unify job decoration approach
- Package reorg
- Add job dependencies to the JobMetadata
- Unify configuration of jobs and groups
- Distinguish between repeating and unique jobs in job graphs
- ExecCommand status reporting: "message: null"
- NPE during registry startup when a job with dependencies delcares params
- Refactor JobModule into two module classes within the same jar
- bootique-job: remove optional dependency on curator ZK client
- TriggerFactory should create a mutable parameters map
- Upgrade Spring to 5.3.34
- Jobs as lambdas
- Align job result API with Bootique "CommandOutcome"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootique-job.