summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorMagnus <mfeuer@jaguarlandrover.com>2014-08-14 15:50:35 -0700
committerMagnus <mfeuer@jaguarlandrover.com>2014-08-14 15:50:35 -0700
commit2c608fdaab106ebbbe22954d4dc52d2106585008 (patch)
tree468d13d8fb4650a1e7b83f1ff71a412ef94762ce /priv
parent80acc58149f3388296fbeb348f84cc80adf86bea (diff)
downloadrvi_core-2c608fdaab106ebbbe22954d4dc52d2106585008.tar.gz
Fixed
Signed-off-by: Magnus <mfeuer@jaguarlandrover.com>
Diffstat (limited to 'priv')
-rw-r--r--priv/backend.config41
-rw-r--r--priv/ivi.config113
2 files changed, 125 insertions, 29 deletions
diff --git a/priv/backend.config b/priv/backend.config
index 4161cfb..e5c6681 100644
--- a/priv/backend.config
+++ b/priv/backend.config
@@ -1,8 +1,20 @@
%% -*- erlang -*-
+
+%% Copyright (C) 2014, Jaguar Land Rover
+%%
+%% This program is licensed under the terms and conditions of the
+%% Mozilla Public License, version 2.0. The full text of the
+%% Mozilla Public License is at https://www.mozilla.org/MPL/2.0/
+%%
+%% Configuration file for the (in-vehicle) IVI used by the hvac_demo
+%% See ../hvac_demo/README.md for detai;s
+%%
+
+%% -----------------------------------------------
+%% See ivi.config file for documentation and hints
+%% -----------------------------------------------
+
[
- %% Put include first, making it possible to override any defaults below
- %%
- %% Add our own app(s)
{apps,
[kernel,
stdlib,
@@ -27,27 +39,25 @@
data_link_bert_rpc,
protocol ]},
- %%
- %% Custom environment settings
- %%
{env,
[
{lager,
[ { handlers,
- [{lager_console_backend, debug}]
+ [{lager_console_backend, notice}]
}
]
},
{rvi,
[
- { node_address, "127.0.0.1:9990" }, %% Should match bert_rpc_server below
+ { node_address, "127.0.0.1:8807" },
{ node_service_prefix, "jlr.com/backend/"},
- { backend_address, "127.0.0.1:9990" },
- { backend_service_prefix, "jlr.com/backend/" },
-
- %% Fire up a bert rpcserver for the backend data link module.
+ { static_nodes,
+ [
+ %% We are the backend server. No need.
+ ]
+ },
{ components,
[
@@ -78,12 +88,9 @@
},
{ data_link,
[
- %% Listen to port 9990 for incoming calls. Must match
- %% the port specified for node_address, which is used by
- %% remote nodes to address this node.
- { bert_rpc_server, [ { port, 9990 }]},
{ url, "http://127.0.0.1:8806" },
- { exo_http_opts, [ { port, 8806 } ] }
+ { exo_http_opts, [ { port, 8806 } ] },
+ { bert_rpc_server, [ { port, 8807 }]}
]
}
diff --git a/priv/ivi.config b/priv/ivi.config
index 6323484..c53d856 100644
--- a/priv/ivi.config
+++ b/priv/ivi.config
@@ -1,8 +1,20 @@
%% -*- erlang -*-
+
+%% Copyright (C) 2014, Jaguar Land Rover
+%%
+%% This program is licensed under the terms and conditions of the
+%% Mozilla Public License, version 2.0. The full text of the
+%% Mozilla Public License is at https://www.mozilla.org/MPL/2.0/
+%%
+%% Configuration file for the (in-vehicle) IVI used by the hvac_demo
+%%
+%% See ../hvac_demo/README.md for details on the demo.
+%%
+%% See ../CONFIGURE.md for a details on the configuration process
+%% itself.
+%%
[
- %% Put include first, making it possible to override any defaults below
- %%
- %% Add our own app(s)
+ %% All erlang apps needed to fire up a node. Do not touch.
{apps,
[kernel,
stdlib,
@@ -18,8 +30,18 @@
ssl,
asn1,
+ %% RVI-specific apps.
-
+ %% Do not touch unless you are replacing apps with your own
+ %% version. If you are replacing an app with a non-Erlang version,
+ %% it still has to be loaded in order to resolve.
+ %% If, for example, you want to deploy your own scheduler
+ %% outside Erlang, replace
+ %%
+ %% schedule,
+ %% with
+ %% { schedule, load },
+ %%
rvi,
rvi_common,
service_edge,
@@ -31,30 +53,94 @@
%%
%% Custom environment settings
+ %% for all apps running on the node.
%%
{env,
[
+ %% Lager is the main logging mechanism.
+ %% See https://github.com/basho/lager for details.
+ %%
{lager,
[ { handlers,
- [ {lager_console_backend, debug} ]
+ %% Change this to debug, info, notice, warning, or error in
+ %% order to lower the console chatter.
+ [ {lager_console_backend, notice} ]
}
]
},
+ %% All RVI configuration is done here.
+ %% Please note that the rvi_node.sh launch script
+ %% can still override the port range and static nodes
+ %% through its command line parameters.
+ %%
{rvi,
[
- %% Should matcch bert_rpc_server below
- { node_address, "127.0.0.1:9991" },
+
+ %% Specify the node address that data_link uses to listen to
+ %% incoming traffic from other rvi nodes.
+ %%
+ %% This is the address that is announced to
+ %% other rvi nodes during service discovery and should be
+ %% forwarded through firewalls and port forwarding to to the port
+ %% specified by the configuration entry rvi -> components ->
+ %% data_link -> bert_rpc_server (see below).
+ %%
+ { node_address, "127.0.0.1:8817" },
+
+ %% Specify the prefix of all services that this rvi node is hosting.
+ %%
+ %% All local services regsitering with service edge will be prefixed with
+ %% the string below when they are announced to remote rvi nodes
+ %% that connect to this node (using the address specified
+ %% by node_address above).
+ %%
+ %% If a locally connected service registers itself as
+ %% "hvac/fan_speed", and the node_service_prefix is
+ %% "jlr.com/vin/1234/", this node will announce the service
+ %% "jlr.com/vin/1234/hvac/fan_speed" as being available
+ %% to remotely connected rvi nodes.
+ %%
+ %% Two rvi nodes should never have the same node_service_prefix
+ %% value.
+ %%
{ node_service_prefix, "jlr.com/vin/1234/"},
- { backend_address, "127.0.0.1:9990" }, %% See data_link_device:send_data() for details
- { backend_service_prefix, "jlr.com/backend/" },
+ %% Specify static service prefixes with well known addresses
+ %%
+ %% Static nodes allows a local RVI node to route services with
+ %% matching prefixes to a well known address of a remote node. A
+ %% static node is often a backend/cloud server that is assumed to
+ %% be found at a given address as soon as network connectivity
+ %% has been established.
+ %%
+ %% When a locally connected service issues a message or rpc to a
+ %% service, and the network address of the service cannot be
+ %% found in the tables maintained by the peer-to-peer service
+ %% discovery process, the static nodes table below is scanned as
+ %% to prefix match the service and locate a suitable network
+ %% address.
+ %%
+ { static_nodes,
+ [
+ { "jlr.com/backend/", "localhost:8807" }
+ ]
+ },
+
{ components,
[
{ service_edge,
+ %% This is the URL that local services use to connect to
+ %% the RVI system. It is also used by
+ %% the other components below to send inter-compoonent
+ %% JSON-RPC calls to the service edge.
+ %%
+ %% The host and address given in URL should route to the port given
+ %% in exo_http_opts below.
+ %%
[ { url, "http://127.0.0.1:8811" },
- { exo_http_opts, [ { port, 8811 } ] }
+ { exo_http_opts, [ { port, 8811 } ] }
]
},
{ service_discovery,
@@ -79,8 +165,11 @@
},
{ data_link,
[ { url, "http://127.0.0.1:8816" },
- { bert_rpc_server, [ {port, 9991 }]},
- { exo_http_opts, [ { port, 8816 } ] }
+ { exo_http_opts, [ { port, 8816 } ] },
+
+ %% The bert_rpc_server port will be used to listen to incoming
+ %% traffic from remote nodes.
+ { bert_rpc_server, [ {port, 8817 }]}
]
}
]