Git Product home page Git Product logo

overcast's People

Contributors

andrewchilds avatar garnold avatar jdiamond avatar kschrader avatar zbigg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

overcast's Issues

SSH Tunnels?

Just thinking that tunneling ports might be useful:

overcast tunnel 7733:instance.01:4567

to allow users to access port 4567 on the remote machine as if it is port 7733 on their machine.

What do you think?

Global SSH options

Hey team -

Is it possible to set global ssh options? I find quite often that a broken bash prompt requires me to:

-t "bash --noprofile"

KVM/Libvirt

Is there any chance of getting KVM or libvirt support in the future?

Windows support

Hey man, sorry to bother you with this, but would you accept a PR that makes running overcast work on Windows (as long as you have bash, SSH, etc, installed)?

I got overcast init to work by creating a real simple wrapper function around child_process.exec along with a few other modifications, trying really hard to be as unobtrusive as possible. After that, a bunch of the other commands just worked to where I was able to create a cluster and new droplet.

I can create a proper fork so you can see the diff if you're interested. If it's not something you want, I'll just force the other devs here to Putty into a Linux environment if they want to manage our DigitalOcean servers.

Duplicate command line options are interpreted as an array

For example, when specifying the --ssh-key argument on the command line twice, an array is stored in ssh_key:

$ overcast instance import foo 1.2.3.4 --ssh-key bar --ssh-key baz
Using "default" cluster.
Instance "foo" (1.2.3.4) has been imported to the "default" cluster.

$ overcast info foo
Using /Users/garnold/.overcast/clusters.json

foo
  ip: 1.2.3.4
  name: foo
  ssh_port: 22
  ssh_key:
    0: bar
    1: baz
  user: root
  password: ""

overcast/bin/ssh: fork: Resource temporarily unavailable

Hey @andrewchilds, when attempting to run a command using a freshly forked clone of the Overcast repo (and adding /path/to/overcast/bin to my path), I'm receiving the following error:

overcast garnold$ overcast run all health

sux-pi-1: $ /bin/bash -s /Users/garnold/Dropbox/Development/Projects/overcast/scripts/health
sux-pi-1: 
sux-pi-1: $ /bin/bash -s /Users/garnold/Dropbox/Development/Projects/overcast/scripts/health
sux-pi-1: 
sux-pi-1: $ /bin/bash -s /Users/garnold/Dropbox/Development/Projects/overcast/scripts/health
sux-pi-1: 

...

sux-pi-1: $ /bin/bash -s /Users/garnold/Dropbox/Development/Projects/overcast/scripts/health
sux-pi-1: 
sux-pi-1: $ /bin/bash -s /Users/garnold/Dropbox/Development/Projects/overcast/scripts/health
sux-pi-1: /Users/garnold/Development/Projects/overcast/bin/ssh: fork: Resource temporarily unavailable
sux-pi-1: SSH connection exited with a non-zero code (128). Stopping execution...

When installing Overcast via NPM and issuing the same command, everything works as expected:

overcast garnold$ overcast run all health

sux-pi-1: $ /bin/bash -s /usr/local/lib/node_modules/overcast/scripts/health
sux-pi-1: {
sux-pi-1: "cpu_1min": "0.12",
sux-pi-1: "cpu_5min": "0.05",
sux-pi-1: "cpu_15min": "0.05",
sux-pi-1: "disk_total": "6095",
sux-pi-1: "disk_used": "2483",
sux-pi-1: "disk_free": "3285",
sux-pi-1: "mem_total": "437",
sux-pi-1: "mem_used": "391",
sux-pi-1: "mem_free": "46",
sux-pi-1: "cache_used": "49",
sux-pi-1: "cache_free": "388",
sux-pi-1: "swap_total": "99",
sux-pi-1: "swap_used": "0",
sux-pi-1: "swap_free": "99",
sux-pi-1: "tcp": "3",
sux-pi-1: "rx_bytes": "806350951",
sux-pi-1: "tx_bytes": "2912126130",
sux-pi-1: "io_reads": "",
sux-pi-1: "io_writes": "",
sux-pi-1: "processes": [
sux-pi-1: "...",
sux-pi-1: ""
sux-pi-1: ]
sux-pi-1: }
sux-pi-1: 

