README.rst 7.3 KB

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