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

remove graph-repository-connector dependency from connector-configuration-factory #5848

Merged
merged 34 commits into from
Nov 12, 2021

Conversation

bogdan-sava
Copy link
Contributor

Description

remove graph-repository-connector dependency from connector-configuration-factory

@bogdan-sava bogdan-sava marked this pull request as draft October 25, 2021 08:04
…ies into distribution lib folder

Signed-off-by: Bogdan Sava <[email protected]>
Signed-off-by: Bogdan Sava <[email protected]>
Signed-off-by: Bogdan Sava <[email protected]>
Signed-off-by: Bogdan Sava <[email protected]>
Signed-off-by: Bogdan Sava <[email protected]>
Signed-off-by: Bogdan Sava <[email protected]>
Signed-off-by: Bogdan Sava <[email protected]>
@bogdan-sava bogdan-sava marked this pull request as ready for review November 9, 2021 09:29
@bogdan-sava bogdan-sava requested a review from planetf1 November 9, 2021 09:30
Copy link
Member

@planetf1 planetf1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a great update! I just noticed one very minor issue with an explicit version in the pom.

I'm going to pull & build/check as an extra test

@planetf1
Copy link
Member

planetf1 commented Nov 9, 2021

I'm seeing an error when testing the PR in launching the ui chassis - which is hitting an exception from CassandraHealthContributor . We saw this in egeria previously, and disabled the health contributor in the chassis properties.

management.health.cassandra.enabled=false

This wasn't done in the UI - but we hadn't seen the issue

Not sure why this change is causing this now - some difference in component scan, or a new version

ie

2021-11-09 12:03:25.090 -ERROR 91413 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cassandraHealthContributor' defined in class path resource [org/springframework/boot/actuate/autoconfigure/cassandra/CassandraHealthContributorConfigurations$CassandraReactiveDriverConfiguration.class]: Unsatisfied dependency expressed through method 'cassandraHealthContributor' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraSession' defined in class path resource [org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.datastax.oss.driver.api.core.CqlSession]: Factory method 'cassandraSession' threw exception; nested exception is com.datastax.oss.driver.api.core.AllNodesFailedException: Could not reach any contact point, make sure you've provided valid addresses (showing first 1 nodes, use getAllErrors() for more): Node(endPoint=/127.0.0.1:9042, hostId=null, hashCode=1ea091d7): [com.datastax.oss.driver.api.core.connection.ConnectionInitException: [s0|control|connecting...] Protocol initialization request, step 1 (OPTIONS): failed to send request (io.netty.channel.StacklessClosedChannelException)]

I have a shell script to setup a local deployment which hasn't changed (though the broader environment could have). In fact locally it doesn't run the UI properly since there is no static content server launched (I usually test in containers)

  • It could be specific to my environment
  • If the UI works ok for you without cassandra etc configured we could merge into master & then I can run more tests ie against the charts & fix quickly if needed
  • alternatively I could test in more environments/with charts - though this will take longer

@planetf1
Copy link
Member

planetf1 commented Nov 9, 2021

