diff --git a/.github/workflows/build_packages.yaml b/.github/workflows/build_packages.yaml index 09a443848..778424882 100644 --- a/.github/workflows/build_packages.yaml +++ b/.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 diff --git a/.github/workflows/build_slim_packages.yaml b/.github/workflows/build_slim_packages.yaml index f62febf0e..f5bb29c13 100644 --- a/.github/workflows/build_slim_packages.yaml +++ b/.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 diff --git a/.github/workflows/elixir_apps_check.yaml b/.github/workflows/elixir_apps_check.yaml index 5fb834959..f1b8c7d01 100644 --- a/.github/workflows/elixir_apps_check.yaml +++ b/.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 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4c7445c1c..9ca319a0e 100644 --- a/.github/workflows/release.yaml +++ b/.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 diff --git a/.github/workflows/run_fvt_tests.yaml b/.github/workflows/run_fvt_tests.yaml index 60c06fe75..0cf530765 100644 --- a/.github/workflows/run_fvt_tests.yaml +++ b/.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: diff --git a/Makefile b/Makefile index d5806197d..26adfd704 100644 --- a/Makefile +++ b/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' diff --git a/apps/emqx/src/emqx_release.erl b/apps/emqx/src/emqx_release.erl index 6bb46afd8..62dcd89dc 100644 --- a/apps/emqx/src/emqx_release.erl +++ b/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. diff --git a/apps/emqx_rule_engine/rebar.config b/apps/emqx_rule_engine/rebar.config index 5e05444ba..110caa33d 100644 --- a/apps/emqx_rule_engine/rebar.config +++ b/apps/emqx_rule_engine/rebar.config @@ -10,7 +10,6 @@ warn_unused_import, warn_obsolete_guard, no_debug_info, - %% for edge compressed, {parse_transform} ]}. diff --git a/build b/build index b48b943ee..f7b7300a6 100755 --- a/build +++ b/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}" ) ;; diff --git a/mix.exs b/mix.exs index 7197913d5..00a1305be 100644 --- a/mix.exs +++ b/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,15 +202,15 @@ 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(edition_type == :enterprise, - do: [ - emqx_enterprise_conf: :load, - emqx_license: :permanent - ], + if(is_app(:observer), + do: [observer: :load], else: [] ) ++ - if(release_type == :cloud, - do: [xmerl: :permanent, observer: :load], + if(edition_type == :enterprise, + do: [ + emqx_license: :permanent, + emqx_enterprise_conf: :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 diff --git a/rebar.config.erl b/rebar.config.erl index 1d41e7768..0a1aa3349 100644 --- a/rebar.config.erl +++ b/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"}]. diff --git a/scripts/buildx.sh b/scripts/buildx.sh index dcd5c4a54..1b716d637 100755 --- a/scripts/buildx.sh +++ b/scripts/buildx.sh @@ -16,7 +16,7 @@ set -euo pipefail help() { echo echo "-h|--help: To display this usage information" - echo "--profile : EMQX profile to build (emqx|emqx-edge|emqx-enterprise)" + echo "--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, " diff --git a/scripts/check-elixir-applications.exs b/scripts/check-elixir-applications.exs index 80a252410..42c838199 100755 --- a/scripts/check-elixir-applications.exs +++ b/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 diff --git a/scripts/pkg-tests.sh b/scripts/pkg-tests.sh index 5fce0f71e..b12c8478a 100755 --- a/scripts/pkg-tests.sh +++ b/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' ;; diff --git a/scripts/relup-base-packages.sh b/scripts/relup-base-packages.sh index ff9e3ba1c..0a910a5b4 100755 --- a/scripts/relup-base-packages.sh +++ b/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