From 5b14041a681ffb87809ba8f947b33b8bf8a87a74 Mon Sep 17 00:00:00 2001 From: Nigel Jones Date: Mon, 4 May 2020 12:22:33 +0100 Subject: [PATCH] #2958 remove omrs-monitor Signed-off-by: Nigel Jones --- .azure-pipelines/docker.yml | 2 - .dependabot/config.yml | 14 +- .../docker/omrs-monitor/Dockerfile | 37 -- .../docker/omrs-monitor/dist/monitor.html | 186 --------- .../docker/omrs-monitor/dist/monitor.js | 87 ---- .../docker/omrs-monitor/dist/package.json | 17 - .../omrs-monitor/dist/public/d3_graphviz.js | 373 ------------------ .../docker/omrs-monitor/pom.xml | 86 ---- .../open-metadata-deployment/docker/pom.xml | 1 - 9 files changed, 1 insertion(+), 802 deletions(-) delete mode 100644 open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/Dockerfile delete mode 100644 open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/dist/monitor.html delete mode 100644 open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/dist/monitor.js delete mode 100644 open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/dist/package.json delete mode 100644 open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/dist/public/d3_graphviz.js delete mode 100644 open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/pom.xml diff --git a/.azure-pipelines/docker.yml b/.azure-pipelines/docker.yml index 23cc03c38ff..f0bba788ea0 100644 --- a/.azure-pipelines/docker.yml +++ b/.azure-pipelines/docker.yml @@ -32,8 +32,6 @@ stages: POM_FILE: 'open-metadata-resources/open-metadata-deployment/docker/apache-atlas/pom.xml' egeria-gaian: POM_FILE: 'open-metadata-resources/open-metadata-deployment/docker/gaian/pom.xml' - egeria-omrs-monitor: - POM_FILE: 'open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/pom.xml' egeria-ranger: POM_FILE: 'open-metadata-resources/open-metadata-deployment/docker/apache-ranger-admin/pom.xml' steps: diff --git a/.dependabot/config.yml b/.dependabot/config.yml index cc4a446e31c..b8b8e8c773e 100644 --- a/.dependabot/config.yml +++ b/.dependabot/config.yml @@ -14,13 +14,7 @@ update_configs: - "grahamwallis" - "mandy-chessell" # Explicit references to package.json (see https://github.com/dependabot/feedback/issues/705 ) - - - package_manager: "javascript" - directory: "/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/dist" - update_schedule: "daily" - default_reviewers: - - "grahamwallis" - - "davidradl" + - package_manager: "javascript" directory: "/open-metadata-implementation/user-interfaces/ui-chassis/ui-chassis-spring/src/main/static" update_schedule: "daily" @@ -29,12 +23,6 @@ update_configs: - "davidradl" # Explicit entries also needed for dockerfile - - package_manager: "docker" - directory: "/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor" - update_schedule: "daily" - default_reviewers: - - "grahamwallis" - - "planetf1" - package_manager: "docker" directory: "/open-metadata-resources/open-metadata-deployment/docker/build-images/apache/ranger" update_schedule: "daily" diff --git a/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/Dockerfile b/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/Dockerfile deleted file mode 100644 index 86b1bb9876c..00000000000 --- a/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright Contributors to the Egeria project - -FROM node:13-alpine - -LABEL org.label-schema.schema-version = "1.0" -LABEL org.label-schema.vendor = "ODPi" -LABEL org.label-schema.name = "omrsmonitor-egeriavdc" -LABEL org.label-schema.description = "Image containing a simple visualisation of the Open Metadata Repository Services (OMRS) cohort, for ODPi Egeria demonstration purposes." -LABEL org.label-schema.url = "https://egeria.odpi.org/open-metadata-resources/open-metadata-deployment/" -LABEL org.label-schema.vcs-url = "https://github.com/odpi/egeria/tree/master/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor" -LABEL org.label-schema.docker.cmd = "docker run -d -p 58080:58080 -e KAFKA_ENDPOINT=host:9092 odpi/omrsmonitor-egeriavdc" -LABEL org.label-schema.docker.debug = "docker exec -it $CONTAINER /bin/sh" -LABEL org.label-schema.docker.params = "KAFKA_ENDPOINT=the hostname and port of a Kafka broker in the OMRS cohort" - -RUN mkdir -p /home/node/monitor/node_modules && chown -R node:node /home/node/monitor - -WORKDIR /home/node/monitor - -COPY dist/package*.json ./ - -RUN npm install - -COPY dist/* ./ - -COPY --chown=node:node . . - -USER node - -EXPOSE 58080 - -ENV KAFKA_ENDPOINT $KAFKA_ENDPOINT - -CMD [ "node", "monitor.js" ] - - - diff --git a/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/dist/monitor.html b/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/dist/monitor.html deleted file mode 100644 index 08f2da855d3..00000000000 --- a/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/dist/monitor.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - OMRS Event Monitor - - - -
-