sux-pi-2: $ /bin/bash -s /usr/local/lib/node_modules/overcast/scripts/health
sux-pi-2: {
sux-pi-2: "cpu_1min": "0.24",
sux-pi-2: "cpu_5min": "0.21",
sux-pi-2: "cpu_15min": "0.16",
sux-pi-2: "disk_total": "5986",
sux-pi-2: "disk_used": "3251",
sux-pi-2: "disk_free": "2409",
sux-pi-2: "mem_total": "437",
sux-pi-2: "mem_used": "422",
sux-pi-2: "mem_free": "15",
sux-pi-2: "cache_used": "106",
sux-pi-2: "cache_free": "330",
sux-pi-2: "swap_total": "99",
sux-pi-2: "swap_used": "0",
sux-pi-2: "swap_free": "99",
sux-pi-2: "tcp": "21",
sux-pi-2: "rx_bytes": "2739004562",
sux-pi-2: "tx_bytes": "1680153943",
sux-pi-2: "io_reads": "169010266",
sux-pi-2: "io_writes": "250421112",
sux-pi-2: "processes": [
sux-pi-2: "...",
sux-pi-2: ""
sux-pi-2: ]
sux-pi-2: }
sux-pi-2: 

sux-pi-3: $ /bin/bash -s /usr/local/lib/node_modules/overcast/scripts/health
sux-pi-3: {
sux-pi-3: "cpu_1min": "0.00",
sux-pi-3: "cpu_5min": "0.03",
sux-pi-3: "cpu_15min": "0.05",
sux-pi-3: "disk_total": "5986",
sux-pi-3: "disk_used": "3208",
sux-pi-3: "disk_free": "2452",
sux-pi-3: "mem_total": "437",
sux-pi-3: "mem_used": "409",
sux-pi-3: "mem_free": "27",
sux-pi-3: "cache_used": "44",
sux-pi-3: "cache_free": "392",
sux-pi-3: "swap_total": "99",
sux-pi-3: "swap_used": "0",
sux-pi-3: "swap_free": "99",
sux-pi-3: "tcp": "3",
sux-pi-3: "rx_bytes": "0",
sux-pi-3: "tx_bytes": "0",
sux-pi-3: "io_reads": "",
sux-pi-3: "io_writes": "",
sux-pi-3: "processes": [
sux-pi-3: "...",
sux-pi-3: ""
sux-pi-3: ]
sux-pi-3: }
sux-pi-3: 

sux-pi-4: $ /bin/bash -s /usr/local/lib/node_modules/overcast/scripts/health
sux-pi-4: {
sux-pi-4: "cpu_1min": "0.00",
sux-pi-4: "cpu_5min": "0.01",
sux-pi-4: "cpu_15min": "0.05",
sux-pi-4: "disk_total": "13207",
sux-pi-4: "disk_used": "3309",
sux-pi-4: "disk_free": "9204",
sux-pi-4: "mem_total": "437",
sux-pi-4: "mem_used": "414",
sux-pi-4: "mem_free": "23",
sux-pi-4: "cache_used": "45",
sux-pi-4: "cache_free": "392",
sux-pi-4: "swap_total": "99",
sux-pi-4: "swap_used": "0",
sux-pi-4: "swap_free": "99",
sux-pi-4: "tcp": "3",
sux-pi-4: "rx_bytes": "2333643989",
sux-pi-4: "tx_bytes": "2121280946",
sux-pi-4: "io_reads": "",
sux-pi-4: "io_writes": "",
sux-pi-4: "processes": [
sux-pi-4: "...",
sux-pi-4: ""
sux-pi-4: ]
sux-pi-4: }
sux-pi-4: 

Any thoughts?

Potentially confusing script usage in README.md

The examples in the README that include shell scripts may not be clear to new users. The examples use a relative path to scripts in the "install" directory. npm with the -g flag installs the examples in /usr/lib/node_modules/overcast/scripts. If there is a way to configure a search path for scripts, this is undocumented and /usr/lib/node_modules/overcast/scripts is not included.

If the user cuts and pastes the examples, the scripts will not be found. One of the great things about overcast is the ease in which a new user can quickly kick the tires and use standard shell scripts for provisioning. It would be a shame if new users got frustrated by not being able to execute the included shell scripts.

On contributing to Overcast

Hey @andrewchilds, I having a bit of trouble finding the right developer setup for contributing to Overcast. Here's how I started:

  1. Fork repo, clone locally
  2. Prepend /path/to/overcast/bin to my PATH

With this setup, I'm getting an error when running overcast run: #30

If skip updating my path, and run Overcast using /path/to/overcast/bin/overcast, it does pickup my local changes to the Overcast framework, however I have to include the path to my scripts, ie. ./bin/overcast run all scripts/my_script. Also, recipes do not pickup my local changes since they use the overcast from my classpath.

