-
Vibhuti Sharma [Microsoft] authoredVibhuti Sharma [Microsoft] authored
Indexer Service
indexer-aws is a Spring Boot service that provides a set of APIs to index storage records against Elasticsearch. It's not user-facing, all APIs are used internally by the platform.
Running Locally
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Prerequisites
Pre-requisites
- JDK 8 (https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html)
- Maven 3.8.3 or later
- Lombok 1.16 or later
- OSDU Instance deployed on AWS
Service Configuration
In order to run the service locally or remotely, you will need to have the following environment variables defined.
name | example value | required | description | sensitive? |
---|---|---|---|---|
LOCAL_MODE |
true |
yes | Set to 'true' to use env vars in place of the k8s variable resolver | no |
APPLICATION_PORT |
8080 |
yes | The port the service will be hosted on. | no |
AWS_REGION |
us-east-1 |
yes | The region where resources needed by the service are deployed | no |
AWS_ACCESS_KEY_ID |
ASIAXXXXXXXXXXXXXX |
yes | The AWS Access Key for a user with access to Backend Resources required by the service | yes |
AWS_SECRET_ACCESS_KEY |
super-secret-key== |
yes | The AWS Secret Key for a user with access to Backend Resources required by the service | yes |
AWS_SESSION_TOKEN |
session-token-xxxxxxxxxx |
no | AWS Session token needed if using an SSO user session to authenticate | yes |
ENVIRONMENT |
osdu-prefix |
yes | The Resource Prefix defined during deployment | no |
LOG_LEVEL |
DEBUG |
yes | The Log Level severity to use (https://www.tutorialspoint.com/log4j/log4j_logging_levels.htm) | no |
SSM_ENABLED |
true |
yes | Set to 'true' to use SSM to resolve config properties, otherwise use env vars | no |
SSL_ENABLED |
false |
no | Set to 'false' to disable SSL for local development | no |
ENTITLEMENTS_BASE_URL |
http://localhost:8081 or https://some-hosted-url
|
yes | Specify the base url for an entitlements service instance. Can be run locally or remote | no |
PARTITION_BASE_URL |
http://localhost:8082 or https://some-hosted-url
|
yes | Specify the base url for a partition service instance. Can be run locally or remote | no |
STORAGE_BASE_URL |
http://localhost:8082 or https://some-hosted-url
|
yes | Specify the base url for a partition service instance. Can be run locally or remote | no |
SCHEMA_BASE_URL |
http://localhost:8082 or https://some-hosted-url
|
yes | Specify the base url for a partition service instance. Can be run locally or remote | no |
STORAGE_RECORDS_BATCH_SIZE |
20 | Batch size for storage API POST {endpoint}/query/records:batch
|
no | - |
STORAGE_RECORDS_BY_KIND_BATCH_SIZE |
- | Batch size for storage API GET {endpoint}/query/records . If this is not present, defaults to value of STORAGE_RECORDS_BATCH_SIZE
|
no | - |
Run Locally
Check that maven is installed:
example:
$ mvn --version
Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)
Maven home: /usr/local/Cellar/maven/3.8.3/libexec
Java version: 1.8.0_312, vendor: Amazon.com Inc., runtime: /Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home/jre
...
You may need to configure access to the remote maven repository that holds the OSDU dependencies. Copy one of the below files' content to your .m2 folder
-
For development against the OSDU GitLab environment, leverage:
<REPO_ROOT>~/.mvn/community-maven.settings.xml
-
For development in an AWS Environment, leverage:
<REPO_ROOT>/provider/indexer-aws/maven/settings.xml
-
Navigate to the service's root folder and run:
mvn clean package -pl indexer-core,provider/indexer-aws
- If you wish to build the project without running tests
mvn clean package -pl indexer-core,provider/indexer-aws -DskipTests
After configuring your environment as specified above, you can follow these steps to run the application. These steps should be invoked from the repository root.
NOTE: If not on osx/linux: Replace *
with version numbers as defined in the provider/indexer-aws/pom.xml file