port-ocean 0.13.1.dev1__tar.gz → 0.14.4__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 (159) hide show
  1. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/PKG-INFO +1 -1
  2. port_ocean-0.14.4/integrations/_infra/Dockerfile.Deb +56 -0
  3. port_ocean-0.14.4/integrations/_infra/Dockerfile.alpine +108 -0
  4. port_ocean-0.14.4/integrations/_infra/Dockerfile.base.builder +26 -0
  5. port_ocean-0.14.4/integrations/_infra/Dockerfile.base.runner +13 -0
  6. port_ocean-0.14.4/integrations/_infra/Dockerfile.dockerignore +94 -0
  7. port_ocean-0.14.4/integrations/_infra/Makefile +89 -0
  8. port_ocean-0.14.4/integrations/_infra/grpcio.sh +18 -0
  9. port_ocean-0.14.4/integrations/_infra/init.sh +5 -0
  10. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/commands/defaults/clean.py +3 -1
  11. port_ocean-0.14.4/port_ocean/cli/cookiecutter/hooks/post_gen_project.py +30 -0
  12. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/clients/port/utils.py +8 -2
  13. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/config/settings.py +1 -0
  14. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/defaults/clean.py +10 -3
  15. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/defaults/common.py +24 -8
  16. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/defaults/initialize.py +3 -1
  17. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/helpers/retry.py +31 -20
  18. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/ocean.py +1 -1
  19. port_ocean-0.14.4/port_ocean/tests/core/defaults/test_common.py +166 -0
  20. port_ocean-0.14.4/port_ocean/tests/utils/test_cache.py +189 -0
  21. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/utils/cache.py +37 -1
  22. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/pyproject.toml +5 -1
  23. port_ocean-0.13.1.dev1/port_ocean/cli/cookiecutter/hooks/post_gen_project.py +0 -20
  24. port_ocean-0.13.1.dev1/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.dockerignore +0 -94
  25. port_ocean-0.13.1.dev1/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/Dockerfile +0 -15
  26. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/LICENSE.md +0 -0
  27. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/README.md +0 -0
  28. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/__init__.py +0 -0
  29. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/bootstrap.py +0 -0
  30. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/__init__.py +0 -0
  31. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cli.py +0 -0
  32. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/commands/__init__.py +0 -0
  33. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/commands/defaults/__init___.py +0 -0
  34. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/commands/defaults/dock.py +0 -0
  35. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/commands/defaults/group.py +0 -0
  36. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/commands/list_integrations.py +0 -0
  37. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/commands/main.py +0 -0
  38. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/commands/new.py +0 -0
  39. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/commands/pull.py +0 -0
  40. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/commands/sail.py +0 -0
  41. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/commands/version.py +0 -0
  42. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/__init__.py +0 -0
  43. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/cookiecutter.json +0 -0
  44. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/extensions.py +0 -0
  45. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.env.example +0 -0
  46. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.gitignore +0 -0
  47. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/.gitignore +0 -0
  48. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/blueprints.json +0 -0
  49. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/port-app-config.yml +0 -0
  50. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/spec.yaml +0 -0
  51. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/CHANGELOG.md +0 -0
  52. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/CONTRIBUTING.md +0 -0
  53. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/README.md +0 -0
  54. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/changelog/.gitignore +0 -0
  55. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/debug.py +0 -0
  56. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/main.py +0 -0
  57. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/poetry.toml +0 -0
  58. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/pyproject.toml +0 -0
  59. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/sonar-project.properties +0 -0
  60. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/tests/__init__.py +0 -0
  61. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/tests/test_sample.py +0 -0
  62. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/cli/utils.py +0 -0
  63. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/clients/__init__.py +0 -0
  64. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/clients/port/__init__.py +0 -0
  65. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/clients/port/authentication.py +0 -0
  66. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/clients/port/client.py +0 -0
  67. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/clients/port/mixins/__init__.py +0 -0
  68. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/clients/port/mixins/blueprints.py +0 -0
  69. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/clients/port/mixins/entities.py +0 -0
  70. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/clients/port/mixins/integrations.py +0 -0
  71. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/clients/port/mixins/migrations.py +0 -0
  72. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/clients/port/retry_transport.py +0 -0
  73. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/clients/port/types.py +0 -0
  74. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/config/__init__.py +0 -0
  75. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/config/base.py +0 -0
  76. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/config/dynamic.py +0 -0
  77. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/consumers/__init__.py +0 -0
  78. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/consumers/kafka_consumer.py +0 -0
  79. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/context/__init__.py +0 -0
  80. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/context/event.py +0 -0
  81. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/context/ocean.py +0 -0
  82. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/context/resource.py +0 -0
  83. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/__init__.py +0 -0
  84. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/defaults/__init__.py +0 -0
  85. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/event_listener/__init__.py +0 -0
  86. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/event_listener/base.py +0 -0
  87. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/event_listener/factory.py +0 -0
  88. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/event_listener/http.py +0 -0
  89. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/event_listener/kafka.py +0 -0
  90. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/event_listener/once.py +0 -0
  91. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/event_listener/polling.py +0 -0
  92. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/handlers/__init__.py +0 -0
  93. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/handlers/base.py +0 -0
  94. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/handlers/entities_state_applier/__init__.py +0 -0
  95. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/handlers/entities_state_applier/base.py +0 -0
  96. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/handlers/entities_state_applier/port/__init__.py +0 -0
  97. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/handlers/entities_state_applier/port/applier.py +0 -0
  98. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/handlers/entities_state_applier/port/get_related_entities.py +0 -0
  99. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/handlers/entities_state_applier/port/order_by_entities_dependencies.py +0 -0
  100. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/handlers/entity_processor/__init__.py +0 -0
  101. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/handlers/entity_processor/base.py +0 -0
  102. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/handlers/entity_processor/jq_entity_processor.py +0 -0
  103. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/handlers/port_app_config/__init__.py +0 -0
  104. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/handlers/port_app_config/api.py +0 -0
  105. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/handlers/port_app_config/base.py +0 -0
  106. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/handlers/port_app_config/models.py +0 -0
  107. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/handlers/resync_state_updater/__init__.py +0 -0
  108. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/handlers/resync_state_updater/updater.py +0 -0
  109. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/integrations/__init__.py +0 -0
  110. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/integrations/base.py +0 -0
  111. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/integrations/mixins/__init__.py +0 -0
  112. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/integrations/mixins/events.py +0 -0
  113. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/integrations/mixins/handler.py +0 -0
  114. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/integrations/mixins/sync.py +0 -0
  115. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/integrations/mixins/sync_raw.py +0 -0
  116. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/integrations/mixins/utils.py +0 -0
  117. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/models.py +0 -0
  118. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/ocean_types.py +0 -0
  119. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/core/utils.py +0 -0
  120. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/exceptions/__init__.py +0 -0
  121. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/exceptions/api.py +0 -0
  122. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/exceptions/base.py +0 -0
  123. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/exceptions/clients.py +0 -0
  124. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/exceptions/context.py +0 -0
  125. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/exceptions/core.py +0 -0
  126. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/exceptions/port_defaults.py +0 -0
  127. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/exceptions/utils.py +0 -0
  128. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/helpers/__init__.py +0 -0
  129. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/helpers/async_client.py +0 -0
  130. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/log/__init__.py +0 -0
  131. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/log/handlers.py +0 -0
  132. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/log/logger_setup.py +0 -0
  133. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/log/sensetive.py +0 -0
  134. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/middlewares.py +0 -0
  135. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/py.typed +0 -0
  136. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/run.py +0 -0
  137. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/sonar-project.properties +0 -0
  138. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/tests/__init__.py +0 -0
  139. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/tests/clients/port/mixins/test_entities.py +0 -0
  140. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/tests/conftest.py +0 -0
  141. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/tests/core/handlers/entity_processor/test_jq_entity_processor.py +0 -0
  142. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/tests/helpers/__init__.py +0 -0
  143. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/tests/helpers/fixtures.py +0 -0
  144. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/tests/helpers/integration.py +0 -0
  145. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/tests/helpers/ocean_app.py +0 -0
  146. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/tests/helpers/port_client.py +0 -0
  147. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/tests/helpers/smoke_test.py +0 -0
  148. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/tests/log/test_handlers.py +0 -0
  149. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/tests/test_smoke.py +0 -0
  150. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/tests/utils/test_async_iterators.py +0 -0
  151. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/utils/__init__.py +0 -0
  152. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/utils/async_http.py +0 -0
  153. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/utils/async_iterators.py +0 -0
  154. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/utils/misc.py +0 -0
  155. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/utils/queue_utils.py +0 -0
  156. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/utils/repeat.py +0 -0
  157. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/utils/signal.py +0 -0
  158. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/utils/time.py +0 -0
  159. {port_ocean-0.13.1.dev1 → port_ocean-0.14.4}/port_ocean/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: port-ocean
