port-ocean 0.29.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of port-ocean might be problematic. Click here for more details.

Files changed (224) hide show
  1. port_ocean-0.29.0/LICENSE.md +202 -0
  2. port_ocean-0.29.0/PKG-INFO +231 -0
  3. port_ocean-0.29.0/README.md +176 -0
  4. port_ocean-0.29.0/integrations/_infra/Dockerfile.Deb +91 -0
  5. port_ocean-0.29.0/integrations/_infra/Dockerfile.alpine +108 -0
  6. port_ocean-0.29.0/integrations/_infra/Dockerfile.base.builder +29 -0
  7. port_ocean-0.29.0/integrations/_infra/Dockerfile.base.runner +14 -0
  8. port_ocean-0.29.0/integrations/_infra/Dockerfile.dockerignore +94 -0
  9. port_ocean-0.29.0/integrations/_infra/Dockerfile.local +65 -0
  10. port_ocean-0.29.0/integrations/_infra/Makefile +97 -0
  11. port_ocean-0.29.0/integrations/_infra/README.md +30 -0
  12. port_ocean-0.29.0/integrations/_infra/entry_local.sh +26 -0
  13. port_ocean-0.29.0/integrations/_infra/grpcio.sh +18 -0
  14. port_ocean-0.29.0/integrations/_infra/init.sh +5 -0
  15. port_ocean-0.29.0/port_ocean/__init__.py +16 -0
  16. port_ocean-0.29.0/port_ocean/bootstrap.py +45 -0
  17. port_ocean-0.29.0/port_ocean/cache/__init__.py +0 -0
  18. port_ocean-0.29.0/port_ocean/cache/base.py +25 -0
  19. port_ocean-0.29.0/port_ocean/cache/disk.py +61 -0
  20. port_ocean-0.29.0/port_ocean/cache/errors.py +10 -0
  21. port_ocean-0.29.0/port_ocean/cache/memory.py +36 -0
  22. port_ocean-0.29.0/port_ocean/cli/__init__.py +13 -0
  23. port_ocean-0.29.0/port_ocean/cli/cli.py +3 -0
  24. port_ocean-0.29.0/port_ocean/cli/commands/__init__.py +19 -0
  25. port_ocean-0.29.0/port_ocean/cli/commands/defaults/__init___.py +7 -0
  26. port_ocean-0.29.0/port_ocean/cli/commands/defaults/clean.py +69 -0
  27. port_ocean-0.29.0/port_ocean/cli/commands/defaults/dock.py +39 -0
  28. port_ocean-0.29.0/port_ocean/cli/commands/defaults/group.py +6 -0
  29. port_ocean-0.29.0/port_ocean/cli/commands/list_integrations.py +35 -0
  30. port_ocean-0.29.0/port_ocean/cli/commands/main.py +29 -0
  31. port_ocean-0.29.0/port_ocean/cli/commands/new.py +91 -0
  32. port_ocean-0.29.0/port_ocean/cli/commands/pull.py +70 -0
  33. port_ocean-0.29.0/port_ocean/cli/commands/sail.py +80 -0
  34. port_ocean-0.29.0/port_ocean/cli/commands/version.py +26 -0
  35. port_ocean-0.29.0/port_ocean/cli/cookiecutter/__init__.py +0 -0
  36. port_ocean-0.29.0/port_ocean/cli/cookiecutter/cookiecutter.json +16 -0
  37. port_ocean-0.29.0/port_ocean/cli/cookiecutter/extensions.py +13 -0
  38. port_ocean-0.29.0/port_ocean/cli/cookiecutter/hooks/post_gen_project.py +30 -0
  39. port_ocean-0.29.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.env.example +6 -0
  40. port_ocean-0.29.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.gitignore +153 -0
  41. port_ocean-0.29.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/.gitignore +1 -0
  42. port_ocean-0.29.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/blueprints.json +41 -0
  43. port_ocean-0.29.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/port-app-config.yml +16 -0
  44. port_ocean-0.29.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/spec.yaml +15 -0
  45. port_ocean-0.29.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/CHANGELOG.md +8 -0
  46. port_ocean-0.29.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/CONTRIBUTING.md +7 -0
  47. port_ocean-0.29.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/README.md +7 -0
  48. port_ocean-0.29.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/changelog/.gitignore +2 -0
  49. port_ocean-0.29.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/debug.py +4 -0
  50. port_ocean-0.29.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/main.py +56 -0
  51. port_ocean-0.29.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/poetry.toml +3 -0
  52. port_ocean-0.29.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/pyproject.toml +113 -0
  53. port_ocean-0.29.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/sonar-project.properties +2 -0
  54. port_ocean-0.29.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/tests/__init__.py +0 -0
  55. port_ocean-0.29.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/tests/test_sample.py +2 -0
  56. port_ocean-0.29.0/port_ocean/cli/utils.py +4 -0
  57. port_ocean-0.29.0/port_ocean/clients/__init__.py +0 -0
  58. port_ocean-0.29.0/port_ocean/clients/auth/__init__.py +0 -0
  59. port_ocean-0.29.0/port_ocean/clients/auth/auth_client.py +10 -0
  60. port_ocean-0.29.0/port_ocean/clients/auth/oauth_client.py +22 -0
  61. port_ocean-0.29.0/port_ocean/clients/port/__init__.py +0 -0
  62. port_ocean-0.29.0/port_ocean/clients/port/authentication.py +115 -0
  63. port_ocean-0.29.0/port_ocean/clients/port/client.py +103 -0
  64. port_ocean-0.29.0/port_ocean/clients/port/mixins/__init__.py +0 -0
  65. port_ocean-0.29.0/port_ocean/clients/port/mixins/actions.py +93 -0
  66. port_ocean-0.29.0/port_ocean/clients/port/mixins/blueprints.py +123 -0
  67. port_ocean-0.29.0/port_ocean/clients/port/mixins/entities.py +628 -0
  68. port_ocean-0.29.0/port_ocean/clients/port/mixins/integrations.py +311 -0
  69. port_ocean-0.29.0/port_ocean/clients/port/mixins/migrations.py +46 -0
  70. port_ocean-0.29.0/port_ocean/clients/port/mixins/organization.py +31 -0
  71. port_ocean-0.29.0/port_ocean/clients/port/retry_transport.py +51 -0
  72. port_ocean-0.29.0/port_ocean/clients/port/types.py +26 -0
  73. port_ocean-0.29.0/port_ocean/clients/port/utils.py +78 -0
  74. port_ocean-0.29.0/port_ocean/config/__init__.py +0 -0
  75. port_ocean-0.29.0/port_ocean/config/base.py +184 -0
  76. port_ocean-0.29.0/port_ocean/config/dynamic.py +93 -0
  77. port_ocean-0.29.0/port_ocean/config/settings.py +231 -0
  78. port_ocean-0.29.0/port_ocean/consumers/__init__.py +0 -0
  79. port_ocean-0.29.0/port_ocean/consumers/kafka_consumer.py +118 -0
  80. port_ocean-0.29.0/port_ocean/context/__init__.py +0 -0
  81. port_ocean-0.29.0/port_ocean/context/event.py +207 -0
  82. port_ocean-0.29.0/port_ocean/context/metric_resource.py +63 -0
  83. port_ocean-0.29.0/port_ocean/context/ocean.py +232 -0
  84. port_ocean-0.29.0/port_ocean/context/resource.py +63 -0
  85. port_ocean-0.29.0/port_ocean/core/__init__.py +0 -0
  86. port_ocean-0.29.0/port_ocean/core/defaults/__init__.py +7 -0
  87. port_ocean-0.29.0/port_ocean/core/defaults/clean.py +93 -0
  88. port_ocean-0.29.0/port_ocean/core/defaults/common.py +133 -0
  89. port_ocean-0.29.0/port_ocean/core/defaults/initialize.py +312 -0
  90. port_ocean-0.29.0/port_ocean/core/event_listener/__init__.py +52 -0
  91. port_ocean-0.29.0/port_ocean/core/event_listener/actions_only.py +42 -0
  92. port_ocean-0.29.0/port_ocean/core/event_listener/base.py +99 -0
  93. port_ocean-0.29.0/port_ocean/core/event_listener/factory.py +114 -0
  94. port_ocean-0.29.0/port_ocean/core/event_listener/http.py +78 -0
  95. port_ocean-0.29.0/port_ocean/core/event_listener/kafka.py +185 -0
  96. port_ocean-0.29.0/port_ocean/core/event_listener/once.py +159 -0
  97. port_ocean-0.29.0/port_ocean/core/event_listener/polling.py +90 -0
  98. port_ocean-0.29.0/port_ocean/core/event_listener/webhooks_only.py +42 -0
  99. port_ocean-0.29.0/port_ocean/core/handlers/__init__.py +21 -0
  100. port_ocean-0.29.0/port_ocean/core/handlers/actions/__init__.py +7 -0
  101. port_ocean-0.29.0/port_ocean/core/handlers/actions/abstract_executor.py +150 -0
  102. port_ocean-0.29.0/port_ocean/core/handlers/actions/execution_manager.py +434 -0
  103. port_ocean-0.29.0/port_ocean/core/handlers/base.py +6 -0
  104. port_ocean-0.29.0/port_ocean/core/handlers/entities_state_applier/__init__.py +7 -0
  105. port_ocean-0.29.0/port_ocean/core/handlers/entities_state_applier/base.py +71 -0
  106. port_ocean-0.29.0/port_ocean/core/handlers/entities_state_applier/port/__init__.py +0 -0
  107. port_ocean-0.29.0/port_ocean/core/handlers/entities_state_applier/port/applier.py +183 -0
  108. port_ocean-0.29.0/port_ocean/core/handlers/entities_state_applier/port/get_related_entities.py +58 -0
  109. port_ocean-0.29.0/port_ocean/core/handlers/entities_state_applier/port/order_by_entities_dependencies.py +49 -0
  110. port_ocean-0.29.0/port_ocean/core/handlers/entity_processor/__init__.py +7 -0
  111. port_ocean-0.29.0/port_ocean/core/handlers/entity_processor/base.py +55 -0
  112. port_ocean-0.29.0/port_ocean/core/handlers/entity_processor/jq_entity_processor.py +819 -0
  113. port_ocean-0.29.0/port_ocean/core/handlers/entity_processor/jq_input_evaluator.py +137 -0
  114. port_ocean-0.29.0/port_ocean/core/handlers/port_app_config/__init__.py +7 -0
  115. port_ocean-0.29.0/port_ocean/core/handlers/port_app_config/api.py +29 -0
  116. port_ocean-0.29.0/port_ocean/core/handlers/port_app_config/base.py +82 -0
  117. port_ocean-0.29.0/port_ocean/core/handlers/port_app_config/models.py +100 -0
  118. port_ocean-0.29.0/port_ocean/core/handlers/queue/__init__.py +5 -0
  119. port_ocean-0.29.0/port_ocean/core/handlers/queue/abstract_queue.py +36 -0
  120. port_ocean-0.29.0/port_ocean/core/handlers/queue/group_queue.py +138 -0
  121. port_ocean-0.29.0/port_ocean/core/handlers/queue/local_queue.py +28 -0
  122. port_ocean-0.29.0/port_ocean/core/handlers/resync_state_updater/__init__.py +5 -0
  123. port_ocean-0.29.0/port_ocean/core/handlers/resync_state_updater/updater.py +105 -0
  124. port_ocean-0.29.0/port_ocean/core/handlers/webhook/__init__.py +0 -0
  125. port_ocean-0.29.0/port_ocean/core/handlers/webhook/abstract_webhook_processor.py +133 -0
  126. port_ocean-0.29.0/port_ocean/core/handlers/webhook/processor_manager.py +340 -0
  127. port_ocean-0.29.0/port_ocean/core/handlers/webhook/webhook_event.py +137 -0
  128. port_ocean-0.29.0/port_ocean/core/integrations/__init__.py +0 -0
  129. port_ocean-0.29.0/port_ocean/core/integrations/base.py +93 -0
  130. port_ocean-0.29.0/port_ocean/core/integrations/mixins/__init__.py +11 -0
  131. port_ocean-0.29.0/port_ocean/core/integrations/mixins/events.py +71 -0
  132. port_ocean-0.29.0/port_ocean/core/integrations/mixins/handler.py +97 -0
  133. port_ocean-0.29.0/port_ocean/core/integrations/mixins/live_events.py +90 -0
  134. port_ocean-0.29.0/port_ocean/core/integrations/mixins/sync.py +108 -0
  135. port_ocean-0.29.0/port_ocean/core/integrations/mixins/sync_raw.py +1055 -0
  136. port_ocean-0.29.0/port_ocean/core/integrations/mixins/utils.py +357 -0
  137. port_ocean-0.29.0/port_ocean/core/models.py +156 -0
  138. port_ocean-0.29.0/port_ocean/core/ocean_types.py +52 -0
  139. port_ocean-0.29.0/port_ocean/core/utils/entity_topological_sorter.py +90 -0
  140. port_ocean-0.29.0/port_ocean/core/utils/utils.py +204 -0
  141. port_ocean-0.29.0/port_ocean/debug_cli.py +5 -0
  142. port_ocean-0.29.0/port_ocean/exceptions/__init__.py +0 -0
  143. port_ocean-0.29.0/port_ocean/exceptions/api.py +22 -0
  144. port_ocean-0.29.0/port_ocean/exceptions/base.py +2 -0
  145. port_ocean-0.29.0/port_ocean/exceptions/clients.py +9 -0
  146. port_ocean-0.29.0/port_ocean/exceptions/context.py +21 -0
  147. port_ocean-0.29.0/port_ocean/exceptions/core.py +43 -0
  148. port_ocean-0.29.0/port_ocean/exceptions/execution_manager.py +22 -0
  149. port_ocean-0.29.0/port_ocean/exceptions/port_defaults.py +26 -0
  150. port_ocean-0.29.0/port_ocean/exceptions/utils.py +9 -0
  151. port_ocean-0.29.0/port_ocean/exceptions/webhook_processor.py +17 -0
  152. port_ocean-0.29.0/port_ocean/helpers/__init__.py +0 -0
  153. port_ocean-0.29.0/port_ocean/helpers/async_client.py +58 -0
  154. port_ocean-0.29.0/port_ocean/helpers/metric/metric.py +424 -0
  155. port_ocean-0.29.0/port_ocean/helpers/metric/utils.py +52 -0
  156. port_ocean-0.29.0/port_ocean/helpers/retry.py +497 -0
  157. port_ocean-0.29.0/port_ocean/helpers/stream.py +71 -0
  158. port_ocean-0.29.0/port_ocean/log/__init__.py +0 -0
  159. port_ocean-0.29.0/port_ocean/log/handlers.py +108 -0
  160. port_ocean-0.29.0/port_ocean/log/logger_setup.py +88 -0
  161. port_ocean-0.29.0/port_ocean/log/sensetive.py +68 -0
  162. port_ocean-0.29.0/port_ocean/middlewares.py +73 -0
  163. port_ocean-0.29.0/port_ocean/ocean.py +259 -0
  164. port_ocean-0.29.0/port_ocean/py.typed +0 -0
  165. port_ocean-0.29.0/port_ocean/run.py +61 -0
  166. port_ocean-0.29.0/port_ocean/sonar-project.properties +3 -0
  167. port_ocean-0.29.0/port_ocean/tests/__init__.py +0 -0
  168. port_ocean-0.29.0/port_ocean/tests/cache/__init__.py +1 -0
  169. port_ocean-0.29.0/port_ocean/tests/cache/test_disk_cache.py +92 -0
  170. port_ocean-0.29.0/port_ocean/tests/cache/test_memory_cache.py +59 -0
  171. port_ocean-0.29.0/port_ocean/tests/clients/__init__.py +0 -0
  172. port_ocean-0.29.0/port_ocean/tests/clients/oauth/__init__.py +0 -0
  173. port_ocean-0.29.0/port_ocean/tests/clients/oauth/test_oauth_client.py +96 -0
  174. port_ocean-0.29.0/port_ocean/tests/clients/port/mixins/test_entities.py +281 -0
  175. port_ocean-0.29.0/port_ocean/tests/clients/port/mixins/test_integrations.py +205 -0
  176. port_ocean-0.29.0/port_ocean/tests/clients/port/mixins/test_organization_mixin.py +28 -0
  177. port_ocean-0.29.0/port_ocean/tests/config/test_config.py +38 -0
  178. port_ocean-0.29.0/port_ocean/tests/conftest.py +4 -0
  179. port_ocean-0.29.0/port_ocean/tests/core/conftest.py +239 -0
  180. port_ocean-0.29.0/port_ocean/tests/core/defaults/test_common.py +166 -0
  181. port_ocean-0.29.0/port_ocean/tests/core/event_listener/test_kafka.py +77 -0
  182. port_ocean-0.29.0/port_ocean/tests/core/handlers/actions/test_execution_manager.py +837 -0
  183. port_ocean-0.29.0/port_ocean/tests/core/handlers/entities_state_applier/test_applier.py +288 -0
  184. port_ocean-0.29.0/port_ocean/tests/core/handlers/entity_processor/test_jq_entity_processor.py +1290 -0
  185. port_ocean-0.29.0/port_ocean/tests/core/handlers/entity_processor/test_jq_input_evaluator.py +932 -0
  186. port_ocean-0.29.0/port_ocean/tests/core/handlers/mixins/test_live_events.py +414 -0
  187. port_ocean-0.29.0/port_ocean/tests/core/handlers/mixins/test_sync_raw.py +1086 -0
  188. port_ocean-0.29.0/port_ocean/tests/core/handlers/port_app_config/test_api.py +67 -0
  189. port_ocean-0.29.0/port_ocean/tests/core/handlers/port_app_config/test_base.py +279 -0
  190. port_ocean-0.29.0/port_ocean/tests/core/handlers/queue/test_group_queue.py +681 -0
  191. port_ocean-0.29.0/port_ocean/tests/core/handlers/queue/test_local_queue.py +90 -0
  192. port_ocean-0.29.0/port_ocean/tests/core/handlers/webhook/test_abstract_webhook_processor.py +106 -0
  193. port_ocean-0.29.0/port_ocean/tests/core/handlers/webhook/test_processor_manager.py +1552 -0
  194. port_ocean-0.29.0/port_ocean/tests/core/handlers/webhook/test_webhook_event.py +106 -0
  195. port_ocean-0.29.0/port_ocean/tests/core/test_utils.py +73 -0
  196. port_ocean-0.29.0/port_ocean/tests/core/utils/test_entity_topological_sorter.py +99 -0
  197. port_ocean-0.29.0/port_ocean/tests/core/utils/test_get_port_diff.py +164 -0
  198. port_ocean-0.29.0/port_ocean/tests/core/utils/test_resolve_entities_diff.py +611 -0
  199. port_ocean-0.29.0/port_ocean/tests/helpers/__init__.py +0 -0
  200. port_ocean-0.29.0/port_ocean/tests/helpers/fake_port_api.py +191 -0
  201. port_ocean-0.29.0/port_ocean/tests/helpers/fixtures.py +45 -0
  202. port_ocean-0.29.0/port_ocean/tests/helpers/integration.py +31 -0
  203. port_ocean-0.29.0/port_ocean/tests/helpers/ocean_app.py +68 -0
  204. port_ocean-0.29.0/port_ocean/tests/helpers/port_client.py +22 -0
  205. port_ocean-0.29.0/port_ocean/tests/helpers/smoke_test.py +82 -0
  206. port_ocean-0.29.0/port_ocean/tests/helpers/test_retry.py +549 -0
  207. port_ocean-0.29.0/port_ocean/tests/log/test_handlers.py +72 -0
  208. port_ocean-0.29.0/port_ocean/tests/test_metric.py +180 -0
  209. port_ocean-0.29.0/port_ocean/tests/test_ocean.py +49 -0
  210. port_ocean-0.29.0/port_ocean/tests/test_smoke.py +74 -0
  211. port_ocean-0.29.0/port_ocean/tests/utils/test_async_iterators.py +45 -0
  212. port_ocean-0.29.0/port_ocean/tests/utils/test_cache.py +514 -0
  213. port_ocean-0.29.0/port_ocean/utils/__init__.py +3 -0
  214. port_ocean-0.29.0/port_ocean/utils/async_http.py +32 -0
  215. port_ocean-0.29.0/port_ocean/utils/async_iterators.py +109 -0
  216. port_ocean-0.29.0/port_ocean/utils/cache.py +156 -0
  217. port_ocean-0.29.0/port_ocean/utils/ipc.py +30 -0
  218. port_ocean-0.29.0/port_ocean/utils/misc.py +76 -0
  219. port_ocean-0.29.0/port_ocean/utils/queue_utils.py +88 -0
  220. port_ocean-0.29.0/port_ocean/utils/repeat.py +80 -0
  221. port_ocean-0.29.0/port_ocean/utils/signal.py +70 -0
  222. port_ocean-0.29.0/port_ocean/utils/time.py +54 -0
  223. port_ocean-0.29.0/port_ocean/version.py +6 -0
  224. port_ocean-0.29.0/pyproject.toml +198 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,231 @@
