Преглед на файлове

refactor: stop releasing edge edition

Prior to EMQX 5.0, the edge edition's main difference comaring
to standard edition are:
* Less number of plugins in the release (smaller package size)
* Smaller number is vm.args (for lower memory usage)

Starting from 5.0 most of the plugins are included as features,
the tuned vm.args arguments does not justify a special release edition.

Also as nanomq is getting mature,
EMQ's recommendtation for MQTT broker in edge is https://nanomq.io/
Zaiming (Stone) Shi преди 3 години
родител
ревизия
ebe4d7c3fb

+ 2 - 6
.github/workflows/build_packages.yaml

@@ -47,14 +47,14 @@ jobs:
           tag=${{ github.ref }}
           case $tag in
             refs/tags/v*)
-              echo "::set-output name=BUILD_PROFILES::[\"emqx\",\"emqx-edge\"]"
+              echo "::set-output name=BUILD_PROFILES::[\"emqx\"]"
               ;;
             refs/tags/e*)
               echo "::set-output name=BUILD_PROFILES::[\"emqx-enterprise\"]"
               ;;
             *)
               # this is for testing ?
-              echo "::set-output name=BUILD_PROFILES::[\"emqx-edge\",\"emqx\",\"emqx-enterprise\"]"
+              echo "::set-output name=BUILD_PROFILES::[\"emqx\",\"emqx-enterprise\"]"
               ;;
           esac
       - name: get_all_deps
@@ -126,8 +126,6 @@ jobs:
         os:
           - macos-11
           - macos-10.15
-        exclude:
-          - profile: emqx-edge
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/download-artifact@v2
@@ -638,8 +636,6 @@ jobs:
             s3dir='emqx-ce'
         elif [ $PROFILE = 'emqx-enterprise' ]; then
             s3dir='emqx-ee'
-        elif [ $PROFILE = 'emqx-edge' ]; then
-            s3dir='emqx-edge'
         else
             echo "unknown profile $PROFILE"
             exit 1

+ 0 - 2
.github/workflows/build_slim_packages.yaml

@@ -29,7 +29,6 @@ jobs:
       fail-fast: false
       matrix:
         profile:
-        - emqx-edge
         - emqx
         - emqx-enterprise
         otp:
@@ -227,7 +226,6 @@ jobs:
     strategy:
       matrix:
         profile:
-        - emqx-edge
         - emqx
         - emqx-enterprise
     runs-on: aws-amd64

+ 0 - 8
.github/workflows/elixir_apps_check.yaml

@@ -15,20 +15,12 @@ jobs:
       matrix:
         release_type:
           - cloud
-          - edge
         package_type:
           - bin
           - pkg
         edition_type:
           - community
           - enterprise
-        exclude:
-          - release_type: edge
-            package_type: bin
-            edition_type: enterprise
-          - release_type: edge
-            package_type: pkg
-            edition_type: enterprise
 
     steps:
       - name: fix_git_permission

+ 0 - 3
.github/workflows/release.yaml

@@ -11,7 +11,6 @@ jobs:
       fail-fast: false
       matrix:
         profile:
-          - emqx-edge
           - emqx
           - emqx-enterprise
 
@@ -28,8 +27,6 @@ jobs:
               s3dir='emqx-ce'
           elif [ $PROFILE = 'emqx-enterprise' ]; then
               s3dir='emqx-ee'
-          elif [ $PROFILE = 'emqx-edge' ]; then
-              s3dir='emqx-edge'
           else
               echo "unknown profile $PROFILE"
               exit 1

+ 0 - 4
.github/workflows/run_fvt_tests.yaml

@@ -41,7 +41,6 @@ jobs:
       matrix:
         profile:
           - emqx
-          - emqx-edge
           - emqx-enterprise
           - emqx-elixir
         cluster_db_backend:
@@ -55,9 +54,6 @@ jobs:
           - 1.13.3
         arch:
           - amd64
-        exclude:
-          - profile: emqx-edge
-            cluster_db_backend: rlog
     steps:
     - uses: actions/download-artifact@v2
       with:

+ 2 - 2
Makefile

@@ -18,8 +18,8 @@ else
 endif
 
 PROFILE ?= emqx
-REL_PROFILES := emqx emqx-edge emqx-enterprise
-PKG_PROFILES := emqx-pkg emqx-edge-pkg emqx-enterprise-pkg
+REL_PROFILES := emqx emqx-enterprise
+PKG_PROFILES := emqx-pkg emqx-enterprise-pkg
 PROFILES := $(REL_PROFILES) $(PKG_PROFILES) default
 
 CT_NODE_NAME ?= 'test@127.0.0.1'