Finally, when creating recipes, in order for Overcast to find the scripts used by the recipe, I need to include the path to the script in the recipe, otherwise the script is not found. Here's an example: https://github.com/andrewchilds/overcast/pull/31/files#diff-b481cea93210e4348dcd2edf85e892ecR19

Any help would be greatly appreciated.

EventEmitter memory leak detected. 11 listeners added on v0.4.5

Running v0.4.5 Work fine for
overcast run workers "egrep 'MMC' *.log | tail -n1 | cut -c29-" --continueOnError | egrep "HPM" > HPM.out
on 37 node

But got the same error if using -p

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at ReadStream.EventEmitter.addListener (events.js:160:15)
at sshExec (/usr/lib/node_modules/overcast/modules/ssh.js:121:17)
at runOnInstance (/usr/lib/node_modules/overcast/modules/ssh.js:38:3)
at /usr/lib/node_modules/overcast/modules/ssh.js:13:7
at forOwn (/usr/lib/node_modules/overcast/node_modules/lodash/dist/lodash.js:2105:15)
at Function.forEach (/usr/lib/node_modules/overcast/node_modules/lodash/dist/lodash.js:3302:9)
at Object.exports.run (/usr/lib/node_modules/overcast/modules/ssh.js:12:7)
at Object.exports.run (/usr/lib/node_modules/overcast/modules/commands/run.js:15:7)
at execute (/usr/lib/node_modules/overcast/overcast.js:30:13)
at /usr/lib/node_modules/overcast/overcast.js:9:7

EventEmitter memory leak detected. 11 listeners added

How do I increase the limit to eliminate this warning ?
running under ubuntu precise with node v0.10.28

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at ReadStream.EventEmitter.addListener (events.js:160:15)
at sshExec (/usr/lib/node_modules/overcast/modules/ssh.js:117:17)
at runOnInstance (/usr/lib/node_modules/overcast/modules/ssh.js:38:3)
at runOnInstances (/usr/lib/node_modules/overcast/modules/ssh.js:25:3)
at /usr/lib/node_modules/overcast/modules/ssh.js:27:7
at /usr/lib/node_modules/overcast/modules/ssh.js:52:7
at ChildProcess. (/usr/lib/node_modules/overcast/modules/ssh.js:161:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:807:12)

OS X 10.9.2 install error

I'm getting the weirdest install error on Mavericks. It says it can't create the .overcast directory despite running the npm install command with sudo privileges. I haven't encountered this error while installing an npm package before. I'm stumped!

screen shot 2014-04-20 at 8 52 27 am

`overcast instance import` allows duplicate instance names

Hey @andrewchilds,

Not sure if this is a bug or feature, but overcast instance import allows you to enter duplicate instance names:

garnold$ overcast init
garnold$ overcast cluster create cluster-1
Cluster "cluster-1" has been created.
garnold$ overcast cluster create cluster-2
Cluster "cluster-2" has been created.
garnold$ overcast instance import instance-1 127.0.0.1 --cluster cluster-1
Instance "instance-1" (127.0.0.1) has been imported to the "cluster-1" cluster.
garnold$ overcast instance import instance-1 127.0.0.1 --cluster cluster-2
Instance "instance-1" (127.0.0.1) has been imported to the "cluster-2" cluster.
garnold$ overcast info
Using /Users/garnold/.overcast/clusters.json

cluster-1

  instance-1
    ip: 127.0.0.1
    name: instance-1
    ssh_port: 22
    ssh_key: overcast.key
    user: root
    password: ""

cluster-2

  instance-1
    ip: 127.0.0.1
    name: instance-1
    ssh_port: 22
    ssh_key: overcast.key
    user: root
    password: ""

... which doesn't place nicely with commands like overcast ssh or overcast instance update which don't have options to disambiguate which instance/cluster combo you're referring to.

Difficult to create multiple instances quickly

If I were to paste in my terminal say:

overcast digitalocean create cs-01 --region=sfo1 --cluster "c-01"
overcast digitalocean create cs-02 --region=nyc1 --cluster "c-01"
overcast digitalocean create cs-03 --region=sfo1 --cluster "c-01"
overcast digitalocean create cs-04 --region=sfo1 --cluster "c-01"

At least a few of them would not be saved and not usable from overcast

