Git Product home page Git Product logo

mccloud's Introduction

Note:

  • This is a quick copy and paste job(weekend hacking), you should not consider it anything but experimental right now
  • But I wanted to share the idea already with others

DISCLAIMER:

this is alpha sofware . Don't trust it:) And don't complain if it removes all your EC instances at once....

Kudos to great stuff

  • Vagrant is great for testing machines on your local machines
  • Fog is a great fog library for managing cloud systems

Without those two, this project would not be possible. Kudos to the authors!

This project tries to combine both:

  • Because your local machine might outgrow your complexity your local machine can handle
  • use the same vagrantfile for local dev, and cloud devel

Some notes before you dive in

  • I could probably have integrated with vagrant code but this would have taken me longer to understand vagrant code
  • I didn't want the dependency on virtualbox
  • The machines it creates will have the prefix as defined in the Mccloudfile, so this should not pollute your stuff

Todo:

  • provision to other providers than ec2
  • try to stay fully compatible with Vagrantfile

How it will work/works

Create a config file for fog. Note that these are spaces in front and no tabs

$ cat $HOME/.fog

:default:
  :aws_access_key_id: 
  :aws_secret_access_key: 

Create a Mccloud project

$ mccloud init

This will create a Mccloudfile

Edit your Mccloud appropriate

	Mccloud::Config.run do |config|
	  # All Mccloud configuration is done here. For a detailed explanation
	  # and listing of configuration options, please view the documentation
	  # online.

	  config.mccloud.prefix="mccloud"

	  config.vm.define :web do |web_config|
	    web_config.vm.ami = "ami-cef405a7"
	    web_config.vm.provider="AWS"

	    #web_config.vm.provisioner=:chef_solo
	    #web_config.vm.provisioner=:puppet

	    web_config.vm.provider_options={ 
	      # ID = "ami-cef405a7" = x64 Ubuntu 10.10
	      :image_id => 'ami-cef405a7', 
	      # Flavors
	      :flavor_id => 't1.micro',
	      #:flavor_id => 'm1.large',
	      :groups => %w(ec2securitygroup), :key_name => "ec2-keyname",
	      :availability_zone => "us-east-1b" 
	    }
	    web_config.vm.forward_port("http", 80, 8080)
	    web_config.vm.user="ubuntu"
	    web_config.vm.bootstrap="ruby-bootstrap.sh"
	    web_config.vm.key="my-ec2-key.pem"
	  end

	  ### Provisioners
	  config.vm.provision :puppet do |puppet|
	    puppet.pp_path = "/tmp/vagrant-puppet"
	    #puppet.manifests_path = "puppet/manifests"
	    #puppet.module_path = "puppet/modules"
	    puppet.manifest_file = "newbox.pp"
	  end

	  config.vm.provision :chef_solo do |chef|
	     chef.cookbooks_path = [""]
	     chef.add_recipe("")
	     # You may also specify custom JSON attributes:
	     chef.json.merge!({})
	  end
	end

Start your machines

If the machine does not yet exist, it will also run bootstrap

$ mccloud up web

Check the status

$ mccloud status

Bootstrap the machine

$ mccloud bootstrap web

(interactive) Login into the machine

$ mccloud ssh web

run a command on a machine

$ mccloud command web "who am i"

Halt the machine

$ mccloud halt web

Start the machine again

$ mccloud up web

Provision the machine

$ mccloud provision web

Port forwarding server

$ mccloud server

Destroy the machine again

$ mccloud destroy web

mccloud's People

Contributors

jedi4ever avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.