Change executable_groups and add bin_dir hook

This commit is contained in:
Ulf Wiger 2025-05-21 22:40:40 +02:00
parent 476bedfdac
commit d45f64f027
5 changed files with 11 additions and 12 deletions

View File

@ -12,7 +12,7 @@
{ref, "818ce33"}}}, {ref, "818ce33"}}},
{gmhive_worker, {git, "https://git.qpq.swiss/QPQ-AG/gmhive_worker", {ref, "708f1a6"}}}, {gmhive_worker, {git, "https://git.qpq.swiss/QPQ-AG/gmhive_worker", {ref, "708f1a6"}}},
{gmconfig, {git, "https://git.qpq.swiss/QPQ-AG/gmconfig.git", {gmconfig, {git, "https://git.qpq.swiss/QPQ-AG/gmconfig.git",
{ref, "32c1ed5c4b"}}}, {ref, "38620ff9e2"}}},
{gproc, "1.0.0"}, {gproc, "1.0.0"},
{setup, {git, "https://github.com/uwiger/setup", {ref, "3ad83ed"}}} {setup, {git, "https://github.com/uwiger/setup", {ref, "3ad83ed"}}}
]}. ]}.

View File

@ -22,12 +22,8 @@
0}, 0},
{<<"gmconfig">>, {<<"gmconfig">>,
{git,"https://git.qpq.swiss/QPQ-AG/gmconfig.git", {git,"https://git.qpq.swiss/QPQ-AG/gmconfig.git",
{ref,"32c1ed5c4bc0913adc175fb18b1c9251acc7b606"}}, {ref,"38620ff9e2289dff121377c382e4d5b08c719d87"}},
0}, 0},
{<<"gmcuckoo">>,
{git,"https://git.qpq.swiss/QPQ-AG/gmcuckoo.git",
{ref,"9f3aef96d8660e83ef8b5a7ee64908060a8c6572"}},
1},
{<<"gmhive_protocol">>, {<<"gmhive_protocol">>,
{git,"https://git.qpq.swiss/QPQ-AG/gmhive_protocol.git", {git,"https://git.qpq.swiss/QPQ-AG/gmhive_protocol.git",
{ref,"818ce33cc1dec74c020515be48fb548a5207befd"}}, {ref,"818ce33cc1dec74c020515be48fb548a5207befd"}},

View File

@ -44,12 +44,16 @@ appl_env(K, C) ->
undefined -> C undefined -> C
end. end.
appl_env(bin_dir_hook , H , C) -> set_bin_dir_hook(H), C;
appl_env(pubkey , K , C) -> C#{<<"pubkey">> => K}; appl_env(pubkey , K , C) -> C#{<<"pubkey">> => K};
appl_env(extra_pubkeys , Ks, C) -> C#{<<"extra_pubkeys">> => Ks}; appl_env(extra_pubkeys , Ks, C) -> C#{<<"extra_pubkeys">> => Ks};
appl_env(pool_admin_url, U , C) -> merge(C, #{<<"pool_admin">> => #{<<"url">> => U}}); appl_env(pool_admin_url, U , C) -> merge(C, #{<<"pool_admin">> => #{<<"url">> => U}});
appl_env(workers , Ws, C) -> C#{<<"workers">> => Ws}. appl_env(workers , Ws, C) -> C#{<<"workers">> => Ws}.
env_keys() -> [pubkey, extra_pubkeys, pool_admin_url, workers, network]. set_bin_dir_hook({Mod, F}) when is_atom(Mod), is_atom(F) ->
application:set_env(gmhive_worker, bin_dir_hook, {Mod, F}).
env_keys() -> [pubkey, extra_pubkeys, pool_admin_url, workers, network, bin_dir_hook].
cpath([<<"pubkey">>]) -> [user_config ]; cpath([<<"pubkey">>]) -> [user_config ];
cpath([<<"extra_pubkeys">>]) -> [user_config, schema_default]; cpath([<<"extra_pubkeys">>]) -> [user_config, schema_default];

View File

@ -66,7 +66,7 @@ pool_admin() ->
workers() -> workers() ->
array( array(
#{default => [#{executable => <<"mean29-generic">>, #{default => [#{executable => <<"mean29-generic">>,
executable_group => <<"aecuckoo">>}], executable_group => <<"cpu">>}],
description => description =>
<<"Definitions of workers' configurations. If no worker are configured one worker " <<"Definitions of workers' configurations. If no worker are configured one worker "
"is used as default, i.e. 'mean29-generic' executable without any extra args.">>}, "is used as default, i.e. 'mean29-generic' executable without any extra args.">>},
@ -83,9 +83,8 @@ workers() ->
"from faster CPU supporting AVX2 instructions).">>}), "from faster CPU supporting AVX2 instructions).">>}),
executable_group => executable_group =>
str(#{description => <<"Group of executable binaries of the worker.">>, str(#{description => <<"Group of executable binaries of the worker.">>,
enum => [ <<"aecuckoo">>, <<"aecuckooprebuilt">>, enum => [ <<"cpu">>, <<"cuda">> ],
<<"gmcuckoo">>, <<"cuda">>, <<"gajumine">> ], default => <<"cpuo">>}),
default => <<"aecuckoo">>}),
extra_args => extra_args =>
str(#{description => <<"Extra arguments to pass to the worker executable binary. " str(#{description => <<"Extra arguments to pass to the worker executable binary. "
"The safest choice is specifying no arguments i.e. empty string.">>, "The safest choice is specifying no arguments i.e. empty string.">>,

View File

@ -16,7 +16,7 @@
-include_lib("kernel/include/logger.hrl"). -include_lib("kernel/include/logger.hrl").
-define(DEFAULT_EXECUTABLE_GROUP , <<"gajumine">>). -define(DEFAULT_EXECUTABLE_GROUP , <<"cpu">>).
-define(DEFAULT_EXTRA_ARGS , <<>>). -define(DEFAULT_EXTRA_ARGS , <<>>).
-define(DEFAULT_HEX_ENCODED_HEADER , false). -define(DEFAULT_HEX_ENCODED_HEADER , false).
-define(DEFAULT_REPEATS , 1). -define(DEFAULT_REPEATS , 1).