CRS conversion service
This document presents useful information about common development activities for the CRS service.
This repository contains
- The Java implementation of the Converter (aka crs-conversion-serice).
- To open the Java project, open
pom.xml
. - The core module is in the crs-converter-core. The Java code is located in its
src
sub-folder and tests are located insrc/test/java/org/opengroup/osdu/crs/...
- The provider folder contains different provider implementations.
- Python integration and health tests in the
testing
folder. See also the test's README.md
Prerequisites
- The project builds with maven. Make sure maven is installed locally.
- 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
- Run the
maven run
command to have the .jar file generated. - Have the Azure subscription set up
- Open a Powershell
- Install the Azure CLI locally
- Authenticate yourself to Azure Container Registry (acr) with the following command:
az acr login --name delfi
- Execute the following command to build the container image:
docker build -t crs-converter .
- Execute the following command to build the container image:
docker run -t --rm -p 8080:8080 crs-converter
- 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.