README.rst 7.3 KB

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