summaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
authorMagnus Feuer <mfeuer@jaguarlandrover.com>2015-06-07 16:27:49 -0700
committerMagnus Feuer <mfeuer@jaguarlandrover.com>2015-06-09 13:54:05 -0700
commit9c4a808dfbfe7fd4a73874cb317171bb4533191a (patch)
tree5ba5242976f87affabcfe074b2212002c92c4039 /packaging
parenta13fd36530c1287ac4a3371cb44841de74333a25 (diff)
downloadrvi_core-9c4a808dfbfe7fd4a73874cb317171bb4533191a.tar.gz
Moved tizen.config to packaging Temporary workaround for setup issues in backend.config.
Diffstat (limited to 'packaging')
-rwxr-xr-xpackaging/rvi.spec2
-rw-r--r--packaging/tizen.config340
2 files changed, 341 insertions, 1 deletions
diff --git a/packaging/rvi.spec b/packaging/rvi.spec
index b61339a..659fff5 100755
--- a/packaging/rvi.spec
+++ b/packaging/rvi.spec
@@ -26,7 +26,7 @@ for i in $(find deps -name '*.app.src'); do sed 's/git/"1.0"/' < $i > $i.tmp; mv
make compile
# Create a tizen node if that is what we have.
-./scripts/setup_rvi_node.sh -n rvi-$RPM_PACKAGE_VERSION -c tizen.config
+./scripts/setup_rvi_node.sh -n rvi-$RPM_PACKAGE_VERSION -c ./packaging/tizen.config
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/opt/rvi-$RPM_PACKAGE_VERSION
diff --git a/packaging/tizen.config b/packaging/tizen.config
new file mode 100644
index 0000000..6bdc2db
--- /dev/null
+++ b/packaging/tizen.config
@@ -0,0 +1,340 @@
+%% -*- 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.
+%%
+[
+ %% All erlang apps needed to fire up a node. Do not touch.
+ {apps,
+ [kernel,
+ stdlib,
+ sasl,
+ {setup, load},
+ syntax_tools,
+ lager,
+ crypto,
+ public_key,
+ exo,
+ compiler,
+ ssl,
+ asn1,
+ wse,
+ %% 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_discovery,
+ service_edge,
+ authorize,
+ schedule,
+ dlink_tcp,
+ bt,
+ dlink_bt,
+ proto_bert,
+ proto_json
+ ]},
+
+ %%
+ %% 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,
+ %% 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.
+ %%
+ %% Value substitution:
+ %% All string values under the rvi tuple tree are scanned
+ %% for specific dokens during startup. If a token is
+ %% found, it will be replaced with a value referenced by it.
+ %% Tokens can one of the following:
+ %%
+ %% $rvi_file(FileName,Default) - File content
+ %% When an $rvi_file() token is encountered, the first line of
+ %% the referenced file is read. The line (without the newline)
+ %% replaces the token.
+ %%
+ %% Example:
+ %% { node_service_prefix, "jlr.com/vin/$rvi_file(/etc/vin,default_vin)"},
+ %%
+ %% will be substituted with the first line from the file
+ %% /etc/vin:
+ %%
+ %% { node_service_prefix, "jlr.com/vin/2GKEG25HXP4093669"},
+ %%
+ %% If /etc/vin cannot be opened, the value default_vin
+ %% will be used instead.
+ %%
+ %%
+ %% $rvi_env(EnvironemtnName,Default) - Environment variable
+ %% When an $rvi_env() token is encountered, the value of
+ %% the Linux process environment variable (such as $HOME) is read
+ %% to replace the token.
+ %%
+ %% Example:
+ %% { node_service_prefix, "jlr.com/vin/$rvi_env(VIN,default_vin)"},
+ %%
+ %% will be substituted with the value of the $VIN environment
+ %% variable:
+ %%
+ %% { node_service_prefix, "jlr.com/vin/2GKEG25HXP4093669"},
+ %%
+ %% If VIN is not a defined environment variable, the value
+ %% default_vin will be used instead.
+ %%
+ %%
+ %% $rvi_uuid(Default) - Unique machine identifier
+ %% When an $rvi_uuid() token is encountered, the UUID of the root
+ %% disk used by the system is read to replace the token.
+ %% The UUID of the root disk is retrieved by opening /proc/cmdline
+ %% and extracting the root=UUID=[DiskUUID] value.
+ %% This value is generated at system install time and is reasonably
+ %% world wide unique.
+ %%
+ %% Example:
+ %% { node_service_prefix, "jlr.com/vin/$uuid(default_vin)"},
+ %%
+ %% will be substituted with the value of the root disk UUID:
+ %%
+ %% { node_service_prefix,
+ %% "jlr.com/vin/afc0a6d8-0264-4f8a-bb3e-51ff8655b51c"},
+ %%
+ %% If the root UUID cannot be retrieved, the value default_vin
+ %% will be used instead.
+ %%
+
+ {rvi,
+ [
+
+ %% 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).
+ %%
+ %% If this node is sitting behind a firewall and cannot
+ %% receive incomign connections on any address, its
+ %% node_address should be set to "0.0.0.0:0" to inform
+ %% the remote node that it should not attempt to
+ %% connect back to self.
+ { node_address, "0.0.0.0:0" },
+
+ %% 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 unless all services add a system-wide unique name
+ %% to it.
+ %%
+ { node_service_prefix, "jlr.com/vin/$rvi_file(/home/app/content/Documents/vin,no_vin)/"},
+
+
+ %% Routing rules determining how to get a message targeting a specific
+ %% service to its destination.
+ %%
+ %% Please note that if a remotely initiated (== client) data link is
+ %% available and has announced that the targeted service is available,
+ %% that data link will be used regardless of what it is.
+ %%
+ %% In other words, if you setup routing rules for how to reach out
+ %% to a vehicle using SMS, and that vehicle happens to have a 3G
+ %% connection up when the message is sent, the 3G connection will be used.
+ %%
+ %% We will add a blacklist feature in the future to optionally block
+ %% such opportunistic routing in the future.
+ %%
+ { routing_rules,
+ [
+ %% Service name prefix that rules are specified for
+ %% The service prefix with the longest match against the service targeted
+ %% by the message will be used.
+ %%
+ %% Example: Targeted service = jlr.com/backend/sota/get_updates
+ %%
+ %% Prefix1: { "jlr.com/backend", [...]}
+ %% Prefix2: { "jlr.com/backend/sota", [...]}
+ %%
+ %% Prefix2 will be used.
+ %%
+ %% This allows you, for example, to setup different servers
+ %% for different types of services (SOTA, remote door unlock,
+ %% HVAC etc).
+ %%
+
+ %% Make sure to have a default if you don't want your message
+ %% to error out immediately. With a default the message will
+ %% be queued until it times out, waiting for a remote node
+ %% to connect and announce that it can handle the targeted service.
+ { "jlr.com/backend/",
+ %% Which protocol and data link pair to use when transmitting the message
+ %% to the targeted service. If a pair reports a failure, the next pair is tried.
+ [
+ { proto_json_rpc, { dlink_tcp_rpc, [ { target, "38.129.64.31:8807" } ]}}
+ ]
+ }
+ ]
+ },
+ { components,
+ [
+ %% A note about JSON-RPC calls vs gen_server calls:
+ %%
+ %% All locally connected services communicate with Service Edge
+ %% through JSON-RPC.
+ %%
+ %% Communication between the internal RVI components, however,
+ %% can be either JSON-RPC or gen_server calls.
+ %%
+ %% JSON-RPC calls provide compatability with replacement components
+ %% written in languages other than Erlang.
+ %%
+ %% Gen_server calls provide native erlang inter-process calls that
+ %% are about 4x faster than JSON-RPC when transmitting large data volumes.
+ %%
+ %% If one or more of the components below are replaced with external
+ %% components, use JSON-RPC by specifying IP address and port in
+ %% json_rpc_address for all interfaced by the external components.
+ %%
+ %% If you are running an all-native erlang system, use gen_server calls
+ %% by specifying gen_server for all components
+ %%
+ %% Please note that communication between two RVI nodes are
+ %% not affected by this since data_link_bert_rpc will use
+ %% BERT-RPC to communicate ( using the address/port specified
+ %% by bert_rpc_server).
+ %%
+
+ %% Service_edge.
+ %% The service_edge tuple is a top level configuration
+ %% container for everything about service edge.
+ %% In theory, we can support multiple different service edge
+ %% components (written in different languages).
+ %%
+ %% However, until we've sorted out internal routing, we will
+ %% only support the native service_edge_rpc component,
+ %% accessed either as a gen_server or through JSON-RPC.
+ %%
+ {service_edge,
+ [
+ %% Service_edge_rpc component is used as a gen_server
+ { service_edge_rpc, gen_server,
+ [
+ %% JSON-RPC address will be translated to
+ %% an URL looking like this:
+ %% http://127.0.0.1:8811
+ %%
+ %% This URL is used both for communication with
+ %% locally connected services and for intra-component
+ %% communication in case the access method for
+ %% service_edge_rpc is specified as json_rpc.
+ { json_rpc_address, { "127.0.0.1", 8811 } },
+
+ %% Websocket is used for websocket access, preferably
+ %% through the rvi.js package available for Javascript
+ %% apps in browsers and crosswalk who wants to interface
+ %% RVI.
+ { websocket, [ { port, 8818}]}
+ ]
+ }
+ ]
+ },
+ { service_discovery,
+ [ { service_discovery_rpc, gen_server,
+ [
+ ]
+ }
+ ]
+ },
+ { schedule,
+ [ { schedule_rpc, gen_server,
+ [
+ ]
+ }
+ ]
+ },
+ { authorize,
+ [ { authorize_rpc, gen_server,
+ [
+ ]
+ }
+ ]
+ },
+ { protocol,
+ [ { proto_json_rpc, gen_server,
+ [
+ ]
+ }
+ ]
+ },
+ { data_link,
+ [ { dlink_tcp_rpc, gen_server,
+ [
+ %% Bert_rpc server specifies the port we should
+ %% listen to for incoming connections
+ %% from other rvi nodes.
+ %% A specific NIC address can also be specified
+ %% through the {ip, "192.168.0.1" } tuple.
+ { server_opts, [ { port, 8817 }]},
+
+ %% Setup persistent connections
+ { persistent_connections, [ "38.129.64.31:8807" ]}
+ ]
+ },
+ { dlink_bt_rpc, gen_server,
+ [
+ %% Bert_rpc server specifies the
+ { server_opts, [ { channel, 1 }]}
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]}
+ ]}
+].