1
+ Metadata-Version: 2.1
2
+ Name: port-ocean
3
+ Version: 0.29.0
4
+ Summary: Port Ocean is a CLI tool for managing your Port projects.
5
+ Home-page: https://app.getport.io
6
+ Keywords: ocean,port-ocean,port
7
+ Author: Daniel Sinai
8
+ Author-email: daniel@getport.io
9
+ Requires-Python: >=3.12,<4.0
10
+ Classifier: Framework :: FastAPI
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Natural Language :: English
14
+ Classifier: Operating System :: POSIX
15
+ Classifier: Programming Language :: Python
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Topic :: Software Development :: Libraries
21
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Classifier: Topic :: Utilities
24
+ Provides-Extra: cli
25
+ Requires-Dist: aiofiles (>=24.1.0,<25.0.0)
26
+ Requires-Dist: aiostream (>=0.5.2,<0.7.0)
27
+ Requires-Dist: click (>=8.1.3,<9.0.0) ; extra == "cli"
28
+ Requires-Dist: confluent-kafka (>=2.10.1,<3.0.0)
29
+ Requires-Dist: cookiecutter (>=2.1.1,<3.0.0) ; extra == "cli"
30
+ Requires-Dist: cryptography (>=44.0.1,<45.0.0)
31
+ Requires-Dist: fastapi (>=0.116.0,<0.117.0)
32
+ Requires-Dist: httpx (>=0.28.1,<0.29.0)
33
+ Requires-Dist: ijson (>=3.4.0,<4.0.0)
34
+ Requires-Dist: jinja2 (>=3.1.6)
35
+ Requires-Dist: jinja2-time (>=0.2.0,<0.3.0) ; extra == "cli"
36
+ Requires-Dist: jq (>=1.8.0,<2.0.0)
37
+ Requires-Dist: loguru (>=0.7.0,<0.8.0)
38
+ Requires-Dist: prometheus-client (>=0.21.1,<0.22.0)
39
+ Requires-Dist: pydantic[dotenv] (>=1.10.8,<2.0.0)
40
+ Requires-Dist: pydispatcher (>=2.0.7,<3.0.0)
41
+ Requires-Dist: pyhumps (>=3.8.0,<4.0.0)
42
+ Requires-Dist: pyjwt (>=2.10.1,<3.0.0)
43
+ Requires-Dist: pytest-cov (>=6.0.0,<7.0.0)
44
+ Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
45
+ Requires-Dist: pyyaml (>=6.0,<7.0)
46
+ Requires-Dist: rich (>=13.4.1,<14.0.0) ; extra == "cli"
47
+ Requires-Dist: six (>=1.16.0,<2.0.0)
48
+ Requires-Dist: tomli (>=2.0.1,<3.0.0)
49
+ Requires-Dist: urllib3 (>=2.5.0,<3.0.0)
50
+ Requires-Dist: uvicorn (>=0.34.3,<0.35.0)
51
+ Requires-Dist: werkzeug (>=2.3.4,<4.0.0)
52
+ Project-URL: Repository, https://github.com/port-labs/Port-Ocean
53
+ Description-Content-Type: text/markdown
54
+
55
+ <img src="./assets/Thumbnail.png" alt="Ocean">
56
+
57
+ # Ocean <img src="./assets/OceanSymbol.svg" alt="Ocean" width="100" height="100" align="right">
58
+
59
+ [![Lint](https://github.com/port-labs/Port-Ocean/actions/workflows/lint.yml/badge.svg)](https://github.com/port-labs/port-ocean/actions/workflows/lint.yml)
60
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/port-labs/ocean)
61
+
62
+ Ocean is an innovative solution developed by Port to seamlessly integrate various third-party systems with our developer portal product,
63
+ empowering engineers to effortlessly prioritize key features and streamline the integration process.
64
+
65
+ ## Prerequisites
66
+
67
+ - Python 3.11
68
+
69
+ ## Installation
70
+
71
+ In order to install the Ocean Framework, run the following command:
72
+
73
+ ```bash
74
+ pip install "port-ocean[cli]"
75
+ ```
76
+
77
+ Or
78
+
79
+ ```bash
80
+ poetry add "port-ocean[cli]"
81
+ ```
82
+
83
+ ## Run Integration
84
+
85
+ 1. source the integration venv
86
+
87
+ ```bash
88
+ . .venv/bin/activate
89
+ ```
90
+
91
+ 2. Run
92
+
93
+ ```bash
94
+ ocean sail ./path/to/integration
95
+ ```
96
+
97
+ # Export Architecture
98
+
99
+ ![image](./assets/ExportArchitecture.svg)
100
+
101
+ ## Real-Time updates Architecture
102
+
103
+ ![image](./assets/RealTimeUpdatesArchitecture.svg)
104
+
105
+ ## Integration Lifecycle
106
+
107
+ ![image](./assets/LifecycleOfIntegration.svg)
108
+
109
+ ## Folder Structure
110
+
111
+ The Ocean Integration Framework follows a specific folder structure within this mono repository. This structure ensures proper organization and easy identification of integration modules. The suggested folder structure is as follows:
112
+
113
+ ```
114
+ port-ocean/
115
+ ├── port_ocean (framework)/
116
+ │ ├── ocean.py
117
+ │ ├── core/
118
+ | └── ...
119
+ └── integrations/
120
+ │ └─── integration_name/
121
+ │ ├──── main.py
122
+ │ ├──── pyproject.toml
123
+ │ └──── Dockerfile
124
+ ├── ...
125
+ └── ...
126
+ ```
127
+
128
+ - The `framework` folder contains the core logic for managing the integration lifecycle.
129
+ - Each integration is represented by a separate folder inside the `integrations` directory.
130
+ - Inside each integration folder, you'll find a `main.py` file that implements the core functionality of the integration for the specific third-party system.
131
+ - The `pyproject.toml` file inside each integration folder lists the required dependencies for that integration.
132
+
133
+ ## Configuration
134
+
135
+ The Integration Framework utilizes a `config.yaml` file for its configuration. This file defines both the framework configuration and the integration configuration within it. Each integration is identified by its type and unique identifier, which are utilized during initialization to appropriately update Port.
136
+
137
+ Example `config.yaml`:
138
+
139
+ ```yaml
140
+ # This is an example configuration file for the integration service.
141
+ # Please copy this file to config.yaml file in the integration folder and edit it to your needs.
142
+
143
+ port:
144
+ clientId: PORT_CLIENT_ID # Can be loaded via environment variable: PORT_CLIENT_ID
145
+ clientSecret: PORT_CLIENT_SECRET # Can be loaded via environment variable: PORT_CLIENT_SECRET
146
+ baseUrl: https://api.getport.io/v1
147
+ # The event listener to use for the integration service.
148
+ eventListener:
149
+ type: KAFKA / WEBHOOK
150
+ integration:
151
+ # The name of the integration.
152
+ identifier: "my_integration"
153
+ # The type of the integration.
154
+ type: "PagerDuty"
155
+ config:
156
+ my_git_token: "random"
157
+ some_other_integration_config: "Very important information"
158
+ ```
159
+
160
+ ## Contributing
161
+
162
+ The reason Ocean is open source is that we aim for the Port integration library to offer numerous useful out-of-the-box integrations. We have confidence that developers and DevOps professionals who rely on Port in their everyday work will be inclined to contribute and assist in making it a comprehensive tool.
163
+
164
+ In order to learn how you can contribute to Ocean, read our [contributing guide](./CONTRIBUTING.md)
165
+
166
+ ### Local Development (Framework)
167
+
168
+ 1. Clone the repository
169
+
170
+ 2. Install dependencies:
171
+
172
+ ```bash
173
+ make install
174
+ ```
175
+
176
+ Or (For installing integrations dependencies as well)
177
+
178
+ ```bash
179
+ make install/all
180
+ ```
181
+
182
+ 3. source the integration venv
183
+
184
+ ```bash
185
+ . .venv/bin/activate
186
+ ```
187
+
188
+ ### Local Development (Integration)
189
+
190
+ 1. Clone the repository
191
+
192
+ 2. For new integration run
193
+
194
+ ```bash
195
+ make new
196
+ ```
197
+
198
+ and follow the instructions
199
+
200
+ 3. Install dependencies
201
+
202
+ 4. ```bash
203
+ cd DESIRED_INTEGRATION_FOLDER && make install
204
+ ```
205
+
206
+ 5. source the integration venv
207
+
208
+ ```bash
209
+ . .venv/bin/activate
210
+ ```
211
+
212
+ 6. Run the integration
213
+
214
+ ```bash
215
+ make run
216
+ ```
217
+
218
+ Or
219
+
220
+ ```bash
221
+ ocean sail
222
+ ```
223
+
224
+ ## License
225
+
226
+ The Ocean Framework is open-source software licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). See the [LICENSE](./LICENSE) file for more information.
227
+
228
+ ## Contact
229
+
230
+ For any questions or inquiries, please reach out to our team at support@getport.io
231
+
@@ -0,0 +1,176 @@
1
+ <img src="./assets/Thumbnail.png" alt="Ocean">
2
+
3
+ # Ocean <img src="./assets/OceanSymbol.svg" alt="Ocean" width="100" height="100" align="right">
4
+
5
+ [![Lint](https://github.com/port-labs/Port-Ocean/actions/workflows/lint.yml/badge.svg)](https://github.com/port-labs/port-ocean/actions/workflows/lint.yml)
6
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/port-labs/ocean)
7
+
8
+ Ocean is an innovative solution developed by Port to seamlessly integrate various third-party systems with our developer portal product,
9
+ empowering engineers to effortlessly prioritize key features and streamline the integration process.
10
+
11
+ ## Prerequisites
12
+
13
+ - Python 3.11
14
+
15
+ ## Installation
16
+
17
+ In order to install the Ocean Framework, run the following command:
18
+
19
+ ```bash
20
+ pip install "port-ocean[cli]"
21
+ ```
22
+
23
+ Or
24
+
25
+ ```bash
26
+ poetry add "port-ocean[cli]"
27
+ ```
28
+
29
+ ## Run Integration
30
+
31
+ 1. source the integration venv
32
+
33
+ ```bash
34
+ . .venv/bin/activate
35
+ ```
36
+
37
+ 2. Run
38
+
39
+ ```bash
40
+ ocean sail ./path/to/integration
41
+ ```
42
+
43
+ # Export Architecture
44
+
45
+ ![image](./assets/ExportArchitecture.svg)
46
+
47
+ ## Real-Time updates Architecture
48
+
49
+ ![image](./assets/RealTimeUpdatesArchitecture.svg)
50
+
51
+ ## Integration Lifecycle
52
+
53
+ ![image](./assets/LifecycleOfIntegration.svg)
54
+
55
+ ## Folder Structure
56
+
57
+ The Ocean Integration Framework follows a specific folder structure within this mono repository. This structure ensures proper organization and easy identification of integration modules. The suggested folder structure is as follows:
58
+
59
+ ```
60
+ port-ocean/
61
+ ├── port_ocean (framework)/
62
+ │ ├── ocean.py
63
+ │ ├── core/
64
+ | └── ...
65
+ └── integrations/
66
+ │ └─── integration_name/
67
+ │ ├──── main.py
68
+ │ ├──── pyproject.toml
69
+ │ └──── Dockerfile
70
+ ├── ...
71
+ └── ...
72
+ ```
73
+
74
+ - The `framework` folder contains the core logic for managing the integration lifecycle.
75
+ - Each integration is represented by a separate folder inside the `integrations` directory.
76
+ - Inside each integration folder, you'll find a `main.py` file that implements the core functionality of the integration for the specific third-party system.
77
+ - The `pyproject.toml` file inside each integration folder lists the required dependencies for that integration.
78
+
79
+ ## Configuration
80
+
81
+ The Integration Framework utilizes a `config.yaml` file for its configuration. This file defines both the framework configuration and the integration configuration within it. Each integration is identified by its type and unique identifier, which are utilized during initialization to appropriately update Port.
82
+
83
+ Example `config.yaml`:
84
+
85
+ ```yaml
86
+ # This is an example configuration file for the integration service.
87
+ # Please copy this file to config.yaml file in the integration folder and edit it to your needs.
88
+
89
+ port:
90
+ clientId: PORT_CLIENT_ID # Can be loaded via environment variable: PORT_CLIENT_ID
91
+ clientSecret: PORT_CLIENT_SECRET # Can be loaded via environment variable: PORT_CLIENT_SECRET
92
+ baseUrl: https://api.getport.io/v1
93
+ # The event listener to use for the integration service.
94
+ eventListener:
95
+ type: KAFKA / WEBHOOK
96
+ integration:
97
+ # The name of the integration.
98
+ identifier: "my_integration"
99
+ # The type of the integration.
100
+ type: "PagerDuty"
101
+ config:
102
+ my_git_token: "random"
103
+ some_other_integration_config: "Very important information"
104
+ ```
105
+
106
+ ## Contributing
107
+
108
+ The reason Ocean is open source is that we aim for the Port integration library to offer numerous useful out-of-the-box integrations. We have confidence that developers and DevOps professionals who rely on Port in their everyday work will be inclined to contribute and assist in making it a comprehensive tool.
109
+
110
+ In order to learn how you can contribute to Ocean, read our [contributing guide](./CONTRIBUTING.md)
111
+
112
+ ### Local Development (Framework)
113
+
114
+ 1. Clone the repository
115
+
116
+ 2. Install dependencies:
117
+
118
+ ```bash
119
+ make install
120
+ ```
121
+
122
+ Or (For installing integrations dependencies as well)
123
+
124
+ ```bash
125
+ make install/all
126
+ ```
127
+
128
+ 3. source the integration venv
129
+
130
+ ```bash
131
+ . .venv/bin/activate
132
+ ```
133
+
134
+ ### Local Development (Integration)
135
+
136
+ 1. Clone the repository
137
+
138
+ 2. For new integration run
139
+
140
+ ```bash
141
+ make new
142
+ ```
143
+
144
+ and follow the instructions
145
+
146
+ 3. Install dependencies
147
+
148
+ 4. ```bash
149
+ cd DESIRED_INTEGRATION_FOLDER && make install
150
+ ```
151
+
152
+ 5. source the integration venv
153
+
154
+ ```bash
155
+ . .venv/bin/activate
156
+ ```
157
+
158
+ 6. Run the integration
159
+
160
+ ```bash
161
+ make run
162
+ ```
163
+
164
+ Or
165
+
166
+ ```bash
167
+ ocean sail
168
+ ```
169
+
170
+ ## License
171
+
172
+ The Ocean Framework is open-source software licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). See the [LICENSE](./LICENSE) file for more information.
173
+
174
+ ## Contact
175
+
176
+ For any questions or inquiries, please reach out to our team at support@getport.io
@@ -0,0 +1,91 @@
1
+ ARG BASE_BUILDER_PYTHON_IMAGE=ghcr.io/port-labs/port-ocean-base-builder:latest
2
+ ARG BASE_RUNNER_PYTHON_IMAGE=ghcr.io/port-labs/port-ocean-base-runner:latest
3
+
4
+ FROM ${BASE_BUILDER_PYTHON_IMAGE} AS base
5
+
6
+ ARG BUILD_CONTEXT
7
+ ARG BUILDPLATFORM
8
+
9
+ ENV LIBRDKAFKA_VERSION=2.8.2 \
10
+ PYTHONUNBUFFERED=1 \
11
+ POETRY_VIRTUALENVS_IN_PROJECT=1 \
12
+ PIP_ROOT_USER_ACTION=ignore
13
+
14
+ WORKDIR /app
15
+
16
+ COPY ./${BUILD_CONTEXT}/pyproject.toml ./${BUILD_CONTEXT}/poetry.lock /app/
17
+
18
+ RUN poetry install --without dev --no-root --no-interaction --no-ansi --no-cache
19
+
20
+ FROM ${BASE_RUNNER_PYTHON_IMAGE} AS prod
21
+ ARG OCEAN_USER_ID=999
22
+
23
+ RUN groupadd -r appgroup && useradd -r -g appgroup -m -u ${OCEAN_USER_ID} ocean
24
+
25
+ RUN mkdir -p /tmp/ocean
26
+
27
+ ARG INTEGRATION_VERSION
28
+ ARG BUILD_CONTEXT
29
+ ARG PROMETHEUS_MULTIPROC_DIR=/tmp/ocean/prometheus/metrics
30
+ ARG OAUTH_CONFIG_DIR=/app/.config
31
+ ARG STREAMING_LOCATION=/tmp/ocean/streaming
32
+
33
+ ENV LIBRDKAFKA_VERSION=2.8.2 \
34
+ PROMETHEUS_MULTIPROC_DIR=${PROMETHEUS_MULTIPROC_DIR} \
35
+ STREAMING_LOCATION=${STREAMING_LOCATION}
36
+
37
+ RUN mkdir -p ${PROMETHEUS_MULTIPROC_DIR}
38
+ RUN mkdir -p ${STREAMING_LOCATION}
39
+ RUN chown -R ocean:appgroup /tmp/ocean && chmod -R 755 /tmp/ocean
40
+
41
+ RUN mkdir -p ${OAUTH_CONFIG_DIR}
42
+ RUN chown -R ocean:appgroup ${OAUTH_CONFIG_DIR}
43
+
44
+ RUN apt-get update \
45
+ && apt-get install -y \
46
+ ca-certificates \
47
+ openssl \
48
+ curl \
49
+ acl \
50
+ sudo \
51
+ jq \
52
+ && apt-get clean
53
+
54
+ LABEL INTEGRATION_VERSION=${INTEGRATION_VERSION}
55
+ # Used to ensure that new integrations will be public, see https://docs.github.com/en/packages/learn-github-packages/configuring-a-packages-access-control-and-visibility
56
+ LABEL org.opencontainers.image.source=https://github.com/port-labs/ocean
57
+
58
+ ENV PIP_ROOT_USER_ACTION=ignore
59
+
60
+ WORKDIR /app
61
+
62
+ USER ocean
63
+
64
+ # Copy the application code
65
+ COPY ./${BUILD_CONTEXT} /app
66
+
67
+ # Copy dependencies from the build stage
68
+ COPY --from=base /app/.venv /app/.venv
69
+
70
+ COPY ./integrations/_infra/init.sh /app/init.sh
71
+
72
+ USER root
73
+
74
+ # Ensure that ocean is available for all in path
75
+ RUN chmod a+x /app/.venv/bin/ocean
76
+
77
+ RUN chmod a+x /app/init.sh
78
+ RUN ln -s /app/.venv/bin/ocean /usr/bin/ocean
79
+
80
+ # Add ocean user to ssl certs group
81
+ RUN setfacl -R -m u:ocean:rwX /etc/ssl/certs \
82
+ && setfacl -d -m u:ocean:rwX /etc/ssl/certs
83
+
84
+ # Allow ocean user to run update-ca-certificates without password (secure, limited sudo)
85
+ RUN echo "ocean ALL=(root) NOPASSWD: /usr/sbin/update-ca-certificates" >> /etc/sudoers.d/ocean-certs \
86
+ && chmod 440 /etc/sudoers.d/ocean-certs
87
+
88
+ USER ocean
89
+
90
+ # Run the application
91
+ CMD ["bash", "/app/init.sh"]