I have tried opening new terminal windows etc(but the servers in different windows must not join the same overcast list), so the only way to create multiple servers is to wait for each one to be properly created then move onto the next.

Am I doing something wrong?

I really like what you've done here, thank you so much for your hard work!

DigitalOcean APIv2 Support

Version 1 of the DigitalOcean API is deprecated and is due to be sunset on November 1st:

https://developers.digitalocean.com/documentation/changelog/api-v1/sunsetting-api-v1/

Docs on v2 can be found here:

https://developers.digitalocean.com/documentation/v2/

There are two different community contributed node wrappers for version 2 under active development:

https://github.com/matt-major/do-wrapper
https://github.com/oliwerhelsen/dropletapi

Just wanted to make sure this is on the radar and create a place for anyone interested in working on this to jump in.

References to PEM files should work when relative

We really dig overcast, and we've started committing some of the files to our repositories so the ops related tools are alongside the code.

Overcast doesn't seem to like complex file path for PEM files. For instance, using $HOME doesn't work as expected. The result is that currently team members must maintain their own clusters.json file. It would be nice if we could support things like ~/.ssh and $HOME.

Add support for SSH environment variables

We have a local overcast repo that includes a shared clusters.json file, so that everyone on the team can receive changes whenever anyone pushes changes to the repo. The issue is that we use individual SSH accounts to access the systems, which requires everyone to update user and ssh_key for each entry after performing a fresh pull.

It would be nice if overcast supported some environment variables that users could set, similar to the DIGITALOCEAN_API_TOKEN var:

overcast vars set OVERCAST_SSH_USER myuser
overcast vars set OVERCAST_SSH_KEY ~/.ssh/myuser_priv

I also wouldn't mind native OS environment variables either

clusters.json could have default user/ssh_key options or not include it at all:

"web-servers": {
    "instances": {
      "web01": {
        "ip": "web01.mydomain.local",
        "name": "web01",
        "ssh_key": "root_key",
        "ssh_port": "22",
        "user": "root"
      },
      "web02": {
        "ip": "web02.mydomain.local",
        "name": "web02",
        "ssh_key": "root_key",
        "ssh_port": "22",
        "user": "root"
      }
    }
  }

Or:

"web-servers": {
    "instances": {
      "web01": {
        "ip": "web01.mydomain.local",
        "name": "web01",
        "ssh_port": "22"
      },
      "web02": {
        "ip": "web02.mydomain.local",
        "name": "web02",
        "ssh_port": "22"
      }
    }
  }

Not sure if this would be the correct place but it could be implemented in src/ssh.js:

function runOnInstance(instance, args, nextFn) {
  const command = args._.shift();
  const vars = utils.getVariables();     // load env vars
  sshExec({
    ip: instance.ip,
    user: args.user || vars.OVERCAST_SSH_USER || instance.user,     // add env var lookup
    password: args.password || instance.password,
    name: instance.name,
    ssh_key: args['ssh-key'] || vars.OVERCAST_SSH_KEY || instance.ssh_key,     // add env var lookup
    ssh_port: instance.ssh_port,
    ssh_args: utils.isString(args['ssh-args']) ? args['ssh-args'] : '',
    continueOnError: args.continueOnError,
    machineReadable: args['mr'] || args['machine-readable'],
    env: args.env,
    command,
    shell_command: args['shell-command']
  }, () => {
    if (args._.length > 0) {
      runOnInstance(instance, args, nextFn);
    } else if (utils.isFunction(nextFn)) {
      nextFn();
    }
  });
}

SSDNodes

I would like to see support for this. :)

Add Docker as a provider

I use Docker instead of Vagrant/VirtualBox for local development.

Is there an interface/specification for creating new providers? I'd like to try and create one for Docker containers.

Digitial Ocean recipes fail

I tried the Digital Ocean Discourse recipes and they work up till the final step in exposing ports which fails.

Up/Down/Tab doesn't work

Hey Team -

I'm sure I'm doing something wrong, but I'm not clear what it is. When I ssh directly to my server, terminal emulation seems to work as expected. Up/Down/Tab work, control-c works, etc. When I use these within overcast I get ^]]A, etc.

Any ideas?

Cheers!
Brian

`npm ERR! extraneous: [email protected]`

Not sure if this is really an issue, but NPM is reporting the following issue when running npm list:

