Difference between revisions of "GPII Services Configuration"

From wiki.gpii
Jump to: navigation, search
Line 41: Line 41:
 
* If you are creating configuration for a single <code>gpii.app</code>, you need to save it in the <code>configs</code> directory that corresponds to the location of that GPII app. Currently all GPII apps are located in <code>universal/gpii/node_modules</code> (e.g. Preferences Server, Solutions Registry, etc). Thus, the config file should be located at this path: <code>universal/gpii/node_modules/{some gpii app}/configs</code>.
 
* If you are creating configuration for a single <code>gpii.app</code>, you need to save it in the <code>configs</code> directory that corresponds to the location of that GPII app. Currently all GPII apps are located in <code>universal/gpii/node_modules</code> (e.g. Preferences Server, Solutions Registry, etc). Thus, the config file should be located at this path: <code>universal/gpii/node_modules/{some gpii app}/configs</code>.
  
----
+
==== Basic configuration =====
 
Basic configuration file with a single <code>gpii.server</code> and no <code>gpii.app</code>s will look like this:
 
Basic configuration file with a single <code>gpii.server</code> and no <code>gpii.app</code>s will look like this:
 
<pre>
 
<pre>

Revision as of 20:26, 9 April 2013

Description

This is page contains all the necessary information on how to configure various components (Flow Manager, Match Maker, Device Reporter, etc) within the GPII framework.

The source code for the core framework and all platform independent components can be found here: GPII Universal

All platform specific components can be found in the following repositories:


GPII Server

gpii.server component is one of the building blocks of the GPII framework you are deploying. It represents a single instance of a Node.js http server.

It serves as a container for one or more gpii.app's (see below). A developer has an option of distributing as many gpii.app's across as many gpii.server's as part of their deployment.

The source code for the gpii.server can be found here: gpii.server

GPII App

gpii.app component is a component that represents a single purpose app deployed within a particular gpii.server. Majority of the existing components within the GPII architecture that support the HTTP API (such as the Flow Manager, Device Reporter, Match Maker, Preferences Server, Solutions Registry, etc) are, in fact, gpii.apps themselves.

The source code for the gpii.app can be found here: gpii.app



A developer, generally, would not need to use these components directly in code and instead should be able to bootstrap the whole system with the configuration approach.

Creating a new configuration or editing an existing one for a specific GPII deployment essentially means setting up the appropriate GPII servers and GPII apps for a single deployment.




Creating Configuration File

There are several conventions in regards to where you configuration file should go (set for consistency and is not a technical constraint):

  • If you are creating configuration for multiple apps, consider putting it in universal/gpii/configs if all your GPII apps are defined in a GPII Universal repository. If one or more apps are defined in a platform specific repository, your configuration files should go into a top level configs directory (Note: you might have to create it) within the appropriate platform specific repository.
  • If you are creating configuration for a single gpii.app, you need to save it in the configs directory that corresponds to the location of that GPII app. Currently all GPII apps are located in universal/gpii/node_modules (e.g. Preferences Server, Solutions Registry, etc). Thus, the config file should be located at this path: universal/gpii/node_modules/{some gpii app}/configs.

Basic configuration =

Basic configuration file with a single gpii.server and no gpii.apps will look like this:

{
    "typeName": "your configuration name",
    "options": {
        "gradeNames": ["autoInit", "fluid.littleComponent"],
        "components": {                // List of components to be deployed.
            "gpii server component": { // The name of the server component.
                "type": "gpii.server"  // The type of the server compoennt.
            }
        }
    }
}

Two gpii.servers with no gpii.apps will look like this:

{
    "typeName": "your configuration name",
    "options": {
        "gradeNames": ["autoInit", "fluid.littleComponent"],
        "components": {
            "server one": {
                "type": "gpii.server"
            },
            "server two": {
                "type": "gpii.server"
            }
        }
    }
}