+ 3 - 5
apps/emqx/src/emqx_release.erl

@@ -26,14 +26,12 @@
 
 -define(EMQX_DESCS, #{
     ee => "EMQX Enterprise",
-    ce => "EMQX",
-    edge => "EMQX Edge"
+    ce => "EMQX"
 }).
 
 -define(EMQX_REL_VSNS, #{
     ee => ?EMQX_RELEASE_EE,
-    ce => ?EMQX_RELEASE_CE,
-    edge => ?EMQX_RELEASE_CE
+    ce => ?EMQX_RELEASE_CE
 }).
 
 %% @doc Return EMQX description.
@@ -43,7 +41,7 @@ description() ->
 %% @doc Return EMQX edition info.
 %% Read info from persistent_term at runtime.
 %% Or meck this function to run tests for another edition.
--spec edition() -> ce | ee | edge.
+-spec edition() -> ce | ee.
 -ifdef(EMQX_RELEASE_EDITION).
 edition() -> ?EMQX_RELEASE_EDITION.
 -else.

+ 0 - 1
apps/emqx_rule_engine/rebar.config

@@ -10,7 +10,6 @@
     warn_unused_import,
     warn_obsolete_guard,
     no_debug_info,
-    %% for edge
     compressed,
     {parse_transform}
 ]}.

+ 3 - 6
build

@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 # This script helps to build release artifacts.
-# arg1: profile, e.g. emqx | emqx-edge | emqx-pkg | emqx-edge-pkg
+# arg1: profile, e.g. emqx | emqx-pkg
 # arg2: artifact, e.g. rel | relup | tgz | pkg
 
 if [[ -n "$DEBUG" ]]; then
@@ -237,10 +237,10 @@ function join {
 export_release_vars() {
   local profile="$1"
   case "$profile" in
-    emqx|emqx-edge|emqx-enterprise)
+    emqx|emqx-enterprise)
       export ELIXIR_MAKE_TAR=${ELIXIR_MAKE_TAR:-no}
       ;;
-    emqx-pkg|emqx-edge-pkg|emqx-enterprise-pkg)
+    emqx-pkg|emqx-enterprise-pkg)
       export ELIXIR_MAKE_TAR=${ELIXIR_MAKE_TAR:-yes}
       ;;
     *)
@@ -255,9 +255,6 @@ export_release_vars() {
     *enterprise*)
       erl_opts+=( "{d, 'EMQX_RELEASE_EDITION', ee}" )
       ;;
-    *edge*)
-      erl_opts+=( "{d, 'EMQX_RELEASE_EDITION', edge}" )
-      ;;
     *)
       erl_opts+=( "{d, 'EMQX_RELEASE_EDITION', ce}" )
       ;;

+ 23 - 25
mix.exs

@@ -16,10 +16,8 @@ defmodule EMQXUmbrella.MixProject do
   The following profiles are valid:
 
     * `emqx`
-    * `emqx-edge`
     * `emqx-enterprise`
     * `emqx-pkg`
-    * `emqx-edge-pkg`
     * `emqx-enterprise-pkg`
     * `dev` -> same as `emqx`, for convenience
 