3
- Version: 0.13.1.dev1
3
+ Version: 0.14.4
4
4
  Summary: Port Ocean is a CLI tool for managing your Port projects.
5
5
  Home-page: https://app.getport.io
6
6
  Keywords: ocean,port-ocean,port
@@ -0,0 +1,56 @@
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=1.9.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
+
22
+ ARG INTEGRATION_VERSION
23
+ ARG BUILD_CONTEXT
24
+
25
+ ENV LIBRDKAFKA_VERSION=1.9.2
26
+
27
+ RUN apt-get update \
28
+ && apt-get install -y \
29
+ ca-certificates \
30
+ openssl \
31
+ curl \
32
+ && apt-get clean
33
+
34
+ LABEL INTEGRATION_VERSION=${INTEGRATION_VERSION}
35
+ # 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
36
+ LABEL org.opencontainers.image.source=https://github.com/port-labs/ocean
37
+
38
+ ENV PIP_ROOT_USER_ACTION=ignore
39
+
40
+ WORKDIR /app
41
+
42
+ # Copy the application code
43
+ COPY ./${BUILD_CONTEXT} /app
44
+
45
+ # Copy dependencies from the build stage
46
+ COPY --from=base /app/.venv /app/.venv
47
+
48
+ COPY ./integrations/_infra/init.sh /app/init.sh
49
+
50
+ # Ensure that ocean is available for all in path
51
+ RUN chmod a+x /app/.venv/bin/ocean
52
+
53
+ RUN chmod a+x /app/init.sh
54
+ RUN ln -s /app/.venv/bin/ocean /usr/bin/ocean
55
+ # Run the application
56
+ CMD ["bash", "/app/init.sh"]
@@ -0,0 +1,108 @@
1
+ ARG BASE_PYTHON_IMAGE=alpine:3.20.1
2
+
3
+ FROM ${BASE_PYTHON_IMAGE} AS base
4
+
5
+ ARG BUILD_CONTEXT
6
+ ARG BUILDPLATFORM
7
+
8
+ ENV LIBRDKAFKA_VERSION=1.9.2 \
9
+ PYTHONUNBUFFERED=1 \
10
+ PIP_DISABLE_PIP_VERSION_CHECK=on \
11
+ POETRY_NO_INTERACTION=1 \
12
+ PIP_NO_CACHE_DIR=on \
13
+ PIP_DEFAULT_TIMEOUT=100 \
14
+ GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY=1 \
15
+ PYTHONDONTWRITEBYTECODE=1
16
+
17
+ # Install system dependencies and libraries
18
+ RUN \
19
+ apk add --no-cache \
20
+ gcc \
21
+ g++ \
22
+ musl-dev \
23
+ build-base \
24
+ bash \
25
+ oniguruma-dev \
26
+ make \
27
+ autoconf \
28
+ automake \
29
+ libtool \
30
+ curl \
31
+ openssl-dev \
32
+ cargo \
33
+ pkgconfig \
34
+ linux-headers \
35
+ libstdc++ \
36
+ libffi-dev \
37
+ py3-grpcio \
38
+ py3-protobuf \
39
+ python3-dev \
40
+ # librdkafka-dev \
41
+ # Install community librdkafka-dev since the default in alpine is older
42
+ && echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories \
43
+ && echo "@edgecommunity http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
44
+ && apk add --no-cache \
45
+ alpine-sdk \
46
+ "librdkafka@edgecommunity>=${LIBRDKAFKA_VERSION}" \
47
+ "librdkafka-dev@edgecommunity>=${LIBRDKAFKA_VERSION}" \
48
+ && curl -sSL https://install.python-poetry.org | python3 - \
49
+ && apk upgrade gcc linux-headers libstdc++ gcc g++ --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main/ \
50
+ && ln -s /root/.local/bin/poetry /usr/bin/poetry \
51
+ && poetry config virtualenvs.in-project true
52
+
53
+ WORKDIR /app
54
+
55
+ COPY ./${BUILD_CONTEXT}/pyproject.toml ./${BUILD_CONTEXT}/poetry.lock /app/
56
+
57
+ COPY ./integrations/_infra/grpcio.sh /app/grpcio.sh
58
+
59
+ RUN chmod a+x /app/grpcio.sh && /app/grpcio.sh "${BUILDPLATFORM}"
60
+
61
+ RUN export GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY=1 \
62
+ && poetry install --without dev --no-root --no-interaction --no-ansi --no-cache
63
+
64
+ FROM ${BASE_PYTHON_IMAGE} AS prod
65
+
66
+ ARG INTEGRATION_VERSION
67
+ ARG BUILD_CONTEXT
68
+
69
+ ENV LIBRDKAFKA_VERSION=1.9.2
70
+
71
+ LABEL INTEGRATION_VERSION=${INTEGRATION_VERSION}
72
+ # 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
73
+ LABEL org.opencontainers.image.source=https://github.com/port-labs/ocean
74
+
75
+ # Install only runtime dependencies
76
+ RUN \
77
+ apk add --no-cache \
78
+ bash \
79
+ oniguruma-dev \
80
+ python3 \
81
+ # Install community librdkafka-dev since the default in alpine is older
82
+ && echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories \
83
+ && echo "@edgecommunity http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
84
+ && apk update \
85
+ && apk add --no-cache \
86
+ alpine-sdk \
87
+ "librdkafka@edgecommunity>=${LIBRDKAFKA_VERSION}" \
88
+ "librdkafka-dev@edgecommunity>=${LIBRDKAFKA_VERSION}" \
89
+ # Fix security issues
90
+ && apk upgrade busybox libcrypto3 libssl3 --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main/
91
+
92
+ WORKDIR /app
93
+
94
+ # Copy the application code
95
+ COPY ./${BUILD_CONTEXT} /app
96
+
97
+ # Copy dependencies from the build stage
98
+ COPY --from=base /app/.venv /app/.venv
99
+
100
+ COPY ./integrations/_infra/init.sh /app/init.sh
101
+
102
+ # Ensure that ocean is available for all in path
103
+ RUN chmod a+x /app/.venv/bin/ocean
104
+
105
+ RUN chmod a+x /app/init.sh
106
+ RUN ln -s /app/.venv/bin/ocean /usr/bin/ocean
107
+ # Run the application
108
+ CMD ["bash", "/app/init.sh"]
@@ -0,0 +1,26 @@
1
+ ARG BASE_PYTHON_IMAGE=debian:trixie-slim
2
+ # debian:trixie-slim - Python 3.12
3
+ FROM ${BASE_PYTHON_IMAGE}
4
+
5
+ LABEL org.opencontainers.image.source=https://github.com/port-labs/ocean
6
+
7
+ ENV LIBRDKAFKA_VERSION=1.9.2 \
8
+ PYTHONUNBUFFERED=1 \
9
+ POETRY_VIRTUALENVS_IN_PROJECT=1 \
10
+ PIP_ROOT_USER_ACTION=ignore
11
+
12
+ RUN apt-get update \
13
+ && apt-get install -y \
14
+ --no-install-recommends \
15
+ wget \
16
+ g++ \
17
+ libssl-dev \
18
+ autoconf \
19
+ automake \
20
+ libtool \
21
+ curl \
22
+ librdkafka-dev \
23
+ python3 \
24
+ python3-pip \
25
+ python3-poetry \
26
+ && apt-get clean
@@ -0,0 +1,13 @@
1
+ ARG BASE_PYTHON_IMAGE=debian:trixie-slim
2
+ # debian:trixie-slim - Python 3.12
3
+ FROM ${BASE_PYTHON_IMAGE}
4
+
5
+ LABEL org.opencontainers.image.source=https://github.com/port-labs/ocean
6
+
7
+ ENV LIBRDKAFKA_VERSION=1.9.2
8
+
9
+ ENV PIP_ROOT_USER_ACTION=ignore
10
+
11
+ RUN apt-get update \
12
+ && apt-get install -y --no-install-recommends librdkafka-dev python3 \
13
+ && apt-get clean
@@ -0,0 +1,94 @@
1
+
2
+ # Git
3
+ **/.git
4
+ **/.gitignore
5
+ **/.gitattributes
6
+
7
+
8
+ # CI
9
+ **/.codeclimate.yml
10
+ **/.travis.yml
11
+ **/.taskcluster.yml
12
+
13
+ # Docker
14
+ **/docker-compose.yml
15
+ **/Dockerfile
16
+ **/.docker
17
+ **/.dockerignore
18
+
19
+ # Byte-compiled / optimized / DLL files
20
+ **/__pycache__/
21
+ **/*.py[cod]
22
+
23
+ # C extensions
24
+ **/*.so
25
+
26
+ # Distribution / packaging
27
+ **/.Python
28
+ **/env/
29
+ **/build/
30
+ **/develop-eggs/
31
+ **/dist/
32
+ **/downloads/
33
+ **/eggs/
34
+ **/lib/
35
+ **/lib64/
36
+ **/parts/
37
+ **/sdist/
38
+ **/var/
39
+ **/*.egg-info/
40
+ **/.installed.cfg
41
+ **/*.egg
42
+
43
+ # PyInstaller
44
+ # Usually these files are written by a python script from a template
45
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
46
+ **/*.manifest
47
+ **/*.spec
48
+
49
+ # Installer logs
50
+ **/pip-log.txt
51
+ **/pip-delete-this-directory.txt
52
+
53
+ # Unit test / coverage reports
54
+ **/htmlcov/
55
+ **/.tox/
56
+ **/.coverage
57
+ **/.cache
58
+ **/nosetests.xml
59
+ **/coverage.xml
60
+
61
+ # Translations
62
+ **/*.mo
63
+ **/*.pot
64
+
65
+ # Django stuff:
66
+ **/*.log
67
+
68
+ # Sphinx documentation
69
+ **/docs/_build/
70
+
71
+ # PyBuilder
72
+ **/target/
73
+
74
+ # Virtual environment
75
+ **/.env
76
+ **/.venv/
77
+ **/venv/
78
+
79
+ # PyCharm
80
+ **/.idea
81
+
82
+ # Python mode for VIM
83
+ **/.ropeproject
84
+
85
+ # Vim swap files
86
+ **/*.swp
87
+
88
+ # VS Code
89
+ **/.vscode/
90
+
91
+ **/*.md
92
+ **/.ruff_cache
93
+ **/changelog
94
+ **/tests
@@ -0,0 +1,89 @@
1
+ ACTIVATE := . .venv/bin/activate
2
+
3
+ define run_checks
4
+ exit_code=0; \
5
+ cd $1; \
6
+ echo "Running poetry check"; \
7
+ poetry check || exit_code=$$?;\
8
+ echo "Running mypy"; \
9
+ mypy . --exclude '/\.venv/' || exit_code=$$?; \
10
+ echo "Running ruff"; \
11
+ ruff check . || exit_code=$$?; \
12
+ echo "Running black"; \
13
+ black --check . || exit_code=$$?; \
14
+ echo "Running yamllint"; \
15
+ yamllint . || exit_code=$$?; \
16
+ if [ $$exit_code -eq 1 ]; then \
17
+ echo "\033[0;31mOne or more checks failed with exit code $$exit_code\033[0m"; \
18
+ else \
19
+ echo "\033[0;32mAll checks executed successfully.\033[0m"; \
20
+ fi; \
21
+ exit $$exit_code
22
+ endef
23
+
24
+ define install_poetry
25
+ if ! command -v poetry &> /dev/null; then \
26
+ pip install --upgrade pip; \
27
+ pip install poetry; \
28
+ else \
29
+ echo "Poetry is already installed."; \
30
+ fi
31
+ endef
32
+
33
+ define deactivate_virtualenv
34
+ if [ -n "$$VIRTUAL_ENV" ]; then \
35
+ unset VIRTUAL_ENV; \
36
+ unset PYTHONHOME; \
37
+ unset -f pydoc >/dev/null 2>&1; \
38
+ OLD_PATH="$$PATH"; \
39
+ PATH=$$(echo -n "$$PATH" | awk -v RS=: -v ORS=: '/\/virtualenv\/bin$$/ {next} {print}'); \
40
+ export PATH; \
41
+ hash -r; \
42
+ echo "Deactivated the virtual environment."; \
43
+ fi
44
+ endef
45
+
46
+ .SILENT: install install/prod install/local-core lint lint/fix run test clean
47
+
48
+ install:
49
+ $(call deactivate_virtualenv) && \
50
+ $(call install_poetry) && \
51
+ poetry install --with dev
52
+
53
+ install/local-core: install
54
+ # NOTE: This is a temporary change that shouldn't be committed
55
+ $(ACTIVATE) && pip install -e ../../
56
+
57
+ install/prod:
58
+ poetry install --without dev --no-root --no-interaction --no-ansi --no-cache
59
+ $(call install_poetry) && \
60
+
61
+ lint:
62
+ $(ACTIVATE) && \
63
+ $(call run_checks,.)
64
+
65
+ lint/fix:
66
+ $(ACTIVATE) && \
67
+ black .
68
+ ruff check --fix .
69
+
70
+ run:
71
+ $(ACTIVATE) && ocean sail
72
+
73
+ test:
74
+ $(ACTIVATE) && poetry run pytest -n auto
75
+
76
+ clean:
77
+ @find . -name '.venv' -type d -exec rm -rf {} \;
78
+ @find . -name '*.pyc' -exec rm -rf {} \;
79
+ @find . -name '__pycache__' -exec rm -rf {} \;
80
+ @find . -name 'Thumbs.db' -exec rm -rf {} \;
81
+ @find . -name '*~' -exec rm -rf {} \;
82
+ rm -rf .cache
83
+ rm -rf build
84
+ rm -rf dist
85
+ rm -rf *.egg-info
86
+ rm -rf htmlcov
87
+ rm -rf .tox/
88
+ rm -rf docs/_build
89
+ rm -rf dist/
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env bash
2
+ PLATFORM=${1}
3
+
4
+ if [[ ! $(grep -q 'grpcio' ./poetry.lock) ]]; then
5
+ echo 'grpcio not present, skipping explicit build'
6
+ else
7
+ echo 'found grpcio, checking platform'
8
+ fi
9
+
10
+ if [[ "${PLATFORM}" == "linux/arm64" ]]; then
11
+ echo "On arm, need to explicitly install grpcio"
12
+ poetry env use "$(which python)"
13
+ echo "${VIRTUAL_ENV}"
14
+ poetry run pip install --upgrade pip
15
+ GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY=1 poetry run pip install 'grpcio==1.66.2'
16
+ else
17
+ echo "Not on arm, no need to explicitly install grpcio"
18
+ fi
@@ -0,0 +1,5 @@
1
+ if test -e /usr/local/share/ca-certificates/cert.crt; then
2
+ update-ca-certificates
3
+ fi
4
+
5
+ ocean sail
@@ -51,4 +51,6 @@ def clean(path: str, force: bool, wait: bool) -> None:
51
51
  default_app,
