Skip to content
Snippets Groups Projects
Commit 057d9690 authored by Aliaksandr Ramanovich (EPAM)'s avatar Aliaksandr Ramanovich (EPAM)
Browse files

Gonrg 5894 gc rename

parent 0b96980a
No related branches found
No related tags found
1 merge request!347Gonrg 5894 gc rename
Showing
with 93 additions and 75 deletions
...@@ -30,9 +30,6 @@ variables: ...@@ -30,9 +30,6 @@ variables:
IBM_HELM_CONFIG_PATH: devops/ibm/ibm-legal-config IBM_HELM_CONFIG_PATH: devops/ibm/ibm-legal-config
IBM_HELM_DEPLOY_PATH: devops/ibm/ibm-legal-deploy IBM_HELM_DEPLOY_PATH: devops/ibm/ibm-legal-deploy
# FIXME remove when all services are migrated to a single helm
OSDU_GCP_ENABLE_HELM_CONFIG: "false"
include: include:
- project: "osdu/platform/ci-cd-pipelines" - project: "osdu/platform/ci-cd-pipelines"
file: "standard-setup.yml" file: "standard-setup.yml"
...@@ -61,14 +58,13 @@ include: ...@@ -61,14 +58,13 @@ include:
- project: "osdu/platform/ci-cd-pipelines" - project: "osdu/platform/ci-cd-pipelines"
file: "cloud-providers/ibm.yml" file: "cloud-providers/ibm.yml"
- project: "osdu/platform/ci-cd-pipelines" - project: "osdu/platform/ci-cd-pipelines"
file: "cloud-providers/azure.yml" file: "cloud-providers/azure.yml"
- project: "osdu/platform/ci-cd-pipelines" - project: "osdu/platform/ci-cd-pipelines"
file: "cloud-providers/osdu-gcp-global.yml" file: "cloud-providers/gc-global.yml"
- project: "osdu/platform/ci-cd-pipelines" - project: "osdu/platform/ci-cd-pipelines"
file: "publishing/pages.yml" file: "publishing/pages.yml"
- local: "devops/gcp/pipeline/override-stages.yml" - local: "devops/gc/pipeline/override-stages.yml"
apiVersion: v2 apiVersion: v2
name: gcp-legal-deploy name: gc-legal-deploy
description: A Helm chart for Kubernetes description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart. # A chart can be either an 'application' or a 'library' chart.
...@@ -21,4 +21,4 @@ version: 0.1.0 ...@@ -21,4 +21,4 @@ version: 0.1.0
# incremented each time you make changes to the application. Versions are not expected to # incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using. # follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes. # It is recommended to use it with quotes.
appVersion: "1.16.0" appVersion: "1.19.0"
...@@ -99,13 +99,13 @@ First you need to set variables in **values.yaml** file using any code editor. S ...@@ -99,13 +99,13 @@ First you need to set variables in **values.yaml** file using any code editor. S
**logLevel** | logging level | string | ERROR | yes **logLevel** | logging level | string | ERROR | yes
**springProfilesActive** | active spring profile | string | gcp | yes **springProfilesActive** | active spring profile | string | gcp | yes
**acceptHttp** | accept Http traffic | string | true | yes **acceptHttp** | accept Http traffic | string | true | yes
**googleAudiences** | your GCP client id | string | - | yes **googleAudiences** | your Google Cloud client id | string | - | yes
**dataPartitionId** | data partition id | string | - | yes **dataPartitionId** | data partition id | string | - | yes
**entitlementsHost** | Entitlements host URL | string | http://entitlements | yes **entitlementsHost** | Entitlements host URL | string | <http://entitlements> | yes
**defaultLegalTag** | Default legal tag | string | default-data-tag| yes **defaultLegalTag** | Default legal tag | string | default-data-tag| yes
**legalHost** | Legal host URL | string | http://legal | yes **legalHost** | Legal host URL | string | <http://legal> | yes
> googleAudiences: If you are connected to GCP console with `gcloud auth application-default login --no-browser` from your terminal, you can get your client_id using the command: > googleAudiences: If you are connected to Google Cloud console with `gcloud auth application-default login --no-browser` from your terminal, you can get your client_id using the command:
```console ```console
cat ~/.config/gcloud/application_default_credentials.json | grep client_id cat ~/.config/gcloud/application_default_credentials.json | grep client_id
...@@ -145,7 +145,7 @@ cat ~/.config/gcloud/application_default_credentials.json | grep client_id ...@@ -145,7 +145,7 @@ cat ~/.config/gcloud/application_default_credentials.json | grep client_id
Run this command from within this directory: Run this command from within this directory:
```console ```console
helm install gcp-legal-deploy . helm install gc-legal-deploy .
``` ```
## Uninstalling the Chart ## Uninstalling the Chart
...@@ -153,7 +153,7 @@ helm install gcp-legal-deploy . ...@@ -153,7 +153,7 @@ helm install gcp-legal-deploy .
To uninstall the helm deployment: To uninstall the helm deployment:
```console ```console
helm uninstall gcp-legal-deploy helm uninstall gc-legal-deploy
``` ```
To delete secrets and PVCs: To delete secrets and PVCs:
......
File moved
variables:
GC_SERVICE: legal
GC_VENDOR: gc
# FIXME: Delete after merging all helm charts
GC_ENABLE_HELM_CONFIG: "false"
gc-anthos-test:
variables:
GC_VENDOR: anthos
gc-containerize-bootstrap-gitlab:
variables:
GC_ENABLE_BOOTSTRAP: "false"
gc-containerize-bootstrap-gcr:
variables:
GC_ENABLE_BOOTSTRAP: "false"
variables:
OSDU_GCP_SERVICE: legal
OSDU_GCP_VENDOR: gcp
osdu-gcp-anthos-test:
variables:
OSDU_GCP_VENDOR: anthos
osdu-gcp-containerize-bootstrap-gitlab:
variables:
OSDU_GCP_ENABLE_BOOTSTRAP: "true"
osdu-gcp-containerize-bootstrap-gcr:
variables:
OSDU_GCP_ENABLE_BOOTSTRAP: "true"
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<modules> <modules>
<module>legal-core</module> <module>legal-core</module>
<module>provider/legal-gcp</module> <module>provider/legal-gc</module>
<module>provider/legal-byoc</module> <module>provider/legal-byoc</module>
<module>provider/legal-azure</module> <module>provider/legal-azure</module>
<module>provider/legal-aws</module> <module>provider/legal-aws</module>
......
# legal-gcp # legal-gc
os-legal-gcp is a Spring Boot service that hosts CRUD APIs that enable management of legal tags within the OSDU R2 ecosystem. legal-gc is a Spring Boot service that hosts CRUD APIs that enable management of legal tags within the OSDU R2 ecosystem.
## Getting Started ## 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. 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.
### Prerequisites ### Prerequisites
- [Maven 3.6.0+](https://maven.apache.org/download.cgi) - [Maven 3.6.0+](https://maven.apache.org/download.cgi)
- [AdoptOpenJDK8](https://adoptopenjdk.net/) - [AdoptOpenJDK8](https://adoptopenjdk.net/)
- [Lombok 1.16 or later](https://projectlombok.org/setup/maven) - [Lombok 1.16 or later](https://projectlombok.org/setup/maven)
- [GCloud SDK with java (latest version)](https://cloud.google.com/sdk/docs/install) - [GCloud SDK with java (latest version)](https://cloud.google.com/sdk/docs/install)
# Features of implementation # Features of implementation
This is a universal solution created using EPAM OSM and OBM mappers technology. This is a universal solution created using EPAM OSM and OBM mappers technology.
It allows you to work with various implementations of KV stores and Blob stores. It allows you to work with various implementations of KV stores and Blob stores.
...@@ -39,12 +40,14 @@ They switch between datasources of different tenants due to the work of a bunch ...@@ -39,12 +40,14 @@ They switch between datasources of different tenants due to the work of a bunch
## Mapper tuning mechanisms ## Mapper tuning mechanisms
This service uses specific implementations of DestinationResolvers based on the tenant information provided by the OSDU Partition service. This service uses specific implementations of DestinationResolvers based on the tenant information provided by the OSDU Partition service.
- for Google Datastore: osm/DsTenantDestinationResolver.java - for Google Datastore: osm/DsTenantDestinationResolver.java
- for Postgres: osm/PgTenantDestinationResolver.java - for Postgres: osm/PgTenantDestinationResolver.java
- for MinIO: obm/MinioDestinationResolver.java - for MinIO: obm/MinioDestinationResolver.java
- for RabbitMQ: oqm/MqTenantOqmDestinationResolver.java - for RabbitMQ: oqm/MqTenantOqmDestinationResolver.java
#### Their algorithms are as follows: #### Their algorithms are as follows
- incoming Destination carries data-partition-id - incoming Destination carries data-partition-id
- resolver accesses the Partition service and gets PartitionInfo - resolver accesses the Partition service and gets PartitionInfo
- from PartitionInfo resolver retrieves properties for the connection: URL, username, password etc. - from PartitionInfo resolver retrieves properties for the connection: URL, username, password etc.
...@@ -60,10 +63,14 @@ This service uses specific implementations of DestinationResolvers based on the ...@@ -60,10 +63,14 @@ This service uses specific implementations of DestinationResolvers based on the
# Configuration # Configuration
## Service Configuration ## Service Configuration
### Anthos:
[Anthos service configuration ](docs/anthos/README.md) ### Anthos
### Google Cloud:
[Google Cloud service configuration ](docs/gcp/README.md) [Anthos service configuration](docs/anthos/README.md)
### Google Cloud
[Google Cloud service configuration](docs/google_cloud/README.md)
Check that maven is installed: Check that maven is installed:
...@@ -101,24 +108,25 @@ $ cat ~/.m2/settings.xml ...@@ -101,24 +108,25 @@ $ cat ~/.m2/settings.xml
</settings> </settings>
``` ```
* Update the Google cloud SDK to the latest version: - Update the Google cloud SDK to the latest version:
```bash ```bash
gcloud components update gcloud components update
``` ```
* Set Google Project Id:
- Set Google Project Id:
```bash ```bash
gcloud config set project <YOUR-PROJECT-ID> gcloud config set project <YOUR-PROJECT-ID>
``` ```
* Perform a basic authentication in the selected project: - Perform a basic authentication in the selected project:
```bash ```bash
gcloud auth application-default login gcloud auth application-default login
``` ```
* Navigate to search service's root folder and run: - Navigate to search service's root folder and run:
```bash ```bash
mvn jetty:run mvn jetty:run
...@@ -129,9 +137,9 @@ mvn jetty:run ...@@ -129,9 +137,9 @@ mvn jetty:run
mvn clean install 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 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 - If you wish to build the project without running tests
```bash ```bash
mvn clean install -DskipTests mvn clean install -DskipTests
...@@ -140,7 +148,7 @@ mvn clean install -DskipTests ...@@ -140,7 +148,7 @@ 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.* 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 ```bash
cd provider/legal-gcp/ && mvn spring-boot:run cd provider/legal-gc/ && mvn spring-boot:run
``` ```
## Testing ## Testing
...@@ -152,42 +160,48 @@ Navigate to legal service's root folder and run all the tests: ...@@ -152,42 +160,48 @@ Navigate to legal service's root folder and run all the tests:
$ (cd testing/legal-test-core/ && mvn clean install) $ (cd testing/legal-test-core/ && mvn clean install)
``` ```
### Running E2E Tests ### Running E2E Tests
This section describes how to run cloud OSDU E2E tests. This section describes how to run cloud OSDU E2E tests.
### Anthos test configuration: ### Anthos test configuration
[Anthos service configuration ](docs/anthos/README.md)
### Google Cloud test configuration:
[Google Cloud service configuration ](docs/gcp/README.md)
[Anthos service configuration](docs/anthos/README.md)
### Google Cloud test configuration
[Google Cloud service configuration](docs/google_cloud/README.md)
## Deployment ## Deployment
* Data-Lake Legal Google Cloud Endpoints on App Engine Flex environment - Data-Lake Legal Google Cloud Endpoints on App Engine Flex environment
* Deploy - Deploy
```sh ```sh
mvn appengine:deploy -pl org.opengroup.osdu.legal:legal -amd mvn appengine:deploy -pl org.opengroup.osdu.legal:legal -amd
``` ```
* If you wish to deploy the search service without running tests - If you wish to deploy the search service without running tests
```sh ```sh
mvn appengine:deploy -pl org.opengroup.osdu.legal:legal -amd -DskipTests mvn appengine:deploy -pl org.opengroup.osdu.legal:legal -amd -DskipTests
``` ```
or or
* Google Documentation: https://cloud.google.com/cloud-build/docs/deploying-builds/deploy-appengine
- Google Documentation: <https://cloud.google.com/cloud-build/docs/deploying-builds/deploy-appengine>
## Licence ## Licence
Copyright © Google LLC Copyright © Google LLC
Copyright © EPAM Systems Copyright © EPAM Systems
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
You may obtain a copy of the License at 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) [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 Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......
...@@ -4,7 +4,7 @@ WORKDIR /opt ...@@ -4,7 +4,7 @@ WORKDIR /opt
RUN apt-get update && apt-get install -yq jq RUN apt-get update && apt-get install -yq jq
COPY ./provider/legal-gcp/bootstrap/ /opt/ COPY ./provider/legal-gc/bootstrap/ /opt/
RUN chmod +x bootstrap.sh validate-env.sh RUN chmod +x bootstrap.sh validate-env.sh
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Script that bootstraps legal service # Script that bootstraps legal service
# It creates default legal tag via request to Legal service # It creates default legal tag via request to Legal service
# For now created legal tag name is hardcoded: ${DATA_PARTITION_ID}-initital-data-tag # For now created legal tag name is hardcoded: ${DATA_PARTITION_ID}-initital-data-tag
# Contains logic for both onprem and gcp version # Contains logic for both onprem and gc version
set -ex set -ex
...@@ -22,9 +22,9 @@ get_token_onprem() { ...@@ -22,9 +22,9 @@ get_token_onprem() {
export ID_TOKEN export ID_TOKEN
} }
get_token_gcp() { get_token_gc() {
ID_TOKEN=$(gcloud auth print-identity-token --audiences="${GOOGLE_AUDIENCES}") BEARER_TOKEN=$(gcloud auth print-identity-token --audiences="${GOOGLE_AUDIENCES}")
export ID_TOKEN export BEARER_TOKEN
} }
check_entitlements_readiness() { check_entitlements_readiness() {
...@@ -94,7 +94,7 @@ if [ "${ONPREM_ENABLED}" == "true" ]; then ...@@ -94,7 +94,7 @@ if [ "${ONPREM_ENABLED}" == "true" ]; then
else else
source ./validate-env.sh "GOOGLE_AUDIENCES" source ./validate-env.sh "GOOGLE_AUDIENCES"
get_token_gcp get_token_gc
fi fi
......
...@@ -15,16 +15,22 @@ ...@@ -15,16 +15,22 @@
# limitations under the License. # limitations under the License.
steps: steps:
- name: 'gcr.io/cloud-builders/docker' - name: "gcr.io/cloud-builders/docker"
args: [ args:
'build', [
'--build-arg', 'PROVIDER_NAME=${_PROVIDER_NAME}', "build",
'--build-arg', 'PORT=${_PORT}', "--build-arg",
'-t', 'gcr.io/$PROJECT_ID/${_APPLICATION_NAME}/${_GCP_SERVICE}-${_PROVIDER_NAME}:${_SHORT_SHA}', "PROVIDER_NAME=${_PROVIDER_NAME}",
'-t', 'gcr.io/$PROJECT_ID/${_APPLICATION_NAME}/${_GCP_SERVICE}-${_PROVIDER_NAME}:latest', "--build-arg",
'-f', 'provider/${_GCP_SERVICE}-${_PROVIDER_NAME}/cloudbuild/Dockerfile.cloudbuild', "PORT=${_PORT}",
'.' "-t",
] "gcr.io/$PROJECT_ID/${_APPLICATION_NAME}/${_GC_SERVICE}-${_PROVIDER_NAME}:${_SHORT_SHA}",
"-t",
"gcr.io/$PROJECT_ID/${_APPLICATION_NAME}/${_GC_SERVICE}-${_PROVIDER_NAME}:latest",
"-f",
"provider/${_GC_SERVICE}-${_PROVIDER_NAME}/cloudbuild/Dockerfile.cloudbuild",
".",
]
images: images:
- 'gcr.io/$PROJECT_ID/${_APPLICATION_NAME}/${_GCP_SERVICE}-${_PROVIDER_NAME}' - "gcr.io/$PROJECT_ID/${_APPLICATION_NAME}/${_GC_SERVICE}-${_PROVIDER_NAME}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment