> Pls. see my comments below…
>
>>> Repositories (you'll need both) are located at [1] and [2].
>>>
>>> This POC follows Sinatra's approach to modular applications: each area
>>> of functionality is now encapsulated by a dedicated Sinatra
>>> application. The main application is assembled and started using rack
>>> (pls. see [3] and [4] correspondingly) via rackup fragments defined in
>>> each of the plugins, e.g. [5].
>>>
>>> The main application can be quite minimal, its main responsibility
>>> being assembling and launching of the whole application based on the
>>> config settings. We could, however, include the most commonly used
>>> modules in the main application code-base (as opposed to extracting
>>> each area of functionality into a dedicated gem).
>>>
>>> The benefits of such a break of the current codebase include ability
>>> to test modules in complete isolation from each other, no
>>> customization of Sinatra, and ability to use rack (which may come
>>> handy if we want to use other webservers).
>>>
>>> I have not tested this approach on Windows.
>>>
>>> Please let me know if you have comments, questions, suggestions, etc,
>>
>> That looks quite straightforward.
>>
>> I think we need to be able to draw a distinction between the APIs and
>> "providers" too, so we could ship the API in core (easy enough), but
>> then have a gem add a provider to say, the DNS API. We might need
>> something like the ModuleConfig or Foreman's plugin registration for
>> that backend piece.
>>
>> Many providers add additional dependencies (e.g. GSSAPI, rubyipmi) which
>> would be really valuable to separate into independent plugins. I'd like
>> to be able to install the DNS API (which might be in core) with the
>> virsh provider without needing the nsupdate_gss provider and its
>> Kerberos dependencies.
>
> Where, besides DNS, do you think we need plugins such as above? Would
> be useful to see a few various cases in order to derive a useful
> abstraction for this. I think the responsibility for loading
> providers, etc should reside with plugins themselves, for a variety of
> reasons and we could keep the api for smart-proxy modules and
> providers separate.
The Puppet run API is currently part of the "puppet" feature (which also
does class/env imports) and has a number of providers that depend on
external tools like MCollective, Salt and SSH. These make sense as
separate plugins to me, with packages that depend on the appropriate
package/binary.
Potentially the BMC API, which is mostly the freeipmi/ipmitool
implementation and a second shell one. I think this could be made a
sub-package, but I can foresee non-IPMI based implementations.
Potentially the DHCP API, which might get providers to other DHCP
implementations like Bluecat devices or something.
>> We should also consider making versions a first class bit of each API,
>> as versioning of a core plus plugins is going to get more complex after
>> this change. Would it make sense for each API to expose its own version
>> route, which might contain various data, or for a single proxy-wide
>> route (like /features)? I'm coming back to the idea of an explicit
>> plugin registration again I think.
>
> Not sure about /features route. I think we can rely on REST discovery
> to enumerate available features (and get their metadata, such as
> versioning). This would require changes on both foreman and
> smart-proxy sides, however. It would look something like:
>
> - Foreman, on startup (periodically? we can cache response data
> together with ETAG) queries the smart-proxy API entry point: GET
> http://smart-proxy/
> - Smart-proxy replies with something like:
> {
> "dns": { "href": "http://…/dns", "rel": "http://…/dns_api" },
> "dhcp": {},
> …
> }
> - Foreman then parser the reply and (re)configures itself appropriately.
>
> Such a change would probably be better carried as a standalone step,
> as it can be quite disruptive.
Sounds good to me.
>> There will be some packaging work to complete this, which should just be
>> a case of releasing gems and packaging like we do with other plugins.
>
> Yep.
>
>>
>> I can imagine us making some APIs and providers plugins in order to
>> remove dependencies from the smart proxy core (i.e. Puppet), but still
>> shipping them in our main repos. Either that, or splitting them up
>> inside the smart-proxy repo (like a Rails engine stored within the main
>> app repo) but then still mounting them as plugins, and shipping
>> foreman-proxy subpackages.
>
> It would probably make sense to include the most commonly used
> features together with smart-proxy. They still can be implemented as
> plugins, but will reside together with the proxy code (trying to
> simplify packaging/install here).
Indeed, I think retaining the primary APIs for things like DHCP, DNS,
Puppet in core makes sense, since they would form a bare minimum
implementation that Foreman requires from the proxy anyway.
···
On 20/03/14 15:09, Dmitri Dolguikh wrote:
> On Thu, Mar 20, 2014 at 1:01 PM, Dominic Cleal wrote:
>> On 20/03/14 12:22, Dmitri Dolguikh wrote:
–
Dominic Cleal
Red Hat Engineering