Skip to content
This repository has been archived by the owner on Oct 30, 2020. It is now read-only.

Building and Deployment

DanNglk edited this page Feb 13, 2017 · 1 revision

Building

Building the Complex Event Processing Service (CEPS) is easy, just run the following command inside the main directory:

./gradlew build

This command uses the Gradle wrapper to build the CEPS and run some unit tests.

Deployment

In order to deploy and run the CEPS you first need to install CouchDB. You can download and install CouchDB from http://docs.couchdb.org/en/2.0.0/install/index.html or just install via package manager:

sudo apt-get install couchdb

CouchDB needs a new Admin, which will later be used by the CEPS to access CouchDB. Run the following command to create a new Admin user in CouchDB:

curl -X PUT http://localhost:5984/_config/admins/admin -d ‘“admin”’

Additionally, you need a running instance of the Open Data Service (ODS) to get CEPS working. Take a look at the ODS Building and Deployment Wiki to understand how to build and deploy an ODS instance.

Now we're ready to set up the CEPS by creating a new configuration file. Copy the template configuration from server/ceps-configuration.yml.template to server/ceps-configuration.yml and edit the file:

  • Edit self-URL to CEPS instance

      url: http://localhost:8080/ceps/api/v1
    
  • Edit ODS URL and authentication

      ods:
        url: http://localhost:8080/ods/api/v1
        admin:
          username: [email protected]
          password: admin123
    
  • Edit CouchDB URL and Admin username/password

      couchDb:
        url: http://localhost:5984/
        dbPrefix: ceps
        maxConnections: 100
        admin:
          username: admin
          password: admin
    
  • Edit authentication paragraph and enter new OAuth2 web client id (for authorizing users on log in) and possible OAuth2 client Ids (for authorizing apps) for each client application

      auth:
        users:
          - name: Admin
            email: [email protected]
            role: ADMIN
            password: admin123
            type: basic
        googleOAuthWebClientId: xxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
        googleOAuthClientIds:
          - xxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
    
  • (Optional) Edit Google Cloud Messaging (GSM) API key to allow clients to receive updates and notifications

  • (Optional) Edit server configuration e.g. port, context path, etc...

      server:
        applicationContextPath: /ceps/api/v1
        applicationConnectors:
        - type: http
          port: 8082
        adminConnectors:
        - type: http
          port: 8083
    

Now you have to rebuild the project to apply and test the new created configuration. Finally you can run the CEPS by using the Gradle wrapper. The following commands will build and deploy the CEPS on the machines localhost:

./gradlew clean build
./gradlew run

To check if the CEPS is running just open your browser and type http://127.0.0.1:8082/ceps/api/v1/version. This should produce some output about which version and build of the CEPS you're currently using.

Clone this wiki locally