Permalink
Browse files

Simplify Greyhound installation/configuration via NPM (#31)

  • Loading branch information...
connormanning committed Sep 24, 2016
1 parent 5d9c6a4 commit d783f47cc22066d2c01af5328d33307a9dd8ebd3
Showing with 246 additions and 39,361 deletions.
  1. +2 −2 .dockerignore
  2. +4 −24 .gitignore
  3. +2 −0 .npmignore
  4. +0 −81 Makefile
  5. +44 −20 README.md
  6. +11 −11 {controller → }/binding.gyp
  7. +0 −111 config.template.js
  8. +0 −6 controller/Makefile
  9. +0 −16 controller/interfaces/http/package.json
  10. +0 −70 controller/interfaces/ws/commander.js
  11. +0 −99 controller/interfaces/ws/handler.js
  12. +0 −10 controller/interfaces/ws/package.json
  13. +0 −11 controller/package.json
  14. BIN {examples → }/data/autzen.las
  15. 0 {examples → }/data/half-dome.xml
  16. 0 {examples → }/data/read.xml
  17. +93 −56 doc/administration.rst
  18. BIN examples/data/half-dome.laz
  19. +0 −50 examples/js/get-points.js
  20. +0 −37,003 examples/js/manifest.js
  21. +0 −8 examples/js/package.json
  22. +0 −78 examples/js/put-multi.js
  23. +0 −45 examples/js/serialize.js
  24. +0 −22 greyhound
  25. +25 −3 package.json
  26. +0 −6 python/README.rst
  27. +0 −7 python/greyhound/__init__.py
  28. +0 −29 python/greyhound/box.py
  29. +0 −25 python/greyhound/main.py
  30. +0 −65 python/greyhound/resource.py
  31. +0 −16 python/greyhound/server.py
  32. +0 −34 python/greyhound/util.py
  33. +0 −78 python/setup.py
  34. +8 −13 scripts/docker/Dockerfile
  35. +2 −2 scripts/supervisord.conf
  36. +16 −19 {controller → src}/app.js
  37. 0 {controller → src}/aws.js
  38. +3 −3 { → src}/config.defaults.json
  39. +2 −2 {controller → src}/controller.js
  40. +18 −0 src/forever.js
  41. 0 controller/interfaces/http/handler.js → src/interfaces/http/index.js
  42. +7 −0 src/interfaces/http/package.json
  43. 0 {controller → src}/interfaces/http/static/public/css/style.css
  44. 0 {controller → src}/interfaces/http/static/public/css/style.less
  45. 0 {controller → src}/interfaces/http/static/public/js/Detector.js
  46. 0 {controller → src}/interfaces/http/static/public/js/controls/TrackballControls.js
  47. 0 {controller → src}/interfaces/http/static/public/js/httpClient.js
  48. 0 {controller → src}/interfaces/http/static/public/js/render.js
  49. 0 {controller → src}/interfaces/http/static/public/js/three.js
  50. 0 {controller → src}/interfaces/http/static/public/js/wsClient.js
  51. 0 {controller → src}/interfaces/http/static/views/httpView.jade
  52. 0 {controller → src}/interfaces/http/static/views/index.jade
  53. 0 {controller → src}/interfaces/http/static/views/wsView.jade
  54. +8 −0 src/package.json
  55. 0 {controller → src}/session/bindings.cpp
  56. 0 {controller → src}/session/bindings.hpp
  57. +1 −0 {controller → src}/session/commands/background.hpp
  58. 0 {controller → src}/session/commands/create.hpp
  59. 0 {controller → src}/session/commands/hierarchy.cpp
  60. 0 {controller → src}/session/commands/hierarchy.hpp
  61. 0 {controller → src}/session/commands/read.cpp
  62. 0 {controller → src}/session/commands/read.hpp
  63. 0 {controller → src}/session/commands/status.hpp
  64. 0 {controller → src}/session/read-queries/base.cpp
  65. 0 {controller → src}/session/read-queries/base.hpp
  66. 0 {controller → src}/session/read-queries/entwine.cpp
  67. 0 {controller → src}/session/read-queries/entwine.hpp
  68. 0 {controller → src}/session/read-queries/unindexed.cpp
  69. 0 {controller → src}/session/read-queries/unindexed.hpp
  70. 0 {controller → src}/session/session.cpp
  71. 0 {controller → src}/session/session.hpp
  72. 0 {controller → src}/session/types/source-manager.cpp
  73. 0 {controller → src}/session/types/source-manager.hpp
  74. 0 {controller → src}/session/util/buffer-pool.cpp
  75. 0 {controller → src}/session/util/buffer-pool.hpp
  76. 0 {controller → src}/session/util/once.cpp
  77. 0 {controller → src}/session/util/once.hpp
  78. +0 −10 test/package.json
  79. +0 −1,326 test/unit.js
View
@@ -1,3 +1,3 @@
examples/*
*node_modules*
controller/build/*
data/*
build/*
View
@@ -1,28 +1,8 @@
*.o
.DS_Store
pdal-session/pdal-session
examples/cpp/get-points
examples/cpp/put-pipeline
*.log
*.swp
*.rdb
key.pem
cert.pem
config.json
credentials.js
node_modules
*node_modules*
npm-debug.log
.vagrant
doc/*.pdf
web/public/css/style.css
scripts/vagrant/pdal
scripts/vagrant/entwine
controller/build
src/build/*
*.gypi
examples/data/*
!examples/data/autzen.las
!examples/data/half-dome.laz
!examples/data/read.xml
!examples/data/half-dome.xml
data/*
!data/autzen.las
View
@@ -0,0 +1,2 @@
data/*
build/*
View
@@ -1,81 +0,0 @@
COMPONENTS = gh_cn
KEY=key.pem
CERT=cert.pem
SHELL := /bin/bash
# Directories that need to be copied to the installation path.
SRC_DIRS = controller
# Directories where we need to run 'npm install'.
# 'npm install' will also be run at the top level.
NPM_DIRS = controller \
controller/interfaces/ws \
controller/interfaces/http
.PHONY: cpp npm test clean install uninstall
all:
$(MAKE) npm
cpp:
@echo Building C++ addon.
$(MAKE) -C controller all
npm:
@echo Getting NPM dependencies.
npm install --unsafe-perm
$(foreach d, $(NPM_DIRS), cd $(d); rm -rf node_modules; npm install --unsafe-perm; cd -;)
test:
nodeunit test/unit.js
clean:
$(MAKE) -C controller clean
install:
@gh_exists=$$(which greyhound); \
if [ -x "$$gh_exists" ]; then \
echo "Stopping running Greyhound components..."; \
greyhound stop; \
fi
@echo Installing Greyhound...
#
# Copy sources.
mkdir -p /var/greyhound
cp -R controller/ /var/greyhound
touch /var/log/supervisor/greyhound.log
ifneq ("$(wildcard config.json)","")
cp config.json /var/greyhound/
endif
ifneq ("$(wildcard config.defaults.json)","")
cp config.defaults.json /var/greyhound/
endif
#
# Copy launcher.
cp scripts/supervisord.conf /etc/supervisor/conf.d/greyhound.conf
#
ifneq ("$(wildcard $(KEY))","")
cp $(KEY) /var/greyhound
endif
ifneq ("$(wildcard $(CERT))","")
cp $(CERT) /var/greyhound
endif
# mkdir -p /var/greyhound/node_modules/
# cp -R node_modules/* /var/greyhound/node_modules/
#
# Copy launcher utility.
cp greyhound /usr/bin/
uninstall:
@echo Stopping and removing all traces of Greyhound...
@greyhound stop
#
# Remove launcher.
rm -f /etc/supervisor/conf.d/greyhound.conf
#
# Remove bin script.
rm -f /usr/bin/greyhound
#
# Remove sources.
rm -rf /var/greyhound/
View
@@ -1,27 +1,51 @@
# Greyhound
# GREYHOUND
A point cloud querying and streaming framework over HTTP for the web and your native apps.
A point cloud streaming framework for dynamic web services and native applications.
# Tell me more
_Greyhound_ is powered by [Entwine](https://entwine.io/) which is used to organize
data in a form that Greyhound can then emit to clients. Entwine uses [PDAL](http://pdal.io)
for data access and abstraction to a wide variety of formats. See the [client
documentation](https://github.com/hobu/greyhound/blob/master/doc/clientDevelopment.rst)
and the [administrator
documentation](https://github.com/hobu/greyhound/blob/master/doc/administration.rst)
for more details on development and deployment.
See it in action with the dynamic [Plas.io](http://speck.ly) client at [speck.ly](http://speck.ly) and the [Potree](http://potree.org) client at [potree.entwine.io](http://potree.entwine.io).
A simple
[RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP
protocol is used to query and stream points in a format specified by the
client.
# Getting started
# How to hack?
## Obtaining Greyhound
For now, see the usage instructions in the [entwine repository](https://entwine.io).
### Using Docker
```bash
docker pull connormanning/greyhound
docker run -it -p 8080:8080 connormanning/greyhound
```
# License
_Greyhound_ is under **MIT** license and is Copyright [Howard
Butler](http://hobu.co), [Uday Verma](https://github.com/verma), and [Connor
Manning](https://github.com/connormanning).
### Natively
Prior to installing natively, you must first install [PDAL](https://pdal.io) and its dependencies, and then install [Entwine](https://entwine.io). Then you can install Greyhound via NPM.
```bash
npm install -g greyhound-server
greyhound
```
## Indexing some data
Greyhound uses data indexed by [Entwine](https://entwine.io/). See [the instructions](https://github.com/connormanning/entwine) for how to use Entwine. By default, Greyhound will look for indexed data in `~/greyhound` (natively) and `/opt/data` (dockerized). If you are eager to get started, we have some publicly hosted data you can index and serve locally:
```bash
docker pull connormanning/entwine
mkdir ~/greyhound
docker run -it -v ~/greyhound:/opt/data connormanning/entwine \
entwine build \
-i https://entwine.io/sample-data/red-rocks.laz \
-o /opt/data/red-rocks
```
## Viewing the data
You've just indexed a LAZ file from the internet (data credit to [DroneMapper](https://dronemapper.com/sample_data)) and created a local Entwine dataset. It's sitting at `~/greyhound/red-rocks`. Now let's start Greyhound and take a look at the data. We'll be mapping that output directory into Greyhound's default search path at `/opt/data` within the container:
```bash
docker run -it -p 8080:8080 -v ~/greyhound:/opt/data connormanning/greyhound
```
Now that Greyhound is awake, you should be able to browse your data with [Plasio](http://speck.ly/?s=http://localhost:8080/&r=red-rocks) or [Potree](http://potree.entwine.io/data/custom.html?s=localhost:8080&r=red-rocks).
# Further reading
See the [client documentation](https://github.com/hobu/greyhound/blob/master/doc/clientDevelopment.rst) if you are interested in developing an application that streams data from Greyhound. For instructions regarding configuring and deploying Greyhound, see the [administrator documentation](https://github.com/hobu/greyhound/blob/master/doc/administration.rst).
@@ -4,23 +4,23 @@
{
'target_name': 'session',
'sources': [
'./session/bindings.cpp',
'./session/session.cpp',
'./src/session/bindings.cpp',
'./src/session/session.cpp',
'./session/commands/read.cpp',
'./session/commands/hierarchy.cpp',
'./src/session/commands/read.cpp',
'./src/session/commands/hierarchy.cpp',
'./session/read-queries/base.cpp',
'./session/read-queries/entwine.cpp',
'./session/read-queries/unindexed.cpp',
'./src/session/read-queries/base.cpp',
'./src/session/read-queries/entwine.cpp',
'./src/session/read-queries/unindexed.cpp',
'./session/types/source-manager.cpp',
'./src/session/types/source-manager.cpp',
'./session/util/buffer-pool.cpp',
'./session/util/once.cpp'
'./src/session/util/buffer-pool.cpp',
'./src/session/util/once.cpp'
],
'include_dirs': [
'./session', '/usr/include/jsoncpp'
'./src/session', '/usr/include/jsoncpp'
],
'cflags!': [ '-fno-exceptions', '-fno-rtti' ],
'cflags_cc!': [ '-fno-exceptions', '-fno-rtti' ],
View
@@ -1,111 +0,0 @@
{
"queryLimits": {
// Maximum number of indexed chunks allowed to be fetched per query.
// Smaller numbers result in faster query response times. Must be no
// less than 4.
"chunksPerQuery": 16,
// Number of previously fetched chunks that may be held in the cache.
// Must be no less than 16.
"chunkCacheSize": 128
},
// Where to find unindexed pointcloud source files and indexed
// subdirectories, searched in order.
"paths": [
"/opt/data"
// , "s3://my-index-bucket"
],
// Time of inactivity per session handler, in minutes, after which to
// free the allocations used to maintain a Greyhound resource.
//
// If set to 0, initialized resources never expire and will never need
// reinitialization. Only recommended if a small and well-known number of
// resources exist.
//
// Expiration checks are amortized, so this configuration entry represents
// the minimum time before expiration occurs.
//
// Default: 30.
"resourceTimeoutMinutes": 30,
"http": {
// Set to true to serve static files at /data/ for testing/verification.
"enableStaticServe": true,
// HTTP headers to be applied to Greyhound responses. Likely uses
// include CORS settings and cache control.
"headers": {
"Cache-Control": "public, max-age=86400",
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET,PUT,POST,DELETE"
},
// If null, no HTTP interface will be supported.
"port": 80,
// If keyFile and certFile are both non-null, and securePort is set
// below, HTTPS will be supported.
//
// If credentials are named key.pem and cert.pem and placed at
// Greyhound"s root directory, key.pem and cert.pem are accepted below.
// Otherwise, absolute paths are required.
"keyFile": "/opt/keys/greyhound/key.pem",
"certFile": "/opt/keys/greyhound/cert.pem",
// If null, no HTTPS interface will be supported.
"securePort": 443
},
"ws": {
// If null, no websocket interface will be supported.
"port": 8989
},
// Greyhound supports the use of an external authentication server to
// authenticate users to supplied resources before serving. This is
// achieved by proxying an entire Greyhound request to the auth path
// specified below, postfixed with "/<resource>", which is the current
// resource that the user is attempting to view.
//
// Depending on your authentication method(s), this may place some domain
// restrictions on your hosting. For example, if your authentication
// server uses cookies for auth, those cookies will only survive Greyhound"s
// proxying if Greyhound and the auth server are on the same top-level
// domain, and that the cookie domain is set loosely enough to be sent to
// the Greyhound server.
//
// Authentication is not supported over the websocket interface.
"auth": {
// Where to proxy Greyhound requests for authentication. The
// authentication server should send a 2xx status code to allow access
// to this resource, or any other status if not. An error status code
// will be returned to the client unmodified.
//
// Sample flow:
// path: "me.com/auth"
//
// - Client requests greyhound-domain.com/resource/autzen/info
// - Greyhound proxies request to me.com/auth/autzen
// - If response is 2xx, user has access until "good" auth timeout
// - Otherwise, user is denied access until "bad" auth timeout
"path": "external-auth-server.my-domain.com/authenticate",
// Greyhound will use the external application"s session cookies for its
// session caching, and map this cookie to the auth server"s response.
"cookieName": "my-application-session-id",
// Specify how long Greyhound caches responses for both successful and
// unsuccessful authentication attempts. If set to a number instead of
// an object, that number will be used for both "good" and "bad" auth
// caching.
//
// Minimum values: 1.
"cacheMinutes": {
"good": 1,
"bad": 1
}
}
}
View
@@ -1,6 +0,0 @@
all:
node-gyp build
clean:
node-gyp clean
@@ -1,16 +0,0 @@
{
"name": "http-handler",
"private": true,
"version": "0.0.1",
"dependencies": {
"bluebird": "^3.2.2",
"body-parser": "^1.14.2",
"cookie-parser": "^1.4.1",
"express": "^4.13.3",
"express-session": "^1.13.0",
"jade": "^1.11.0",
"less-middleware": "^1.0.4",
"node-uuid": "^1.4.7",
"request": "^2.69.0"
}
}
Oops, something went wrong.

0 comments on commit d783f47

Please sign in to comment.