Skip to content

Commit 3cc6254

Browse files
Sergio Andres Mejia TovarNicolò Bidotti
authored andcommitted
[WIT-2826] Java Tech Adapter Framework HLD
# New features and improvements * Added framework HLD # Related issue Closes WIT-2826 # Definition of Done So you are going to put your MR in review, but are you sure you have done all things listed here? ## All Developments - [ ] **Feature was implemented as per the requirements** - [ ] **If some code parts are complex they must be commented with code documentation** - [ ] **Unit, integration and E2E tests have been performed and code coverage is not reduced**, so that new code is covered - [ ] **CI/CD is successful** - [ ] **Exceptions and errors are handled, returning meaningful errors to the user**, without letting the underlying framework to respond with a generic Internal Server Error. Technical details are stored in the errors/problems and not in the user message - [X] **Documentation (user documentation, HLD and others) has been updated** - Documentation has been updated with explanation of the new feature if it's user-facing (e.g. component now has additional setting) or it impacts them in some other way (e.g. optional field that becomes mandatory) - If it is a breaking change, we have documented it as such in the MR description in a "Breaking Changes" section - [ ] **Helm chart and other DevOps artifacts** have been updated and are valid deployment tools for the new version - [ ] **Problematic information (sensitive information, credentials, customer information or other intellectual property) is not included in the changes** as they could end up being public (most SPs are already published and automatically mirrored on every merge) - [ ] **Feature doesn't negatively affect any existing environments**, especially the clients Playgrounds. This means that merging it to master and deploying it to these environments will not break them and **no manual operations that are not reported in the documentation will be needed** - [ ] **If dependencies were changed, be sure that they will not impact the project**, that their license is compatible, and that they introduce no vulnerabilities - [ ] **Security, Authentication and Authorization have been considered**. No SQL injection, tokens handling, RBAC integration. Common security vulnerabilities identified and resolved ## API related Development - [ ] **API Parameters and return body are compliant** with the API specification - [ ] **Errors are correctly handled**, respecting the type of errors return bodies and responses for each endpoint - [ ] **API is logging in compliance with audit standards**, presence of sensitive information for GDPR has been assessed and removed or managed in case is needed ## DB related Development - [ ] **The database schema is designed to accurately** represent the data model and meet the requirements - [ ] **Tables, relationships, and constraints (e.g. primary keys, foreign keys, unique constraints) are defined appropriately**, following best practices and a common naming convention - [ ] **Sensitive data is stored securely**, encrypted if required, and access is restricted to authorized users - [ ] **Migration scripts to upgrade and downgrade the database have been implemented and tested**
1 parent 1306e3e commit 3cc6254

File tree

4 files changed

+104
-0
lines changed

4 files changed

+104
-0
lines changed

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
target/
2+
!.mvn/wrapper/maven-wrapper.jar
3+
!**/src/main/**/target/
4+
!**/src/test/**/target/
5+
6+
### IntelliJ IDEA ###
7+
.idea/modules.xml
8+
.idea/jarRepositories.xml
9+
.idea/compiler.xml
10+
.idea/libraries/
11+
*.iws
12+
*.iml
13+
*.ipr
14+
15+
### Eclipse ###
16+
.apt_generated
17+
.classpath
18+
.factorypath
19+
.project
20+
.settings
21+
.springBeans
22+
.sts4-cache
23+
24+
### NetBeans ###
25+
/nbproject/private/
26+
/nbbuild/
27+
/dist/
28+
/nbdist/
29+
/.nb-gradle/
30+
build/
31+
!**/src/main/**/build/
32+
!**/src/test/**/build/
33+
34+
### VS Code ###
35+
.vscode/
36+
37+
### Mac OS ###
38+
.DS_Store
39+
/.idea/
40+
41+
### LOGS ###
42+
*.log
43+
44+
### HELM ###
45+
46+
helm/charts

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Java Tech Adapter Framework

