Cloud plugin, provisioning

35 views
Skip to first unread message

Stanislav Baiduzhyi

unread,
Sep 6, 2015, 2:55:18 PM9/6/15
to jenkin...@googlegroups.com
Hi All,

Quick question: writing cloud plugin, provisioning is called more than
once for the same label, but I have only one node to provision, should
I return the same instance once again, or should I return empty list
and Jenkins will reuse the node that was returned on first request?

Stephen Connolly

unread,
Sep 7, 2015, 4:21:23 AM9/7/15
to jenkin...@googlegroups.com
Once you've handed out the node you are not supposed to hand it out again until it has been deprovisioned. If you have no more nodes to provision then return empty list so that additional clouds have a chance to contribute.

Also good luck, there is no "correct" implementation of the Jenkins Cloud API. I argue that in its current form it is impossible to have a correct implementation.

The following are, in order of correctness, the know "not too bad" cloud implementations:

* operations-center-cloud (sorry closed source)
* nectar-vmware (sorry closed source)
* docker (yeah! open source... OTOH early versions of this were bad. I'm not sure if KS has merged his pull request making it "not too bad" yet, so check with KS as to whether to look at his PR or the master branch)
* mansion-cloud (open source, but we are hitting the lower limit of "not too bad")

Everything else has either race conditions that could well cause deadlock or improper behaviour (e.g. resource leaks, etc) and certainly should not be used as an example of what to do... generally the issues in these cloud plugins are subtle, but if you follow them too much you will be stuck in a design that is difficult to work your way to something "not too bad"

HTH

-Stephen 


--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAFHiie5GcKQ9LU72K07y4OFcL3ZDSJQcWf7FiS2oEfRNwCnx3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Stanislav Baiduzhyi

unread,
Sep 7, 2015, 5:07:41 AM9/7/15
to jenkin...@googlegroups.com
Hi Stephen,

On Mon, Sep 7, 2015 at 10:21 AM, Stephen Connolly
<stephen.al...@gmail.com> wrote:
> Once you've handed out the node you are not supposed to hand it out again
> until it has been deprovisioned. If you have no more nodes to provision then
> return empty list so that additional clouds have a chance to contribute.

I see, thanx.

> Everything else has either race conditions that could well cause deadlock or
> improper behaviour (e.g. resource leaks, etc) and certainly should not be
> used as an example of what to do... generally the issues in these cloud
> plugins are subtle, but if you follow them too much you will be stuck in a
> design that is difficult to work your way to something "not too bad"

That sounds quite pessimistic. But thanx for heads up, now I know what
to watch for in my own plugin.

Stephen Connolly

unread,
Sep 7, 2015, 11:38:09 AM9/7/15
to jenkin...@googlegroups.com
Actually I am an optimist... especially with my description... if I were a pessimist I wouldn't even think there was one "not too bad" implementation ;-)
 
But thanx for heads up, now I know what
to watch for in my own plugin.
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages