Skip to content
Snippets Groups Projects
Rostislav Dublin (EPAM)'s avatar
Rostislav Dublin (EPAM) authored
Added new version info endpoint (GONRG-2811)

See merge request !67
c1ba102a
History

CRS conversion service

This document presents useful information about common development activities for the CRS service.

This repository contains

  1. The Java implementation of the Converter (aka crs-conversion-serice).
  2. To open the Java project, open pom.xml.
  3. The core module is in the crs-converter-core. The Java code is located in its src sub-folder and tests are located in src/test/java/org/opengroup/osdu/crs/...
  4. The provider folder contains different provider implementations.
  5. Python integration and health tests in the testing folder. See also the test's README.md

Prerequisites

  1. The project builds with maven. Make sure maven is installed locally.
  2. The project requires the Lombok plug-in installed for your IDE.

Make the below change for a successful local build. Do not commit this change.

  • Comment the following in "crs-converter-core/pom.xml"
<!--    <localRepositoryPath>${basedir}/../../.m2/repository</localRepositoryPath>-->

Running CRS Conversion Service locally

Build and run CRS Conversion Service locally using bash

  • Set the required environments described in Release/deployment section
  • Navigate to the Converter Service's root folder crs-conversion-service
  • Build core and run unit tests on command line:
    • In order to run unit tests, set the SIS_DATA variable before building
export SIS_DATA=${SRC_ROOT_DIR}/apachesis_setup/SIS_DATA
mvn clean install 
# To run without tests add -DskipTests=true
  • Run application with command
java -jar provider/crs-converter-azure/crs-converter-aks/target/crs-converter-aks-1.0.0.jar

Debug CRS Conversion Service locally

  • Perform build as instructed in the Build and run Converter Service locally section
  • Start the application:
java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=5005,suspend=n -jar provider/crs-converter-azure/crs-converter-aks/target/crs-converter-aks-1.0.0.jar
  • Set up remote debugging configuration in Intellij and start it

  • Environment variables: Set the required environments described in Release/deployment section

  • Execute Debug for configured Application

In the Postman Settings / General, turn SSL certificate validation off when running locally. Similarly, when not using Postman but client code, set the configuration verify_ssl false (see instructions)

Run application using debug mode and use Postman to send a GET request to obtaining the Swagger API documentation

http://localhost:8080/api/crs/converter/v2/api-docs

or send a POST request to convert points.

http://localhost:8080/api/crs/converter/v2/convert

Open the Swagger-UI:

http://localhost:8080/api/crs/converter/swagger-ui.html

Headers for Postman:

Key Value
Authorization Bearer <token>
data-partition-id $MY_TENANT (see testing\README.md)

Build and run the Docker container locally

  1. Run the maven run command to have the .jar file generated.
  2. Have the Azure subscription set up
  3. Open a Powershell
  4. Install the Azure CLI locally
  5. Authenticate yourself to Azure Container Registry (acr) with the following command: az acr login --name delfi
  6. Execute the following command to build the container image: docker build -t crs-converter .
  7. Execute the following command to build the container image: docker run -t --rm -p 8080:8080 crs-converter
  8. Use Postman or curl to try out the endpoints

Release/deployment

VSTS release definition is located at provider\crs-converter-azure\crs-converter-aks\devops, which requires the following environment variables:

Variable Contents Example
ENTITLEMENT_URL Required
SIS_DATA Required ${SRC_ROOT_DIR}/apachesis_setup/SIS_DATA

GCP

Instructions for Google Cloud Platform implementation can be found here.