@@ -132,7 +130,7 @@ defmodule EMQXUmbrella.MixProject do
           end
 
         [
-          applications: applications(release_type, edition_type),
+          applications: applications(edition_type),
           skip_mode_validation_for: [
             :emqx_gateway,
             :emqx_dashboard,
@@ -156,7 +154,7 @@ defmodule EMQXUmbrella.MixProject do
     ]
   end
 
-  def applications(release_type, edition_type) do
+  def applications(edition_type) do
     [
       crypto: :permanent,
       public_key: :permanent,
@@ -168,6 +166,7 @@ defmodule EMQXUmbrella.MixProject do
       compiler: :permanent,
       runtime_tools: :permanent,
       redbug: :permanent,
+      xmerl: :permanent,
       hocon: :load,
       emqx: :load,
       emqx_conf: :load,
@@ -203,16 +202,16 @@ defmodule EMQXUmbrella.MixProject do
       if(enable_quicer?(), do: [quicer: :permanent], else: []) ++
       if(enable_bcrypt?(), do: [bcrypt: :permanent], else: []) ++
       if(enable_jq?(), do: [jq: :permanent], else: []) ++
+      if(is_app(:observer),
+        do: [observer: :load],
+        else: []
+      ) ++
       if(edition_type == :enterprise,
         do: [
-          emqx_enterprise_conf: :load,
-          emqx_license: :permanent
+          emqx_license: :permanent,
+          emqx_enterprise_conf: :load
         ],
         else: []
-      ) ++
-      if(release_type == :cloud,
-        do: [xmerl: :permanent, observer: :load],
-        else: []
       )
   end
 
@@ -244,6 +243,19 @@ defmodule EMQXUmbrella.MixProject do
       []
   end
 
+  defp is_app(name) do
+    case Application.load(name) do
+      :ok ->
+        true
+
+      {:error, {:already_loaded, _}} ->
+        true
+
+      _ ->
+        false
+    end
+  end
+
   defp emqx_machine_boot_app_list(edition_type) do
     edition_type
     |> emqx_machine_boot_apps()
@@ -257,9 +269,7 @@ defmodule EMQXUmbrella.MixProject do
       :emqx,
       :"emqx-pkg",
       :"emqx-enterprise",
-      :"emqx-enterprise-pkg",
-      :"emqx-edge",
-      :"emqx-edge-pkg"
+      :"emqx-enterprise-pkg"
     ]
 
     if Mix.env() not in valid_envs do
@@ -286,18 +296,12 @@ defmodule EMQXUmbrella.MixProject do
         :emqx ->
           {:cloud, :bin, :community}
 
-        :"emqx-edge" ->
-          {:edge, :bin, :community}
-
         :"emqx-enterprise" ->
           {:cloud, :bin, :enterprise}
 
         :"emqx-pkg" ->
           {:cloud, :pkg, :community}
 
-        :"emqx-edge-pkg" ->
-          {:edge, :pkg, :community}
-
         :"emqx-enterprise-pkg" ->
           {:cloud, :pkg, :enterprise}
       end
@@ -390,9 +394,6 @@ defmodule EMQXUmbrella.MixProject do
       case release_type do
         :cloud ->
           "apps/emqx/etc/emqx_cloud/vm.args"
-
-        :edge ->
-          "apps/emqx/etc/emqx_edge/vm.args"
       end
 
     render_template(
@@ -594,9 +595,6 @@ defmodule EMQXUmbrella.MixProject do
 
       {:cloud, :community} ->
         "EMQX"
-
-      {:edge, :community} ->
-        "EMQX Edge"
     end
   end
 

+ 8 - 48
rebar.config.erl

@@ -165,20 +165,6 @@ profiles_ce() ->
             {overrides, prod_overrides()},
             {project_app_dirs, project_app_dirs(ce)},
             {post_hooks, [{compile, "bash build emqx-pkg doc"}]}
-        ]},
-        {'emqx-edge', [
-            {erl_opts, prod_compile_opts(edge, Vsn)},
-            {relx, relx(Vsn, edge, bin, ce)},
-            {overrides, prod_overrides()},
-            {project_app_dirs, project_app_dirs(ce)},
-            {post_hooks, [{compile, "bash build emqx-edge doc"}]}
-        ]},
-        {'emqx-edge-pkg', [
-            {erl_opts, prod_compile_opts(edge, Vsn)},
-            {relx, relx(Vsn, edge, pkg, ce)},
-            {overrides, prod_overrides()},
-            {project_app_dirs, project_app_dirs(ce)},
-            {post_hooks, [{compile, "bash build emqx-edge-pkg doc"}]}
         ]}
     ].
 
@@ -217,7 +203,7 @@ profiles_dev() ->
         ]}
     ].
 
-%% RelType: cloud (full size) | edge (slim size)
+%% RelType: cloud (full size)
 %% PkgType: bin | pkg
 %% Edition: ce (community) | ee (enterprise)
 relx(Vsn, RelType, PkgType, Edition) ->
@@ -257,23 +243,15 @@ relform() ->
     end.
 
 emqx_description(cloud, ee) -> "EMQX Enterprise";
-emqx_description(cloud, ce) -> "EMQX";
-emqx_description(edge, ce) -> "EMQX Edge".
+emqx_description(cloud, ce) -> "EMQX".
 
 overlay_vars(RelType, PkgType, Edition) ->
     overlay_vars_rel(RelType) ++
         overlay_vars_pkg(PkgType) ++
         overlay_vars_edition(Edition).
 
