README.rst 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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.
  4. .. image:: https://landscape.io/github/CloudVE/cloudbridge/master/landscape.svg?style=flat
  5. :target: https://landscape.io/github/CloudVE/cloudbridge/master
  6. :alt: Landscape Code Health
  7. .. image:: https://coveralls.io/repos/CloudVE/cloudbridge/badge.svg?branch=master&service=github
  8. :target: https://coveralls.io/github/CloudVE/cloudbridge?branch=master
  9. :alt: Code Coverage
  10. .. image:: https://codeclimate.com/github/CloudVE/cloudbridge/badges/gpa.svg
  11. :target: https://codeclimate.com/github/CloudVE/cloudbridge
  12. :alt: Code Climate
  13. .. image:: https://img.shields.io/pypi/v/cloudbridge.svg
  14. :target: https://pypi.python.org/pypi/cloudbridge/
  15. :alt: latest version available on PyPI
  16. .. image:: https://readthedocs.org/projects/cloudbridge/badge/?version=latest
  17. :target: http://cloudbridge.readthedocs.org/en/latest/?badge=latest
  18. :alt: Documentation Status
  19. .. image:: https://badge.waffle.io/CloudVE/cloudbridge.png?label=in%20progress&title=In%20Progress
  20. :target: https://waffle.io/CloudVE/cloudbridge?utm_source=badge
  21. :alt: 'Waffle.io - Issues in progress'
  22. .. |aws-py27| image:: https://travis-matrix-badges.herokuapp.com/repos/CloudVE/cloudbridge/branches/master/1
  23. :target: https://travis-ci.org/CloudVE/cloudbridge
  24. .. |aws-py36| image:: https://travis-matrix-badges.herokuapp.com/repos/CloudVE/cloudbridge/branches/master/4
  25. :target: https://travis-ci.org/CloudVE/cloudbridge
  26. .. |aws-pypy| image:: https://travis-matrix-badges.herokuapp.com/repos/CloudVE/cloudbridge/branches/master/7
  27. :target: https://travis-ci.org/CloudVE/cloudbridge
  28. .. |os-py27| image:: https://travis-matrix-badges.herokuapp.com/repos/CloudVE/cloudbridge/branches/master/3
  29. :target: https://travis-ci.org/CloudVE/cloudbridge
  30. .. |os-py36| image:: https://travis-matrix-badges.herokuapp.com/repos/CloudVE/cloudbridge/branches/master/6
  31. :target: https://travis-ci.org/CloudVE/cloudbridge
  32. .. |os-pypy| image:: https://travis-matrix-badges.herokuapp.com/repos/CloudVE/cloudbridge/branches/master/9
  33. :target: https://travis-ci.org/CloudVE/cloudbridge
  34. .. |azure-py27| image:: https://travis-matrix-badges.herokuapp.com/repos/CloudVE/cloudbridge/branches/master/2
  35. :target: https://travis-ci.org/CloudVE/cloudbridge/branches
  36. .. |azure-py36| image:: https://travis-matrix-badges.herokuapp.com/repos/CloudVE/cloudbridge/branches/master/5
  37. :target: https://travis-ci.org/CloudVE/cloudbridge/branches
  38. .. |azure-pypy| image:: https://travis-matrix-badges.herokuapp.com/repos/CloudVE/cloudbridge/branches/master/8
  39. :target: https://travis-ci.org/CloudVE/cloudbridge/branches
  40. .. |gce-py27| image:: https://travis-matrix-badges.herokuapp.com/repos/CloudVE/cloudbridge/branches/gce/3
  41. :target: https://travis-ci.org/CloudVE/cloudbridge/branches
  42. .. |gce-py36| image:: https://travis-matrix-badges.herokuapp.com/repos/CloudVE/cloudbridge/branches/gce/6
  43. :target: https://travis-ci.org/CloudVE/cloudbridge/branches
  44. .. |gce-pypy| image:: https://travis-matrix-badges.herokuapp.com/repos/CloudVE/cloudbridge/branches/gce/9
  45. :target: https://travis-ci.org/CloudVE/cloudbridge/branches
  46. Build Status
  47. ~~~~~~~~~~~~
  48. +--------------------------+--------------+--------------+--------------+
  49. | **Provider/Environment** | py27 | py36 | pypy |
  50. +--------------------------+--------------+--------------+--------------+
  51. | **aws** | |aws-py27| | |aws-py36| | |aws-pypy| |
  52. +--------------------------+--------------+--------------+--------------+
  53. | **openstack** | |os-py27| | |os-py36| | |os-pypy| |
  54. +--------------------------+--------------+--------------+--------------+
  55. | **azure (beta)** | |azure-py27| | |azure-py36| | |azure-py36| |
  56. +--------------------------+--------------+--------------+--------------+
  57. | **gce (alpha)** | |gce-py27| | |gce-py36| | |gce-pypy| |
  58. +--------------------------+--------------+--------------+--------------+
  59. Installation
  60. ~~~~~~~~~~~~
  61. Install the latest release from PyPi:
  62. .. code-block:: shell
  63. pip install cloudbridge
  64. For other installation options, see the `installation page`_ in
  65. the documentation.
  66. Usage example
  67. ~~~~~~~~~~~~~
  68. To `get started`_ with CloudBridge, export your cloud access credentials
  69. (e.g., AWS_ACCESS_KEY and AWS_SECRET_KEY for your AWS credentials) and start
  70. exploring the API:
  71. .. code-block:: python
  72. from cloudbridge.cloud.factory import CloudProviderFactory, ProviderList
  73. provider = CloudProviderFactory().create_provider(ProviderList.AWS, {})
  74. print(provider.security.key_pairs.list())
  75. Citation
  76. ~~~~~~~~
  77. N. Goonasekera, A. Lonie, J. Taylor, and E. Afgan,
  78. "CloudBridge: a Simple Cross-Cloud Python Library,"
  79. presented at the Proceedings of the XSEDE16 Conference on Diversity, Big Data, and Science at Scale, Miami, USA, 2016.
  80. DOI: http://dx.doi.org/10.1145/2949550.2949648
  81. Documentation
  82. ~~~~~~~~~~~~~
  83. Documentation can be found at https://cloudbridge.readthedocs.org.
  84. Quick Reference
  85. ~~~~~~~~~~~~~~~
  86. The following object graph shows how to access various provider services, and the resource
  87. that they return.
  88. .. image:: http://cloudbridge.readthedocs.org/en/latest/_images/object_relationships_detailed.svg
  89. :target: http://cloudbridge.readthedocs.org/en/latest/?badge=latest#quick-reference
  90. :alt: CloudBridge Quick Reference
  91. Design Goals
  92. ~~~~~~~~~~~~
  93. 1. Create a cloud abstraction layer which minimises or eliminates the need for
  94. cloud specific special casing (i.e., Not require clients to write
  95. ``if EC2 do x else if OPENSTACK do y``.)
  96. 2. Have a suite of conformance tests which are comprehensive enough that goal
  97. 1 can be achieved. This would also mean that clients need not manually test
  98. against each provider to make sure their application is compatible.
  99. 3. Opt for a minimum set of features that a cloud provider will support,
  100. instead of a lowest common denominator approach. This means that reasonably
  101. mature clouds like Amazon and OpenStack are used as the benchmark against
  102. which functionality & features are determined. Therefore, there is a
  103. definite expectation that the cloud infrastructure will support a compute
  104. service with support for images and snapshots and various machine sizes.
  105. The cloud infrastructure will very likely support block storage, although
  106. this is currently optional. It may optionally support object storage.
  107. 4. Make the CloudBridge layer as thin as possible without compromising goal 1.
  108. By wrapping the cloud provider's native SDK and doing the minimal work
  109. necessary to adapt the interface, we can achieve greater development speed
  110. and reliability since the native provider SDK is most likely to have both
  111. properties.
  112. Contributing
  113. ~~~~~~~~~~~~
  114. Community contributions for any part of the project are welcome. If you have
  115. a completely new idea or would like to bounce your idea before moving forward
  116. with the implementation, feel free to create an issue to start a discussion.
  117. Contributions should come in the form or a pull request. We strive for 100% test
  118. coverage so code will only be accepted if it comes with appropriate tests and it
  119. does not break existing functionality. Further, the code needs to be well
  120. documented and all methods have docstrings. We are largely adhering to the
  121. `PEP8 style guide`_ with 80 character lines, 4-space indentation (spaces
  122. instead of tabs), explicit, one-per-line imports among others. Please keep the
  123. style consistent with the rest of the project.
  124. Conceptually, the library is laid out such that there is a factory used to
  125. create a reference to a cloud provider. Each provider offers a set of services
  126. and resources. Services typically perform actions while resources offer
  127. information (and can act on itself, when appropriate). The structure of each
  128. object is defined via an abstract interface (see
  129. ``cloudbridge/providers/interfaces``) and any object should implement the
  130. defined interface. If adding a completely new provider, take a look at the
  131. `provider development page`_ in the documentation.
  132. .. _`installation page`: http://cloudbridge.readthedocs.org/en/
  133. latest/topics/install.html
  134. .. _`get started`: http://cloudbridge.readthedocs.org/en/latest/
  135. getting_started.html
  136. .. _`PEP8 style guide`: https://www.python.org/dev/peps/pep-0008/
  137. .. _`provider development page`: http://cloudbridge.readthedocs.org/
  138. en/latest/
  139. topics/provider_development.html