index.rst 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. Mico: a monkey in the cloud
  2. ===========================
  3. Mico is a tool-toy to manage a number of hosts deployed in cloud services
  4. (currently only support Amazon AWS), and also allows you to deploy new hosts
  5. with specified template or create autoscaling groups and manage them easily.
  6. .. raw:: html
  7. <a href="https://twitter.com/share" class="twitter-share-button"
  8. data-via="andresjdiaz" data-hashtags="mico">Tweet</a>
  9. <script>!function(d,s,id){var
  10. js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
  11. <iframe
  12. src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fmico.readthedocs.org&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=true&amp;font=verdana&amp;colorscheme=light&amp;action=like&amp;height=21"
  13. scrolling="no" frameborder="0" style="border:none; overflow:hidden;
  14. width:450px; height:21px;" allowTransparency="true"></iframe>
  15. Installation
  16. ------------
  17. As usual, mico is available from pypi_, and can be installed using ``pip``::
  18. pip install mico
  19. .. _pypi: http://pypi.python.org/pypi
  20. Mico just need an AWS key ID and AWS secret key to run. By default mico just
  21. take this variables from the OS environment::
  22. export AWS_ACCESS_KEY_ID="*foo*"
  23. export AWS_SECRET_ACCESS_KEY="*bar*"
  24. QuickStart
  25. ----------
  26. Mico works using the concept of template. A template is just a python code
  27. (with steroids which we call *libraries*), the template can implements
  28. a number of actions to perform in the cloud. In this example we just create
  29. a new host in AWS and install some packages there.
  30. .. code-block:: python
  31. from mico.lib.aws import *
  32. from mico.lib.core import *
  33. def deploy(*args):
  34. for host in args:
  35. instance = ec2_ensure(
  36. ami = "ami-3d4ff254",
  37. name = host,
  38. instance_type = "t1.micro",
  39. key_name = "root-us-east-virginia",
  40. security_groups = "sec-test"
  41. )
  42. package_ensure("python") # of course :)
  43. package_ensure("apache")
  44. Once, your template is created, you need to put it into a mico template path
  45. (by default uses ``/etc/mico`` and ``~/.config/mico/``, and the current
  46. working directory.
  47. Then you can just run mico
  48. .. code-block:: bash
  49. $ mico template:deploy myhost1.mydomain.com myhost2.mydomain.com
  50. mico:cloud:deploy:create security group: sec-test
  51. mico:cloud:deploy:create instance: i-4543123
  52. mico:cloud:deploy:use existent security group: sec-test
  53. mico:cloud:deploy:create instance: i-2291281
  54. You can see more complex (and useful!) templates in `examples directory`_.
  55. .. _`examples directory`: tree/master/examples
  56. .. raw:: html
  57. <button class="tpl"><a href="https://github.com/ajdiaz/mico/tree/master/examples">View template
  58. examples</a></button>
  59. User Guide
  60. ----------
  61. .. toctree::
  62. :maxdepth: 4
  63. templates
  64. decorators
  65. environ
  66. api
  67. contributing