-%% vars per release type, cloud or edge
-overlay_vars_rel(RelType) ->
-    VmArgs =
-        case RelType of
-            cloud -> "vm.args";
-            edge -> "vm.args.edge"
-        end,
-
-    [{vm_args_file, VmArgs}].
+overlay_vars_rel(cloud) ->
+    [{vm_args_file, "vm.args"}].
 
 overlay_vars_edition(ce) ->
     [
@@ -330,6 +308,7 @@ relx_apps(ReleaseType, Edition) ->
         compiler,
         runtime_tools,
         redbug,
+        xmerl,
         {hocon, load},
         % started by emqx_machine
         {emqx, load},
@@ -365,16 +344,8 @@ relx_apps(ReleaseType, Edition) ->
         [quicer || is_quicer_supported()] ++
         [bcrypt || provide_bcrypt_release(ReleaseType)] ++
         [jq || provide_jq()] ++
-        relx_apps_per_rel(ReleaseType) ++
-        relx_additional_apps(ReleaseType, Edition).
-
-relx_apps_per_rel(cloud) ->
-    [
-        xmerl
-        | [{observer, load} || is_app(observer)]
-    ];
-relx_apps_per_rel(edge) ->
-    [].
+        [{observer, load} || is_app(observer)] ++
+        relx_apps_per_edition(Edition).
 
 is_app(Name) ->
     case application:load(Name) of
@@ -383,15 +354,6 @@ is_app(Name) ->
         _ -> false
     end.
 
-relx_additional_apps(ReleaseType, Edition) ->
-    relx_plugin_apps_per_rel(ReleaseType) ++
-        relx_apps_per_edition(Edition).
-
-relx_plugin_apps_per_rel(cloud) ->
-    [];
-relx_plugin_apps_per_rel(edge) ->
-    [].
-
 relx_apps_per_edition(ee) ->
     [
         emqx_license,
@@ -480,9 +442,7 @@ emqx_etc_overlay(ReleaseType, Edition) ->
         emqx_etc_overlay_common().
 
 emqx_etc_overlay_per_rel(cloud) ->
-    [{"{{base_dir}}/lib/emqx/etc/emqx_cloud/vm.args", "etc/vm.args"}];
-emqx_etc_overlay_per_rel(edge) ->
-    [{"{{base_dir}}/lib/emqx/etc/emqx_edge/vm.args", "etc/vm.args"}].
+    [{"{{base_dir}}/lib/emqx/etc/emqx_cloud/vm.args", "etc/vm.args"}].
 
 emqx_etc_overlay_common() ->
     [{"{{base_dir}}/lib/emqx/etc/ssl_dist.conf", "etc/ssl_dist.conf"}].

+ 1 - 1
scripts/buildx.sh

@@ -16,7 +16,7 @@ set -euo pipefail
 help() {
     echo
     echo "-h|--help:                 To display this usage information"
-    echo "--profile <PROFILE>:       EMQX profile to build (emqx|emqx-edge|emqx-enterprise)"
+    echo "--profile <PROFILE>:       EMQX profile to build (emqx|emqx-enterprise)"
     echo "--pkgtype tgz|pkg:         Specify which package to build, tgz for .tar.gz,"
     echo "                           pkg for .rpm or .deb"
     echo "--elixir:                  Specify if the release should be built with Elixir, "

+ 3 - 3
scripts/check-elixir-applications.exs

@@ -22,7 +22,7 @@ defmodule CheckElixirApplications do
       env: [{"DEBUG", "1"}]
     )
 
-    mix_apps = mix_applications(inputs.release_type, inputs.edition_type)
+    mix_apps = mix_applications(inputs.edition_type)
     rebar_apps = rebar_applications(profile)
     results = diff_apps(mix_apps, rebar_apps)
 
@@ -70,8 +70,8 @@ defmodule CheckElixirApplications do
     end
   end
 
-  defp mix_applications(release_type, edition_type) do
-    EMQXUmbrella.MixProject.applications(release_type, edition_type)
+  defp mix_applications(edition_type) do
+    EMQXUmbrella.MixProject.applications(edition_type)
   end
 
   defp rebar_applications(profile) do

+ 0 - 3
scripts/pkg-tests.sh

@@ -9,9 +9,6 @@ case "${MAKE_TARGET}" in
     emqx-enterprise-*)
         EMQX_NAME='emqx-enterprise'
         ;;
-    emqx-edge-*)
-        EMQX_NAME='emqx-edge'
-        ;;
     emqx-*)
         EMQX_NAME='emqx'
         ;;

+ 0 - 4
scripts/relup-base-packages.sh

@@ -21,10 +21,6 @@ case $PROFILE in
         DIR='enterprise'
         EDITION='enterprise'
         ;;
-    "emqx-edge")
-        DIR='edge'
-        EDITION='edge'
-        ;;
     *)
         echo "Unknown profile $PROFILE"
         exit 1