Re: Cloud clustering support using Kubernetes
On Thu, Oct 4, 2018 at 7:29 PM Rémy Maucherat wrote: > Ok ! For now I switched to openjson, since it's the same nonsense API as > the other one (so no retesting needed for now), without the "no evil" > clause. I had read the org.json license actually and thought the evil > clause was just for fun, but I guess lawyers aren't amused. > I did more updates. I should now be able to add it to Tomcat, as package "org.apache.catalina.tribes.membership.cloud". I'll add a compile time dependency on openjson for now (since it's the easiest thing to do), but I won't add it to the build for now (this way it is still possible to switch). Rémy
Re: Cloud clustering support using Kubernetes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Rémy, On 10/4/18 13:29, Rémy Maucherat wrote: > On Thu, Oct 4, 2018 at 7:23 PM Christopher Schultz < > ch...@christopherschultz.net> wrote: > >> -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 >> >> Rémy, >> >> On 10/4/18 05:26, Rémy Maucherat wrote: >>> On Wed, Oct 3, 2018 at 10:27 PM Christopher Schultz < >>> ch...@christopherschultz.net> wrote: >>> -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Rémy, On 10/3/18 09:48, Rémy Maucherat wrote: > Hi, > > As I talked about during the latest TomcatCon (and the > previous one in London actually ...), there's a cloud aware > cluster members provider that can be contributed to > Tomcat. > > The current code is here: > https://github.com/rmaucher/tomcat-in-the-cloud It uses > Kubernetes to retrieve the members of a cluster, rather > than multicast (which isn't available) or static (which is > well ... static) member providers. > > Credits: Maxime Beck and JGroups did the initial code > Keiichi Fujino explained how to refactor it to fit in the > Catalina cluster API and I refactored it as he told me to > > Problems: Only does Kubernetes for now (which is likely ok > since it's now widely available) JSON parser dependency > (org.json) that is likely not ok to have as is in the lib > folder (solutions: package renaming using a script or > include json code in Tomcat) Solr uses this JSON parser which is quite fast, although the API is a little little awkward because of it: https://github.com/yonik/noggit AL2 license I'm not sure it's necessary to have a "streaming JSON" parser as opposed to a more "traditional" one where the whole JSON object is converted into objects before the client code can do anything with them. >>> >>> The json from Kube is simple. >>> >>> The org.json parser is very dom like, this event based one >>> looks good I guess. Is it worth changing my code ? Given the >>> parser size, event based nature and the presence of a "writer", >>> this noggit could be worth package renaming (IMO for this one >>> that's the only viable strategy as I'm not sure there's much >>> maintenance or use going on - maybe it's bug free ;) ). After >>> all, we might need/use more json handling in Tomcat in the >>> future (right ?). >> >> I like the Noggit code because it's insanely small and produces >> regular Java objects instead of the nonsense that most JSON >> libraries produce, with JSONObject and JSONArray, etc. >> >> Compare sizes: >> >> version bytes classes Noggit 0.8 2794814 >> org.json (unknown) 4389521 gson 2.3.1 210856 >> 165 >> >> If you want to use it in a streaming/progressive/eventing kind of >> way, you can. Or you can call the "gimmie the tree" method and >> get a whole object tree back. >> >> The documentation is non-existent AFAICT, so I've had to read the >> code to figure out how to use it, which is a little frustrating. > > Ok ! For now I switched to openjson, since it's the same nonsense > API as the other one (so no retesting needed for now), without the > "no evil" clause. I had read the org.json license actually and > thought the evil clause was just for fun, but I guess lawyers > aren't amused. I think it's because they know that line is in there for them, specifically. - -chris -BEGIN PGP SIGNATURE- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlu2U8MACgkQHPApP6U8 pFgRIQ/+I7UbuDxjFpF5y/MS5EXY1DzellKICX329tqNU+ZkcYYutU9aPZOHRz2w +++nhUbsiveLNmnbh5queh/WDewKApONiwMqf1UgLBRJ9S3npiPhs2PajBWbQ9xN jzd3KxX5Th2ZUnPgm7B4mUKnOHZXvUvUsiApQVIb5hAifCUdVu1MOQYHcWihKtz6 +vnx8YrbaUVH9RUq9z5R8tnFjWMkLUtuhjzbeqw/ubgUZVhtsXOgW0/qAmjltARq JPTzqxvznnH44WAUmcKt8AH2KY9bfrbDaExCKptbrZ3S+0yX1Lkks7Jvox0vh2qU qIJTzmvZCruuSSENV/aagRGPGOH8W5no+vKOgICAdYcUlT2d+ID3Pism3ZA06h3J XIvVom4DcdhQQ4q7dS7C/Yz7YWpKYiVjS2McKiNhD6sqga0m2hzwwZSLAmGPCjKV 5NKS4qLzuwqogCkTsUVGIM09eIP7KA7G2SqnpAUwQF0khUwU+n17Tf43tdymXF1u AwIRA1S1UE07foIWxBDBguEbWFXnWJ+oZURzFvRei+92VgAoB+DD1ve6RTfv3Ieq Zav44nhOK6rSVspXTJCP6v5wXc+5OIMnrOkFsvcC/ZQt3nm80EZAH8GqmuKt0Cf6 gZahZN+t4APjx08SB3/XoVHpqUwhb5umirayTayoC8uO6R5iibQ= =d28+ -END PGP SIGNATURE- - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Cloud clustering support using Kubernetes
On Thu, Oct 4, 2018 at 7:23 PM Christopher Schultz < ch...@christopherschultz.net> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > Rémy, > > On 10/4/18 05:26, Rémy Maucherat wrote: > > On Wed, Oct 3, 2018 at 10:27 PM Christopher Schultz < > > ch...@christopherschultz.net> wrote: > > > >> -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 > >> > >> Rémy, > >> > >> On 10/3/18 09:48, Rémy Maucherat wrote: > >>> Hi, > >>> > >>> As I talked about during the latest TomcatCon (and the previous > >>> one in London actually ...), there's a cloud aware cluster > >>> members provider that can be contributed to Tomcat. > >>> > >>> The current code is here: > >>> https://github.com/rmaucher/tomcat-in-the-cloud It uses > >>> Kubernetes to retrieve the members of a cluster, rather than > >>> multicast (which isn't available) or static (which is well ... > >>> static) member providers. > >>> > >>> Credits: Maxime Beck and JGroups did the initial code Keiichi > >>> Fujino explained how to refactor it to fit in the Catalina > >>> cluster API and I refactored it as he told me to > >>> > >>> Problems: Only does Kubernetes for now (which is likely ok > >>> since it's now widely available) JSON parser dependency > >>> (org.json) that is likely not ok to have as is in the lib > >>> folder (solutions: package renaming using a script or include > >>> json code in Tomcat) > >> > >> Solr uses this JSON parser which is quite fast, although the API > >> is a little little awkward because of it: > >> > >> https://github.com/yonik/noggit > >> > >> AL2 license > >> > >> I'm not sure it's necessary to have a "streaming JSON" parser as > >> opposed to a more "traditional" one where the whole JSON object > >> is converted into objects before the client code can do anything > >> with them. > >> > > > > The json from Kube is simple. > > > > The org.json parser is very dom like, this event based one looks > > good I guess. Is it worth changing my code ? Given the parser size, > > event based nature and the presence of a "writer", this noggit > > could be worth package renaming (IMO for this one that's the only > > viable strategy as I'm not sure there's much maintenance or use > > going on - maybe it's bug free ;) ). After all, we might need/use > > more json handling in Tomcat in the future (right ?). > > I like the Noggit code because it's insanely small and produces > regular Java objects instead of the nonsense that most JSON libraries > produce, with JSONObject and JSONArray, etc. > > Compare sizes: > >version bytes classes > Noggit 0.8 2794814 > org.json (unknown) 4389521 > gson 2.3.1 210856 165 > > If you want to use it in a streaming/progressive/eventing kind of way, > you can. Or you can call the "gimmie the tree" method and get a whole > object tree back. > > The documentation is non-existent AFAICT, so I've had to read the code > to figure out how to use it, which is a little frustrating. > > Ok ! For now I switched to openjson, since it's the same nonsense API as the other one (so no retesting needed for now), without the "no evil" clause. I had read the org.json license actually and thought the evil clause was just for fun, but I guess lawyers aren't amused. Rémy
Re: Cloud clustering support using Kubernetes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Rémy, On 10/4/18 05:26, Rémy Maucherat wrote: > On Wed, Oct 3, 2018 at 10:27 PM Christopher Schultz < > ch...@christopherschultz.net> wrote: > >> -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 >> >> Rémy, >> >> On 10/3/18 09:48, Rémy Maucherat wrote: >>> Hi, >>> >>> As I talked about during the latest TomcatCon (and the previous >>> one in London actually ...), there's a cloud aware cluster >>> members provider that can be contributed to Tomcat. >>> >>> The current code is here: >>> https://github.com/rmaucher/tomcat-in-the-cloud It uses >>> Kubernetes to retrieve the members of a cluster, rather than >>> multicast (which isn't available) or static (which is well ... >>> static) member providers. >>> >>> Credits: Maxime Beck and JGroups did the initial code Keiichi >>> Fujino explained how to refactor it to fit in the Catalina >>> cluster API and I refactored it as he told me to >>> >>> Problems: Only does Kubernetes for now (which is likely ok >>> since it's now widely available) JSON parser dependency >>> (org.json) that is likely not ok to have as is in the lib >>> folder (solutions: package renaming using a script or include >>> json code in Tomcat) >> >> Solr uses this JSON parser which is quite fast, although the API >> is a little little awkward because of it: >> >> https://github.com/yonik/noggit >> >> AL2 license >> >> I'm not sure it's necessary to have a "streaming JSON" parser as >> opposed to a more "traditional" one where the whole JSON object >> is converted into objects before the client code can do anything >> with them. >> > > The json from Kube is simple. > > The org.json parser is very dom like, this event based one looks > good I guess. Is it worth changing my code ? Given the parser size, > event based nature and the presence of a "writer", this noggit > could be worth package renaming (IMO for this one that's the only > viable strategy as I'm not sure there's much maintenance or use > going on - maybe it's bug free ;) ). After all, we might need/use > more json handling in Tomcat in the future (right ?). I like the Noggit code because it's insanely small and produces regular Java objects instead of the nonsense that most JSON libraries produce, with JSONObject and JSONArray, etc. Compare sizes: version bytes classes Noggit 0.8 2794814 org.json (unknown) 4389521 gson 2.3.1 210856 165 If you want to use it in a streaming/progressive/eventing kind of way, you can. Or you can call the "gimmie the tree" method and get a whole object tree back. The documentation is non-existent AFAICT, so I've had to read the code to figure out how to use it, which is a little frustrating. - -chris -BEGIN PGP SIGNATURE- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlu2TJcACgkQHPApP6U8 pFiO2Q/9HxaVpy0zmIvQdDrDW0STDfem6Hw2KMj/UFXJ0Se6wzxJMcLJ8DHtcPbD IYO6rkgkrlK+D8ZHbwrTSoTKAQgEZ2tXv5818V95Etj5AzxUKdke2wi3x/WuTVCF nsYHALgYhXVytoqAfL61V3Jld+N9kI8PAFe34lHZtHgQP6G+ypXW85h4q8WfBHTE Fr8eWSFAogcGrHKSoSUjDOKvjL4zP/I6vyqG0zQB8ajz0YqSBviTRxWGSgmSMRIa WZz5xvfLwMb1F+ykFvIdI5FtBw4C0AACKcwZzjf78gpTSOQYeQBfVGWaCspeNyAG 10JRBz+ktxdgEDaDEtEaOsfloK1PMxO/U/UDoKM4e51cQvNELpj0gWzGUaRi8guz LWj9/ewz5BmpurojWXwLbzdFNfmovOxPRK8cJid1LI6rmm+bvucxt0nHM+n4M18p ehD43gK5sidR/mVlnEJkGNfzdhforoIoZDtvaXNOGGe4/7j9Blb0OdXrcCxAsHd6 6eoPLW7sRJU6L5IMZf31S0Mfp0E/n96EqaKfKjDKMQdBc41sz3XHesTXGHC9SyHK 7wM4P/YBX6pnPGG0wna00NUKaWBwv16ch5SvpM5bAl/ms8wK3X8x4gbeeL0xF9Eu hTulFWB2QYrGEKkYgt2/6091vOJIyJ3c5ZcK7eEs7F+V71brnVo= =dl4u -END PGP SIGNATURE- - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Cloud clustering support using Kubernetes
On Thu, Oct 4, 2018 at 12:58 PM Mark Thomas wrote: > On 04/10/18 11:48, Martin Grigorov wrote: > > Hi, > > > > I cannot find the original mail now (I think it was sent by Bertrand > > Delacretaz two years ago) but json.org's licence is not ASL2 compatible. > > For that reason several Apache projects (Apache Wicket one of them) had > to > > migrate to something else. > > Wicket choose https://github.com/tdunning/open-json and then improved > it to > > https://github.com/openjson/openjson. The APIs are almost identical to > make > > the transition easier. > > http://www.apache.org/legal/resolved.html#json > Oops, thanks for the review. There are some massive json libraries out there, I'll obviously avoid them. I will try to use https://github.com/openjson/openjson then https://github.com/yonik/noggit if I'm not happy about it, and if it's still not good enough, as a coworker suggested, use antlr or javacc. Rémy
Re: Cloud clustering support using Kubernetes
On 04/10/18 11:48, Martin Grigorov wrote: > Hi, > > I cannot find the original mail now (I think it was sent by Bertrand > Delacretaz two years ago) but json.org's licence is not ASL2 compatible. > For that reason several Apache projects (Apache Wicket one of them) had to > migrate to something else. > Wicket choose https://github.com/tdunning/open-json and then improved it to > https://github.com/openjson/openjson. The APIs are almost identical to make > the transition easier. http://www.apache.org/legal/resolved.html#json Mark > > On Thu, Oct 4, 2018 at 12:27 PM Rémy Maucherat wrote: > >> On Wed, Oct 3, 2018 at 10:27 PM Christopher Schultz < >> ch...@christopherschultz.net> wrote: >> >>> -BEGIN PGP SIGNED MESSAGE- >>> Hash: SHA256 >>> >>> Rémy, >>> >>> On 10/3/18 09:48, Rémy Maucherat wrote: Hi, As I talked about during the latest TomcatCon (and the previous one in London actually ...), there's a cloud aware cluster members provider that can be contributed to Tomcat. The current code is here: https://github.com/rmaucher/tomcat-in-the-cloud It uses Kubernetes to retrieve the members of a cluster, rather than multicast (which isn't available) or static (which is well ... static) member providers. Credits: Maxime Beck and JGroups did the initial code Keiichi Fujino explained how to refactor it to fit in the Catalina cluster API and I refactored it as he told me to Problems: Only does Kubernetes for now (which is likely ok since it's now widely available) JSON parser dependency (org.json) that is likely not ok to have as is in the lib folder (solutions: package renaming using a script or include json code in Tomcat) >>> >>> Solr uses this JSON parser which is quite fast, although the API is a >>> little little awkward because of it: >>> >>> https://github.com/yonik/noggit >>> >>> AL2 license >>> >>> I'm not sure it's necessary to have a "streaming JSON" parser as >>> opposed to a more "traditional" one where the whole JSON object is >>> converted into objects before the client code can do anything with them. >>> >> >> The json from Kube is simple. >> >> The org.json parser is very dom like, this event based one looks good I >> guess. Is it worth changing my code ? Given the parser size, event based >> nature and the presence of a "writer", this noggit could be worth package >> renaming (IMO for this one that's the only viable strategy as I'm not sure >> there's much maintenance or use going on - maybe it's bug free ;) ). After >> all, we might need/use more json handling in Tomcat in the future (right >> ?). >> >> Rémy >> > - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Cloud clustering support using Kubernetes
Hi, I cannot find the original mail now (I think it was sent by Bertrand Delacretaz two years ago) but json.org's licence is not ASL2 compatible. For that reason several Apache projects (Apache Wicket one of them) had to migrate to something else. Wicket choose https://github.com/tdunning/open-json and then improved it to https://github.com/openjson/openjson. The APIs are almost identical to make the transition easier. On Thu, Oct 4, 2018 at 12:27 PM Rémy Maucherat wrote: > On Wed, Oct 3, 2018 at 10:27 PM Christopher Schultz < > ch...@christopherschultz.net> wrote: > > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA256 > > > > Rémy, > > > > On 10/3/18 09:48, Rémy Maucherat wrote: > > > Hi, > > > > > > As I talked about during the latest TomcatCon (and the previous one > > > in London actually ...), there's a cloud aware cluster members > > > provider that can be contributed to Tomcat. > > > > > > The current code is here: > > > https://github.com/rmaucher/tomcat-in-the-cloud It uses Kubernetes > > > to retrieve the members of a cluster, rather than multicast (which > > > isn't available) or static (which is well ... static) member > > > providers. > > > > > > Credits: Maxime Beck and JGroups did the initial code Keiichi > > > Fujino explained how to refactor it to fit in the Catalina cluster > > > API and I refactored it as he told me to > > > > > > Problems: Only does Kubernetes for now (which is likely ok since > > > it's now widely available) JSON parser dependency (org.json) that > > > is likely not ok to have as is in the lib folder (solutions: > > > package renaming using a script or include json code in Tomcat) > > > > Solr uses this JSON parser which is quite fast, although the API is a > > little little awkward because of it: > > > > https://github.com/yonik/noggit > > > > AL2 license > > > > I'm not sure it's necessary to have a "streaming JSON" parser as > > opposed to a more "traditional" one where the whole JSON object is > > converted into objects before the client code can do anything with them. > > > > The json from Kube is simple. > > The org.json parser is very dom like, this event based one looks good I > guess. Is it worth changing my code ? Given the parser size, event based > nature and the presence of a "writer", this noggit could be worth package > renaming (IMO for this one that's the only viable strategy as I'm not sure > there's much maintenance or use going on - maybe it's bug free ;) ). After > all, we might need/use more json handling in Tomcat in the future (right > ?). > > Rémy >
Re: Cloud clustering support using Kubernetes
On Wed, Oct 3, 2018 at 10:27 PM Christopher Schultz < ch...@christopherschultz.net> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > Rémy, > > On 10/3/18 09:48, Rémy Maucherat wrote: > > Hi, > > > > As I talked about during the latest TomcatCon (and the previous one > > in London actually ...), there's a cloud aware cluster members > > provider that can be contributed to Tomcat. > > > > The current code is here: > > https://github.com/rmaucher/tomcat-in-the-cloud It uses Kubernetes > > to retrieve the members of a cluster, rather than multicast (which > > isn't available) or static (which is well ... static) member > > providers. > > > > Credits: Maxime Beck and JGroups did the initial code Keiichi > > Fujino explained how to refactor it to fit in the Catalina cluster > > API and I refactored it as he told me to > > > > Problems: Only does Kubernetes for now (which is likely ok since > > it's now widely available) JSON parser dependency (org.json) that > > is likely not ok to have as is in the lib folder (solutions: > > package renaming using a script or include json code in Tomcat) > > Solr uses this JSON parser which is quite fast, although the API is a > little little awkward because of it: > > https://github.com/yonik/noggit > > AL2 license > > I'm not sure it's necessary to have a "streaming JSON" parser as > opposed to a more "traditional" one where the whole JSON object is > converted into objects before the client code can do anything with them. > The json from Kube is simple. The org.json parser is very dom like, this event based one looks good I guess. Is it worth changing my code ? Given the parser size, event based nature and the presence of a "writer", this noggit could be worth package renaming (IMO for this one that's the only viable strategy as I'm not sure there's much maintenance or use going on - maybe it's bug free ;) ). After all, we might need/use more json handling in Tomcat in the future (right ?). Rémy
Re: Cloud clustering support using Kubernetes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Rémy, On 10/3/18 09:48, Rémy Maucherat wrote: > Hi, > > As I talked about during the latest TomcatCon (and the previous one > in London actually ...), there's a cloud aware cluster members > provider that can be contributed to Tomcat. > > The current code is here: > https://github.com/rmaucher/tomcat-in-the-cloud It uses Kubernetes > to retrieve the members of a cluster, rather than multicast (which > isn't available) or static (which is well ... static) member > providers. > > Credits: Maxime Beck and JGroups did the initial code Keiichi > Fujino explained how to refactor it to fit in the Catalina cluster > API and I refactored it as he told me to > > Problems: Only does Kubernetes for now (which is likely ok since > it's now widely available) JSON parser dependency (org.json) that > is likely not ok to have as is in the lib folder (solutions: > package renaming using a script or include json code in Tomcat) Solr uses this JSON parser which is quite fast, although the API is a little little awkward because of it: https://github.com/yonik/noggit AL2 license I'm not sure it's necessary to have a "streaming JSON" parser as opposed to a more "traditional" one where the whole JSON object is converted into objects before the client code can do anything with them. > Needs more testing Tomcat 9.0.13 needed (with some fixmes related > to that in the code) > > Comments ? - -chris -BEGIN PGP SIGNATURE- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlu1JjwACgkQHPApP6U8 pFgyYg/+Io3TnvBtSNm99H6dLzJ2AL4k3vOWBRupqgG6U93a7KP4F+R+6XuXhpBp XpGg3mkjx/gxXfR8Srd33dS7PUGd0k74HDDqBklXWmEJaaZR+Wu4gWswsbUwaHHx wnXGsBeiCgoVeoBu4fu108+tn8QirhkQy1RSSYERh26+YdHY9FlRHgRZSUJKMIoT G5uUk0QGUdHVWSNROvNOKZPDgCWHisN2sRXka7nOtuJXYEuvISusM0Rp2lizbd5o GndX9CtqyHyyB1UVBH61nx11wssGuHGY8aNSsRj/CaFSzp2mHlA0d2V7ohieV/p1 aKHmC2WdjndBmYZSlRBbBSrHce5J1iyf/OYyaDSt7V7cQU7fP2Ofpg866SDMh5XK b8tS4Bo5ZRSRRWkiC3Dl8sW2RAcFcjKHbmMpinj1ML8ygMVqLCNY81DWpxGsZtm/ opPZxEoBnPcQc5vpfpi0QjPKUrJxCUVKxrIO0KzHJ6jQ6UYJJ7VY5LUUvI5c+dqO xq3ag4JAqfCmcot/+9Ccz8+JVS9oGexkVexvkQBmuaqkXR6mkdBSnqlP1YrPVvt5 v6qu48nqkJtvOXkeGgk1XZgUsr+AKQBrprpO3i/Blf5ElMBw7uZodVe6LGRrfZUI ltQS+PIGQ4Uh6ECYZDjp9eIdlr2QKRjPOTs+qeERUru3sLvoeq4= =3p5n -END PGP SIGNATURE- - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Cloud clustering support using Kubernetes
On Wed, Oct 3, 2018 at 4:35 PM Mark Thomas wrote: > On 03/10/18 14:48, Rémy Maucherat wrote: > > Hi, > > > > As I talked about during the latest TomcatCon (and the previous one in > > London actually ...), there's a cloud aware cluster members provider that > > can be contributed to Tomcat. > > > > The current code is here: > https://github.com/rmaucher/tomcat-in-the-cloud > > It uses Kubernetes to retrieve the members of a cluster, rather than > > multicast (which isn't available) or static (which is well ... static) > > member providers. > > > > Credits: > > Maxime Beck and JGroups did the initial code > > Keiichi Fujino explained how to refactor it to fit in the Catalina > cluster > > API > > and I refactored it as he told me to > > > > Problems: > > Only does Kubernetes for now (which is likely ok since it's now widely > > available) > > No objections on this point. A quick look at the code indicates > additional CloudMembershipProvider implementations should be fairly > simple to add as required. > Yes, it's very small, most of the work is knowing to use your cloud infrastructure (... :( ). > > > JSON parser dependency (org.json) that is likely not ok to have as is in > > the lib folder (solutions: package renaming using a script or include > json > > code in Tomcat) > > Because we get JSON from Kubernetes? Is there any other interface we > could use that doesn't return JSON? Well, it's very simple, you get the pods list that way, afaik they don't like xml at all, it's all either yml or json. I guess it's "simpler" (ahem). > Are other providers (Docker is the > one that comes immediately to mind) also going to require JSON? > Yes, that comes to mind, I don't know their orchestration yet (it's called Docker swarm) but it looks like json responses as well. > > Other random thoughts: > - Make it an optional library that we depend on at compile time but > don't ship? Fail start-up if it is not present when the > CloudMembershipProvider is configured? > - Package the cloud membership provider stuff extras and include the > JSON JAR in that? > > It is only 64Kb (if I am looking at the correct JAR). I am a little > concerned about conflicts with web applications shipping alternative > versions of the JAR. We should be OK on this point as none of the > clustering objects that touch JSON should be visible to web applications. > Yes, it's small, but it's probably a commonly used library. So a decision has to be made about it. > > > Needs more testing > > Tomcat 9.0.13 needed (with some fixmes related to that in the code) > > > > Comments ? > > It it is intended for inclusion in Tomcat then the sooner it is in the > Tomcat code base the better. It doesn't have to ship with a release > straight away if it isn't release ready. > Ok, no problem with that. Rémy
Re: Cloud clustering support using Kubernetes
On 03/10/18 14:48, Rémy Maucherat wrote: > Hi, > > As I talked about during the latest TomcatCon (and the previous one in > London actually ...), there's a cloud aware cluster members provider that > can be contributed to Tomcat. > > The current code is here: https://github.com/rmaucher/tomcat-in-the-cloud > It uses Kubernetes to retrieve the members of a cluster, rather than > multicast (which isn't available) or static (which is well ... static) > member providers. > > Credits: > Maxime Beck and JGroups did the initial code > Keiichi Fujino explained how to refactor it to fit in the Catalina cluster > API > and I refactored it as he told me to > > Problems: > Only does Kubernetes for now (which is likely ok since it's now widely > available) No objections on this point. A quick look at the code indicates additional CloudMembershipProvider implementations should be fairly simple to add as required. > JSON parser dependency (org.json) that is likely not ok to have as is in > the lib folder (solutions: package renaming using a script or include json > code in Tomcat) Because we get JSON from Kubernetes? Is there any other interface we could use that doesn't return JSON? Are other providers (Docker is the one that comes immediately to mind) also going to require JSON? Other random thoughts: - Make it an optional library that we depend on at compile time but don't ship? Fail start-up if it is not present when the CloudMembershipProvider is configured? - Package the cloud membership provider stuff extras and include the JSON JAR in that? It is only 64Kb (if I am looking at the correct JAR). I am a little concerned about conflicts with web applications shipping alternative versions of the JAR. We should be OK on this point as none of the clustering objects that touch JSON should be visible to web applications. > Needs more testing > Tomcat 9.0.13 needed (with some fixmes related to that in the code) > > Comments ? It it is intended for inclusion in Tomcat then the sooner it is in the Tomcat code base the better. It doesn't have to ship with a release straight away if it isn't release ready. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Cloud clustering support using Kubernetes
Hi, As I talked about during the latest TomcatCon (and the previous one in London actually ...), there's a cloud aware cluster members provider that can be contributed to Tomcat. The current code is here: https://github.com/rmaucher/tomcat-in-the-cloud It uses Kubernetes to retrieve the members of a cluster, rather than multicast (which isn't available) or static (which is well ... static) member providers. Credits: Maxime Beck and JGroups did the initial code Keiichi Fujino explained how to refactor it to fit in the Catalina cluster API and I refactored it as he told me to Problems: Only does Kubernetes for now (which is likely ok since it's now widely available) JSON parser dependency (org.json) that is likely not ok to have as is in the lib folder (solutions: package renaming using a script or include json code in Tomcat) Needs more testing Tomcat 9.0.13 needed (with some fixmes related to that in the code) Comments ? Rémy