52
52
  )
53
53
 
54
- clean_defaults(app.integration.AppConfigHandlerClass.CONFIG_CLASS, force, wait)
54
+ clean_defaults(
55
+ app.integration.AppConfigHandlerClass.CONFIG_CLASS, app.config, force, wait
56
+ )
@@ -0,0 +1,30 @@
1
+ import os
2
+ import shutil
3
+
4
+
5
+ def handle_private_integration_flags():
6
+ target_dir = os.path.join(
7
+ "{{cookiecutter._output_dir}}", "{{cookiecutter.integration_slug}}"
8
+ )
9
+ root_dir = os.path.join("{{ cookiecutter._repo_dir }}", "../../../")
10
+ infra_make_file = os.path.join(root_dir, "integrations/_infra/Makefile")
11
+ infra_dockerfile = os.path.join(root_dir, "integrations/_infra/Dockerfile.deb")
12
+ infra_dockerignore = os.path.join(
13
+ root_dir, "integrations/_infra/Dockerfile.dockerignore"
14
+ )
15
+ target_link_make_file = os.path.join(target_dir, "./Makefile")
16
+ target_link_dockerfile = os.path.join(target_dir, "./Dockerfile")
17
+ target_link_dockerignore = os.path.join(target_dir, "./.dockerignore")
18
+
19
+ if "{{ cookiecutter.is_private_integration }}" == "True":
20
+ shutil.copyfile(infra_make_file, target_link_make_file)
21
+ shutil.copyfile(infra_dockerfile, target_link_dockerfile)
22
+ shutil.copyfile(infra_dockerignore, target_link_dockerignore)
23
+ os.remove("sonar-project.properties")
24
+ return
25
+
26
+ os.symlink(infra_make_file, target_link_make_file)
27
+
28
+
29
+ if __name__ == "__main__":
30
+ handle_private_integration_flags()
@@ -16,7 +16,7 @@ if TYPE_CHECKING:
16
16
  # period of time, before raising an exception.
