You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwhisk.apache.org by japhar81 <ja...@gmail.com> on 2018/08/10 16:35:11 UTC
Pluggable API Gateways
This is a follow-up to a Slack conversation with @dragos.dascalita and
@csantanapr. As I've been struggling to stand up the API Gateway for
OpenWhisk, it occurred to me that I would actually prefer to use a
different GW entirely. In my case, Traefik fits nicely in one spot, and
Istio integration would be very handy in another.
I'm happy to implement both, but the current state makes it hard to
contribute. A couple options and opinions came out of our discussion that
could use more input;
1. Splitting the routemgt stuff out of incubator-openwhisk either into
openwhisk-apigateway or the cli repo. My preference is a dedicated repo, as
it makes more sense from a new users' POV -- I had a rough time getting
things to work and it was unclear in the current structure.
2. We can either ship APIGW+routemgt combos for each implementation, or
we can potentially make the api commands in wsk a plugin, shipping an APIGW
+ a wsk cli plugin to match.
My personal opinion is this; if the APIGW is optional, the routemgt actions
must be as well -- one is pointless without the other. They're also tightly
coupled to the specific implementation. As such, I would suggest that both
pieces move to their own repo, with a folder for each implementation, as
well as deployment docs for all things APIGW in the same place.
Thoughts/comments welcome!
Thanks,
Henry
Re: Pluggable API Gateways
Posted by Dascalita Dragos <dd...@gmail.com>.
I’d +1 Rodric’s suggestion with subdirs until we group a few implementation
together in the repo, and decide at that point on splitting into separate
repos or not.
On Fri, Aug 10, 2018 at 10:48 PM Rodric Rabbah <ro...@gmail.com> wrote:
> > One possibility would be to create a layer that sits in between Whisk
> > "proper" and a given gateway implementation that knows how to take a
> common
> > set of directives and translate them into whatever DSL the target gateway
> > understands.
>
> Isn’t this what the route management package does, with the canonical
> input as swagger and the wsk cli for APIs?
>
> -r
Re: Pluggable API Gateways
Posted by Rodric Rabbah <ro...@gmail.com>.
> One possibility would be to create a layer that sits in between Whisk
> "proper" and a given gateway implementation that knows how to take a common
> set of directives and translate them into whatever DSL the target gateway
> understands.
Isn’t this what the route management package does, with the canonical input as swagger and the wsk cli for APIs?
-r
Re: Pluggable API Gateways
Posted by Matt Hamann <ma...@gmail.com>.
Great discussion. I wholeheartedly agree with the notion of making gateways
pluggable. It's a fairly complex issue, given the various differences in
each gateway implementation, whether it be feature parity or even the way
each feature is implemented.
One possibility would be to create a layer that sits in between Whisk
"proper" and a given gateway implementation that knows how to take a common
set of directives and translate them into whatever DSL the target gateway
understands. One could conceivably even use this to target 3rd-party cloud
gateways like AWS, Azure, IBM, etc. That way, Whisk only needs to maintain
one repo containing the translation layer, while Whisk adopters can deploy
their gateways of choice.
At a surface level, I'd liken this to something akin to Terraform or
Ansible, where a somewhat common set of directives can be used to target
any number of cloud providers.
On a potentially controversial note, the OpenResty gateway could continue
to be the "officially" packaged gateway implementation for Whisk unless we
collectively see a reason to use something else. I do think we should have
an opinion.
-Matt
matthew.hamann@gmail.com
On Fri, Aug 10, 2018 at 9:25 PM japhar81 <ja...@gmail.com> wrote:
> I was in the midst of doing that, but the immediate snag is travis -- it
> doesn't support a separate travis.yml per subdirectory (
> https://github.com/travis-ci/travis-ci/issues/3540) and the mess it
> created
> to try and matrix subdirectories and languages is just a huge fail. For
> instance, my current hack of traefik is a node.js app, adding that in made
> the config so unreadable I couldn't PR it with a clean conscience. Add a
> few more gateways in a few more languages, and it'll be an unmaintainable
> mess..
>
> On Fri, Aug 10, 2018 at 9:21 PM Rodric Rabbah <ro...@gmail.com> wrote:
>
> > What about subdirectories instead of repos? I admit not having thought
> too
> > deeply about this yet but I find that we have too many repos and
> generally
> > makes things harder to work across many components.
> >
> > -r
> >
> > > On Aug 10, 2018, at 9:17 PM, japhar81 <ja...@gmail.com> wrote:
> > >
> > > As I started poking at incubator-openwhisk-apigateway, it may be
> > preferable
> > > to make this a repo that just holds documentation and ansible scripts,
> > and
> > > each apigateway is a submodule. For instance the current gateway would
> > move
> > > to incubator-openwhisk-apigateway-openresty or something along those
> > lines.
> > > Then we could add incubator-openwhisk-apigateway-traefik, etc. This
> would
> > > mean easier maintenance, simpler travis configs, etc. I see lots of
> > upside
> > > and no real downside. Obviously I don't have rights to do this myself,
> > but
> > > Id be curious if you folks agree, and if someone with enough github
> > rights
> > > might be willing to help me get it done..
> > >
> > >> On Fri, Aug 10, 2018 at 8:24 PM japhar81 <ja...@gmail.com> wrote:
> > >>
> > >> I completely agree, it's model is a bit rigid -- I'm happy to take on
> > that
> > >> work as well, though it might take me a bit, I've just started playing
> > with
> > >> golang. Regardless, I do think it should come as a follow-on effort,
> > with
> > >> the current model being the first plugin we build -- which will
> > >> coincidentally work against at least the current gateway and the
> traefik
> > >> one I'm trying to implement.
> > >>
> > >>> On Fri, Aug 10, 2018 at 8:21 PM Rodric Rabbah <ro...@gmail.com>
> > wrote:
> > >>>
> > >>> My point about the cli is that current implementation is
> unnecessarily
> > >>> opinionated and while you can work with it, it’s just not necessary
> to
> > have
> > >>> to fit into its current model. I opened several issues to try to
> > address
> > >>> these shortcomings. It is absolutely true that this can be viewed
> > >>> separately from consolidating the route management package with its
> > >>> gateway.
> > >>>
> > >>> -r
> > >>
> > >>
> >
>
Re: Pluggable API Gateways
Posted by japhar81 <ja...@gmail.com>.
I was in the midst of doing that, but the immediate snag is travis -- it
doesn't support a separate travis.yml per subdirectory (
https://github.com/travis-ci/travis-ci/issues/3540) and the mess it created
to try and matrix subdirectories and languages is just a huge fail. For
instance, my current hack of traefik is a node.js app, adding that in made
the config so unreadable I couldn't PR it with a clean conscience. Add a
few more gateways in a few more languages, and it'll be an unmaintainable
mess..
On Fri, Aug 10, 2018 at 9:21 PM Rodric Rabbah <ro...@gmail.com> wrote:
> What about subdirectories instead of repos? I admit not having thought too
> deeply about this yet but I find that we have too many repos and generally
> makes things harder to work across many components.
>
> -r
>
> > On Aug 10, 2018, at 9:17 PM, japhar81 <ja...@gmail.com> wrote:
> >
> > As I started poking at incubator-openwhisk-apigateway, it may be
> preferable
> > to make this a repo that just holds documentation and ansible scripts,
> and
> > each apigateway is a submodule. For instance the current gateway would
> move
> > to incubator-openwhisk-apigateway-openresty or something along those
> lines.
> > Then we could add incubator-openwhisk-apigateway-traefik, etc. This would
> > mean easier maintenance, simpler travis configs, etc. I see lots of
> upside
> > and no real downside. Obviously I don't have rights to do this myself,
> but
> > Id be curious if you folks agree, and if someone with enough github
> rights
> > might be willing to help me get it done..
> >
> >> On Fri, Aug 10, 2018 at 8:24 PM japhar81 <ja...@gmail.com> wrote:
> >>
> >> I completely agree, it's model is a bit rigid -- I'm happy to take on
> that
> >> work as well, though it might take me a bit, I've just started playing
> with
> >> golang. Regardless, I do think it should come as a follow-on effort,
> with
> >> the current model being the first plugin we build -- which will
> >> coincidentally work against at least the current gateway and the traefik
> >> one I'm trying to implement.
> >>
> >>> On Fri, Aug 10, 2018 at 8:21 PM Rodric Rabbah <ro...@gmail.com>
> wrote:
> >>>
> >>> My point about the cli is that current implementation is unnecessarily
> >>> opinionated and while you can work with it, it’s just not necessary to
> have
> >>> to fit into its current model. I opened several issues to try to
> address
> >>> these shortcomings. It is absolutely true that this can be viewed
> >>> separately from consolidating the route management package with its
> >>> gateway.
> >>>
> >>> -r
> >>
> >>
>
Re: Pluggable API Gateways
Posted by Rodric Rabbah <ro...@gmail.com>.
What about subdirectories instead of repos? I admit not having thought too deeply about this yet but I find that we have too many repos and generally makes things harder to work across many components.
-r
> On Aug 10, 2018, at 9:17 PM, japhar81 <ja...@gmail.com> wrote:
>
> As I started poking at incubator-openwhisk-apigateway, it may be preferable
> to make this a repo that just holds documentation and ansible scripts, and
> each apigateway is a submodule. For instance the current gateway would move
> to incubator-openwhisk-apigateway-openresty or something along those lines.
> Then we could add incubator-openwhisk-apigateway-traefik, etc. This would
> mean easier maintenance, simpler travis configs, etc. I see lots of upside
> and no real downside. Obviously I don't have rights to do this myself, but
> Id be curious if you folks agree, and if someone with enough github rights
> might be willing to help me get it done..
>
>> On Fri, Aug 10, 2018 at 8:24 PM japhar81 <ja...@gmail.com> wrote:
>>
>> I completely agree, it's model is a bit rigid -- I'm happy to take on that
>> work as well, though it might take me a bit, I've just started playing with
>> golang. Regardless, I do think it should come as a follow-on effort, with
>> the current model being the first plugin we build -- which will
>> coincidentally work against at least the current gateway and the traefik
>> one I'm trying to implement.
>>
>>> On Fri, Aug 10, 2018 at 8:21 PM Rodric Rabbah <ro...@gmail.com> wrote:
>>>
>>> My point about the cli is that current implementation is unnecessarily
>>> opinionated and while you can work with it, it’s just not necessary to have
>>> to fit into its current model. I opened several issues to try to address
>>> these shortcomings. It is absolutely true that this can be viewed
>>> separately from consolidating the route management package with its
>>> gateway.
>>>
>>> -r
>>
>>
Re: Pluggable API Gateways
Posted by japhar81 <ja...@gmail.com>.
As I started poking at incubator-openwhisk-apigateway, it may be preferable
to make this a repo that just holds documentation and ansible scripts, and
each apigateway is a submodule. For instance the current gateway would move
to incubator-openwhisk-apigateway-openresty or something along those lines.
Then we could add incubator-openwhisk-apigateway-traefik, etc. This would
mean easier maintenance, simpler travis configs, etc. I see lots of upside
and no real downside. Obviously I don't have rights to do this myself, but
Id be curious if you folks agree, and if someone with enough github rights
might be willing to help me get it done..
On Fri, Aug 10, 2018 at 8:24 PM japhar81 <ja...@gmail.com> wrote:
> I completely agree, it's model is a bit rigid -- I'm happy to take on that
> work as well, though it might take me a bit, I've just started playing with
> golang. Regardless, I do think it should come as a follow-on effort, with
> the current model being the first plugin we build -- which will
> coincidentally work against at least the current gateway and the traefik
> one I'm trying to implement.
>
> On Fri, Aug 10, 2018 at 8:21 PM Rodric Rabbah <ro...@gmail.com> wrote:
>
>> My point about the cli is that current implementation is unnecessarily
>> opinionated and while you can work with it, it’s just not necessary to have
>> to fit into its current model. I opened several issues to try to address
>> these shortcomings. It is absolutely true that this can be viewed
>> separately from consolidating the route management package with its
>> gateway.
>>
>> -r
>
>
Re: Pluggable API Gateways
Posted by japhar81 <ja...@gmail.com>.
I completely agree, it's model is a bit rigid -- I'm happy to take on that
work as well, though it might take me a bit, I've just started playing with
golang. Regardless, I do think it should come as a follow-on effort, with
the current model being the first plugin we build -- which will
coincidentally work against at least the current gateway and the traefik
one I'm trying to implement.
On Fri, Aug 10, 2018 at 8:21 PM Rodric Rabbah <ro...@gmail.com> wrote:
> My point about the cli is that current implementation is unnecessarily
> opinionated and while you can work with it, it’s just not necessary to have
> to fit into its current model. I opened several issues to try to address
> these shortcomings. It is absolutely true that this can be viewed
> separately from consolidating the route management package with its
> gateway.
>
> -r
Re: Pluggable API Gateways
Posted by Rodric Rabbah <ro...@gmail.com>.
My point about the cli is that current implementation is unnecessarily opinionated and while you can work with it, it’s just not necessary to have to fit into its current model. I opened several issues to try to address these shortcomings. It is absolutely true that this can be viewed separately from consolidating the route management package with its gateway.
-r
Re: Pluggable API Gateways
Posted by japhar81 <ja...@gmail.com>.
I agree on the repo moves, yes. Honestly I hadn't considered the tests, but
it does make sense to move them -- and perhaps generalize them so they can
test every implementation the same way.
I also concur that the CLI can probably stay as-is, at least for the time
being. I do see value in making it a plugin, but as a separate effort. Your
suggestions of caching and the like are my main rationale there -- adding a
--caching=true flag to an api create command only makes sense for those
gateways that know how to cache. Same for e.g. tracing. So I see that as an
eventual thing, but I would suggest we do this in smaller increments so the
PRs don't become unmanageable -- and so I don't go slightly crazy trying to
manage that much change at once.
On Fri, Aug 10, 2018 at 8:13 PM Dascalita Dragos <dd...@gmail.com> wrote:
> I assume Henry's suggestion is to colocate (as a start) APIGW + apimgmt
> actions in a folder, probably in "incubator-openwhisk-apigateway".
> In that repo there would be a folder for each impl: GW + apimgmt together.
> Henry please keep me honest here.
> I assume that apimgmt tests would also move along.
>
> The existing WSK CLI impl for apimgmt, even though it could be improved,
> it's something I was able to work with when writing an alternate
> implementation. We could keep it as-is, and ask the other apimgmt actions
> to adhere to the existing API.
>
> Supporting other implementations of Gateways ( Traefik, Envoy, and others )
> should be a great addition to the ecosystem. I would also mention the
> feature of "Caching HTTP Responses" of web actions as an additional
> capability of new Gateway impl, besides API Management.
>
> On Fri, Aug 10, 2018 at 10:27 AM Rodric Rabbah <ro...@gmail.com> wrote:
>
> > Hi Henry
> >
> > Fundamentally, I agree with you and think what you're proposing is a good
> > way forward.
> >
> > Specifically, based on my own experience helping others integrate their
> own
> > API gateways, I've found a few issues which I've tried to slowly fix.
> >
> > 1. The openwhisk deployment and route management packages were tied
> > together. A PR that was finally merged yesterday breaks this dependence,
> so
> > that the API gateway and route management package are entirely optional.
> > (This affects ansible deployments, doesn't necessarily address other ways
> > of deploying the system).
> >
> > 2. I also posite that the route management package (and all of its
> > corresponding tests) should be consolidated in the same place that ties
> > them to the implementation (i.e. the actual API gateway being used).
> >
> > 3. The wsk CLI needs to be refactored to break several hard coded
> > assumptions (which are not necessary in my assessment) about the
> underling
> > route management implementation and what the gateway implementation
> > supports. Simply put, hard coding of the JSON responses and the
> parameters
> > that can be passed to the gateway is wrong and should be generalized.
> >
> > I believe that the way OpenWhisk provides a level of indirection to
> > impedance match against many API gateways that are out there is a good
> > engineering of the system, and that it bootstraps actions to extend the
> API
> > is a good design to preserve... so that from the OpenWhisk clients
> > perspective we're defining a canonical experience.
> >
> > In short, I'm in favor of the proposal but caution there will be a bit of
> > grunt work ahead to fully realize this (based on my recent experience).
> >
> > -r
> >
> >
> > -r
> >
> >
> > On Fri, Aug 10, 2018 at 12:35 PM, japhar81 <ja...@gmail.com> wrote:
> >
> > > This is a follow-up to a Slack conversation with @dragos.dascalita and
> > > @csantanapr. As I've been struggling to stand up the API Gateway for
> > > OpenWhisk, it occurred to me that I would actually prefer to use a
> > > different GW entirely. In my case, Traefik fits nicely in one spot, and
> > > Istio integration would be very handy in another.
> > >
> > > I'm happy to implement both, but the current state makes it hard to
> > > contribute. A couple options and opinions came out of our discussion
> that
> > > could use more input;
> > >
> > > 1. Splitting the routemgt stuff out of incubator-openwhisk either
> into
> > > openwhisk-apigateway or the cli repo. My preference is a dedicated
> > > repo, as
> > > it makes more sense from a new users' POV -- I had a rough time
> > getting
> > > things to work and it was unclear in the current structure.
> > > 2. We can either ship APIGW+routemgt combos for each implementation,
> > or
> > > we can potentially make the api commands in wsk a plugin, shipping
> an
> > > APIGW
> > > + a wsk cli plugin to match.
> > >
> > > My personal opinion is this; if the APIGW is optional, the routemgt
> > actions
> > > must be as well -- one is pointless without the other. They're also
> > tightly
> > > coupled to the specific implementation. As such, I would suggest that
> > both
> > > pieces move to their own repo, with a folder for each implementation,
> as
> > > well as deployment docs for all things APIGW in the same place.
> > >
> > > Thoughts/comments welcome!
> > >
> > > Thanks,
> > > Henry
> > >
> >
>
Re: Pluggable API Gateways
Posted by Dascalita Dragos <dd...@gmail.com>.
I assume Henry's suggestion is to colocate (as a start) APIGW + apimgmt
actions in a folder, probably in "incubator-openwhisk-apigateway".
In that repo there would be a folder for each impl: GW + apimgmt together.
Henry please keep me honest here.
I assume that apimgmt tests would also move along.
The existing WSK CLI impl for apimgmt, even though it could be improved,
it's something I was able to work with when writing an alternate
implementation. We could keep it as-is, and ask the other apimgmt actions
to adhere to the existing API.
Supporting other implementations of Gateways ( Traefik, Envoy, and others )
should be a great addition to the ecosystem. I would also mention the
feature of "Caching HTTP Responses" of web actions as an additional
capability of new Gateway impl, besides API Management.
On Fri, Aug 10, 2018 at 10:27 AM Rodric Rabbah <ro...@gmail.com> wrote:
> Hi Henry
>
> Fundamentally, I agree with you and think what you're proposing is a good
> way forward.
>
> Specifically, based on my own experience helping others integrate their own
> API gateways, I've found a few issues which I've tried to slowly fix.
>
> 1. The openwhisk deployment and route management packages were tied
> together. A PR that was finally merged yesterday breaks this dependence, so
> that the API gateway and route management package are entirely optional.
> (This affects ansible deployments, doesn't necessarily address other ways
> of deploying the system).
>
> 2. I also posite that the route management package (and all of its
> corresponding tests) should be consolidated in the same place that ties
> them to the implementation (i.e. the actual API gateway being used).
>
> 3. The wsk CLI needs to be refactored to break several hard coded
> assumptions (which are not necessary in my assessment) about the underling
> route management implementation and what the gateway implementation
> supports. Simply put, hard coding of the JSON responses and the parameters
> that can be passed to the gateway is wrong and should be generalized.
>
> I believe that the way OpenWhisk provides a level of indirection to
> impedance match against many API gateways that are out there is a good
> engineering of the system, and that it bootstraps actions to extend the API
> is a good design to preserve... so that from the OpenWhisk clients
> perspective we're defining a canonical experience.
>
> In short, I'm in favor of the proposal but caution there will be a bit of
> grunt work ahead to fully realize this (based on my recent experience).
>
> -r
>
>
> -r
>
>
> On Fri, Aug 10, 2018 at 12:35 PM, japhar81 <ja...@gmail.com> wrote:
>
> > This is a follow-up to a Slack conversation with @dragos.dascalita and
> > @csantanapr. As I've been struggling to stand up the API Gateway for
> > OpenWhisk, it occurred to me that I would actually prefer to use a
> > different GW entirely. In my case, Traefik fits nicely in one spot, and
> > Istio integration would be very handy in another.
> >
> > I'm happy to implement both, but the current state makes it hard to
> > contribute. A couple options and opinions came out of our discussion that
> > could use more input;
> >
> > 1. Splitting the routemgt stuff out of incubator-openwhisk either into
> > openwhisk-apigateway or the cli repo. My preference is a dedicated
> > repo, as
> > it makes more sense from a new users' POV -- I had a rough time
> getting
> > things to work and it was unclear in the current structure.
> > 2. We can either ship APIGW+routemgt combos for each implementation,
> or
> > we can potentially make the api commands in wsk a plugin, shipping an
> > APIGW
> > + a wsk cli plugin to match.
> >
> > My personal opinion is this; if the APIGW is optional, the routemgt
> actions
> > must be as well -- one is pointless without the other. They're also
> tightly
> > coupled to the specific implementation. As such, I would suggest that
> both
> > pieces move to their own repo, with a folder for each implementation, as
> > well as deployment docs for all things APIGW in the same place.
> >
> > Thoughts/comments welcome!
> >
> > Thanks,
> > Henry
> >
>
Re: Pluggable API Gateways
Posted by Rodric Rabbah <ro...@gmail.com>.
Hi Henry
Fundamentally, I agree with you and think what you're proposing is a good
way forward.
Specifically, based on my own experience helping others integrate their own
API gateways, I've found a few issues which I've tried to slowly fix.
1. The openwhisk deployment and route management packages were tied
together. A PR that was finally merged yesterday breaks this dependence, so
that the API gateway and route management package are entirely optional.
(This affects ansible deployments, doesn't necessarily address other ways
of deploying the system).
2. I also posite that the route management package (and all of its
corresponding tests) should be consolidated in the same place that ties
them to the implementation (i.e. the actual API gateway being used).
3. The wsk CLI needs to be refactored to break several hard coded
assumptions (which are not necessary in my assessment) about the underling
route management implementation and what the gateway implementation
supports. Simply put, hard coding of the JSON responses and the parameters
that can be passed to the gateway is wrong and should be generalized.
I believe that the way OpenWhisk provides a level of indirection to
impedance match against many API gateways that are out there is a good
engineering of the system, and that it bootstraps actions to extend the API
is a good design to preserve... so that from the OpenWhisk clients
perspective we're defining a canonical experience.
In short, I'm in favor of the proposal but caution there will be a bit of
grunt work ahead to fully realize this (based on my recent experience).
-r
-r
On Fri, Aug 10, 2018 at 12:35 PM, japhar81 <ja...@gmail.com> wrote:
> This is a follow-up to a Slack conversation with @dragos.dascalita and
> @csantanapr. As I've been struggling to stand up the API Gateway for
> OpenWhisk, it occurred to me that I would actually prefer to use a
> different GW entirely. In my case, Traefik fits nicely in one spot, and
> Istio integration would be very handy in another.
>
> I'm happy to implement both, but the current state makes it hard to
> contribute. A couple options and opinions came out of our discussion that
> could use more input;
>
> 1. Splitting the routemgt stuff out of incubator-openwhisk either into
> openwhisk-apigateway or the cli repo. My preference is a dedicated
> repo, as
> it makes more sense from a new users' POV -- I had a rough time getting
> things to work and it was unclear in the current structure.
> 2. We can either ship APIGW+routemgt combos for each implementation, or
> we can potentially make the api commands in wsk a plugin, shipping an
> APIGW
> + a wsk cli plugin to match.
>
> My personal opinion is this; if the APIGW is optional, the routemgt actions
> must be as well -- one is pointless without the other. They're also tightly
> coupled to the specific implementation. As such, I would suggest that both
> pieces move to their own repo, with a folder for each implementation, as
> well as deployment docs for all things APIGW in the same place.
>
> Thoughts/comments welcome!
>
> Thanks,
> Henry
>