Commit Graph

735 Commits

Author SHA1 Message Date
Thales Macedo Garitezi bd0d331b64
Merge pull request #6636 from emqx/elixir-packages-mkII
ci(mix): build emqx packages with elixir
2022-01-27 11:10:30 -03:00
Zaiming (Stone) Shi 8c114db168 chore: pin hocon 0.23.0 2022-01-27 00:23:08 +01:00
Thales Macedo Garitezi 506dad169a
chore(elixir_otp): bump emqx-builder images 2022-01-26 16:59:50 -03:00
Thales Macedo Garitezi 01092982c1
fix(elixir): do not start logger before config
Despite Hocon generating the same config in both Elixir and Erlang
releases, apparently starting Logger before other applications has the
subtle effect of redirecting all logs to `log/erlang.log.N`, even
those lines that should appear in `log/emqx.log.N`.  Simply not adding
it to the application list restores the Erlang release behavior.
2022-01-26 16:59:48 -03:00
Thales Macedo Garitezi bc498a8041
ci(mix): add fvt tests and docker images with elixir 2022-01-26 16:59:48 -03:00
Thales Macedo Garitezi 6dd11665bb
ci(mix): build emqx packages with elixir 2022-01-26 16:59:48 -03:00
Thales Macedo Garitezi f34e87daeb
chore(ekka): update ekka -> 0.11.3
This ekka tag contains the core node discovery callback feature.
2022-01-26 14:19:39 -03:00
Zaiming (Stone) Shi d2a0b163da build: mix build version per edition type 2022-01-26 14:25:59 +01:00
DDDHuang e2ba0fc4ae fix(minirest): app version to 1.2.10 support string desc in api spec 2022-01-21 09:41:13 +08:00
Zaiming (Stone) Shi a04c834d05 chore: relocate some release files from data/ to rel/
data dir at the root is easily confused with the data
dir for EMQ X at run time
2022-01-14 16:41:22 +01:00
zhouzb e2676bcbd8 fix: fix dep of epgsql 2022-01-13 11:39:48 +08:00
k32 6ee18b6104 refactor(broker): Don't use a macro 2022-01-05 01:28:31 +01:00
Zaiming (Stone) Shi 1eaac9ea12 feat: add redbug 2022-01-04 00:56:25 +01:00
Zaiming (Stone) Shi 57a466f372 chore: sync rebar dependency to mix build 2022-01-03 12:53:49 +01:00
Thales Macedo Garitezi 6858f496a7
chore(hocon): update hocon version 2021-12-31 14:13:39 -03:00
Thales Macedo Garitezi c70a47bba6
refactor(mix): undo the `bin/emqx` script split into helper files 2021-12-30 13:45:13 -03:00
Thales Macedo Garitezi cea54365dd
chore(mix): keep debug info and docs in beams 2021-12-28 10:27:17 -03:00
Thales Macedo Garitezi 32b7dc406f
docs: document the elixir release vars 2021-12-28 08:46:33 -03:00
Thales Macedo Garitezi 1e567ac2b1
chore(mix): populate BUILT_ON file 2021-12-27 17:28:46 -03:00
Thales Macedo Garitezi 360a00622b
chore(mix): copy more files required by relup 2021-12-27 16:07:38 -03:00
Thales Macedo Garitezi 432faf7bd2
chore(mix): copy emqx_ctl to release as well 2021-12-27 14:09:48 -03:00
Thales Macedo Garitezi a54e108296
ci(mix): add application mode check
This adds a CI check to ensure that applications and their modes are
in sync between Elixir and Rebar release builds.
2021-12-27 13:09:55 -03:00
Thales Macedo Garitezi c14e8db869
style(format): format elixir files 2021-12-27 10:51:12 -03:00
Thales Macedo Garitezi a4fd777d77
chore(mix): take into account different release/package/edition types 2021-12-27 09:57:56 -03:00
Thales Macedo Garitezi cc652c3343
ci(mix): add elixir deps check
Checks whether there are discrepancies between rebar3 and mix deps.
2021-12-24 14:44:49 -03:00
Thales Macedo Garitezi 08571f0914
chore(mix): fix: vm.args is actually a template file 2021-12-24 09:59:53 -03:00
Thales Macedo Garitezi 4977921cdb
chore(mix): produce tar and copy more files to release 2021-12-24 09:59:30 -03:00
Thales Macedo Garitezi 4287a8f88d
chore(mix): auto-discover umbrella apps 2021-12-24 08:22:26 -03:00
Thales Macedo Garitezi 67cca5d3a1
chore(mix): use the same script in mix release as in rebar release
Surprisingly enough, by doing small cirurgical changes in the existing
EMQX control scripts, we are able to get it running with Elixir and
with existing functionalities (`console`, `remote_console`, `start`,
`stop`, `ctl`, `foreground`, `eval`).
2021-12-23 17:20:04 -03:00
Thales Macedo Garitezi 238895a301
chore(mix): correctly define release version
With this, we no longer need the last hack in `mix_release.sh`.

A version schema with 3 parts (Major.Minor.Patch) is required by
Elixir:

https://hexdocs.pm/elixir/1.13.1/Version.html#module-versions
2021-12-22 15:43:43 -03:00
Thales Macedo Garitezi 62024854e5
chore(mix): wrap produced script and set required variables
We create a shim script that calls the one produced by Mix Release,
creating and setting the required configurations.
2021-12-22 15:15:19 -03:00
Thales Macedo Garitezi 93d603e336
chore(mix): copy more required files to release
This adds a few more required file copying/templating to the release
build step.
2021-12-22 09:46:40 -03:00
Thales Macedo Garitezi 34d6dbca61
chore(mix): simplify build by using rebar3 for umbrella apps
By treating the apps in the umbrella as dependencies to be managed and
built by rebar3, we can simplify the maintenance of the release, at
the cost of increased build times: using Mix as before, it could track
changed files better than using rebar.  But the complexity and
possibility of discrepancies make it using rebar much more compelling.
2021-12-22 09:40:01 -03:00
Thales Macedo Garitezi 2ff46a6dbb
chore(mix): create a few more required files during release
Since Mix does not support hot upgrades out of the box, it does not
create a `RELEASES` file by default.  Here, we introduce functionality
similar to what `relx` does in order for that file to be generated.

fdc8d7237e/src/rlx_assemble.erl (L928-L948)

The `RELEASES` file, in its turn, is required for `nodetool` to work
properly, and `nodetool` is required for us to generate several
required config files using `hocon`.  Since the `start{_clean}.boot`
file used by the files generated by Elixir must be explicitly defined
in the `RELEASE_LIB` `boot_var`, we apply a small patch in the
existing `nodetool` in order to inject that required parameter when
calling the escript.
2021-12-21 17:28:39 -03:00
Thales Macedo Garitezi 917575de5a
chore(mix): minimal elixir mix release build
This commit enables a minimal working build of EMQX release using
Mix.  However, to properly start the release, several configuration
steps are still missing.  A `mix_release.sh` script does a few hacks
to get the release built with Mix to start properly, by first assuming
that `make emqx` has been run prior to the release, ran once to
generate the `app.*.config` files, and then it copies that and some
other files to the expected places.

Also, `emqx_telemetry` hangs the start procedure because it thinks
it's in an official release and tries to make a request.  We disable
it temporarily via config just to get a working build for now.
2021-12-21 13:51:22 -03:00