OMRS Event Monitor

-

Simple demonstration that displays recent events seen on the OMRS topic for the cohort specified in the URL (e.g. http://localhost:58080/cohort/<cohort-name>)

-

A summary of each event is shown in the scrollable list below. The OMRS events are also logged as JSON in the console.

-

When the list or the visualization gets too cluttered, reload the page to start again clean.

-
-
Cohort: loading...
-
Visualization Area
-
-
    -
    - - - - - - - - - diff --git a/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/dist/monitor.js b/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/dist/monitor.js deleted file mode 100644 index 888d6903610..00000000000 --- a/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/dist/monitor.js +++ /dev/null @@ -1,87 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -const express = require('express'); -const app = express(); - -const PORT = 58080; - -var options = { - dotfiles: 'ignore', - etag: false, - extensions: ['htm', 'html', 'js'], - index: false, - maxAge: '1d', - redirect: false, - setHeaders: function (res, path, stat) { - res.set('x-timestamp', Date.now()) - } -} - -app.use(express.static('public',options)); - -var http = require('http').Server(app); -var io = require('socket.io')(http); -var kafka = require('kafka-node'); - -globalCohort = "undefined"; -consumer = null; -client = null; -admin = null; - - -// Allow the client to specify the cohort -app.get('/cohort/:cohortName', function(req, res){ - console.log("handling get request with params "+req.params); - globalCohort = req.params.cohortName; - console.log('cohort is ' + req.params.cohortName); - getKafkaConsumer(globalCohort); - res.sendFile(__dirname + '/monitor.html'); -}); - - -getKafkaConsumer = function(cohortName) { - console.log('Invoked getKC'); - // Close any previous Kafka resources - if (consumer != null) consumer.close(); - if (client != null) client.close(); - // Get new Kafka resources - kafka_endpoint = process.env.KAFKA_ENDPOINT; - console.log('Will connect to kafka using '+kafka_endpoint); - client = new kafka.KafkaClient({ kafkaHost : kafka_endpoint }); - console.log('Client connected to kafka using '+kafka_endpoint); - admin = new kafka.Admin(client); - console.log('Kafka Admin created - try to list topics...'); - admin.listTopics((err, res) => { console.log('topics', res); }); - console.log('Try to create Kafka Consumer...'); - consumer = new kafka.Consumer( client, [ { topic: 'open-metadata.repository-services.cohort.'+cohortName+'.OMRSTopic', partition: 0 } ], { autoCommit: true }); - consumer.on('error', function() { io.emit('cohort', 'does not exist - please try a different cohort name')}); - consumer.on('message', function(message) { - try { - var data = JSON.parse(message.value); - io.emit('event', data); console.log(data); - } - catch (e) { - if (e instanceof SyntaxError) { - console.log('Could not make sense of JSON - skipping this event'); - } else { - console.log('Encountered (non-syntax) error in JSON.parse - skipping this event'); - } - } - }); - -}; - -io.on('connection', function(socket){ - console.log('client connected'); - io.emit('cohort', globalCohort); - socket.on('disconnect', function(){ - console.log('client disconnected'); - }); -}); - -http.listen(PORT, function(){ - console.log('listening on *:58080'); -}); - - diff --git a/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/dist/package.json b/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/dist/package.json deleted file mode 100644 index 305777b140e..00000000000 --- a/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/dist/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "egeria-omrs-event-viz", - "version": "1.0.0", - "description": "nodejs application for displaying omrs events using a simple graph visualization", - "author": "Graham Wallis ", - "license": "Apache 2.0", - "main": "monitor.js", - "keywords": [ - "nodejs", - "express" - ], - "dependencies": { - "express": "^4.16.4", - "kafka-node": "^5.0.0", - "socket.io": "^2.2.0" - } -} diff --git a/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/dist/public/d3_graphviz.js b/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/dist/public/d3_graphviz.js deleted file mode 100644 index b4d7143ea9f..00000000000 --- a/open-metadata-resources/open-metadata-deployment/docker/omrs-monitor/dist/public/d3_graphviz.js +++ /dev/null @@ -1,373 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - - -function omrsMon_initialize() { - - console.log('called d3_initialize'); - - width = 600; - height = 600; - node_radius = 5; - - // Nodes represent entities. The id is set to the entityGUID, the x and y properties are for layout - // and the qualifiedName is the qualifiedName of the entity. - //myNodes = [ {id:1, x:100, y:100, qualifiedName:"alice"}, - // {id:2, x:200, y:100, qualifiedName:"bob"}, - // {id:3, x:200, y:200, qualifiedName:"charlie"} - // ]; - myNodes = []; - - // Links represent relationships. The source and target are the entityGUIDs (node.id) - //myLinks = [ { source: 1, target: 2 }, - // { source: 1, target: 3 }, - // { source: 2, target: 2 } - // ]; - myLinks = []; - - d3initialize(); - - d3update(); -} - -function nodeId(d) { - return d.id; -} - -function d3initialize() { - - svg = d3.select('#graphviz').append('svg') - .attr('width', width) - .attr('height', height); - - attraction = d3.forceManyBody().strength(100).distanceMax(width/2).distanceMin(width/10); - repulsion = d3.forceManyBody().strength(-200).distanceMax(width/2).distanceMin(width/10); - - sim = d3.forceSimulation(myNodes) - .alphaDecay(0.006) - .force('horiz', d3.forceX(width / 2).strength(0.1)) - .force('vert', d3.forceY(height / 2).strength(0.1)) - .force('repulsion', repulsion) - .on('tick',tick_function) - .force('link', d3.forceLink().links(myLinks).id(nodeId).distance(75)); - //.force('center', d3.forceCenter(width / 2, height / 2)) - //.force('attraction', attraction) - - d3update(); - -} - -function nodeId(d) { - return d.id; -} - -function getNode(id) { - return ( myNodes.filter(obj => { return obj.id === id })[0] ); -} - -function tick_function() { - - // If not using a forceLink force, then use attr('x1', function(d) { return getNode(d.source).x; }) - //line.attr('x1', function(d) { return getNode(d.source).x; }) - // .attr('y1', function(d) { return getNode(d.source).y; }) - // .attr('x2', function(d) { return getNode(d.target).x; }) - // .attr('y2', function(d) { return getNode(d.target).y; }); - // However, if using forceLink force the node id accessor is defined by nodeId() - line.attr('x1', function(d) { return d.source.x; }) - .attr('y1', function(d) { return d.source.y; }) - .attr('x2', function(d) { return d.target.x; }) - .attr('y2', function(d) { return d.target.y; }); - - // Prior to node labelling - //circ.attr('r', node_radius) - // .attr('cx', function(d) { return d.x = Math.max(node_radius, Math.min(width - node_radius, d.x)); }) - // .attr('cy', function(d) { return d.y = Math.max(node_radius, Math.min(height - node_radius, d.y)); }); - - // With node labelling... - - circ.attr('transform', function(d) { return "translate(" + d.x + "," + d.y + ")";}); - - circ.selectAll('circle') - .attr('r', node_radius) - .attr('cx', 0) - .attr('cy', 0); - - circ.selectAll("text") - .text(function(d) { return d.qualifiedName }); - - //node_para.text(function(d) { return ""+d.id+":"+Math.floor(d.x)+","+Math.floor(d.y); }); - - // When not using forceLink() force, you only need d.source - //link_para.text(function(d) { return ""+d.source+","+d.target; }); - // When using forceLink() force, node accessor nodeId() means you will need to use d.source.id, not d.source - //link_para.text(function(d) { return ""+d.source.id+","+d.target.id; }); -} - -// In order to get the nodes always in front of the links, the nodes need to be re-added to the svg -// So whenever links changes we need to re-generate all the nodes. Or you do select and re-gen of all -// nodes in the tick function. The former is probably more efficient. -function d3update() { - console.log('tickle the links'); - d3updateLinks(); - console.log('tickle the nodes'); - d3updateNodes(); - console.log('tickle the layout'); - sim.alpha(1); - sim.restart(); -} - -function d3updateNodes() { - - // update the visual rendering of the nodes - - sim.nodes(myNodes); - - u = svg.selectAll(".node") - .data(myNodes) - .attr('cx',function(d) { return d.x = Math.max(node_radius, Math.min(width - node_radius, d.x)); }) - .attr('cy',function(d) { return d.y = Math.max(node_radius, Math.min(height - node_radius, d.y)); }); - - u.exit().remove(); - - // Prior to node labelling - //circ = u.enter() - // .append('circle') - // .attr('class', 'node') - // .attr('r',node_radius) - // .attr('cx',function(d) { return d.x = Math.max(node_radius, Math.min(width - node_radius, d.x)); }) - // .attr('cy',function(d) { return d.y = Math.max(node_radius, Math.min(height - node_radius, d.y)); }) - // .merge(u); - - // With node labelling... - circ = u.enter() - .append("g") - .attr('class', 'node') - .attr('x',function(d) { return d.x = Math.max(node_radius, Math.min(width - node_radius, d.x)); }) - .attr('y',function(d) { return d.y = Math.max(node_radius, Math.min(height - node_radius, d.y)); }) - .merge(u) - - circ.append('circle') - .attr('r',node_radius); - //.attr('cx',function(d) { return d.x = Math.max(node_radius, Math.min(width - node_radius, d.x)); }) - //.attr('cy',function(d) { return d.y = Math.max(node_radius, Math.min(height - node_radius, d.y)); }) - - circ.append('text') - .attr("fill","red") - .text( function(d) { return d.qualifiedName; } ) - .attr("font-family","sans-serif") - .attr("font-size","15px") - .attr("stroke-width","0") - .attr("dx",20) - .attr("dy",".35em"); - - - // update the textual rendering of the graph - - //u = d3.select("body").select("#nodes") - // .selectAll("p") - // .data(myNodes); - // - //node_para = u.enter() - // .append("p") - // .merge(u) - // .text(function(d) { return ""+d.id+":"+Math.floor(d.x)+","+Math.floor(d.y); }); - // - //u.exit().remove(); - -} - -function d3updateLinks() { - - // update the visual rendering of the links - - sim.force('link').links(myLinks); - - u = svg.selectAll(".link") - .data(myLinks) - .attr('x1', function(d) { return d.source.x; }) - .attr('y1', function(d) { return d.source.y; }) - .attr('x2', function(d) { return d.target.x; }) - .attr('y2', function(d) { return d.target.y; }); - - u.exit().remove(); - - // If not using forceLink() then specify { return getNode(d.source).x; } - //line = u.enter().append('line') - // .attr('class', 'link') - // .merge(u) - // .attr('x1', function(d) { return getNode(d.source).x; }) - // .attr('y1', function(d) { return getNode(d.source).y; }) - // .attr('x2', function(d) { return getNode(d.target).x; }) - // .attr('y2', function(d) { return getNode(d.target).y; }); - // If using forceLink() then you only need { return d.source.x; } - line = u.enter().append('line') - .attr('class', 'link') - .attr('x1', function(d) { return d.source.x; }) - .attr('y1', function(d) { return d.source.y; }) - .attr('x2', function(d) { return d.target.x; }) - .attr('y2', function(d) { return d.target.y; }) - .merge(u); - - - // Re-generate the nodes - so that they are 'on top' of the links - d3regenNodes(); - - // update the textual rendering of the graph - - u = d3.select("body") - .select("#links") - .selectAll("p") - .data(myLinks); - - // If not using forceLink() then specify { return d.source; } - // If using forceLink() then specify { return d.source.id; } - link_para = u.enter() - .append("p") - .merge(u) - .text(function(d) { return ""+d.source.id+","+d.target.id; }); - - u.exit().remove(); -} - -function d3regenNodes() { - - // remove and re-append all the nodes - - svg.selectAll(".node").remove() - - d3updateNodes(); - -} - - - -function omrsMon_addNode(guid, name) { - console.log('addNode called with name '+name); - createNode(guid, name); - console.log('node was added'); - console.log('call d3update'); - d3update(); - console.log('d3 was updated'); -} - -function omrsMon_addLink(guid,end1Guid,end2Guid) { - createLinkedNode(guid,end1Guid,end2Guid); - d3update(); -} - -function createNode(guid, name) { - if (myNodes.length == 0) { - newNode = {id:guid, x:100, y:100, qualifiedName: name}; - } - else { - // find an unused id - //var candidateId = 1; - //var unique = false; - //while (unique == false) { - // var found = false; - // for (var i=0;i 0) { - var i=0; - do { - thisLink = myLinks[i]; - //appendStatus("Link index "+i); - if (thisLink.source.id == rndId || thisLink.target.id == rndId) { - // Status update - //appendStatus("Remove link "+thisLink.source.id+"->"+thisLink.target.id); - - myLinks.splice(i,1); - } - else { - i=i+1; - } - } while(i - - - - - - - open-metadata-docker - org.odpi.egeria - 1.8-SNAPSHOT - - - 4.0.0 - - - scm:git:git://github.com/odpi/egeria.git - scm:git:ssh://github.com/odpi/egeria.git - http://github.com/odpi/egeria/tree/master - - - Docker image - OMRS Monitor - - Samples, Helm charts to deploy Egeria and associated components such as docker image build scripts - - - open-metadata-docker-omrsmonitor - - pom - - - - - com.spotify - dockerfile-maven-plugin - - - build-and-tag-latest - install - - build - - - - tag-version - install - - tag - - - ${project.version} - - - - push-latest - install - - push - - - latest - - - - push-version - install - - push - - - ${project.version} - - - - - ${docker.registry}/${docker.repo}/omrsmonitor-egeriavdc - - - - - - - diff --git a/open-metadata-resources/open-metadata-deployment/docker/pom.xml b/open-metadata-resources/open-metadata-deployment/docker/pom.xml index ef07f3364e8..bdc7de0176a 100644 --- a/open-metadata-resources/open-metadata-deployment/docker/pom.xml +++ b/open-metadata-resources/open-metadata-deployment/docker/pom.xml @@ -88,7 +88,6 @@ apache-atlas apache-ranger-admin gaian - omrs-monitor