emqx / emqx-rel

Release Project for EMQX Broker prior to 4.3. Newer releases are built here: https://github.com/emqx/emqx
https://www.emqx.com
Apache License 2.0
190 stars 221 forks source link

Helm/Docker support for emqx-exproto and emqx-extension-hook #573

Open daadu opened 4 years ago

daadu commented 4 years ago

emqx-exproto and emqx-extension-hook are the newly released plugins, they require access to "custom code" written by user and "python3/java(coming soon)" runtime. Current Helm chart does not support this.

Possible Solution

  1. Let user provide a docker registry that contains the code that needs to be executed, the Helm chart should make it a "sidecar" pod, the /code volume of the "sidecar" should be mounted to /extension. This is will give emqx access to user defined "code"
  2. These plugins require "python3" or "java" runtimes inside the "emqx" docker, one solution that I can think of is to have variant of emqx docker images - emqx-4.2.3 tag for simple emqx, emqx-py3-4.2.3 tag for emqx+python3 and emqx-java-4.2.3 for emqx+java. The emqx-py3-* and emqx-java-* tagged docker images will have python and java runtimes inside the image. This could be done by using multi-stage docker build. Also an additional feature could be make the py3 and java runtimes tuneable - eg. user can change heap size of JVM, etc. using environment variables.
daadu commented 4 years ago

Please give me feedback on the proposed solution. I am interested on working on this feature.

daadu commented 4 years ago

Also could consider adding support for emqx-lua-hook

Rory-Z commented 4 years ago

Hi, @daadu Thank you for your suggestion, we will further discuss the solution to this issue. CC @HJianBo Do you have any ideas ?

daadu commented 4 years ago

@zhanghongtong I have mentioned in Possible Solution section.

HJianBo commented 3 years ago

Hi @daadu We plan to refactor the implementation of these two plugins in 4.3. The new implementation will make procedure calls based on gRPC instead of the erlang port. In this way, the two plug-ins have a very flexible deployment approach