17
17
  # The max_connections value can't be too high, as it will cause the application to run out of memory.
18
18
  # The max_keepalive_connections can't be too high, as it will cause the application to run out of available connections.
19
- PORT_HTTP_MAX_CONNECTIONS_LIMIT = 200
19
+ PORT_HTTP_MAX_CONNECTIONS_LIMIT = 100
20
20
  PORT_HTTP_MAX_KEEP_ALIVE_CONNECTIONS = 50
21
21
  PORT_HTTP_TIMEOUT = 60.0
22
22
 
@@ -28,13 +28,19 @@ PORT_HTTPX_LIMITS = httpx.Limits(
28
28
 
29
29
  _http_client: LocalStack[httpx.AsyncClient] = LocalStack()
30
30
 
31
+ FIVE_MINUETS = 60 * 5
32
+
31
33
 
32
34
  def _get_http_client_context(port_client: "PortClient") -> httpx.AsyncClient:
33
35
  client = _http_client.top
34
36
  if client is None:
35
37
  client = OceanAsyncClient(
36
38
  TokenRetryTransport,
37
- transport_kwargs={"port_client": port_client},
39
+ transport_kwargs={
40
+ "port_client": port_client,
41
+ "max_backoff_wait": FIVE_MINUETS,
42
+ "base_delay": 0.3,
43
+ },
38
44
  timeout=PORT_HTTPX_TIMEOUT,
39
45
  limits=PORT_HTTPX_LIMITS,
40
46
  )
@@ -78,6 +78,7 @@ class IntegrationConfiguration(BaseOceanSettings, extra=Extra.allow):
78
78
  default_factory=lambda: IntegrationSettings(type="", identifier="")
79
79
  )
