Skip to content

Commit

Permalink
Merge pull request #46 from moxious/v0.6.0
Browse files Browse the repository at this point in the history
V0.6.0
  • Loading branch information
moxious authored Dec 10, 2018
2 parents 152c5c0 + 722b951 commit 639bd8e
Show file tree
Hide file tree
Showing 56 changed files with 1,465 additions and 918 deletions.
69 changes: 64 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,20 @@ jobs:
- run:
name: Prep
command: |
# I should maybe be using a different docker image in Circle rather than
# doing all of this junk, but works for me. :)
mkdir -p /tmp/artifacts
sudo npm install -g yarn
sudo apt-get update && sudo apt-get install -y s3cmd
- run:
name: Build Halin Docker Image
command: docker build -t mdavidallen/halin:latest -f Dockerfile .
# Do not install s3cmd from apt-get, it's an out of date version.
wget https://github.com/s3tools/s3cmd/releases/download/v2.0.2/s3cmd-2.0.2.tar.gz
tar zxvf s3cmd-2.0.2.tar.gz
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python get-pip.py
sudo pip install setuptools
cd s3cmd-2.0.2 && sudo python setup.py install
cd $HOME && s3cmd --version
- restore_cache:
name: Restore Yarn Package Cache
keys:
Expand All @@ -28,7 +36,34 @@ jobs:
name: Save Yarn Package Cache
key: yarn-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- ~/.cache/yarn
- run:
name: Deploy to S3 (Build Branch)
command: |
if [ "${CIRCLE_BRANCH}" = "master" ]; then
echo "Skipping branch build; master will be deployed"
else
export SUBDIR="${CIRCLE_BRANCH}-${CIRCLE_SHA1}"
export BUCKET=halin
export BASE_URL=http://halin.s3-website-us-east-1.amazonaws.com/
export FINAL_URL="$BASE_URL$SUBDIR/"
cp package.json package.orig
# Have to monkeypatch the "homepage" field so that the react build will
# work.
cat package.json | sed s,$BASE_URL,$FINAL_URL, > package.branch
cp package.branch package.json
cp package.branch /tmp/artifacts/package.branch.json
npm run build
s3cmd put --recursive -P dist/* "s3://$BUCKET/$SUBDIR/"
# Thinking this is a bug in s3 that has to be overcome: https://stackoverflow.com/questions/53708938/s3cmd-flagging-css-with-wrong-mime-type
s3cmd modify "s3://$BUCKET/$SUBDIR/static/css/*.css" --mime-type="text/css"
# Replace package file with the original
cp package.orig package.json
echo "$FINAL_URL" | tee /tmp/artifacts/s3-deploy-branch.txt
fi
- run:
name: Build Halin Docker Image
command: docker build -t mdavidallen/halin:latest -f Dockerfile .
- run:
name: Test Against Neo4j 3.4.9 Enterprise
command: |
Expand All @@ -46,6 +81,7 @@ jobs:
--env NEO4J_USERNAME=neo4j \
--env NEO4J_PASSWORD=admin \
mdavidallen/halin:latest npm run gather > /tmp/artifacts/halin-3.4.9.txt
docker logs neo4j349 > /tmp/artifacts/neo4j349.log
docker stop neo4j349
- run:
name: Test Against Neo4j 3.5.0 Enterprise
Expand All @@ -64,14 +100,37 @@ jobs:
--env NEO4J_USERNAME=neo4j \
--env NEO4J_PASSWORD=admin \
mdavidallen/halin:latest npm run gather > /tmp/artifacts/halin-3.5.0.txt
docker logs neo4j350 > /tmp/artifacts/neo4j350.log
docker stop neo4j350
- run:
name: Test Against Neo4j 3.5.0 Community
command: |
docker run -d --name neo4j350community --rm -p 127.0.0.1:7474:7474 -p 127.0.0.1:7687:7687 --env NEO4J_AUTH=neo4j/admin --env=NEO4J_ACCEPT_LICENSE_AGREEMENT=yes -t neo4j:3.5.0
sleep 20
docker ps
export NEO4J_URI=bolt://localhost:7687
export NEO4J_USER=neo4j
export NEO4J_PASSWORD=admin
# Run gather against the temp docker image started.
docker run --network container:neo4j350community \
--env NEO4J_URI=bolt://localhost:7687 \
--env NEO4J_USERNAME=neo4j \
--env NEO4J_PASSWORD=admin \
mdavidallen/halin:latest npm run gather > /tmp/artifacts/halin-3.5.0-community.txt
docker logs neo4j350community > /tmp/artifacts/neo4j350community.log
docker stop neo4j350community
- run:
name: Deploy to S3 (Production)
command: |
if [ "${CIRCLE_BRANCH}" = "master" ]; then
export BUCKET=halin
cp package.json /tmp/artifacts/package.dist.json
npm run build
s3cmd put --recursive -P dist/* s3://$BUCKET
# Thinking this is a bug in s3 that has to be overcome: https://stackoverflow.com/questions/53708938/s3cmd-flagging-css-with-wrong-mime-type
s3cmd modify "s3://$BUCKET/static/css/*.css" --mime-type="text/css"
echo http://halin.s3-website-us-east-1.amazonaws.com/ > /tmp/artifacts/s3-deploy-production.txt
else
echo "Not master, nothing to do"
Expand Down
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![CircleCI](https://circleci.com/gh/moxious/halin.svg?style=svg)](https://circleci.com/gh/moxious/halin)

## Halin Neo4j Monitoring

Halin is a Graph App for monitoring your Neo4j instance, or cluster. It works with both
Expand All @@ -9,7 +11,8 @@ Causal Clusters.
Primary features:
1. Basic performance monitoring (system load, memory usage)
2. Advisor and Diagnostics: Checks your Neo4j configuration and finds problems, makes suggestions on how to improve.
3. User & Role Management: allows you to administer users & roles across any number of machines.
3. Works with both Neo4j Enterprise and Neo4j Community
4. User & Role Management: allows you to administer users & roles across any number of machines.

## Running Halin in Development Mode

Expand All @@ -30,6 +33,12 @@ docker run -d -p 127.0.0.1:3000:3000 --rm -t mdavidallen/halin:latest

Open a browser to http://localhost:3000/

If you'd like to build the Halin docker container from source:

```
docker build -t halin:latest -f Dockerfile .
```

### Running as a GraphApp

4. Inside of Neo4j Desktop, go to application settings, scroll all the way to the bottom, enable development mode
Expand All @@ -38,19 +47,11 @@ Open a browser to http://localhost:3000/
7. Finally, inside of desktop you'll see a special tile labeled "Development App 9.9.9". This will
point to your running copy of Halin

### Docker Support

To build the container:

```
docker build -t halin:latest -f Dockerfile .
```

## FAQ

1. Does it support Neo4j Enterprise or Community?

Both. But some features must be disabled for community (such as user management) because community does not support them.
Both. Some features must be disabled for community (such as user management) because community does not support them. For a comparison of features between Neo4j Enterprise and Community, [see this link](https://neo4j.com/subscriptions/#editions)

2. Does Halin capture any data about my database?

Expand All @@ -62,7 +63,10 @@ software, but nothing about your configuration is sent back to me.
3. How does Halin work?

Halin uses pure cypher/bolt connections to nodes in your cluster, and uses Neo4j's existing
management interfaces and queries, including things like JMX, to obtain all statistics.
management interfaces and queries, including things like JMX, to obtain all statistics. The upside
of this approach is that it will work on any Neo4j instance with zero modification or configuration.
The downside is that there are certain aspects of debugging (like getting remote log files) that Halin
cannot yet access because this would require server-side SSH access.

4. Do I have to run Halin as an admin user?

Expand Down
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "halin",
"description": "Halin helps you monitor and improve your Neo4j graph",
"version": "0.5.2",
"version": "0.6.0",
"neo4jDesktop": {
"apiVersion": "^1.2.0"
},
Expand All @@ -19,17 +19,18 @@
"homepage": "http://halin.s3-website-us-east-1.amazonaws.com/",
"private": false,
"dependencies": {
"@sentry/browser": "^4.0.6",
"bluebird": "^3.5.2",
"graph-app-kit": "^1.0.2",
"@sentry/browser": "^4.4.1",
"bluebird": "^3.5.3",
"graph-app-kit": "^1.0.3",
"lodash": "^4.17.11",
"mathjs": "^5.4.0",
"moment": "^2.22.2",
"neo4j-driver": "^1.7.2",
"pondjs": "^0.8.9",
"prop-types": "^15.6.0",
"react": "^16.0.0",
"react": "^16.6.3",
"react-d3-components": "^0.9.1",
"react-dom": "^16.0.0",
"react-dom": "^16.6.3",
"react-graph-vis": "^1.0.2",
"react-scripts": "1.0.16",
"react-sortable-tree": "^2.2.0",
Expand All @@ -39,7 +40,7 @@
"source-map-explorer": "^1.6.0",
"uri-parser": "^1.0.1",
"uuid": "^3.3.2",
"yargs": "^12.0.2"
"yargs": "^12.0.5"
},
"scripts": {
"analyze": "./node_modules/.bin/source-map-explorer dist/static/js/main.*",
Expand All @@ -52,11 +53,11 @@
"prepublishOnly": "npm run build"
},
"devDependencies": {
"@babel/cli": "^7.1.5",
"@babel/core": "^7.1.5",
"@babel/node": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/preset-env": "^7.1.6",
"@babel/cli": "^7.2.0",
"@babel/core": "^7.2.0",
"@babel/node": "^7.2.0",
"@babel/plugin-proposal-class-properties": "^7.2.1",
"@babel/preset-env": "^7.2.0",
"@babel/preset-react": "^7.0.0"
}
}
6 changes: 6 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Halin Release Notes

## 0.6.0

- Halin can now gather diagnostics and render advice about Neo4j Community
- The user management pane now works for Neo4j Community (no longer just enterprise)
- Improvements to the diagnostic data format, and better tracking of node performance.

## 0.5.2

- Bugfixes: #40, #41, #42, #44
Expand Down
19 changes: 5 additions & 14 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { Component } from 'react';
import * as Sentry from '@sentry/browser';
import appPkg from '../package.json';
import sentry from './sentry/index';
import {
GraphAppBase,
CONNECTED
Expand Down Expand Up @@ -72,8 +71,7 @@ class Halin extends Component {

const initPromise = window.halinContext.initialize()
.catch(err => {
Sentry.captureException(err);
console.error('Error initializing halin context', err);
sentry.reportError(err, 'Error initializing halin context');
this.setState({ error: err });
return window.halinContext;
})
Expand All @@ -83,7 +81,7 @@ class Halin extends Component {

this.setState({ initPromise });
} catch (e) {
console.error(e);
sentry.error(e);
}
}

Expand Down Expand Up @@ -141,9 +139,7 @@ class Halin extends Component {

const allPanesInOrder = [overviewPane].concat(nodePanes);

// The user management tab is only available in enterprise, unfortunately,
// because it relies on stored procedures that don't exist in community.
if (window.halinContext.isEnterprise() && window.halinContext.supportsNativeAuth()) {
if (window.halinContext.supportsNativeAuth()) {
allPanesInOrder.push(userMgmtPane);
}
allPanesInOrder.push(diagnosticPane);
Expand Down Expand Up @@ -194,12 +190,7 @@ class Halin extends Component {
}

const App = () => {
Sentry.init({
dsn: 'https://82705ec41177415dbf13621167480fd8@sentry.io/1297023',
maxBreadcrumbs: 50,
debug: false,
release: appPkg.version,
});
sentry.init();

// If this global is defined, we're running in desktop. If it isn't, then we need
// to use the shim object to convince the rest of the app we're in Desktop.
Expand Down
4 changes: 0 additions & 4 deletions src/AppFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import { Button, Modal, Header } from 'semantic-ui-react'
import SettingsPane from './settings/SettingsPane';

export default class AppFooter extends Component {
settings = () => {
console.log('Foo');
};

render() {
return (
<div className='AppFooter'>
Expand Down
8 changes: 8 additions & 0 deletions src/ClusterNodeTabHeader.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React, { Component } from 'react';
import { Menu, Icon, Popup } from 'semantic-ui-react'
import util from './data/util.js';

export default class ClusterNodeTabHeader extends Component {
state = {
ratio: 1,
total: 1,
fresh: 1,
notFresh: 0,
performance: { observations: [] },
};

sampleFeeds() {
Expand All @@ -22,6 +24,7 @@ export default class ClusterNodeTabHeader extends Component {
total,
fresh,
notFresh,
performance: this.props.node.performance(),
});
}

Expand All @@ -47,6 +50,10 @@ export default class ClusterNodeTabHeader extends Component {
<h4>Data</h4>
<p>{`${this.state.fresh} of ${this.state.total} fresh`}</p>

<p>{this.state.performance.observations.length} observations; mean response time
&nbsp;{util.roundToPlaces(this.state.performance.mean,0)}ms with a standard deviation of
&nbsp;{util.roundToPlaces(this.state.performance.stdev,0)}ms</p>

<p>When most/all feeds are fresh, this indicates responsiveness. When performance
degrades, data feeds slow, stop, or error.</p>
</div>
Expand Down Expand Up @@ -81,6 +88,7 @@ export default class ClusterNodeTabHeader extends Component {
trigger={this.statusIcon()}
header={node.role}
content={this.popupContent()}
position='bottom left'
/>

{ node.getLabel() }
Expand Down
Loading

0 comments on commit 639bd8e

Please sign in to comment.