README.rst 6.7 KB

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