-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow linking to containers not managed by the plugin #195
Comments
I thought linking already works also with external container names (and internal aliases). Is this not the case ? |
unless i'm doing something wrong, it doesn't. i get this error message:
and w/o looking at the code, my guess is the plugin is looking for the image configuration so it can be started. if you think we should just use the existing configuration elements and make the plugin smarter to check for an already running container if it can't find the image in the xml, that would work as well. |
Ah, ok. Good point, but this is more a bug than a missing feature. Any externally linked container (i.e. any container which is not in the realm of the plugin) should be assumed to be up and running and hence don't need to be considered when calculating the start order. |
hrm - how would you compare this w/ #73 b/c they are related in the sense that you want to reference something from an existing container. should that code be made smarter to check for a running image if it's not found in the plugin configuration or should we use separate tags? |
Yeah, you are right. Personally I think we shouldn't clutter the configuration namesspace to much, so I'm against having new tags without a super good reason ;-) Maybe we can really be that smart to (a) first check whether it's an internal container (that we already do) and if not (b) check if another container with this name is running and than use that one. If neither (a) nor (b) then --> error. What do you think ? |
sounds good to me! |
ok, then let's go this route and fix #73 in a similar way. I think we already have a If you like you can take it, otherwise I can go for it sometimes later (backlog is already quite long ;-) |
i'll take care of it - i need this for something else i'm doing so that will motivate me to get it done. |
Thanks a lot ! |
Any news on that one ? I want to cut a release on Friday and wonder whether it could be included. No pressure, though ;-P (really) |
unfortunately no, i'm still working on it - other things have gotten in the way. i will try and get it finished over the weekend. |
No hurry, there will always be a next release ;-P |
i started working on this and i've got a question...
what does that get us verse just creating an instead of the class in the mojo, like how the LogDispatcher is handled, and just working w/ it that way? one thing it seems to prevent is the ability to inject dependencies into the component itself - i will admit i'm not a fan of passing the worst case i figured i could just inject it w/ a setter at the start of the |
Yeah, you are right. The story behind
Of course ideally we would also have a The point about DockerAcess can not really be injected because the creation is a bit more complex than a simple constructor and needs mojo parameters, too, which not available if using injection. So we can't use Plexus alone. Moving it down is indeed no so nice (but on the other not so super problematic), we could either consider the setter approach you propose or some thread local stuff with static methods for getting to DockerAccess.
Altough DockerAccess is a bit lengthy, we could split it up into multiple DAOs (QueryDao, ImageDao, ...). The difference of a 'Service' is that it is on top of the DAO. Ideally we have a complete layer like Mojo -> Service -> Dao, so that no Mojo accesses the DockerAccess directly and mostly serves only as a (stupid) entry point. |
thanks for that explanation! it makes sense for shared state to be handled that way. i don't think a query service will need to share state, but i think it will probably be best to follow the component regardless. i think a setter method could be added to ok...i'll finish this and put together an initial pull request and we can review. i think what i have in mind should offer some good flexibility and also puts us in a good position to offer a |
…N objects This is related to #195 but also contains many other refactorings.
Externally running containers can be specified via their names in the <link> and <volume> section. They will be looked up after the plugin tried to resolve the dependencies internally. That way you can easily restart only the container you are working on right now and the dependencies will be picked up later. - pulled fine grained query methods out of DockerAccess into QueryService - added coarse grained list/inspect methods to DockerAccess - introduced model objects as proxies to JSON responses - refactored RunService to accept DocerAccess instance via 'initialize' method - allow linking/mounting from external containers - account for external data volume containers - extracted state information into it's own class - Use 'ServiceHub' as central access point for services Signed-off-by: Jae Gangemi <[email protected]>
fixed in 0.13.2 |
i thought i had seen an issue regarding this before, but perhaps it was for referencing volumes from other containers.
in any case, when starting a container via the plugin, i'd like to be able to link to an existing container that has been started via some other mechanism.
in an effort not to break existing configuration, my thought is to just add a new xml block to the run section:
thoughts? i'm open to different element names, etc.
The text was updated successfully, but these errors were encountered: