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