docs/HLD.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# High Level Design
2+
3+
This High Level Design defines the Java Tech Adapter Framework design, a Spring Boot based framework to streamline the experience of creating Witboost tech adapters by standardizing common features, namely the API layer, descriptor parsing, base configuration, etc. This also allows to introduce new features and fix issues faster and without the need to propagate the feature or fix to all developed Java tech adapters.
4+
5+
The base for this Framework will follow the existing [Java scaffold](https://github.com/agile-lab-dev/witboost-java-scaffold), and will take most of the implementation as-is, improving the existing base features to allow complete use of the potential of Witboost tech adapters.
6+
7+
At a high level, the features this framework should provide are:
8+
9+
- Support for the whole Tech Adapter OpenAPI specification v2.2.0 at API level with plans to update to newer versions of the API (current version as of 01/08/2024 is 2.6.0).
10+
- Implement the API layer of a typical Java Tech Adapter, including appropriate error handling with support for the full error schema
11+
- Provide extension points to define provisioning and validation business logic with a well-defined interface.
12+
- Support to both component level and data product level provisioning.
13+
- Descriptor parsing and the possibility to configure the expected component `specific` schema for component level operations.
14+
- Possibility to configure the request `params` schema for ReverseProvisioning requests
15+
16+
Parsing the input to the framework model, and validating said input will be decoupled operations, allowing the framework to handle all possible parsing errors, and providing an interface to validate the parsed input against the specific environment or technology for which the Tech Adapter is developed.
17+
18+
Thus, the interface must provide all the necessary information that the business logic may need to perform all its operations. This includes the following items, but more may be necessary:
19+
20+
- Complete parsed descriptor/request, including data product information
21+
- Requests must contain all possible fields as per the specification. Optional fields should be marked accordingly
22+
- For component level provisioning: Component to provision parsed with the appropriate schema
23+
- Other components not to be provisioned are also correctly parsed as JSON but not decoded as a class
24+
- For validation operation: As this task is executed during different operations, the type of Operation being performed
25+
26+
![HLD](img/HLD.png)
27+
28+
## Spring Boot
29+
We will continue to use Spring Boot as the underlying API framework and leveraging the Spring facilities to achieve the wiring between the framework API layer and the business logic by using Spring's Dependency Injection.
30+
31+
We may provide default behaviour on the interfaces which return Not Implemented errors for each method.
32+
33+
## Sync/async operations
34+
The framework must support both synchronous and asynchronous operations. This should be handled via configuration, and its implementation should be transparent to the tech adapter implementation, which will only implement the (sync) business logic interface. The asynchronous pool handling shall be done by the framework. The configuration shall provide:
35+
36+
- Enable/disable async provisioning
37+
- The implementation type of the repository, following WIT-229 design. As a first implementation, only the Cache (in-memory) strategy will be implemented
38+
39+
## OpenTelemetry
40+
Currently, we provide integration with OpenTelemetry as part of the Java Scaffold project. This integration should remain at the Java scaffold level, as not to impose this tool onto the framework users. Thus, an OpenTelemetry dependency should not be present on the framework.
41+
42+
## Java Scaffold
43+
The Java Scaffold should be rewritten to remove the API layer and instead including the framework as a dependency, injecting the business logic by implementing the necessary interfaces.
44+
45+
The scaffold will still contain artifacts like the Dockerfile, Helm chart, documentation, and of course, the business logic.
46+
47+
### Helm
48+
Explore the possibility to have a base chart that could be used as-is or extended for each provisioner, so that we also deduplicate the several charts we have.
49+
50+
## Migration
51+
The idea of creating the framework is not only to facilitate the creation of future tech adapters, but also to migrate the existing Java and Scala tech adapters to use it and standardize all of our repositories. The migration should be performed only when the framework can support all the tech adapter features that a certain adapter implementation uses.
52+
53+
For example, the Databricks Tech Adapter uses asynchronous operations, so unless the frameworks supports them, it cannot be migrated as we must avoid missing existing features when migrating.
54+
55+
There are other instances, like the ADLS Gen2 Output Port Tech Adapter which slightly modifies the ValidationService interfaces provided by the scaffold to account for the use case it solves. Because of this is necessary to analyze the existing implementations to support them on the framework, else it would be of no use for said tech adapter.
56+
57+
For this purpose, we must provide a sensible guide on how to migrate existing Java and Scala tech adapters to use this framework.

docs/img/HLD.png

297 KB
Loading

0 commit comments

Comments
 (0)