80
80
  runtime: Runtime = Runtime.OnPrem
81
+ resources_path: str = Field(default=".port/resources")
81
82
 
82
83
  @root_validator()
83
84
  def validate_integration_config(cls, values: dict[str, Any]) -> dict[str, Any]:
@@ -4,6 +4,7 @@ from typing import Type
4
4
  import httpx
5
5
  from loguru import logger
6
6
 
7
+ from port_ocean.config.settings import IntegrationConfiguration
7
8
  from port_ocean.context.ocean import ocean
8
9
  from port_ocean.core.defaults.common import (
9
10
  get_port_integration_defaults,
@@ -14,12 +15,13 @@ from port_ocean.core.handlers.port_app_config.models import PortAppConfig
14
15
 
15
16
  def clean_defaults(
16
17
  config_class: Type[PortAppConfig],
18
+ integration_config: IntegrationConfiguration,
17
19
  force: bool,
18
20
  wait: bool,
19
21
  ) -> None:
20
22
  try:
21
23
  asyncio.new_event_loop().run_until_complete(
22
- _clean_defaults(config_class, force, wait)
24
+ _clean_defaults(config_class, integration_config, force, wait)
23
25
  )
24
26
 
25
27
  except Exception as e:
@@ -27,13 +29,18 @@ def clean_defaults(
27
29
 
28
30
 
29
31
  async def _clean_defaults(
30
- config_class: Type[PortAppConfig], force: bool, wait: bool
32
+ config_class: Type[PortAppConfig],
33
+ integration_config: IntegrationConfiguration,
34
+ force: bool,
35
+ wait: bool,
31
36
  ) -> None:
32
37
  port_client = ocean.port_client
33
38
  is_exists = await is_integration_exists(port_client)
34
39
  if not is_exists:
35
40
  return None
36
- defaults = get_port_integration_defaults(config_class)
41
+ defaults = get_port_integration_defaults(
42
+ config_class, integration_config.resources_path
43
+ )
37
44
  if not defaults:
38
45
  return None
39
46
 
@@ -3,6 +3,7 @@ from pathlib import Path
3
3
  from typing import Type, Any, TypedDict, Optional
4
4
 
5
5
  import httpx
6
+ from loguru import logger
6
7
  import yaml
7
8
  from pydantic import BaseModel, Field
8
9
  from starlette import status
@@ -77,18 +78,33 @@ def deconstruct_blueprints_to_creation_steps(
77
78
  )
78
79
 
79
80
 
81
+ def is_valid_dir(path: Path) -> bool:
82
+ return path.is_dir()
83
+
84
+
80
85
  def get_port_integration_defaults(
81
- port_app_config_class: Type[PortAppConfig], base_path: Path = Path(".")
86
+ port_app_config_class: Type[PortAppConfig],
87
+ custom_defaults_dir: Optional[str] = None,
88
+ base_path: Path = Path("."),
82
89
  ) -> Defaults | None:
83
- defaults_dir = base_path / ".port/resources"
84
- if not defaults_dir.exists():
85
- return None
86
-
87
- if not defaults_dir.is_dir():
88
- raise UnsupportedDefaultFileType(
89
- f"Defaults directory is not a directory: {defaults_dir}"
90
+ fallback_dir = base_path / ".port/resources"
91
+
92
+ if custom_defaults_dir and is_valid_dir(base_path / custom_defaults_dir):
93
+ defaults_dir = base_path / custom_defaults_dir
94
+ elif is_valid_dir(fallback_dir):
95
+ logger.info(
96
+ f"Could not find custom defaults directory {custom_defaults_dir}, falling back to {fallback_dir}",
97
+ fallback_dir=fallback_dir,
98
+ custom_defaults_dir=custom_defaults_dir,
99
+ )
100
+ defaults_dir = fallback_dir
101
+ else:
102
+ logger.warning(
103
+ f"Could not find defaults directory {fallback_dir}, skipping defaults"
90
104
  )
105
+ return None
91
106
 
107
+ logger.info(f"Loading defaults from {defaults_dir}", defaults_dir=defaults_dir)
92
108
  default_jsons = {}
93
109
  allowed_file_names = [
94
110
  field_model.alias for _, field_model in Defaults.__fields__.items()
@@ -198,7 +198,9 @@ async def _initialize_defaults(
198
198
  config_class: Type[PortAppConfig], integration_config: IntegrationConfiguration
199
199
  ) -> None:
200
200
  port_client = ocean.port_client
201
- defaults = get_port_integration_defaults(config_class)
201
+ defaults = get_port_integration_defaults(
202
+ config_class, integration_config.resources_path
203
+ )
202
204
  if not defaults:
203
205
  logger.warning("No defaults found. Skipping initialization...")
204
206
  return None