-
Notifications
You must be signed in to change notification settings - Fork 22
Conversation
@seanewest I LOVE the simplicity of this approach, a couple thoughts about how we could make things even more powerful:
// begin by looking in the local ./node_modules folder, then look in common system paths.
// we should still respect the module-prefix variable.
["./", "/usr", "/usr/local"]
Awesome feature 💯 did you try it out with any packages? |
Ok cool. How does this sound:
I noticed that |
Are there any other directories that one might put packages in? |
on Ubuntu, it's I'm not quite sure what the best practice would be for logs, on Linux machines |
On my mac <key>WorkingDirectory</key>
<string>/usr/local</string>
<key>StandardErrorPath</key>
<string>/usr/local/var/postgres/server.log</string> I tried logging to |
I also noticed a |
Let's punt on the logs for a bit, and get everything else working; I can dig into the permissions issues with logs on OSX/Centos/Ubuntu when I get a moment. |
Haven't forgotten about this @seanewest, been swamped with ops work this week. Let's get this feature shipped this weekend. |
Sounds good to me. I'm free Saturday and Sunday to work on this. On Thursday, August 7, 2014, Benjamin E. Coe notifications@github.com
|
Background: A couple weeks ago I wrote https://github.com/strongloop/strong-service-install so that I could add an install command to another module. For testing purposes, I threw a minimist wrapper around it that let it install upstart wrappers for arbitrary executables. For your prefix query, if the global module in question has a "binary" associated with it, could you inspect the symlink to determine the module's location and from there find the metadata? |
@rmg I like the idea of using the symlink to determine the module directory, that's what we should default to :) As for deploying services with
Any thoughts about simplifying this flow? |
From the bottom up:
Actually, overall I don't really get the |
ndm grows out of my need to run many services at the same time in a service oriented architecture. It's nice that
This gets confusing, hence the abstraction.
|
For Ubuntu and CentOS using Upstart like ndm does, For service orchestration, if the services are on the same machine Upstart lets you use other jobs as start/stop triggers. That's how foreman (and node-foreman) generate top level jobs that kick off the other services. You'd create a top level job, say
And then your sub-services,
And another,
Then you'd just do It's a pretty natural progression to generate that from a |
@rmg I've made the conscious decision not to go down the path of implementing an orchestration tool for a set of interdependent services. ndm helps you share configuration between, and boot multiple isolated web-services. |
@bcoe I missed the multiple-serivces part of The generation of a top-level Upstart job would still work. The theoretical benefit is that $init becomes aware of the dependencies and "do the right thing", but I realize that doesn't actually translate to anything real (except in Windows Services land, I suppose). |
@rmg I think this is worth talking about more. Here's what I'm thinking:
|
Coincidentally, I took over node-foreman from @groundwater a few months back, and we happened to meet in person just last night. |
@seanewest I'm going to be hacking on ndm this afternoon and tonight, I'll hop in the npm IRC channel 👍 |
@bcoe roger |
Here's what I'm thinking, let's make it so you can pass a service name to every command: ndm generate foo
ndm start foo
ndm remove foo If no service.json is found in the current working directory, look for the package in |
I think that sounds good. My pull request has a couple of commits that try to resolve the ubuntu/mac os separate prefix paths and also changes the prefix flag to module-prefix. So then I was thinking the next changes would be to remove the explore flag and instead use explore internally when we can't find a local service.json. |
@seanewest I've created a
|
Fixes #39
I implemented a minimalist solution for global npm packages:
ndm <cmd> -g <package>
If you want to see this interface in action, I'm using it for my project npmfs
I see a couple of benefits in doing it this way:
npm <cmd> -g <package>
(but it can't dondm -g <cmd> <package>
)npm start <local-service>
There are three main things currently missing (at least from how this feature was discussed):
ndm <cmd> <package>
is not supportedndm start <package>
currently runs just like it does for local ndm wrappers and does not shortcut the interview -> generate -> start process.--prefix
which defaults to/usr/local
to determine the location of npm modules, rather than programatically asking npm. The npm module requires an async load method which I was having a hard time working in with the currently synchronous initialization phase.I'd like to hear your feedback and suggestions.