Skip to content
Snippets Groups Projects
README.md 4.47 KiB
Newer Older
  • Learn to ignore specific revisions
  • Artem Dobrynin (EPAM)'s avatar
    Artem Dobrynin (EPAM) committed
    # Notification Service
    
    Rustam Lotsmanenko (EPAM)'s avatar
    Rustam Lotsmanenko (EPAM) committed
    notification-gcp is a [Spring Boot](https://spring.io/projects/spring-boot) service that allow for interested consumers to subscribe to data and metadata changes using a publish/subscriber pattern.
    
    
    ## Table of Contents <a name="TOC"></a>
    * [Getting started](#Getting-started)
    * [Mappers](#Mappers)
    * [Settings and Configuration](#Settings-and-Configuration)
    * [Run service](#Run-service)
    * [Testing](#Testing)
    * [Tutorial](#Tutorial)
    * [Licence](#License)
    
    
    Rustam Lotsmanenko (EPAM)'s avatar
    Rustam Lotsmanenko (EPAM) committed
    ## Getting Started
    These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
    
    
    This is a universal solution created using EPAM OQM mapper technology.
    It allows you to work with various implementations of message brokers.
    
    
    For more information about mappers:
    - [OQM Readme](https://community.opengroup.org/osdu/platform/system/lib/cloud/gcp/oqm/-/blob/master/README.md)
    
    
    In the current version, the OQM mapper is equipped with 2 drivers to the message brokers:
    
    1. Mandatory
       - Java 8
       -[Maven 3.6.0+](https://maven.apache.org/download.cgi)
    
    2. For Google Cloud only
       - GCloud command line tool
       - GCloud access to opendes project
    
    ### Anthos Service Configuration:
    [Anthos service configuration ](docs/anthos/README.md)
    ### GCP Service Configuration:
    [Gcp service configuration ](docs/gcp/README.md)
    
    Rustam Lotsmanenko (EPAM)'s avatar
    Rustam Lotsmanenko (EPAM) committed
    Check that maven is installed:
    ```bash
    $ mvn --version
    Apache Maven 3.6.0
    Maven home: /usr/share/maven
    Java version: 1.8.0_212, vendor: AdoptOpenJDK, runtime: /usr/lib/jvm/jdk8u212-b04/jre
    ...
    ```
    
    You will need to configure access to the remote maven repository that holds the OSDU dependencies. This file should live within `~/.m2/settings.xml`:
    
    ```bash
    $ cat ~/.m2/settings.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
        <servers>
            <server>
                <id>os-core</id>
                <username>slb-des-ext-collaboration</username>
                <!-- Treat this auth token like a password. Do not share it with anyone, including Microsoft support. -->
                <password>${VSTS_FEED_TOKEN}</password>
            </server>
        </servers>
    </settings>
    ```
    
    * Update the Google cloud SDK to the latest version:
    
    ```bash
    gcloud components update
    ```
    * Set Google Project Id:
    
    ```bash
    gcloud config set project <YOUR-PROJECT-ID>
    ```
    
    * Perform a basic authentication in the selected project:
    
    ```bash
    gcloud auth application-default login
    ```
    
    * Navigate to notification service's root folder and run:
    
    ```bash
    mvn jetty:run
    ## Testing
    * Navigate to notification service's root folder and run:
     
    ```bash
    mvn clean install   
    ```
    
    * If you wish to see the coverage report then go to testing/target/site/jacoco-aggregate and open index.html
    
    * If you wish to build the project without running tests
    
    ```bash
    mvn clean install -DskipTests
    ```
    
    After configuring your environment as specified above, you can follow these steps to build and run the application. These steps should be invoked from the *repository root.*
    
    ```bash
    cd provider/notification-gcp/ && mvn spring-boot:run -Dspring-boot.run.profiles=local 
    ```
    
    ## Testing
    
    
    #### Anthos:
    [Anthos Testing](docs/anthos/README.md)
    #### GCP:
    [Gcp Testing](docs/gcp/README.md)
    
    
    ## Tutorial
    
    - [Notification OpenAPI specification ](../../docs/api/notification_openapi.yaml)
    - [Notification tutorial ](../../docs/tutorial/DataNotification.md)
    
    ## Entitlements groups
    Notification service account should have entitlements groups listed below:
    - users
    - users.datalake.editors
    - service.entitlements.user
    
    
    Rustam Lotsmanenko (EPAM)'s avatar
    Rustam Lotsmanenko (EPAM) committed
    ## License
    Copyright © Google LLC
    
    Copyright © EPAM Systems
     
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
     
    [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
     
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.