Docker fixes

This commit is contained in:
stephb9959
2021-02-05 21:02:57 -08:00
parent 3b1b3369d8
commit 2c94801cb3
3 changed files with 14 additions and 11 deletions

View File

@@ -33,22 +33,22 @@ mkdir docker_logs_node1
HOSTNAMES="--add-host mgr.owls.net:172.21.10.2 --add-host node1.owls.net:172.21.10.3 --add-host $TIP_CONTROLLER_NAME:$TIP_CONTROLLER_IP"
#
# A simulation file is used to describe how a simulation should run. Here is the content...
# A simulation file called sim1.yaml is used to describe how a simulation should run. Here is the content...
#
# simulation:
# name: sim1
# ca:
# name: tip1
# cert: tipcert.pem (this file should be in the $PWD/ssl dir)
# key: tipkey.pem (this file should be in the $PWD/ssl dir)
# cert: /etc/ssl/tipcert.pem (this file should be in the $PWD/ssl dir)
# key: /etc/ssl/tipkey.pem (this file should be in the $PWD/ssl dir)
# password: mypassword
# server: (should be the same name as TIP_CONTROLLER_NAME
# port: 6643
# devices: 10
#
# To run a script, please replace the host line with this in your manager section
# To run a script, please replace the host line with this one in your manager section
#
# -e ERL_NODE_NAME="mgr@mgr.owls.net" -e ERL_OPTIONS="-noshell -noinput" -e ERL_NODE_TYPE="manager" -e TIP_AUTH="2" -e SIM_SCRIPT="sim1.yaml" \
# -e ERL_NODE_NAME="mgr@mgr.owls.net" -e ERL_OPTIONS="-noshell -noinput" -e ERL_NODE_TYPE="manager" -e TIP_AUTH="2" -e SIM_SCRIPT="/scripts/sim1.yaml" \

View File

@@ -23,12 +23,6 @@ stop(_State) ->
start() ->
ok = app_settings(),
case init:get_argument(sim) of
{ok,[[Script]]} ->
timer:apply_after(30*1000,user_default,run_script,[Script]);
_ ->
ok
end,
application:ensure_all_started(owls).
load_cli()->

View File

@@ -23,6 +23,7 @@ init([]) ->
Processes = case utils:app_env(role,undefined) of
manager ->
?L_I("Simulation Manager starting."),
should_i_run_a_script(),
node_finder:creation_info() ++
manager:creation_info() ++
manager_rest_api:creation_info() ++
@@ -51,3 +52,11 @@ init([]) ->
lager:error("No role has been defined in configuration (must be manager or node)")
end,
{ok, {{one_for_one, 1, 5}, Processes}}.
should_i_run_a_script() ->
case init:get_argument(sim) of
{ok,[[Script]]} ->
timer:apply_after(30*1000,user_default,run_script,[Script]);
_ ->
ok
end.