|
| 1 | +--- |
| 2 | +tags: |
| 3 | + - Configuration |
| 4 | + - Graph-Insights |
| 5 | + - GraphInsights |
| 6 | +--- |
| 7 | +# Graph Insights |
| 8 | + |
| 9 | +## Enable Graph Insights |
| 10 | + |
| 11 | +Follow the instructions related to your deployment type: a) docker-compose or b) helm / Kubernetes based. |
| 12 | + |
| 13 | +### (a) Enable in docker-compose deployment |
| 14 | + |
| 15 | +In our Corporate Memory docker-orchestration all main configurations can be directed by setting environment |
| 16 | +variables in `environments/config.env`. |
| 17 | +You can find the environments are set as usual in `environments/default.env` and `environments/config.env`. |
| 18 | + |
| 19 | +Add your license to ```licenses/graphinsights.lic``` then start the extension on a already running Corporate Memory |
| 20 | +deployment. |
| 21 | + |
| 22 | +``` console |
| 23 | +mkdir licenses |
| 24 | +ln -s your-license-file.lic graphinsights.lic |
| 25 | +make enable-extension EXTENSION=graphinsights |
| 26 | +``` |
| 27 | + |
| 28 | +Please also have a look at `extensions/README.graphinsights.md`. |
| 29 | + |
| 30 | +### (b) Enable in helm deployment |
| 31 | + |
| 32 | +In helm based deployment you can enable Graph Insights by enable it in your value file. |
| 33 | +It creates a new StatefulSet. |
| 34 | +Preemptive you have to create a secret containing your license file. |
| 35 | + |
| 36 | +``` console |
| 37 | +kubectl -n cmem create secret generic graphinsights-license --from-file your-graphinsights.lic |
| 38 | +``` |
| 39 | + |
| 40 | +All needed configuration can be done in the Corporate Memory helm chart `value.yaml` file. |
| 41 | +This enables the plugin. |
| 42 | + |
| 43 | +``` yaml |
| 44 | +graphinsights: |
| 45 | + enabled: true |
| 46 | +``` |
| 47 | +
|
| 48 | +Beside enabling the extension you also have to create a route/path in your Ingress or Route. |
| 49 | +In the Charts `value.yaml` file is a configuration commented out. |
| 50 | +You should enable this in your `value.yaml` file. |
| 51 | + |
| 52 | +``` yaml |
| 53 | + # GraphInsights at /graphinsights path (if enabled). |
| 54 | + - path: /graphinsights |
| 55 | + pathType: Prefix |
| 56 | + serviceName: graphinsights |
| 57 | + servicePort: 8080 |
| 58 | +``` |
| 59 | + |
| 60 | +Also make sure you have set the clients and client credentials. |
| 61 | +See [Configure OAuth clients (helm)](../../../deploy-and-configure/configuration/graphinsights/index.md#configure-oauth-clients-helm) |
| 62 | + |
| 63 | +The configuration mentioned below is rendered with those files, but you usually don't have to touch those: |
| 64 | + |
| 65 | +- `configuration-files/explore-application.yml` for Explore |
| 66 | +- `configuration-files/cmem.integration.config.yml` for Graph Insights |
| 67 | + |
| 68 | +For more details please have a look in the helm value file. |
| 69 | +Every configuration is documented there. |
| 70 | +Please refer to [Kubernetes deployments](../../../deploy-and-configure/installation/scenario-k8s-deployment/index.md) |
| 71 | +for more information. |
| 72 | + |
| 73 | +## Activate and verify the installation |
| 74 | + |
| 75 | +Fist you have enable the Graph Insight in your Explore workspace. By default ist is disabled. |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | +Then you are able to create a snapshot, send it to Graph Insights and select the Graph Insights tab in explore. |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | +## Configuration |
| 86 | + |
| 87 | +This section explains the basic configuration of Graph Insights. Since Graph Insights is an application integrated |
| 88 | +into explore, we need to have to configure Explore for the integration and Graph Insights as application itself. |
| 89 | + |
| 90 | +The following chapters explain the configuration in case you want to change the default behavior. |
| 91 | + |
| 92 | +While the extension in the docker-orchestration it is enabled through Spring profiles, we just use the benefits of |
| 93 | +templating in helm and only use one profile. |
| 94 | + |
| 95 | +This is why the configuration differs in both deployments, but we tried to use the same variable names and configuration |
| 96 | +snippets. |
| 97 | + |
| 98 | +### Explore configuration |
| 99 | + |
| 100 | +In our **docker-orchestration** you find the file which is loaded as `graphinsight` profile |
| 101 | +at `conf/explore/application-graphinsights.yml`. |
| 102 | +Environment variables as usual can be found in `environments/default.env` and `environments/config.env`. |
| 103 | +Sizing can be changed in the loaded memory profile, e.g. at `environments/config.mem.16g.env`. |
| 104 | +The deployment definition for explore with the extension is defined `extensions/docker-compose.graphinsights.yml` |
| 105 | +in the explore service. |
| 106 | + |
| 107 | +In **helm deployments** you find the needed section inside the `.Values.graphinsights.enabled` in file |
| 108 | +at `configuration-files/explore-application.yml`, where most of the configuration is inserted with GO-templates. |
| 109 | +Some environment variables are set in the `value.yaml` and rendered in a ConfigMap `templates/explore-configmap.yaml`. |
| 110 | + |
| 111 | +``` yaml |
| 112 | +spring.security.oauth2.client.registration.explore-service: |
| 113 | + client-id: cmem-service-account |
| 114 | + client-secret: change-me |
| 115 | + authorization-grant-type: client_credentials |
| 116 | + provider: keycloak |
| 117 | +``` |
| 118 | + |
| 119 | +``` yaml |
| 120 | +semspect: |
| 121 | + enabled: true |
| 122 | + integration: |
| 123 | + url: http://graphinsights:8080/graphinsights |
| 124 | + externalUrl: ${DEPLOY_BASE_URL}/graphinsights |
| 125 | + automaticResyncCronExpression: "0 0/30 8-10 * * *" |
| 126 | + localDatasetStatePath: /graphinsights/infinispan |
| 127 | + ### Configure either fileShareIntegrationSettings or graph-store-integration-settings |
| 128 | + # fileShareIntegrationSettings: |
| 129 | + localGraphStoragePathExplore: /graphinsights |
| 130 | + # localGraphStoragePathSemspect: /explore-share/ |
| 131 | + graph-store-integration-settings: |
| 132 | + semspect-dataplatform-url: http://explore/dataplatform |
| 133 | +``` |
| 134 | + |
| 135 | +### Graph Insights configuration |
| 136 | + |
| 137 | +Graph Insights, like Explore, is a Spring Boot application, so it gets configured with environment variables and a YAML |
| 138 | +file. |
| 139 | + |
| 140 | +In our **docker-orchestration** you find the file at `conf/graphinsights/cmem.integration.config.yml`. |
| 141 | +Environment variables as usual can be found in `environments/default.env` and `environments/config.env`. |
| 142 | +Sizing can be changed in the loaded memory profile, e.g. at `environments/config.mem.16g.env`. |
| 143 | +The deployment definition of the extension is defined `extensions/docker-compose.graphinsights.yml`. |
| 144 | + |
| 145 | +In **helm deployments** you find the file at `configuration-files/cmem.integration.config.yml`, which is rendered as |
| 146 | +ConfigMap and then mounted into the Graph Insight StatefulSet. |
| 147 | +Environment variables are set in the `value.yaml` and rendered in a ConfigMap `templates/graphinsights-configmap.yaml`. |
| 148 | +Sizing regarding memory, CPU or disk usage are configured in the `value.yaml`. |
| 149 | + |
| 150 | +``` yaml |
| 151 | +--- |
| 152 | +# for descriptions of the properties s. the same file in https://gitlab.eccenca.com/devops/eccenca-graphinsights-docker |
| 153 | +semspect: |
| 154 | + extensions: cmem |
| 155 | + extension.cmem: |
| 156 | + baseUri: "${DEPLOY_BASE_URL}" |
| 157 | + authorization: |
| 158 | + cacheDuration: 60 |
| 159 | + core: |
| 160 | + enableCaptionPropertySelection: false |
| 161 | + enableDescriptionPropertySelection: false |
| 162 | +
|
| 163 | +frontend: |
| 164 | + appNameOverride: "Graph Insights" |
| 165 | + enableLogo: false |
| 166 | + enableAboutWindow: false |
| 167 | + singleDatabaseMode: true |
| 168 | + enableIframeOnlyMode: true |
| 169 | + enableCopyDeepLink: false |
| 170 | + fontFamily: "Roboto, helvetica, arial, sans-serif" |
| 171 | + fontFace: > |
| 172 | + @font-face { |
| 173 | + font-family: 'Roboto'; |
| 174 | + font-style: normal; |
| 175 | + font-weight: 400; |
| 176 | + src: url('https://eccenca.com/layouts/default/fonts/roboto-v20-latin-regular.woff2') format('woff2'); |
| 177 | + } |
| 178 | +
|
| 179 | + trustedOrigins: |
| 180 | + - "${DEPLOY_BASE_URL}" |
| 181 | + - "${DEPLOY_BASE_URL}/*" |
| 182 | +
|
| 183 | + backlink: |
| 184 | + objectURLTemplate: ${DEPLOY_BASE_URL}/{workspaceID}/explore?resource={objectID}&graph={contextGraphIRI} |
| 185 | + categoryURLTemplate: ${DEPLOY_BASE_URL}/{workspaceID}/explore?type={categoryID}&graph={contextGraphIRI} |
| 186 | + objectBacklinkDestination: "CMEM" |
| 187 | + categoryBacklinkDestination: "CMEM" |
| 188 | + multiObjectBacklinkDestination: "CMEM" |
| 189 | + debug: true |
| 190 | + logLevel: DEBUG |
| 191 | +
|
| 192 | +# secure /api/** via resourceserver |
| 193 | +spring.security.oauth2: |
| 194 | + resourceserver: |
| 195 | + jwt: |
| 196 | + jwk-set-uri: "${OAUTH_JWK_SET_URL}" |
| 197 | + # semspect backend for frontent as oauth2client |
| 198 | + # To enable SLO add this as back-channel logout uri to the client semspect uses: |
| 199 | + # http://docker.localhost/graphinsights/logout/connect/back-channel/keycloak |
| 200 | + client: |
| 201 | + registration: |
| 202 | + keycloak: |
| 203 | + client-id: "${GRAPHINSIGHTS_OAUTH_CLIENT_ID}" |
| 204 | + authorization-grant-type: "authorization_code" |
| 205 | + client-authentication-method: "client_secret_basic" |
| 206 | + # not needed here because we never login to semspect directly |
| 207 | + redirectUri: "${DEPLOY_BASE_URL}/graphinsights/login/oauth2/code/{registrationId}" |
| 208 | + # openid is mandatory as spring somehow does not add it to the userinfo request |
| 209 | + scope: |
| 210 | + - openid |
| 211 | + - profile |
| 212 | + - email |
| 213 | + # service account used for datastore access |
| 214 | + semspect-service: |
| 215 | + client-id: "${GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_ID}" |
| 216 | + client-secret: "${GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_SECRET}" |
| 217 | + authorization-grant-type: client_credentials |
| 218 | + provider: keycloak |
| 219 | + provider: |
| 220 | + keycloak: |
| 221 | + issuer-uri: "${OAUTH_ISSUER_URL}" |
| 222 | + user-name-attribute: "preferred_username" |
| 223 | +
|
| 224 | +# same (fixed) session timeout as explore backend |
| 225 | +server.servlet.session.timeout: "36000s" |
| 226 | +server.frame.ancestors: "${DEPLOY_BASE_URL}" |
| 227 | +
|
| 228 | +logging: |
| 229 | + level: |
| 230 | + root: DEBUG |
| 231 | + org.springframework: WARN |
| 232 | + org.springframework.security: WARN |
| 233 | +
|
| 234 | + pattern: |
| 235 | + console: "%d{yyyy-MM-dd'T'HH:mm:ss.SSSX,UTC} %-5level %logger{15} - %message%n%xException" |
| 236 | +
|
| 237 | +``` |
| 238 | + |
| 239 | +### Resource consideration |
| 240 | + |
| 241 | +Please refer to [Graph Insights Sizing](../../../deploy-and-configure/requirements/graph-insights-sizing.md) for more |
| 242 | +information. |
| 243 | + |
| 244 | +### OAuth configuration |
| 245 | + |
| 246 | +Graph Insights requires authentication similar to Explore and Build (DataIntegration). |
| 247 | +There is the need for a client to authenticate in a browser and a second client to allow inter-component communication. |
| 248 | + |
| 249 | +For convenience, by default we use the same clients as for the rest of the application: |
| 250 | + |
| 251 | +- Client for browser: cmem |
| 252 | +- Client for component communication: cmem-service-account |
| 253 | + |
| 254 | +In case you want to have separate clients for production deployments, this chapter is for you. |
| 255 | + |
| 256 | +#### Configure OAuth clients (docker-compose) |
| 257 | + |
| 258 | +In our **docker-orchestration** to enrol those other clients, please follow these steps: |
| 259 | + |
| 260 | +1.) take a look at `environments/default.env` and copy these variables to your `environments/config.env` file: |
| 261 | + |
| 262 | +``` Makefile |
| 263 | +# This is the browser client: |
| 264 | +GRAPHINSIGHTS_OAUTH_CLIENT_ID=graph-insights |
| 265 | +# was this before: |
| 266 | +# GRAPHINSIGHTS_OAUTH_CLIENT_ID=${OAUTH_CLIENT_ID} |
| 267 | +
|
| 268 | +# This is the inter component client: |
| 269 | +GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_ID=graph-insights-service-account |
| 270 | +# change the credital depending on your client secret, default would be: 7Ctw7eZvTeFYdwwvwopy8OjuMUVPb8A9 |
| 271 | +GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_SECRET=changeme |
| 272 | +``` |
| 273 | + |
| 274 | +2.) Replace this in `docker-compose.yml`: |
| 275 | + |
| 276 | +``` yaml |
| 277 | + - "EXPLORE_CMEM_SERVICE_CLIENT=${CMEM_SERVICE_ACCOUNT_CLIENT_ID}" |
| 278 | + - "EXPLORE_CMEM_SERVICE_CLIENT_SECRET=${CMEM_SERVICE_ACCOUNT_CLIENT_SECRET}" |
| 279 | + # with: |
| 280 | + - "EXPLORE_CMEM_SERVICE_CLIENT=${GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_ID}" |
| 281 | + - "EXPLORE_CMEM_SERVICE_CLIENT_SECRET=${GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_SECRET}" |
| 282 | +``` |
| 283 | + |
| 284 | +3.) And also replace this in `extensions/docker-compose.graphinsights.yml` |
| 285 | + |
| 286 | +``` yaml |
| 287 | + - "GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_ID=${CMEM_SERVICE_ACCOUNT_CLIENT_ID}" |
| 288 | + - "GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_SECRET=${CMEM_SERVICE_ACCOUNT_CLIENT_SECRET}" |
| 289 | + # with: |
| 290 | + - "GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_ID=${GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_ID}" |
| 291 | + - "GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_SECRET=${GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_SECRET}" |
| 292 | +``` |
| 293 | + |
| 294 | +#### Configure OAuth clients (helm) |
| 295 | + |
| 296 | +In **helm deployments**, once you have the clients available all you have to do is change these lines in your value.yaml |
| 297 | +accordingly: |
| 298 | + |
| 299 | +``` yaml |
| 300 | +global: |
| 301 | + # GraphInsights service account OAuth credentials (if using GraphInsights). |
| 302 | + # Can use the same credentials as CMEM or separate ones. |
| 303 | + graphinsightsClientId: graph-insights-service-account |
| 304 | + graphinsightsClientSecret: changeme # IMPORTANT: Change this to a secure value! |
| 305 | +
|
| 306 | + # OAuth client ID for GraphInsights frontend authentication. |
| 307 | + # Default: "graph-insights" (must exist in your Keycloak realm if GraphInsights is enabled). |
| 308 | + oauthClientIdGraphInsights: graph-insights |
| 309 | +``` |
| 310 | + |
| 311 | +#### Creating separate OAuth clients for Graph Insights |
| 312 | + |
| 313 | +If you start Corporate Memory with the docker-orchestration (or use our keycloak helm chart) for the first time, the |
| 314 | +separate clients are already created when starting the Postgresql container. |
| 315 | + |
| 316 | +However, regenerating a new client secret is advisable: |
| 317 | + |
| 318 | +- Select the `eccenca Corporate Memory`-realm |
| 319 | +- Select `Clients` |
| 320 | +- Select the client `graph-insights-service-account`. |
| 321 | +- Select the tab `Credentials` |
| 322 | +- Press `Regenerate` |
| 323 | +- Then copy the new secret and fill in the values from above. |
| 324 | + |
| 325 | + |
| 326 | + |
| 327 | +Also have a look below and check if your |
| 328 | +[Backchannel logout URL](../../../deploy-and-configure/configuration/graphinsights/index.md#set-backchannel-logout-url-for-graph-insights) is set. |
| 329 | + |
| 330 | +In an already running deployment you would have to create those clients on your own. |
| 331 | + |
| 332 | +We assume the we name the clients as following: |
| 333 | + |
| 334 | +- Browser client: `graph-insights` |
| 335 | +- Inter-component client: `graph-insights-service-account` |
| 336 | + |
| 337 | +#### Set Backchannel logout URL for Graph Insights |
| 338 | + |
| 339 | +You would follow the same steps as in |
| 340 | +[Keycloak Client configuration](../../../deploy-and-configure/configuration/keycloak/index.md) but name them |
| 341 | +differently, e.g. as above. |
| 342 | +In addition, on last step is missing: To have the logout working properly you have to add a client Backchannel logout |
| 343 | +URL for the client ment for browser authentication (`graph-insights`): |
| 344 | + |
| 345 | +- Select the `eccenca Corporate Memory`-realm |
| 346 | +- Select `Clients` |
| 347 | +- Select the client `graph-insights`. |
| 348 | +- Scroll down to this section and add this: `https://<your-deploy-host>/graphinsights/logout/connect/back-channel/keycloak` |
| 349 | + |
| 350 | + |
0 commit comments