Commit 296e8189 authored by harshit aggarwal's avatar harshit aggarwal Committed by Hema Vishnu Pola [Microsoft]
Browse files

Updating README for wks-azure

parent 99e6a215
## License
Copyright © Microsoft Corporation
## wks-azure
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
Wks-Azure is a [Spring Boot](https://spring.io/projects/spring-boot) service transforms a given storage record in adherence to a well known schema creating a WKS record.
http://www.apache.org/licenses/LICENSE-2.0
## Running Locally
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.
### Requirements
### Environment Variables
In order to run this service locally, you will need the following:
- [Maven 3.6.0+](https://maven.apache.org/download.cgi)
- [AdoptOpenJDK8](https://adoptopenjdk.net/)
### General Tips
**Environment Variable Management**
The following tools make environment variable configuration simpler
- [direnv](https://direnv.net/) - for a shell/terminal environment
- [EnvFile](https://plugins.jetbrains.com/plugin/7861-envfile) - for [Intellij IDEA](https://www.jetbrains.com/idea/)
**Lombok**
This project uses [Lombok](https://projectlombok.org/) for code generation. You may need to configure your IDE to take advantage of this tool.
- [Intellij configuration](https://projectlombok.org/setup/intellij)
- [VSCode configuration](https://projectlombok.org/setup/vscode)
## Service Dependencies
- [storage](https://community.opengroup.org/osdu/platform/system/storage)
- [schema](https://community.opengroup.org/osdu/platform/system/schema-service)
- [search](https://community.opengroup.org/osdu/platform/system/search-service)
### Understanding Environment Variables
In order to run the service locally, you will need to have the following environment variables defined.
**System Environment required to run service**
Refer to [application.properties](./src/main/resources/application.properties)
Definitions for Azure Environment variables used
**Required to run service**
| name | value | description | sensitive? | source |
| --- | --- | --- | --- | --- |
| `storage_service_endpoint` | ex `https://foo-storage.azurewebsites.net` | Storage API endpoint | no | output of infrastructure deployment |
| `appinsights_key` | `********` | API Key for App Insights | yes | output of infrastructure deployment |
| `cosmosdb_database` | ex `dev-osdu-r2-db` | Cosmos database for storage documents | no | output of infrastructure deployment |
| `storage_container` | `osdu-wks-mappings` | Storage Container name | no | - |
......@@ -35,10 +48,28 @@ Definitions for Azure Environment variables used
| `AZURE_CLIENT_SECRET` | `********` | Secret for `$AZURE_CLIENT_ID` | yes | keyvault secret: `$KEYVAULT_URI/secrets/app-dev-sp-password` |
| `search_service_endpoint` | ex `https://search-service/api/search/v2` | Search service endpoint | no | - |
| `storage_service_endpoint` | ex `https://storage-service/api/storage/v2` | Storage service endpoint | no | - |
| `schmea_service_endpoint` | ex `https://schema-service/api/schema/v1` | Schema service endpoint | no | - |
| `schema_service_endpoint` | ex `https://schema-service/api/schema/v1` | Schema service endpoint | no | - |
| `partition_service_endpoint` | ex `http://partition/api/partition/v1` | Partition service endpoint | no | - |
| `default_tenant` | ex `opendes` | Default tenant that hosts mapping files | no | output of infrastructure deployment |
>>>>>>> master
**Required to run integration tests**
| name | value | description | sensitive? | source |
| --- | --- | --- | --- | --- |
| `INTEGRATION_TESTER` | `********` | System identity to assume for API calls. Note: this user must have entitlements configured already | no | -- |
| `AZURE_TESTER_SERVICEPRINCIPAL_SECRET` | `********` | Secret for `$INTEGRATION_TESTER` | yes | -- |
| `AZURE_AD_TENANT_ID` | `********` | AD tenant to authenticate users from | yes | -- |
| `AZURE_AD_APP_RESOURCE_ID` | `********` | AAD client application ID | yes | output of infrastructure deployment |
| `VENDOR` | ex `gcp/azure/aws` | Cloud provider name | no | - |
| `STORAGE_URL` | ex `https://storage.azurewebsites.net/api/storage/v2/` | storage service endpoint | no | - |
| `HOST` | ex `https://osdu-test.org` | Host url for the services | no | - |
| `LEGAL_TAG` | ex `opendes-public-usa-dataset-7643990` | legal tag name | no | - |
| `DOMAIN` | ex `contoso.com` | domain name | no | - |
| `ACL_OWNERS` | ex `data.test1` | owner acls | no | - |
| `ACL_VIEWERS` | ex `data.test1` | viewer acls | no | - |
| `OS_TARGET_SCHEMA_KIND` | ex `slb:oga:wellbore:1.0.0` | Schema kind for WKS records, takes a default value as (slb:wks:wellbore:1.3.1)| no | - |
| `OS_TARGET_SCHEMA_KIND_TENANT` | ex `opendes:oga:wellbore:1.0.0` | Schema kind for WKS records with tenant name, takes a default value as (opendes:wks:wellbore:1.3.1)| no | - |
| `DATA_PARTITION_ID` | ex `opendes` | data partition id| no | - |
### Build and run the application
......@@ -57,4 +88,27 @@ $ cd provider/wks-azure/ && mvn clean package
$ mvn spring-boot:run -Dspring-boot.run.profiles=local
# or directly run the jar file
$ cd provider/wks-azure/ && java -jar target\wks-azure-1.0.0-spring-boot.jar
```
\ No newline at end of file
```
### Debugging
Jet Brains - the authors of Intellij IDEA, have written an [excellent guide](https://www.jetbrains.com/help/idea/debugging-your-first-java-application.html) on how to debug java programs.
### Commands to run tests
* `mvn clean install` and `mvn verfify` to be executed inside testing/wks-test-core directory (Make sure environment variable are set before executing these commands)
* Intellij can be used to run the tests using [Cucumber Plugin](https://plugins.jetbrains.com/plugin/7212-cucumber-for-java) for IntelliJ [ Use the EnvFile plugin to use environment variables directly from .env or .json/.yaml file]
## License
Copyright © Microsoft Corporation
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.
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment