arquillian / arquillian-cube

Control (docker, kubernetes, openshift) containers in your tests with ease!
http://arquillian.org/arquillian-cube/
120 stars 98 forks source link

Add support for influencing the AutoStart order via SPI #276

Closed aslakknutsen closed 8 years ago

aslakknutsen commented 8 years ago

When working with Q I came across a need to influence the default sort order.

Server A -> Server B

Now the proxy is installed as: P -> A (proxied route for external bount port) P -> B (proxied route for communication with Server B) Server A -> P (updated Server A link to reoute via proxy)

P can't link to both Server A and B so it needs to communicate with them via IP directly. The problem then is that the sort alg see P as having no links, and end on the same level as Server B since needs to be started before Server A. But P needs to setup a route to Server B when B is started so when A starts it's all ready. When P and B start at the same time, it's a bit random if P is availble to setup the route when B starts.

Some SPI to influence the order and force P to start first in it's own Step could be a fix.

aslakknutsen commented 8 years ago

Come to think of it, I can workaround it by adding a 'syntetic' link from A -> P and B -> P, even tho it's never used it would force the order to be correct.

lordofthejars commented 8 years ago

humm thinks starting to get complicated :)

smiklosovic commented 8 years ago

I have got similar problem while I was extracting that whole Cube runtime into completely standalone / Arquillian-less usage because even I can fire Create/StartCube events on my own, since I am outside of Arquillian lifecycle and I have a container which links to other three, I had to make sure that the other three are fully started before the fourth one is about to start which will link to them (= I will fire events for it). I can not expect that Cube will deal with this because I am basically not using it.

I wrote quite a robust API for this which is quite sexy to use, I wrote an abstraction of a container service which has some precedence and my eventing logic sorts these services according to precedence and the service with lowest precedence is started as the last one and in case services have the same precedence, its starting order is random.

aslakknutsen commented 8 years ago

Show us your sexy beast! :)

lordofthejars commented 8 years ago

And even better let s add it in containerless and core :) El 6/2/2016 10:31 a. m., "Aslak Knutsen" notifications@github.com escribió:

Show us your sexy beast! :)

— Reply to this email directly or view it on GitHub https://github.com/arquillian/arquillian-cube/issues/276#issuecomment-180725970 .

smiklosovic commented 8 years ago

I am afraid I will not be able to disclose it as it is technically the intellectual property of the company I am currently working for. Believe me I would be the very first one who would show it to you if possible.

But yeah, that is the solution I did and it serves my needs pretty well. In connection with Spacelift Gradle plugin, whole orchestration of the testing platform is no-brainer. I do not know why but I have always found myself excited about the automatization stuff. Cube is kickass extension which enables me to do it :)

lordofthejars commented 8 years ago

when you say influencing, you mean that you might be able to configure some configuration attribute to set your own autostart strategy or you want to configure it during test execution programmatically?