$ sudo npm list --global
/usr/local/lib
...
└─┬ [email protected]
  ├─┬ [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ └── [email protected]
  │ └── [email protected]
  ├── [email protected]
  ├── [email protected]
  ├─┬ [email protected]
  │ ├─┬ [email protected]
  │ │ └── [email protected]
  │ ├── [email protected] extraneous
  │ └── [email protected]
  ├── [email protected]
  ├── [email protected]
  ├── [email protected]
  └── [email protected]

npm ERR! extraneous: [email protected] /usr/local/lib/node_modules/overcast/node_modules/linode-api/node_modules/progress

digitalocean create doesn't support --ssh-key and --ssh-pub-key arguments

If --ssh-key is specified when running overcast digitalocean create, it will use overcast.key during creation, but after that any connection attempts will use the specified key pair, which won't work. overcast digitalocean create should be consistent with other provider commands and support --ssh-key and --ssh-pub-key arguments.

Azure Support

Would be awesome to have support for Microsoft Azure.

Common provider interface

We need to rewrite the provider commands to use a common interface, which will make it easier to add support for new providers.

Running `overcast instance import` with a name but no IP wipes out `clusters.json`

Steps to reproduce (output below):

  1. Run overcast instance import to populate clusters.json. Also note that Overcast reports "Cluster sux-pi-3 has been created", however the cluster name is actually "sux-pis".
  2. Run overcast info to verify that the instance has been added to clusters.json.
  3. Run overcast instance import again, this time providing a name but no IP.
  4. Run overcast info to see that clusters.json is corrupt (the file is now empty).
overcast garnold$ ./bin/overcast instance import sux-pi-3 10.0.1.5 --cluster sux-pis --user pi
Cluster "sux-pi-3" has been created.
Instance "sux-pi-3" (10.0.1.5) has been imported to the "sux-pis" cluster.

overcast garnold$ ./bin/overcast info
Using /Users/garnold/.overcast/clusters.json

sux-pis

  sux-pi-3
    ip: 10.0.1.5
    name: sux-pi-3
    ssh_port: 22
    ssh_key: overcast.key
    user: pi

overcast garnold$ ./bin/overcast instance import whoops
Using "default" cluster.
Missing [ip] argument.

Usage:
  overcast instance import [name] [ip] [options...]

Description:
  Imports an existing instance to a cluster.

Options:                 Defaults:
  --cluster CLUSTER      default
  --ssh-port PORT        22
  --ssh-key PATH         overcast.key
  --user USERNAME        root
  --password PASSWORD    

Examples:
  $ overcast instance import app.01 127.0.0.1 --cluster app \
      --ssh-port 22222 --ssh-key $HOME/.ssh/id_rsa

overcast garnold$ ./bin/overcast info
Unable to parse the clusters.json file. Please correct the parsing error.

Declarative refactor

The commands should be refactored to be declarative instead of ad-hoc and procedural.

Problems configuring DigitalOcean access

The .overcast/variables.json file has two DigitalOcean keys, DIGITALOCEAN_CLIENT_ID and DIGITALOCEAN_API_KEY. Are these compatible with the current DO API? It's not clear what should go into the _CLIENT_ID value. In any case, I keep seeing "Access Denied" messages.

From the current DO control panel, https://cloud.digitalocean.com/settings/applications, one can now generate "Personal Access Tokens" And I can verify that mine works when I do,

curl -H "Authorization: Bearer your-secret-DO-API-token" -X GET "https://api.digitalocean.com/v2/images?type=snapshot"

But using that access token in the overcast DIGITALOCEAN_CLIENT_ID or DIGITALOCEAN_API_KEY keeps resulting in the same "Access Denied" output with overcast digitalocean x commands.

Any help appreciated, thanks in advance!

Vagrant/Virtualbox support

Would be great to be able to use Vagrant/Virtualbox like a local cloud provider:

overcast virtualbox create [instance] --image trusty64 --ram 512
overcast virtualbox reboot [instance]
overcast virtualbox shutdown [instance]
overcast virtualbox boot [instance]
overcast virtualbox destroy [instance]

SSHinception

We recently disabled the option to ssh to multiple machines at one. I think this was a good change, it was sorta confusing, and it's probably true that a script is a better approach.

However, it might be nice to allow multiple SSH if someone has csshX installed. Its not a great tool, but it's pretty popular and available on both OSX & Linux. Just a thought!

Change Password on remote host

Hi,

I can't get this command to work

"overcast run INSTANCE passwd"

the CLI asks for the pasword, but doesn't ask me to re-confirm the password

Bloated npm distribution

There is no .npmignore file or files property in the package.json, meaning the test files and other files are all being distributed over npm.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.