Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New server config features #7860

Merged
merged 13 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ ext {
servletVersion = '4.0.1'
jakartaServletVersion = '6.0.0'
sleepycatVersion = '18.3.12'
snakeyamlVersion = '2.0'
slf4jVersion = '2.0.6'
snappyVersion = '1.1.10.2'
springbootVersion = '3.1.1'
Expand All @@ -114,6 +113,7 @@ ext {
reactivestreamsVersion = '1.0.4'
springdocStarterVersion = '2.1.0'
jacocoVersion = '0.8.8'
snakeYamlVersion = '2.2'
}

dependencies {
Expand Down Expand Up @@ -255,7 +255,6 @@ dependencies {
// testng also used in our 'source' code to support unit tests
api("org.testng:testng:${testngVersion}")
api("joda-time:joda-time:${jodatimeVersion}")
api("org.yaml:snakeyaml:${snakeyamlVersion}")
api("org.antlr:antlr-runtime:${antlrVersion}")
api("org.antlr:ST4:${ST4Version}")
api("org.apache.jena:jena-arq:${jenaVersion}")
Expand Down Expand Up @@ -284,6 +283,7 @@ dependencies {
api("org.slf4j:slf4j-simple:${slf4jVersion}")
api("org.testng:testng:${testngVersion}")
api("org.hamcrest:hamcrest:${hamcrestVersion}")
api("org.yaml:snakeyaml:${snakeYamlVersion}")

// Explicitly enforced versions of transitive dependencies to mitigate potential CVEs reported by static security scans.
//TODO: Remove dependency line below in case the new parent library is updated and pulls good version.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
<!-- Copyright Contributors to the ODPi Egeria project. -->
<!-- Copyright Contributors to the ODPi Egeria project. -->

# OMAG Server Chassis Spring

Expand All @@ -15,18 +15,54 @@ To build the boot application jar from the current module use:

### Starting the application locally

You can run the application locally from this module with java using following command:
You can run the application locally in the current module with java using following command:

```bash
java -jar build/libs/server-chassis-spring-*-SNAPSHOT.jar --omag.server-config=classpath:samples/metadata-repository-server.json --server.port=9080 --server.ssl.enabled=false
java -jar build/libs/server-chassis-spring-*-SNAPSHOT.jar --omag.server-config-file=classpath:samples/metadata-repository-server.yml --server.port=9080 --server.ssl.enabled=false
```

The command will run the application using provided parameters. For demo purpose we turn ssl off and run the application on http port 9080.
```
Project Egeria - Open Metadata and Governance
____ __ ___ ___ ______ _____
/ __ \ / |/ // | / ____/ / ___/ ___ ____ _ __ ___ ____
/ / / // /|_/ // /| | / / __ \__ \ / _ \ / __/| | / // _ \ / __/
/ /_/ // / / // ___ |/ /_/ / ___/ // __// / | |/ // __// /
\____//_/ /_//_/ |_|\____/ /____/ \___//_/ |___/ \___//_/

:: Powered by Spring Boot (v3.1.1) ::

2023-09-07T10:08:05.779+02:00 INFO 4334 --- [ main] o.o.o.s.springboot.OMAGServer : Starting OMAGServer using Java 17.0.8 with PID 4334 (/Developer/egeria/open-metadata-implementation/server-chassis/server-chassis-spring/build/libs/server-chassis-spring-4.4-SNAPSHOT.jar started by DEVELOPER in /Developer/egeria/open-metadata-implementation/server-chassis/server-chassis-spring)
2023-09-07T10:08:05.781+02:00 INFO 4334 --- [ main] o.o.o.s.springboot.OMAGServer : No active profile set, falling back to 1 default profile: "default"
2023-09-07T10:08:07.435+02:00 INFO 4334 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 9080 (http)
2023-09-07T10:08:07.444+02:00 INFO 4334 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2023-09-07T10:08:07.444+02:00 INFO 4334 --- [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.10]
2023-09-07T10:08:07.505+02:00 INFO 4334 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2023-09-07T10:08:07.506+02:00 INFO 4334 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1681 ms
2023-09-07T10:08:08.228+02:00 INFO 4334 --- [ main] EnvironmentConfiguration$$SpringCGLIB$$0 : SSL configuration started working directory: /Developer/egeria/open-metadata-implementation/server-chassis/server-chassis-spring
2023-09-07T10:08:08.685+02:00 INFO 4334 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path '/actuator'
2023-09-07T10:08:08.749+02:00 INFO 4334 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 9080 (http) with context path ''
2023-09-07T10:08:08.763+02:00 INFO 4334 --- [ main] o.o.o.s.springboot.OMAGServer : Started OMAGServer in 3.384 seconds (process running for 3.851)
2023-09-07T10:08:08.786+02:00 INFO 4334 --- [ main] o.o.o.s.s.config.OMAGConfigHelper : Using configuration from class path resource [samples/metadata-repository-server.yml]
2023-09-07T10:08:09.024+02:00 INFO 4334 --- [ main] o.o.o.s.springboot.OMAGServer : Sending activation request for server: cocoMDS1 and user: OMAGServer
2023-09-07T10:08:09.208+02:00 INFO 4334 --- [ main] o.o.o.s.springboot.OMAGServer : Activation succeeded for server: cocoMDS1

```

The command will run the application using parameters provided. The OMAG server instance is created and activated using the configuration file supplied via application property `omag.server-config-file`.
<br/>To demonstrate basic functionality, we turn ssl off `server.ssl.enabled=false` and run the application on http port 9080 `server.port=9080`.

### Quick-start configuration properties

| Property name | Environment variable | Description |
|-------------------------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| omag.server-config-file | OMAG_SERVERCONFIGFILE | [REQUIRED] The [OMAGServerConfig document](https://egeria-project.org/concepts/configuration-document/) file location. <br/>Note the value should be defined as spring Resource i.e. starting with `classpath:` or `file:` <br/> Both JSON and YAML files are supported. See [samples](src%2Fmain%2Fresources%2Fsamples) for sample configuration files. |
| server.port | SERVER_PORT | Configures port used by the embedded Tomcat server. |
| server.ssl.enabled | SERVER_SSL_ENABLED | Configures if SSL should be enabled for the embedded Tomcat server. |

### Configuration properties
Application can be further customized by setting supported spring boot and application specific properties.
<br/>The default configuration that is already packaged within the JAR distribution is [application.properties](src%2Fmain%2Fresources%2Fapplication.properties).
<br/>Following Spring application [external configuration](https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.external-config) feature, all the properties can be customized at deploy/run time as shown in the quick-start example above.

| Property name | Environment variable | | Description |
|--------------------|----------------------|:----|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| omag.server-config | OMAG_SERVER-CONFIG | | The [OMAGServerConfig document](https://egeria-project.org/concepts/configuration-document/) json file location **(Required)**. Note the value should be spring Resource i.e. starting with `classpath:` or `file:` |
| server.port | SERVER_PORT | | Configures port used by the embedded Tomcat server |
| server.ssl.enabled | SERVER_SSL_ENABLED | | Configures if SSL should be enabled for the embedded Tomcat server |
----
License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/),
Copyright Contributors to the ODPi Egeria project.
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,88 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-actuator-autoconfigure'
implementation 'org.springframework.boot:spring-boot-actuator'
implementation 'org.springframework.boot:spring-boot-starter-tomcat'
implementation 'org.slf4j:slf4j-api'
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.fasterxml.jackson.core:jackson-annotations'
implementation 'jakarta.servlet:jakarta.servlet-api'
implementation 'jakarta.validation:jakarta.validation-api'
implementation 'org.projectlombok:lombok'
implementation 'org.yaml:snakeyaml'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
implementation 'com.google.guava:guava'
annotationProcessor 'org.projectlombok:lombok'

runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
runtimeOnly 'ch.qos.logback:logback-classic'
runtimeOnly 'org.hibernate:hibernate-validator'
compileOnly 'io.swagger.core.v3:swagger-annotations-jakarta'
runtimeOnly 'com.fasterxml.jackson.core:jackson-core'

compileOnly project(':open-metadata-implementation:common-services:ffdc-services')
implementation project(':open-metadata-implementation:adapters:authentication-plugins:http-helper')
implementation project(':open-metadata-implementation:admin-services:admin-services-api')
implementation project(':open-metadata-implementation:server-operations:server-operations-api')
implementation project(':open-metadata-implementation:server-operations:server-operations-server')

/* IN DEVELOPMENT */

/* Pulling dependencies for some fo the sub-systems enabling 'Metadata Access Store' services */

runtimeOnly project(':open-metadata-implementation:repository-services:repository-services-spring')
runtimeOnly project(':open-metadata-implementation:access-services:asset-manager:asset-manager-spring')
runtimeOnly project(':open-metadata-implementation:access-services:asset-catalog:asset-catalog-spring')
runtimeOnly project(':open-metadata-implementation:access-services:data-manager:data-manager-spring')

/* Pulling dependencies for some fo the sub-systems enabling 'Integration Daemon' services to test Database Integrator via JDBC integration connector */

// runtimeOnly project(':open-metadata-implementation:integration-services:database-integrator:database-integrator-server')
// runtimeOnly 'org.odpi.egeria:egeria-connector-resource-jdbc:1.1'
// runtimeOnly 'org.odpi.egeria:egeria-connector-integration-jdbc:1.1'
// runtimeOnly 'com.oracle.database.jdbc:ojdbc10:19.19.0.0'
if (!project.hasProperty("adminChassisOnly")) {
runtimeOnly project(':open-metadata-implementation:view-services:server-author-view:server-author-view-spring')
runtimeOnly project(':open-metadata-implementation:view-services:glossary-author-view:glossary-author-view-spring')
runtimeOnly project(':open-metadata-implementation:view-services:glossary-browser:glossary-browser-spring')
runtimeOnly project(':open-metadata-implementation:view-services:glossary-workflow:glossary-workflow-spring')
runtimeOnly project(':open-metadata-implementation:view-services:my-profile:my-profile-spring')
runtimeOnly project(':open-metadata-implementation:view-services:rex-view:rex-view-spring')
runtimeOnly project(':open-metadata-implementation:view-services:tex-view:tex-view-spring')
runtimeOnly project(':open-metadata-implementation:view-services:dino-view:dino-view-spring')
runtimeOnly project(':open-metadata-implementation:access-services:security-officer:security-officer-spring')
runtimeOnly project(':open-metadata-implementation:access-services:security-manager:security-manager-spring')
runtimeOnly project(':open-metadata-implementation:access-services:data-manager:data-manager-spring')
runtimeOnly project(':open-metadata-implementation:access-services:glossary-view:glossary-view-spring')
runtimeOnly project(':open-metadata-implementation:access-services:asset-lineage:asset-lineage-spring')
runtimeOnly project(':open-metadata-implementation:access-services:data-engine:data-engine-spring')
runtimeOnly project(':open-metadata-implementation:access-services:subject-area:subject-area-spring')
runtimeOnly project(':open-metadata-implementation:access-services:asset-catalog:asset-catalog-spring')
runtimeOnly project(':open-metadata-implementation:access-services:governance-program:governance-program-spring')
runtimeOnly project(':open-metadata-implementation:access-services:governance-engine:governance-engine-spring')
runtimeOnly project(':open-metadata-implementation:access-services:discovery-engine:discovery-engine-spring')
runtimeOnly project(':open-metadata-implementation:access-services:stewardship-action:stewardship-action-spring')
runtimeOnly project(':open-metadata-implementation:access-services:community-profile:community-profile-spring')
runtimeOnly project(':open-metadata-implementation:access-services:design-model:design-model-spring')
runtimeOnly project(':open-metadata-implementation:access-services:data-privacy:data-privacy-spring')
runtimeOnly project(':open-metadata-implementation:access-services:it-infrastructure:it-infrastructure-spring')
runtimeOnly project(':open-metadata-implementation:access-services:project-management:project-management-spring')
runtimeOnly project(':open-metadata-implementation:access-services:dev-ops:dev-ops-spring')
runtimeOnly project(':open-metadata-implementation:access-services:software-developer:software-developer-spring')
runtimeOnly project(':open-metadata-implementation:access-services:digital-architecture:digital-architecture-spring')
runtimeOnly project(':open-metadata-implementation:access-services:digital-service:digital-service-spring')
runtimeOnly project(':open-metadata-implementation:access-services:data-science:data-science-spring')
runtimeOnly project(':open-metadata-implementation:access-services:asset-consumer:asset-consumer-spring')
runtimeOnly project(':open-metadata-implementation:access-services:asset-manager:asset-manager-spring')
runtimeOnly project(':open-metadata-implementation:access-services:asset-owner:asset-owner-spring')
runtimeOnly project(':open-metadata-implementation:engine-services:asset-analysis:asset-analysis-spring')
runtimeOnly project(':open-metadata-implementation:engine-services:repository-governance:repository-governance-spring')
runtimeOnly project(':open-metadata-implementation:engine-services:governance-action:governance-action-spring')
runtimeOnly project(':open-metadata-implementation:integration-services:security-integrator:security-integrator-spring')
runtimeOnly project(':open-metadata-implementation:integration-services:organization-integrator:organization-integrator-spring')
runtimeOnly project(':open-metadata-implementation:integration-services:infrastructure-integrator:infrastructure-integrator-spring')
runtimeOnly project(':open-metadata-implementation:integration-services:lineage-integrator:lineage-integrator-spring')
runtimeOnly project(':open-metadata-implementation:integration-services:files-integrator:files-integrator-spring')
runtimeOnly project(':open-metadata-implementation:integration-services:display-integrator:display-integrator-spring')
runtimeOnly project(':open-metadata-implementation:integration-services:database-integrator:database-integrator-spring')
runtimeOnly project(':open-metadata-implementation:integration-services:analytics-integrator:analytics-integrator-spring')
runtimeOnly project(':open-metadata-implementation:integration-services:api-integrator:api-integrator-spring')
runtimeOnly project(':open-metadata-implementation:integration-services:catalog-integrator:catalog-integrator-spring')
runtimeOnly project(':open-metadata-implementation:integration-services:search-integrator:search-integrator-spring')
runtimeOnly project(':open-metadata-implementation:integration-services:topic-integrator:topic-integrator-spring')
runtimeOnly project(':open-metadata-implementation:repository-services:repository-services-spring')
runtimeOnly project(':open-metadata-conformance-suite:open-metadata-conformance-suite-spring')
runtimeOnly project(':open-metadata-implementation:framework-services:ocf-metadata-management:ocf-metadata-spring')
runtimeOnly project(':open-metadata-implementation:framework-services:gaf-metadata-management:gaf-metadata-spring')
runtimeOnly project(':open-metadata-implementation:framework-services:oif-metadata-management:oif-metadata-spring')
runtimeOnly project(':open-metadata-implementation:governance-servers:data-engine-proxy-services:data-engine-proxy-services-spring')
runtimeOnly project(':open-metadata-implementation:governance-servers:integration-daemon-services:integration-daemon-services-spring')
runtimeOnly project(':open-metadata-implementation:governance-servers:engine-host-services:engine-host-services-spring')
runtimeOnly project(':open-metadata-implementation:governance-servers:open-lineage-services:open-lineage-services-spring')
}

testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.springframework.boot:spring-boot-test'
Expand Down
Loading