6.3.1 How to make release?
1. Run mix release.init
(RUN ONE TIME ONLY)
2. Run MIX_ENV=prod mix release
$ MIX_ENV=prod mix release
===> Analyzing applications...
===> Compiling idna
==> jason
Compiling 10 files (.ex)
Generated jason app
===> Analyzing applications...
===> Compiling mimerl
==> ssl_verify_fun
Compiling 7 files (.erl)
Generated ssl_verify_fun app
===> Analyzing applications...
===> Compiling certifi
===> Analyzing applications...
===> Compiling parse_trans
===> Analyzing applications...
===> Compiling metrics
===> Analyzing applications...
===> Compiling hackney
==> httpoison
Compiling 3 files (.ex)
Generated httpoison app
==> cpu_gpu_sentry
Compiling 23 files (.ex)
Generated cpu_gpu_sentry app
* assembling cpu_gpu_sentry-0.1.0 on MIX_ENV=prod
* using config/runtime.exs to configure the release at runtime
* creating _build/prod/rel/cpu_gpu_sentry/releases/0.1.0/vm.args
* creating _build/prod/rel/cpu_gpu_sentry/releases/0.1.0/remote.vm.args
* creating _build/prod/rel/cpu_gpu_sentry/releases/0.1.0/env.sh
* creating _build/prod/rel/cpu_gpu_sentry/releases/0.1.0/env.bat
Release created at _build/prod/rel/cpu_gpu_sentry
# To start your system
_build/prod/rel/cpu_gpu_sentry/bin/cpu_gpu_sentry start
Once the release is running:
# To connect to it remotely
_build/prod/rel/cpu_gpu_sentry/bin/cpu_gpu_sentry remote
# To stop it gracefully (you may also send SIGINT/SIGTERM)
_build/prod/rel/cpu_gpu_sentry/bin/cpu_gpu_sentry stop
To list all commands:
_build/prod/rel/cpu_gpu_sentry/bin/cpu_gpu_sentry
3. Run test script
Before run this test script, it's a must that you create a CPU/GPU Miner
on Mining Rig Monitor
to get API_CODE
.
In addition, you also need to create a mining playbook on Mining Rig Monitor
. It will help you test if your release can fetch/execute playbook.
This is an example of working xmrig playbook to mine Monero.
- software name: XMRig
- software version: 6.22.2
- command argument: --no-color --url pool.hashvault.pro:443 --algo rx/0 --user 84CHRDdXzTYLPSBHpnT5iTEFzc5CQuKk43XjLHZ7bdPm6Yw1ZZrbLDJ1M6zhyq5pECdKyDS6xxnUaPczpKXfNd3LJ2bBVeY --pass CPU-GPU-SENTY-RELEASE
mkdir /tmp/cpu_gpu_sentry_tmp;
export CPU_GPU_SENTRY_INSTALLATION_PATH=/tmp/cpu_gpu_sentry_tmp
export MININIG_RIG_COMMANDER_API_URL=http://127.0.0.1:4000/api/v1
export API_CODE=change_me_bro
_build/prod/rel/cpu_gpu_sentry/bin/cpu_gpu_sentry start
4. Create an archive and upload to github
- Go to
_build/prod/rel/_
- Run
tar -cJvf cpu_gpu_sentry.tar.xz cpu_gpu_sentry
- Due to difference version, remember to modify tar name such as:
cpu_gpu_sentry-0.1.0.tar.xz