nodejitsu / haibu-carapace Goto Github PK
View Code? Open in Web Editor NEWThe application host used by the haibu node.js application deployment / management server.
Home Page: http://github.com/nodejitsu/haibu-carapace
License: MIT License
The application host used by the haibu node.js application deployment / management server.
Home Page: http://github.com/nodejitsu/haibu-carapace
License: MIT License
I couldn't find a guide on how to create new plugins. Not all of the plugins are written the same way, what is the best way to get started?
Sometimes it is apt to use carapace from inside of a file in order to be used w/ forever etc. Make a JS API rather than just a binary.
Useful for monitoring purposes.
Blocked by nodejs/node-v0.x-archive#3496.
That's because net.Server.prototype._doListen
doesn't exist in v0.6. My guess is that we should override _listen2
instead, but I'm not familiar with net
module internals.
This causes tests to fail:
♢ carapace/net/dolisten
When using haibu-carapace
✓ it should fire the carapace::listening event
When using haibu-carapace spawning the server-dolisten.js script the child carapace should exit
✗ with the correct exit code
» expected 0,
got 1 (==) // net-multiple-servers-test.js:61
✗ and 3x emit the *::carapace::port event with the correct port
» expected 3,
got 0 (==) // net-multiple-servers-test.js:66
(Fixture exits here).
This is what is happening when I try and run the example:
$ node -v
v0.6.10
$ sudo node ./examples/jailer.js
hello { [Error: EPERM, Operation not permitted] errno: 1, code: 'EPERM', syscall: 'setgid' }
undefined
server.js running on port 31337
$ curl http://localhost:31337
curl: (7) couldn't connect to host
What is it supposed to be doing? It would be helpful to include what you expect the examples to output in the README so I can compare my output to what the correct output.
I saw an issue where an application was explicitly listening to localhost
, this was preventing it from being seen on the network.
Can we also add the ability to override the host argument passed to net.listen
?
nt
zeromq and other addons that do not allow for communication over existing sockets do not work properly with the rebinding shim. The proper solution would be forcing carapaced packages to be recompiled with fake headers and providing a secondary rebinding shim in C++.
The recommended workaround is to avoid these modules and note to them this tight coupling in hopes they eventually patch their modules (or libraries that are used).
Today I started 5 apps at the same time (all doing the same with the same code) with haibu
, all trying to bind to port 8000. But I noticed strange things happening. Sometimes one or two apps had to be started twice by forever
. I noticed it because of the logging msgs.
It all points to line 103 and further in net.js where, because of the process.nextTick, another 'process' (in my case another app) can bind first to the 'free' port. And the other app will fail with a EADDRINUSE
error, which crashes the app...
Luckily I remembered that @bmeck also made a pull request for node (see nodejs/node-v0.x-archive#1412) and I noticed that that code is different then the current code for _doListen in net.js. Especially the code between the 2nd try..catch is different where in the pull code there is another check for EADDRINUSE
which will trigger a new _doListen call...
Implementing the pull code solved the problem so maybe can someone implement the new code in net.js ??
Thanks!!
Add support for name plugins (i.e. built-in) and artbitrary file-path plugins, (i.e. custom plug-in).
figured out a waaaay simpler method to discover the port an app has started on
lsof -a -p $PID -i TCP
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node 19423 dominic 5u IPv4 244275 0t0 TCP *:8000 (LISTEN)
no need for complicated monkey patching or IPC.
First of all: I like the progress made with Haibu!! Just came back from a 4 week holiday and was surprised to see the nice structural changes!! Keep on going!! :-)
But when installing all the needed packages for the new version of Haibu I had some problems getting haibu-carapace installed. Every time I did a npm install I got:
> [email protected] preinstall /home/sander/Development/haibu/node_modules/haibu-carapace
> node-waf configure build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /home/sander/local/node
'configure' finished successfully (0.154s)
Waf: Entering directory `/home/sander/Development/haibu/node_modules/haibu-carapace/build'
[1/2] cxx: src/evref.cc -> build/default/src/evref_1.o
../src/evref.cc:1:21: error: node/ev.h: No such file or directory
../src/evref.cc:2:21: error: node/v8.h: No such file or directory
../src/evref.cc:4: error: ‘v8’ is not a namespace-name
../src/evref.cc:4: error: expected namespace-name before ‘;’ token
../src/evref.cc:6: error: expected constructor, destructor, or type conversion before ‘<’ token
../src/evref.cc:11: error: expected constructor, destructor, or type conversion before ‘<’ token
../src/evref.cc:17: error: variable or field ‘init’ declared void
../src/evref.cc:17: error: ‘Handle’ was not declared in this scope
../src/evref.cc:17: error: ‘Object’ was not declared in this scope
../src/evref.cc:17: error: ‘target’ was not declared in this scope
Waf: Leaving directory `/home/sander/Development/haibu/node_modules/haibu-carapace/build'
Build failed: -> task failed (err #1):
{task: cxx evref.cc -> evref_1.o}
Got the same error when installing haibu-carapace standalone... :-(
When I changed the location of the includes in src/evref.cc
from:
#include <node/ev.h>
#include <node/v8.h>
To:
#include <ev.h>
#include <v8.h>
I got everything working...
Any idea what is wrong with my node or npm setup ??
Thanks!!
PS: node v0.4.10 and npm 1.0.22
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.