This is the sequence that causes the failure - specifically when including our other libraries in the loader path.
Both the server chassis and ui chassis are run in the same context - with loader path, & when we run the container we again set the same values (we could not do this, but I think it's easier to fix)

This is understandable as the spring component scan will find the cassandra health check to add.

$ export LOADER_PATH=~/src/egeria/open-metadata-distribution/open-metadata-assemblies/target/egeria-3.4-SNAPSHOT-distribution/egeria-omag-3.4-SNAPSHOT/server/lib
jonesn:egeria/ ((0aab3cad73...)*) $ ls $LOADER_PATH                                                                           [15:28:29]
audit-log-console-connector-3.4-SNAPSHOT.jar                      governance-action-connectors-3.4-SNAPSHOT.jar
audit-log-event-topic-connector-3.4-SNAPSHOT.jar                  governance-services-sample-3.4-SNAPSHOT.jar
audit-log-file-connector-3.4-SNAPSHOT.jar                         graph-repository-connector-3.4-SNAPSHOT-jar-with-dependencies.jar
audit-log-slf4j-connector-3.4-SNAPSHOT.jar                        inmemory-open-metadata-topic-connector-3.4-SNAPSHOT.jar
avro-file-connector-3.4-SNAPSHOT.jar                              inmemory-repository-connector-3.4-SNAPSHOT.jar
basic-file-connector-3.4-SNAPSHOT.jar                             kafka-integration-connector-3.4-SNAPSHOT.jar
cohort-registry-file-store-connector-3.4-SNAPSHOT.jar             kafka-open-metadata-topic-connector-3.4-SNAPSHOT.jar
configuration-encrypted-file-store-connector-3.4-SNAPSHOT.jar     omrs-rest-repository-connector-3.4-SNAPSHOT.jar
configuration-file-store-connector-3.4-SNAPSHOT.jar               open-lineage-janus-connector-3.4-SNAPSHOT.jar
csv-file-connector-3.4-SNAPSHOT.jar                               open-metadata-archive-file-connector-3.4-SNAPSHOT.jar
data-folder-connector-3.4-SNAPSHOT.jar                            open-metadata-security-samples-3.4-SNAPSHOT.jar
discovery-service-connectors-3.4-SNAPSHOT.jar                     openapi-integration-connector-3.4-SNAPSHOT.jar
elasticsearch-integration-connector-3.4-SNAPSHOT.jar              openlineage-integration-connectors-3.4-SNAPSHOT.jar
files-integration-connectors-3.4-SNAPSHOT.jar                     spring-rest-client-connector-3.4-SNAPSHOT.jar
jonesn:egeria/ ((0aab3cad73...)*) $ OMAS_SERVER_URL=https://localhost:9444 OMAS_SERVER_NAME=cocoMDS4 java -jar ./open-metadata-distribution/open-metadata-assemblies/target/egeria-3.4-SNAPSHOT-distribution/egeria-omag-3.4-SNAPSHOT/user-interface/ui-chassis-spring-3.4-SNAPSHOT.jar
 ODPi Egeria

       ______                        _                  __  __   ____
      / ____/ ____ _  ___    _____  (_) ____ _         / / / /  /  _/
     / __/   / __ `/ / _ \  / ___/ / / / __ `/        / / / /   / /
    / /___  / /_/ / /  __/ / /    / / / /_/ /        / /_/ /  _/ /
   /_____/  \__, /  \___/ /_/    /_/  \__,_/         \____/  /___/
           /____/


 :: Powered by Spring Boot (v2.5.6) ::

2021-11-09 15:28:48.706 - INFO 99716 --- [           main] o.o.o.u.u.springboot.EgeriaUIPlatform    : Starting EgeriaUIPlatform using Java 11.0.11 on Nigels-MBP.fritz.box with PID 99716 (/Users/jonesn/IdeaProjects/egeria.maven/open-metadata-distribution/open-metadata-assemblies/target/egeria-3.4-SNAPSHOT-distribution/egeria-omag-3.4-SNAPSHOT/user-interface/ui-chassis-spring-3.4-SNAPSHOT.jar started by jonesn in /Users/jonesn/IdeaProjects/egeria.maven)
2021-11-09 15:28:48.710 - INFO 99716 --- [           main] o.o.o.u.u.springboot.EgeriaUIPlatform    : No active profile set, falling back to default profiles: default
2021-11-09 15:28:51.849 - INFO 99716 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8443 (https)
2021-11-09 15:28:58.204 -ERROR 99716 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cassandraHealthContributor' defined in class path resource [org/springframework/boot/actuate/autoconfigure/cassandra/CassandraHealthContributorConfigurations$CassandraReactiveDriverConfiguration.class]: Unsatisfied dependency expressed through method 'cassandraHealthContributor' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraSession' defined in class path resource [org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.datastax.oss.driver.api.core.CqlSession]: Factory method 'cassandraSession' threw exception; nested exception is com.datastax.oss.driver.api.core.AllNodesFailedException: Could not reach any contact point, make sure you've provided valid addresses (showing first 1 nodes, use getAllErrors() for more): Node(endPoint=/127.0.0.1:9042, hostId=null, hashCode=21ad6f42): [com.datastax.oss.driver.api.core.connection.ConnectionInitException: [s0|control|connecting...] Protocol initialization request, step 1 (OPTIONS): failed to send request (io.netty.channel.StacklessClosedChannelException)]
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-5.3.12.jar!/:5.3.12]

@planetf1
Copy link
Member

planetf1 commented Nov 9, 2021

If the spring property is set to disable the cassandra endpoint ie here's the env var equiv - it works:

