-
Notifications
You must be signed in to change notification settings - Fork 127
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
[ProcessContainers] Runtime configurable containers #1723
Conversation
WARNING: A Blackduck scan failure has been waivedA prior failure has been upvoted
|
125e8a2
to
b47f000
Compare
fe92f55
to
41ba5b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you are on a deserved holiday, oke to merge and will pick the comment up in a next cycle ?
virtual void Deinitialize()= 0; | ||
|
||
// Creates a new container | ||
virtual Core::ProxyType<IContainer> Container(const string& id, IStringIterator& searchPaths, const string& logPath, const string& configuration) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are working everywhere with Interface pointers everywhere, why are we now using a proxyType around the interface (at the end we can put it in a ProxyTypeContainer, but for the interface it makes it more depending on Thunder features) Can we not simply retunr a IContainer here ?
} | ||
|
||
public: | ||
Core::ProxyType<IContainer> Container(const IContainer::containertype type, const string& id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the explicit public Container call, here on 69, not also emplacing the container in the _containers list ? It looks like it is done by calling (from the real implementation line 64 ?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind figured it out. It is all due to the automatic lifetime management from the ProxyListType<>... If that the administrator holds the last reference it drops the container. Correct ?
~ContainerProducerRegistrationType() | ||
{ | ||
ContainerAdministrator::Instance().Revoke(CONTAINERTYPE); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not have in this class, the PRODUCER an aggregated member and than announce (CONTAINERTYPE, IContainerProducer& _Producer); Saves you a list with autopointers and new in the administrator and lifetime is guaranteed aligned with the Announce and Revoke.
It is my allergy to visible "new" 's and std::unique_ptr that triggered this deep dive ;-) and potential simple fix to avoid them..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wil pick up the remarks in the next round. Sebas is on holiday now..
Container runtime is selectable via enum string "lxc", "runc", "crun", "dobby", "awc" in root/configuration/containertype. LXC is the default.
/etc/Thunder/plugins/Messenger.json
Each container runtime has separate configuration that is passed to its Initialize(config) method. Initialize() and Deinitialize() replace system-wide Logging() call. Container system configuration has been moved from COM to the runtime implementation (it was specific to LXC). Each runtime can define its own configuration, if any.
/etc/Thunder/config.json
The runtime implementations are registering themselves in ContainerAdminstrator via static initialization.
The previously singleton "administrators" of each implementation are turned into producers that create IContainer concrete objects for the ContainerAdminstrator (i.e. the a factory). The BaseAdministrator common codeis removed as the functionality has been taken over by the factory. The ContainerAdminstrator holds the live containers in a ProxyList.
This solution requires southbound interface changes. LXC and runC implementations are adapted along.