README.rst 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. CloudBridge aims to provide a simple layer of abstraction over
  2. different cloud providers, reducing or eliminating the need to write
  3. conditional code for each cloud. It is currently under development and is in
  4. an Alpha state.
  5. .. image:: https://landscape.io/github/gvlproject/cloudbridge/master/landscape.svg?style=flat
  6. :target: https://landscape.io/github/gvlproject/cloudbridge/master
  7. :alt: Landscape Code Health
  8. .. image:: https://coveralls.io/repos/gvlproject/cloudbridge/badge.svg?branch=master&service=github
  9. :target: https://coveralls.io/github/gvlproject/cloudbridge?branch=master
  10. :alt: Code Coverage
  11. .. image:: https://travis-ci.org/gvlproject/cloudbridge.svg?branch=master
  12. :target: https://travis-ci.org/gvlproject/cloudbridge
  13. :alt: Travis Build Status
  14. .. image:: https://codeclimate.com/github/gvlproject/cloudbridge/badges/gpa.svg
  15. :target: https://codeclimate.com/github/gvlproject/cloudbridge
  16. :alt: Code Climate
  17. .. image:: https://img.shields.io/pypi/v/cloudbridge.svg
  18. :target: https://pypi.python.org/pypi/cloudbridge/
  19. :alt: latest version available on PyPI
  20. .. image:: https://readthedocs.org/projects/cloudbridge/badge/?version=latest
  21. :target: http://cloudbridge.readthedocs.org/en/latest/?badge=latest
  22. :alt: Documentation Status
  23. Installation
  24. ~~~~~~~~~~~~
  25. Install the latest release from PyPi:
  26. .. code-block:: shell
  27. pip install cloudbridge
  28. For other installation options, see the `installation page`_ in
  29. the documentation.
  30. Usage example
  31. ~~~~~~~~~~~~~
  32. To `get started`_ with CloudBridge, export your cloud access credentials
  33. (e.g., AWS_ACCESS_KEY and AWS_SECRET_KEY for your AWS credentials) and start
  34. exploring the API:
  35. .. code-block:: python
  36. from cloudbridge.cloud.factory import CloudProviderFactory, ProviderList
  37. provider = CloudProviderFactory().create_provider(ProviderList.AWS, {})
  38. print(provider.security.key_pairs.list())
  39. Documentation
  40. ~~~~~~~~~~~~~
  41. Documentation can be found at https://cloudbridge.readthedocs.org.
  42. Quick Reference
  43. ~~~~~~~~~~~~~~~
  44. The following object graph shows how to access various provider services, and the resource
  45. that they return.
  46. .. image:: http://cloudbridge.readthedocs.org/en/latest/_images/object_relationships_detailed.svg
  47. :target: http://cloudbridge.readthedocs.org/en/latest/?badge=latest#quick-reference
  48. :alt: CloudBridge Quick Reference
  49. Design Goals
  50. ~~~~~~~~~~~~
  51. 1. Create a cloud abstraction layer which minimises or eliminates the need for
  52. cloud specific special casing (i.e., Not require clients to write
  53. ``if EC2 do x else if OPENSTACK do y``.)
  54. 2. Have a suite of conformance tests which are comprehensive enough that goal
  55. 1 can be achieved. This would also mean that clients need not manually test
  56. against each provider to make sure their application is compatible.
  57. 3. Opt for a minimum set of features that a cloud provider will support,
  58. instead of a lowest common denominator approach. This means that reasonably
  59. mature clouds like Amazon and OpenStack are used as the benchmark against
  60. which functionality & features are determined. Therefore, there is a
  61. definite expectation that the cloud infrastructure will support a compute
  62. service with support for images and snapshots and various machine sizes.
  63. The cloud infrastructure will very likely support block storage, although
  64. this is currently optional. It may optionally support object storage.
  65. 4. Make the CloudBridge layer as thin as possible without compromising goal 1.
  66. By wrapping the cloud provider's native SDK and doing the minimal work
  67. necessary to adapt the interface, we can achieve greater development speed
  68. and reliability since the native provider SDK is most likely to have both
  69. properties.
  70. Contributing
  71. ~~~~~~~~~~~~
  72. Community contributions for any part of the project are welcome. If you have
  73. a completely new idea or would like to bounce your idea before moving forward
  74. with the implementation, feel free to create an issue to start a discussion.
  75. Contributions should come in the form or a pull request. We strive for 100% test
  76. coverage so code will only be accepted if it comes with appropriate tests and it
  77. does not break existing functionality. Further, the code needs to be well
  78. documented and all methods have docstrings. We are largely adhering to the
  79. `PEP8 style guide`_ with 80 character lines, 4-space indentation (spaces
  80. instead of tabs), explicit, one-per-line imports among others. Please keep the
  81. style consistent with the rest of the project.
  82. Conceptually, the library is laid out such that there is a factory used to
  83. create a reference to a cloud provider. Each provider offers a set of services
  84. and resources. Services typically perform actions while resources offer
  85. information (and can act on itself, when appropriate). The structure of each
  86. object is defined via an abstract interface (see
  87. ``cloudbridge/providers/interfaces``) and any object should implement the
  88. defined interface. If adding a completely new provider, take a look at the
  89. `provider development page`_ in the documentation.
  90. .. _`installation page`: http://cloudbridge.readthedocs.org/en/
  91. latest/topics/install.html
  92. .. _`get started`: http://cloudbridge.readthedocs.org/en/latest/
  93. getting_started.html
  94. .. _`PEP8 style guide`: https://www.python.org/dev/peps/pep-0008/
  95. .. _`provider development page`: http://cloudbridge.readthedocs.org/
  96. en/latest/
  97. topics/provider_development.html