Reputation: 83255
I have a very lightweight job that should be executed immediately when it is triggered, rather than waiting an hours for current jobs to finish.
As I understand, a flyweight task is what I want. It will create a ephemeral executor, just for that task.
How can I make a job be run as flyweight?
Upvotes: 7
Views: 1856
Reputation: 161
I have recently had the same problem. My company has a lot of jenkins projects and some have more precedence over others, and we limit the number of executors to only 4.
Therefore, we decided to create some slaves, instead of always building on the master. Create a slave node that only builds your "very lightweight job".
Go to Manage Jenkin -> Manage nodes -> New node -> Dumb slave
.
Then configure your slave node to your liking. Now configure the "very lightweight job". Make sure that This build is parameter
is checked, then Add parameter -> Node
.
Then select the slave node that you just created. There are a lot of configurations, such as which node do you want to default, but I think you can customize that to your liking.
Upvotes: 2
Reputation: 212
Try out this FlyWeightProject Plugin. It is an extension of the Freestyle type that runs in Flyweight.
Upvotes: 0
Reputation: 14762
AFAIU the issue is that all your executors are occupied when it comes to running this high priority job.
What about:
Another possibility is to:
Restrict where the high priority job can be run to the new node
This avoids having to create and assign labels to all jobs, as mentioned above, but is less flexible for future adaptions and extensions.
Upvotes: 0