export MANAGEMENT_HEALTH_CASSANDRA_ENABLED=false                                          [15:30:50]
jonesn:egeria/ ((0aab3cad73...)*) $ cd open-metadata-implementation                                                           [15:31:52]
jonesn:egeria/ ((0aab3cad73...)*) $ OMAS_SERVER_URL=https://localhost:9444 OMAS_SERVER_NAME=cocoMDS4 java -jar ./open-metadata-distribution/open-metadata-assemblies/target/egeria-3.4-SNAPSHOT-distribution/egeria-omag-3.4-SNAPSHOT/user-interface/ui-chassis-spring-3.4-SNAPSHOT.jar
 ODPi Egeria

       ______                        _                  __  __   ____
      / ____/ ____ _  ___    _____  (_) ____ _         / / / /  /  _/
     / __/   / __ `/ / _ \  / ___/ / / / __ `/        / / / /   / /
    / /___  / /_/ / /  __/ / /    / / / /_/ /        / /_/ /  _/ /
   /_____/  \__, /  \___/ /_/    /_/  \__,_/         \____/  /___/
           /____/


 :: Powered by Spring Boot (v2.5.6) ::

2021-11-09 15:32:04.176 - INFO 271 --- [           main] o.o.o.u.u.springboot.EgeriaUIPlatform    : Starting EgeriaUIPlatform using Java 11.0.11 on Nigels-MBP.fritz.box with PID 271 (/Users/jonesn/IdeaProjects/egeria.maven/open-metadata-distribution/open-metadata-assemblies/target/egeria-3.4-SNAPSHOT-distribution/egeria-omag-3.4-SNAPSHOT/user-interface/ui-chassis-spring-3.4-SNAPSHOT.jar started by jonesn in /Users/jonesn/IdeaProjects/egeria.maven)
2021-11-09 15:32:04.180 - INFO 271 --- [           main] o.o.o.u.u.springboot.EgeriaUIPlatform    : No active profile set, falling back to default profiles: default
2021-11-09 15:32:07.304 - INFO 271 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8443 (https)
2021-11-09 15:32:11.362 - INFO 271 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8443 (https) with context path ''
2021-11-09 15:32:11.380 - INFO 271 --- [           main] o.o.o.u.u.springboot.EgeriaUIPlatform    : Started EgeriaUIPlatform in 8.177 seconds (JVM running for 9.031)

I am unsure if this is specific to this PR, or has crept in since I last ran in this configuration, but since we already have
this setting in the main server chassis I think it advisable we include in the ui server chassis? cc: @bogdan-sava @lpalashevski

@bogdan-sava
Copy link
Contributor Author

I see!
It starts with the same loader.path as server-chassis and it shouldn't.
I'll add the property, but in the future we should not have the same lib folder.

The dependency is adding a contributor to health check.

@bogdan-sava
Copy link
Contributor Author

bogdan-sava commented Nov 9, 2021

Please do not export LOADER_PATH of OMAG to environment.
Use -Dloader.path in command line, and run ui-chassis-server without loader.path

@planetf1
Copy link
Member

planetf1 commented Nov 9, 2021

It's a reflection of what we do currently in the helm chart for coco pharma where the same configuration for LOADER_PATH is used for both. Hence the failure (so good it was spotted :-)

I agree though in terms of setting the environment. It doesn't make sense to add these libraries into the loader path for the ui chassis. Therefore I'll update the environment for the pod running the ui chassis so that it has a cleaner environment. I think that is the right fix

Until that is done, I've not tested, but I think:

  • egeria-ui will not work in docker without LOADER_PATH being overriden (if that works)
  • egeria-ui will not work in the coco pharma environment
  • egeria-ui will not work in the egeria-base environment (poss. used for dojo)

I can make the change for 3.4 but maybe not for a few days/week. It's probably best to defer the merge until done.

Will need

  • change to egeria docker container or creation of a new container specifically for the ui chassis (which may be better)
  • change to docs for docker container
  • check dojo docs
  • update to odpi-egeria-lab helm chart
  • update to egeria-base chart

@bogdan-sava
Copy link
Contributor Author

I added the property in application.properties .
However, LOADER_PATH can be overriden by command line.

The order is:
https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.external-config

@planetf1
Copy link
Member

planetf1 commented Nov 9, 2021

I've raised the issue for cleanup in the container image
Running another test - if good I propose all good to merge (since we have the property set which avoids the failure)

@planetf1
Copy link
Member

planetf1 commented Nov 9, 2021

test passed. recommend merge

@planetf1 planetf1 self-requested a review November 9, 2021 17:33
@lpalashevski
Copy link
Contributor

lpalashevski commented Nov 10, 2021

PR looks good, nice job!
In regards to actuator health check behavior I am suggesting to completely disable this by default for all (not only cassandra)

management.health.defaults.enabled = false

I will check if this is working and create separate PR + document it somewhere in admin docs.

@bogdan-sava bogdan-sava merged commit 23282b5 into odpi:master Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants