Refactoring code for Reference implementation
Description:
Link to story: https://gitlab.opengroup.org/osdu/pmc/community-implementation/-/issues/11
More details about the solution: https://community.opengroup.org/osdu/documentation/-/wikis/Pluggable-approach-for-Mappers-and-Drivers
As a part of the community implementation solution GC module was refactored to the Core-Plus module, in addition new pluggable approach for Drivers was used.
What is the current behavior?
- We do not have the core-plus module.
- Drivers not pluggable, all dependencies bounded during the compile step.
What is the new behavior?
- We have the core-plus module.
- Drivers are pluggable and could be attached to service during image build, not compile.
Dev Checklist:
- Start
-
Copy ./provider/service-gc to ./service-core-plus
-
- Dependencies
-
Add core-plus
as a module to the root pom file, located in ./pom.xml -
Replace Google Drivers OQM, OBM, OSM with latest Community Core Drivers OQM, OBM, OSM, ex: old oqm new os-oqm-core -
Replace core-lib-gc with core-plus-common-lib -
Add spring boot loader dependency. -
Update spring-boot-maven
plugin, to use PropertiesLauncher as a main class. -
Remove Google Cloud dependencies, except Google Datastore (it's a known issue. Datastore dependency should accompany OSM, if you had to add it please update the issue with the project link).
-
- Code and Documentation cleanups
-
Reimport dependencies in Java classes. -
(Optional) Rename classes that have GC or GCP in names, ex: old DatasetApplicationGCP.java new DatasetCorePlusApplication.java -
Delete ./service-core-plus/docs/gc, which contains instructions related to Google Cloud mode. -
(Optional) Clean up all docs from instructions purposed for Google Cloud. -
Delete application-anthos.properties and application-gcp.properties. Spring profiles won't be used in Community Implementation to switch between Drivers. -
Remove @ConditionalOn annotations, which are related to Drivers("osmMapper", "obmDriver"....), from Java classes. -
Delete Google JSON formatter from logback.xml .
-
- Deployment, Continuous Integration
-
Add override-stages.yml to /devops/core-plus/pipeline/ -
Add the following job overrides (may vary, content should be adjusted accordingly):
gc-containerize-gitlab:core-plus:
gc-helm-charts-gitlab:core-plus:
gc-baremetal-deploy:
gc-baremetal-test:
-
Add core-plus/pipeline/override-stages.yml to the root .gitlab-ci.yml -
Add download_plugins job to the root .gitlab-ci.yml. Make sure to use the latest versions. -
Update core-plus Dockerfile, add a step with plugin copy. -
In the same Dockerfile add a new -Dloader. run args, to point out the plugin location, and the original main class. -
Update .fossa.yml by adding a new core-plus module.
-
- Finish
-
Make sure to have a passing gc-baremetal-deploy
andgc-baremetal-test
, since we're reusing the GC environment for now.
-
Edited by Rustam Lotsmanenko (EPAM)