fast2dev 1.0.0__py3-none-any.whl

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.
Files changed (543) hide show
  1. f2dev/__init__.py +1 -0
  2. f2dev/__main__.py +5 -0
  3. f2dev/_bundle/platform/.dockerignore +80 -0
  4. f2dev/_bundle/platform/.gitignore +82 -0
  5. f2dev/_bundle/platform/LICENSE +202 -0
  6. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/template_values.yaml +1731 -0
  7. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/Chart.yaml +9 -0
  8. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-airflow-deploy.yaml +60 -0
  9. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-bi-sync.yaml +46 -0
  10. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-checkout.yaml +49 -0
  11. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-console-sync.yaml +41 -0
  12. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-e2e-label.yaml +48 -0
  13. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-e2e-run.yaml +43 -0
  14. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-e2e-teardown.yaml +47 -0
  15. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-governance.yaml +40 -0
  16. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-lint.yaml +37 -0
  17. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-notify.yaml +32 -0
  18. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-quality.yaml +38 -0
  19. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-refresh.yaml +36 -0
  20. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-supersede.yaml +30 -0
  21. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-tags.yaml +44 -0
  22. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/pipeline-branch.yaml +138 -0
  23. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/pipeline-main.yaml +150 -0
  24. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/pipeline-pr.yaml +184 -0
  25. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/templates/NOTES.txt +18 -0
  26. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/templates/settings-configmap.yaml +14 -0
  27. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/templates/workflowtemplates.yaml +31 -0
  28. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/values.yaml +41 -0
  29. f2dev/_bundle/platform/charts/data_services_charts/cicd_workload_runner/github/template_github_values.yaml +436 -0
  30. f2dev/_bundle/platform/charts/data_services_charts/cicd_workload_runner/github/template_github_values_extra.yaml +49 -0
  31. f2dev/_bundle/platform/charts/data_services_charts/cicd_workload_runner/gitlab/template_gitlab_values.yaml +551 -0
  32. f2dev/_bundle/platform/charts/data_services_charts/cicd_workload_runner/gitlab/template_gitlab_values_extra.yaml +9 -0
  33. f2dev/_bundle/platform/charts/data_services_charts/data_analysis/lightdash/template_values.yaml +359 -0
  34. f2dev/_bundle/platform/charts/data_services_charts/data_analysis/metabase/template_values.yaml +384 -0
  35. f2dev/_bundle/platform/charts/data_services_charts/data_analysis/superset/template_values.yaml +1562 -0
  36. f2dev/_bundle/platform/charts/data_services_charts/data_analysis/template_values.yaml +269 -0
  37. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/.helmignore +15 -0
  38. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/Chart.yaml +20 -0
  39. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/template_values.yaml.j2 +175 -0
  40. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/NOTES.txt +19 -0
  41. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/_helpers.tpl +50 -0
  42. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/cicd-rbac.yaml +30 -0
  43. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/configmap.yaml +142 -0
  44. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/extras.yaml +14 -0
  45. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/ingress.yaml +69 -0
  46. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/promtail-configmap.yaml +68 -0
  47. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/secret.yaml +31 -0
  48. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/service.yaml +15 -0
  49. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/serviceaccount.yaml +12 -0
  50. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/statefulset.yaml +276 -0
  51. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/valkey.yaml +113 -0
  52. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/warehouse-stats-cronjob.yaml +107 -0
  53. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/values.yaml +828 -0
  54. f2dev/_bundle/platform/charts/data_services_charts/data_dbt_server/template_values.yaml +385 -0
  55. f2dev/_bundle/platform/charts/data_services_charts/data_governance/template_dh_prerequisites_values.yaml +118 -0
  56. f2dev/_bundle/platform/charts/data_services_charts/data_governance/template_dh_values.yaml +1671 -0
  57. f2dev/_bundle/platform/charts/data_services_charts/data_governance/template_kafka_values.yaml +112 -0
  58. f2dev/_bundle/platform/charts/data_services_charts/data_governance/template_opensearch_values.yaml +662 -0
  59. f2dev/_bundle/platform/charts/data_services_charts/data_governance/template_values.yaml +738 -0
  60. f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/Chart.yaml +6 -0
  61. f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/files/argo-openapi.json +681 -0
  62. f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/templates/_helpers.tpl +17 -0
  63. f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/templates/argo-rbac.yaml +35 -0
  64. f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/templates/backends.yaml +327 -0
  65. f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/templates/gateway.yaml +150 -0
  66. f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/values.yaml +91 -0
  67. f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/template_values.yaml +142 -0
  68. f2dev/_bundle/platform/charts/data_services_charts/data_modeling/template_values.yaml +1167 -0
  69. f2dev/_bundle/platform/charts/data_services_charts/data_modeling/template_values_extra.yaml +99 -0
  70. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/airflow-cleanup/Dockerfile +10 -0
  71. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/airflow-cleanup/build.sh +38 -0
  72. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/airflow-cleanup/cleanup.py +452 -0
  73. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/airflow-cleanup/requirements.txt +3 -0
  74. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/docs/keycloak-oidc-setup.md +106 -0
  75. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/template_values.yaml +5536 -0
  76. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/template_values_extra.yaml +379 -0
  77. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/webserver-config/configmap.yaml +459 -0
  78. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/webserver-config/fast2dev_auth.py +285 -0
  79. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/webserver-config/fast2dev_mcp_plugin.py +24 -0
  80. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/webserver-config/webserver_config.py +130 -0
  81. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/Dockerfile +10 -0
  82. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/build.sh +38 -0
  83. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/cleanup.py +749 -0
  84. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/k8s/configmap.yaml +24 -0
  85. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/k8s/cronjob.yaml +137 -0
  86. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/requirements.txt +3 -0
  87. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/.helmignore +26 -0
  88. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/Chart.lock +3 -0
  89. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/Chart.yaml +15 -0
  90. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/README.md +243 -0
  91. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/NOTES.txt +31 -0
  92. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/_helpers.tpl +245 -0
  93. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/_images.tpl +17 -0
  94. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-auth-secret.yaml +35 -0
  95. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-bootloader/bootloader-secrets.yaml +19 -0
  96. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-bootloader/pod.yaml +126 -0
  97. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-connector-rollout-worker/deployment.yaml +171 -0
  98. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-cron/cron-secrets.yaml +19 -0
  99. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-cron/deployment.yaml +149 -0
  100. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-db.yaml +88 -0
  101. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/_helpers.tpl +111 -0
  102. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/deployment.yaml +169 -0
  103. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/hpa.yaml +23 -0
  104. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/pdb.yaml +17 -0
  105. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/service.yaml +25 -0
  106. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/serviceaccount.yaml +10 -0
  107. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-featureflag-server/deployment.yaml +161 -0
  108. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-featureflag-server/service.yaml +25 -0
  109. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-keycloak/service.yaml +62 -0
  110. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-keycloak/statefulset.yaml +182 -0
  111. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-manifest-server/_helpers.tpl +54 -0
  112. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-manifest-server/deployment.yaml +152 -0
  113. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-manifest-server/service.yaml +23 -0
  114. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-manifest-server/serviceaccount.yaml +10 -0
  115. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-metrics/deployment.yaml +124 -0
  116. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-server/deployment.yaml +227 -0
  117. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-server/service.yaml +29 -0
  118. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-stigg-sidecar/deployment.yaml +184 -0
  119. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-stigg-sidecar/service.yaml +21 -0
  120. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-temporal/configmap.yaml +55 -0
  121. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-temporal/deployment.yaml +220 -0
  122. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-temporal/service.yaml +21 -0
  123. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-temporal-ui/deployment.yaml +122 -0
  124. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-temporal-ui/service.yaml +23 -0
  125. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-webapp/deployment.yaml +146 -0
  126. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-webapp/ingress.yaml +63 -0
  127. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-webapp/service.yaml +32 -0
  128. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-worker/deployment.yaml +229 -0
  129. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-workload-api-server/deployment.yaml +191 -0
  130. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-workload-api-server/service.yaml +25 -0
  131. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-workload-launcher/deployment.yaml +232 -0
  132. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-workload-launcher/jobs-secrets.yaml +21 -0
  133. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_auth.tpl +944 -0
  134. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_aws.tpl +109 -0
  135. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_cluster.tpl +82 -0
  136. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_common.tpl +370 -0
  137. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_connector.tpl +58 -0
  138. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_connectorRollout.tpl +141 -0
  139. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_connectorRolloutWorker.tpl +56 -0
  140. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_cron.tpl +62 -0
  141. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_customerio.tpl +56 -0
  142. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_database.tpl +375 -0
  143. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_dataplaneGroups.tpl +38 -0
  144. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_directJobRunner.tpl +122 -0
  145. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_featureFlags.tpl +126 -0
  146. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_java.tpl +38 -0
  147. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_jobs.tpl +422 -0
  148. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_keycloak.tpl +542 -0
  149. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_logging.tpl +38 -0
  150. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_metrics.tpl +214 -0
  151. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_micronaut.tpl +43 -0
  152. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_minio.tpl +64 -0
  153. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_secretsManager.tpl +628 -0
  154. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_server.tpl +533 -0
  155. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_shopify.tpl +83 -0
  156. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_stigg.tpl +157 -0
  157. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_storage.tpl +468 -0
  158. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_temporal.tpl +943 -0
  159. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_topology.tpl +98 -0
  160. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_tracking.tpl +82 -0
  161. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_webapp.tpl +38 -0
  162. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_worker.tpl +366 -0
  163. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_workloadApiServer.tpl +62 -0
  164. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_workloadLauncher.tpl +395 -0
  165. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_workloads.tpl +770 -0
  166. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/env-configmap.yaml +62 -0
  167. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/gcs-log-creds-secret.yaml +19 -0
  168. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/ingress.yaml +69 -0
  169. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/minio.yaml +161 -0
  170. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/secret.yaml +31 -0
  171. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/serviceaccount.yaml +50 -0
  172. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/telemetry-configmap.yaml +32 -0
  173. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/tests/test-webapp.yaml +34 -0
  174. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/values.yaml +3158 -0
  175. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/.helmignore +12 -0
  176. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/Chart.yaml +16 -0
  177. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/README.md +172 -0
  178. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/templates/_helpers.tpl +42 -0
  179. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/templates/deployment.yaml +105 -0
  180. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/templates/externalsecret.yaml +23 -0
  181. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/templates/pdb.yaml +15 -0
  182. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/templates/service.yaml +18 -0
  183. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/values.yaml +97 -0
  184. f2dev/_bundle/platform/charts/data_services_charts/data_replication/feature-flags-configmap.yaml +16 -0
  185. f2dev/_bundle/platform/charts/data_services_charts/data_replication/template_metrics_values.yaml +13 -0
  186. f2dev/_bundle/platform/charts/data_services_charts/data_replication/template_oauth2proxy_values.yaml +1200 -0
  187. f2dev/_bundle/platform/charts/data_services_charts/data_replication/template_values.yaml +3255 -0
  188. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/Chart.yaml +7 -0
  189. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/hazelcast-client.yaml +27 -0
  190. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/hazelcast-master.yaml +38 -0
  191. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/hazelcast-worker.yaml +29 -0
  192. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/jvm_client_options +24 -0
  193. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/jvm_master_options +6 -0
  194. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/jvm_worker_options +6 -0
  195. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/log4j2.properties +109 -0
  196. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/seatunnel.yaml +36 -0
  197. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/_helpers.tpl +70 -0
  198. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/configmap.yaml +11 -0
  199. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/deployment-master.yaml +120 -0
  200. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/deployment-worker.yaml +118 -0
  201. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/rbac.yaml +32 -0
  202. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/services.yaml +33 -0
  203. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/values.yaml +101 -0
  204. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/template_oauth2proxy_values.yaml +196 -0
  205. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/template_values.yaml +75 -0
  206. f2dev/_bundle/platform/charts/data_services_charts/object_storage_operator/template_values.yaml +506 -0
  207. f2dev/_bundle/platform/charts/infra_services_charts/cert_manager/csi_driver_values.yaml +193 -0
  208. f2dev/_bundle/platform/charts/infra_services_charts/cert_manager/template_pdns_webhook_values.yaml +91 -0
  209. f2dev/_bundle/platform/charts/infra_services_charts/cert_manager/template_values.yaml +1777 -0
  210. f2dev/_bundle/platform/charts/infra_services_charts/cert_manager/template_values_extra.yaml +253 -0
  211. f2dev/_bundle/platform/charts/infra_services_charts/cluster_cleaner/template_values.yaml +57 -0
  212. f2dev/_bundle/platform/charts/infra_services_charts/external_dns/template_values.yaml +476 -0
  213. f2dev/_bundle/platform/charts/infra_services_charts/external_dns/template_values_extra.yaml +131 -0
  214. f2dev/_bundle/platform/charts/infra_services_charts/idp_sso_manager/realm_template.json +4785 -0
  215. f2dev/_bundle/platform/charts/infra_services_charts/idp_sso_manager/template_values.yaml +657 -0
  216. f2dev/_bundle/platform/charts/infra_services_charts/pvc_autoscaller/template_values.yaml +36 -0
  217. f2dev/_bundle/platform/charts/infra_services_charts/pvc_autoscaller/template_values_extra.yaml +352 -0
  218. f2dev/_bundle/platform/charts/infra_services_charts/secret_manager/template_values.yaml +1218 -0
  219. f2dev/_bundle/platform/charts/infra_services_charts/secret_manager/template_values_extra.yaml +845 -0
  220. f2dev/_bundle/platform/charts/infra_services_charts/secret_manager_operator/template_values.yaml +561 -0
  221. f2dev/_bundle/platform/charts/infra_services_charts/secret_manager_operator/template_values_extra.yaml +23 -0
  222. f2dev/_bundle/platform/charts/infra_services_charts/services_logs/template_alloy_events_values.yaml +59 -0
  223. f2dev/_bundle/platform/charts/infra_services_charts/services_logs/template_alloy_values.yaml +185 -0
  224. f2dev/_bundle/platform/charts/infra_services_charts/services_logs/template_loki_values.yaml +108 -0
  225. f2dev/_bundle/platform/charts/infra_services_charts/services_metrics/template_values.yaml +1530 -0
  226. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/00-main/.gitkeep +0 -0
  227. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/00-main/f2d-main.json +2871 -0
  228. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/01-platform/.gitkeep +0 -0
  229. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/01-platform/f2d-k8s-cluster.json +1751 -0
  230. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/01-platform/f2d-microservices.json +1682 -0
  231. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/01-platform/f2d-pvc-storage.json +1320 -0
  232. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/01-platform/f2d-service.json +1193 -0
  233. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/.gitkeep +0 -0
  234. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/f2d-cert-manager.json +755 -0
  235. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/f2d-keycloak.json +746 -0
  236. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/f2d-object-storage.json +881 -0
  237. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/f2d-postgresql.json +1590 -0
  238. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/f2d-traefik.json +1375 -0
  239. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/.gitkeep +0 -0
  240. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-cicd-workflows-trends.json +1916 -0
  241. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-cicd-workflows.json +1330 -0
  242. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-analysis.json +631 -0
  243. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-freshness.json +1362 -0
  244. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-governance.json +1958 -0
  245. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-modeling.json +764 -0
  246. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-orchestration-trends.json +2352 -0
  247. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-orchestration.json +1506 -0
  248. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-quality.json +1549 -0
  249. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-replication-trends.json +2799 -0
  250. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-replication.json +2153 -0
  251. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-streaming-trends.json +1536 -0
  252. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-streaming.json +1209 -0
  253. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/04-data-warehouse/.gitkeep +0 -0
  254. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/04-data-warehouse-bigquery/.gitkeep +0 -0
  255. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/04-data-warehouse-bigquery/f2d-bigquery.json +990 -0
  256. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/05-logs/.gitkeep +0 -0
  257. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/05-logs/f2d-logs.json +630 -0
  258. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/folders.yaml +17 -0
  259. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/requirements.yaml +8 -0
  260. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/template_alerts_cm.yaml +2031 -0
  261. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/template_values.yaml +1315 -0
  262. f2dev/_bundle/platform/charts/infra_services_charts/stackgres_postgres_db/template_values.yaml +550 -0
  263. f2dev/_bundle/platform/charts/infra_services_charts/stackgres_postgres_db/template_values_extra.yaml +742 -0
  264. f2dev/_bundle/platform/charts/infra_services_charts/traefik_lb/template_values.yaml +1758 -0
  265. f2dev/_bundle/platform/cli/README.md +866 -0
  266. f2dev/_bundle/platform/cli/__init__.py +42 -0
  267. f2dev/_bundle/platform/cli/__main__.py +17 -0
  268. f2dev/_bundle/platform/cli/cert_providers.py +369 -0
  269. f2dev/_bundle/platform/cli/command_record.py +144 -0
  270. f2dev/_bundle/platform/cli/config/data_services_config.json +217 -0
  271. f2dev/_bundle/platform/cli/config/environment_profiles.yaml +183 -0
  272. f2dev/_bundle/platform/cli/config/images.json +129 -0
  273. f2dev/_bundle/platform/cli/config/infrastructure_services_config.json +141 -0
  274. f2dev/_bundle/platform/cli/config.py +252 -0
  275. f2dev/_bundle/platform/cli/deployment_configuration_aws_example.yaml +117 -0
  276. f2dev/_bundle/platform/cli/deployment_configuration_gcp_example.yaml +130 -0
  277. f2dev/_bundle/platform/cli/deployment_configuration_onprem_example.yaml +71 -0
  278. f2dev/_bundle/platform/cli/destroy.py +677 -0
  279. f2dev/_bundle/platform/cli/dns_check.py +27 -0
  280. f2dev/_bundle/platform/cli/dns_providers.py +405 -0
  281. f2dev/_bundle/platform/cli/exit_codes.py +32 -0
  282. f2dev/_bundle/platform/cli/fixers.py +56 -0
  283. f2dev/_bundle/platform/cli/generate_only.py +336 -0
  284. f2dev/_bundle/platform/cli/health_report.py +114 -0
  285. f2dev/_bundle/platform/cli/logging.py +206 -0
  286. f2dev/_bundle/platform/cli/main.py +5293 -0
  287. f2dev/_bundle/platform/cli/precheck.py +1523 -0
  288. f2dev/_bundle/platform/cli/prerequisites/README.md +208 -0
  289. f2dev/_bundle/platform/cli/prerequisites/install-prerequisites.bat +107 -0
  290. f2dev/_bundle/platform/cli/prerequisites/install-prerequisites.ps1 +343 -0
  291. f2dev/_bundle/platform/cli/prerequisites/install-prerequisites.sh +207 -0
  292. f2dev/_bundle/platform/cli/prerequisites/linux/install-linux.sh +775 -0
  293. f2dev/_bundle/platform/cli/prerequisites/macos/install-macos.sh +634 -0
  294. f2dev/_bundle/platform/cli/prerequisites/requirements.txt +41 -0
  295. f2dev/_bundle/platform/cli/prerequisites/verify-prerequisites.ps1 +150 -0
  296. f2dev/_bundle/platform/cli/prerequisites/verify-prerequisites.sh +418 -0
  297. f2dev/_bundle/platform/cli/prerequisites/versions.yaml +43 -0
  298. f2dev/_bundle/platform/cli/prerequisites/windows/install-windows.ps1 +1005 -0
  299. f2dev/_bundle/platform/cli/restore.py +179 -0
  300. f2dev/_bundle/platform/cli/service_gates.py +160 -0
  301. f2dev/_bundle/platform/cli/state.py +332 -0
  302. f2dev/_bundle/platform/cli/wizard.py +782 -0
  303. f2dev/_bundle/platform/cli.py +235 -0
  304. f2dev/_bundle/platform/deployers/__init__.py +4 -0
  305. f2dev/_bundle/platform/deployers/base_deployer.py +8 -0
  306. f2dev/_bundle/platform/deployers/clouds/__init__.py +0 -0
  307. f2dev/_bundle/platform/deployers/clouds/aws_cloud.py +619 -0
  308. f2dev/_bundle/platform/deployers/clouds/azure_cloud.py +0 -0
  309. f2dev/_bundle/platform/deployers/clouds/google_cloud.py +785 -0
  310. f2dev/_bundle/platform/deployers/clouds/terragrunt_progress.py +56 -0
  311. f2dev/_bundle/platform/deployers/services/data_services/1.0_cicd_workload_runner.py +644 -0
  312. f2dev/_bundle/platform/deployers/services/data_services/12.0_control_plane.py +321 -0
  313. f2dev/_bundle/platform/deployers/services/data_services/13.0_data_mcp_hub.py +362 -0
  314. f2dev/_bundle/platform/deployers/services/data_services/2.0_object_storage_operator.py +416 -0
  315. f2dev/_bundle/platform/deployers/services/data_services/2.5_services_logs.py +482 -0
  316. f2dev/_bundle/platform/deployers/services/data_services/3.0_data_cicd_workflows.py +361 -0
  317. f2dev/_bundle/platform/deployers/services/data_services/4.0_data_replication.py +534 -0
  318. f2dev/_bundle/platform/deployers/services/data_services/4.5_data_streaming.py +303 -0
  319. f2dev/_bundle/platform/deployers/services/data_services/5.0_data_orchestration.py +760 -0
  320. f2dev/_bundle/platform/deployers/services/data_services/6.0_data_modeling.py +753 -0
  321. f2dev/_bundle/platform/deployers/services/data_services/7.0_data_governance.py +795 -0
  322. f2dev/_bundle/platform/deployers/services/data_services/8.0_data_analysis.py +587 -0
  323. f2dev/_bundle/platform/deployers/services/infra_services/1.0_secret_operator.py +467 -0
  324. f2dev/_bundle/platform/deployers/services/infra_services/10.0_cluster_pvc_autoscaller.py +500 -0
  325. f2dev/_bundle/platform/deployers/services/infra_services/2.0_cert_manager.py +963 -0
  326. f2dev/_bundle/platform/deployers/services/infra_services/3.0_external_dns.py +823 -0
  327. f2dev/_bundle/platform/deployers/services/infra_services/4.0_traefik_lb.py +604 -0
  328. f2dev/_bundle/platform/deployers/services/infra_services/5.0_stackgres_postgresql.py +652 -0
  329. f2dev/_bundle/platform/deployers/services/infra_services/6.0_services_metrics.py +515 -0
  330. f2dev/_bundle/platform/deployers/services/infra_services/7.0_services_monitoring.py +787 -0
  331. f2dev/_bundle/platform/deployers/services/infra_services/8.0_cluster_cleaner.py +439 -0
  332. f2dev/_bundle/platform/deployers/services/infra_services/9.0_idp_sso_manager.py +790 -0
  333. f2dev/_bundle/platform/readme.md +47 -0
  334. f2dev/_bundle/platform/requirements.txt +14 -0
  335. f2dev/_bundle/platform/terraform/aws_cloud/templates/backend.tf_template +10 -0
  336. f2dev/_bundle/platform/terraform/aws_cloud/templates/defaults.yaml_template +11 -0
  337. f2dev/_bundle/platform/terraform/aws_cloud/templates/env.yaml_template +2 -0
  338. f2dev/_bundle/platform/terraform/aws_cloud/templates/root.hcl_advanced_template +134 -0
  339. f2dev/_bundle/platform/terraform/aws_cloud/templates/root.hcl_basic_template +134 -0
  340. f2dev/_bundle/platform/terraform/aws_cloud/templates/terragrunt.hcl_advanced_template +134 -0
  341. f2dev/_bundle/platform/terraform/aws_cloud/templates/terragrunt.hcl_basic_template +134 -0
  342. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/01-apps-vpc/terragrunt.hcl +26 -0
  343. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/02-create-dns-ns-record/terragrunt.hcl +16 -0
  344. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/03-eks-cluster/terragrunt.hcl +21 -0
  345. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/04-external_dns_sa/terragrunt.hcl +28 -0
  346. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/01-apps-vpc/terragrunt.hcl +25 -0
  347. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/02-eks-cluster/terragrunt.hcl +32 -0
  348. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/03-external-dns-irsa/terragrunt.hcl +34 -0
  349. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/04-cert-manager-irsa/terragrunt.hcl +34 -0
  350. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/05-create-dns-zone/terragrunt.hcl +22 -0
  351. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/06-create-dns-ns-record/terragrunt.hcl +44 -0
  352. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/empty.yaml +1 -0
  353. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/empty.yaml +1 -0
  354. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/env.hcl +2 -0
  355. f2dev/_bundle/platform/terraform/azure_cloud/README.md +3 -0
  356. f2dev/_bundle/platform/terraform/azure_cloud/templates/_keep_structure.txt +0 -0
  357. f2dev/_bundle/platform/terraform/google_cloud/README.md +20 -0
  358. f2dev/_bundle/platform/terraform/google_cloud/templates/backend.tf_template +7 -0
  359. f2dev/_bundle/platform/terraform/google_cloud/templates/defaults.yaml_template +12 -0
  360. f2dev/_bundle/platform/terraform/google_cloud/templates/env.yaml_template +2 -0
  361. f2dev/_bundle/platform/terraform/google_cloud/templates/root.hcl_advanced_template +114 -0
  362. f2dev/_bundle/platform/terraform/google_cloud/templates/root.hcl_basic_template +116 -0
  363. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/.gitignore +3 -0
  364. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/00-create-ou-folder/terragrunt.hcl +15 -0
  365. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/01-create-project/terragrunt.hcl +30 -0
  366. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/02-enable-apis/terragrunt.hcl +25 -0
  367. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/03-0-apps-vpc/terragrunt.hcl +134 -0
  368. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/04-external-ip-traefik/terragrunt.hcl +29 -0
  369. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/05-create-dns-zone/terragrunt.hcl +25 -0
  370. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/06-create-dns-ns-record/terragrunt.hcl +43 -0
  371. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/07-gke-cluster/terragrunt.hcl +103 -0
  372. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/08-dbt_deploy_sa/terragrunt.hcl +36 -0
  373. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/09-dbt_sa/terragrunt.hcl +40 -0
  374. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/10-cert_manager_sa/terragrunt.hcl +34 -0
  375. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/11-external_dns_sa/terragrunt.hcl +30 -0
  376. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/12-monitoring_sa/terragrunt.hcl +52 -0
  377. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/13-data_replication_sa/terragrunt.hcl +35 -0
  378. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/14-data_orchestration_sa/terragrunt.hcl +35 -0
  379. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/15-bi_data_sa/terragrunt.hcl +43 -0
  380. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/16-whitelist-external-ip-on-common/terragrunt.hcl +30 -0
  381. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/17-kubeconfig/terragrunt.hcl +23 -0
  382. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/18-data_streaming_sa/terragrunt.hcl +24 -0
  383. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/empty.yaml +1 -0
  384. f2dev/_bundle/platform/utils/__init__.py +0 -0
  385. f2dev/_bundle/platform/utils/customer_data_platform_repository_operator.py +1098 -0
  386. f2dev/_bundle/platform/utils/customer_secret_manager_operations.py +1635 -0
  387. f2dev/_bundle/platform/utils/environment_profiles.py +58 -0
  388. f2dev/_bundle/platform/utils/helm_utils.py +215 -0
  389. f2dev/_bundle/platform/utils/infrastructure_deployment_operator.py +1532 -0
  390. f2dev/_bundle/platform/utils/keycloak_realm_reconcile.py +320 -0
  391. f2dev/_bundle/platform/utils/kubeconfig_fixer.py +265 -0
  392. f2dev/_bundle/platform/utils/raw_extras.py +34 -0
  393. f2dev/_bundle/platform/utils/readiness.py +330 -0
  394. f2dev/_bundle/platform/utils/secret_structure_upgrade.py +194 -0
  395. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/.gitignore +7 -0
  396. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/README.md +33 -0
  397. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/analyses/.gitkeep +0 -0
  398. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/dbt_project.yml +52 -0
  399. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/macros/.gitkeep +0 -0
  400. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/macros/fast2dev_bq_time_zones.sql +12 -0
  401. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/macros/fast2dev_monitoring_grain.sql +23 -0
  402. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_daily_spend.sql +19 -0
  403. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_daily_spend.yml +25 -0
  404. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_model_costs_daily.sql +16 -0
  405. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_model_costs_daily.yml +24 -0
  406. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_storage_by_dataset.sql +12 -0
  407. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_storage_by_dataset.yml +21 -0
  408. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_user_costs_daily.sql +14 -0
  409. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_user_costs_daily.yml +22 -0
  410. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_weekly_kpi.sql +52 -0
  411. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_weekly_kpi.yml +42 -0
  412. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_weekly_spend.sql +74 -0
  413. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_weekly_spend.yml +49 -0
  414. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/sources/billing_export.yml +9 -0
  415. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/staging/fast2dev_bq_billing_export.sql +9 -0
  416. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/staging/fast2dev_bq_billing_export.yml +4 -0
  417. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/packages.yml +5 -0
  418. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/profiles.yml +15 -0
  419. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/scripts/run_monitoring.py +201 -0
  420. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/seeds/.gitkeep +0 -0
  421. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/snapshots/.gitkeep +0 -0
  422. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/tests/.gitkeep +0 -0
  423. f2dev/_bundle/platform/utils/templates/dry_run/gcp_sa.json +12 -0
  424. f2dev/_bundle/platform/utils/templates/dry_run/kubeconfig.yaml +18 -0
  425. f2dev/_bundle/platform/utils/templates/git_repo_templates/data_orchestrator/repository_structure/README.MD +50 -0
  426. f2dev/_bundle/platform/utils/templates/git_repo_templates/data_orchestrator/repository_structure/dags/dbt/README.MD +47 -0
  427. f2dev/_bundle/platform/utils/templates/git_repo_templates/data_orchestrator/repository_structure/dags/fast2dev_healthcheck.py_template_airflow_3.x +158 -0
  428. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/bitbucket/bitbucket-pipelines.yml_template +144 -0
  429. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitea/.gitea/PR_VALIDATION.md +52 -0
  430. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitea/.gitea/pull_request_template.md +48 -0
  431. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitea/.gitea/workflows/argo-workflows.yml_template +143 -0
  432. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitea/.gitea/workflows/pr-agent.yml +30 -0
  433. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitea/.gitea/workflows/validate-pr-description.yml +38 -0
  434. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/github/.github/PR_VALIDATION.md +52 -0
  435. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/github/.github/pull_request_template.md +48 -0
  436. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/github/.github/workflows/argo-workflows.yml_template +143 -0
  437. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/github/.github/workflows/pr-agent.yml +37 -0
  438. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/github/.github/workflows/validate-pr-description.yml +157 -0
  439. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitlab/.gitlab/PR_VALIDATION.md +43 -0
  440. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitlab/.gitlab/merge_request_templates/Default.md +48 -0
  441. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitlab/.gitlab-ci.yml_template +181 -0
  442. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/repository_structure/.gitignore +21 -0
  443. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/repository_structure/.pr_agent.toml +82 -0
  444. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/repository_structure/AGENTS.md +126 -0
  445. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/repository_structure/README.MD +101 -0
  446. f2dev/_bundle/platform/utils/templates/git_repo_templates/infrastructure_deployment_files/DR.md +341 -0
  447. f2dev/_bundle/platform/utils/templates/git_repo_templates/infrastructure_deployment_files/README.md.j2 +81 -0
  448. f2dev/_bundle/platform/utils/templates/git_repo_templates/infrastructure_deployment_files/decrypt_files.py +331 -0
  449. f2dev/_bundle/platform/utils/templates/git_repo_templates/infrastructure_deployment_files/encrypt_files.py +321 -0
  450. f2dev/_bundle/platform/utils/templates/secret_structure_template/customer_vault_structure.json +502 -0
  451. f2dev/_bundle/platform/utils/vault_structure_sync.py +96 -0
  452. f2dev/_bundle/terraform-modules/README.md +12 -0
  453. f2dev/_bundle/terraform-modules/aws_cloud/README.md +7 -0
  454. f2dev/_bundle/terraform-modules/aws_cloud/eks/addons-roles.tf +298 -0
  455. f2dev/_bundle/terraform-modules/aws_cloud/eks/main.tf +313 -0
  456. f2dev/_bundle/terraform-modules/aws_cloud/eks/outputs.tf +3 -0
  457. f2dev/_bundle/terraform-modules/aws_cloud/eks/policies/lb-controller-policy.json +219 -0
  458. f2dev/_bundle/terraform-modules/aws_cloud/eks/provider.tf +36 -0
  459. f2dev/_bundle/terraform-modules/aws_cloud/eks/variables.tf +107 -0
  460. f2dev/_bundle/terraform-modules/aws_cloud/eks/versions.tf +10 -0
  461. f2dev/_bundle/terraform-modules/aws_cloud/gcp_aws_zone/main.tf +25 -0
  462. f2dev/_bundle/terraform-modules/aws_cloud/gcp_aws_zone/provider.tf +17 -0
  463. f2dev/_bundle/terraform-modules/aws_cloud/gcp_aws_zone/variables.tf +41 -0
  464. f2dev/_bundle/terraform-modules/aws_cloud/vpc/main.tf +34 -0
  465. f2dev/_bundle/terraform-modules/aws_cloud/vpc/outputs.tf +44 -0
  466. f2dev/_bundle/terraform-modules/aws_cloud/vpc/provider.tf +12 -0
  467. f2dev/_bundle/terraform-modules/aws_cloud/vpc/variables.tf +118 -0
  468. f2dev/_bundle/terraform-modules/aws_cloud/vpc/versions.tf +10 -0
  469. f2dev/_bundle/terraform-modules/azure_cloud/README.md +3 -0
  470. f2dev/_bundle/terraform-modules/google_cloud/README.md +17 -0
  471. f2dev/_bundle/terraform-modules/google_cloud/artifact-registry/main.tf +8 -0
  472. f2dev/_bundle/terraform-modules/google_cloud/artifact-registry/providers.tf +6 -0
  473. f2dev/_bundle/terraform-modules/google_cloud/artifact-registry/variables.tf +17 -0
  474. f2dev/_bundle/terraform-modules/google_cloud/artifact-registry/versions.tf +8 -0
  475. f2dev/_bundle/terraform-modules/google_cloud/cloud-dns/main.tf +24 -0
  476. f2dev/_bundle/terraform-modules/google_cloud/cloud-dns/outputs.tf +25 -0
  477. f2dev/_bundle/terraform-modules/google_cloud/cloud-dns/providers.tf +7 -0
  478. f2dev/_bundle/terraform-modules/google_cloud/cloud-dns/variables.tf +17 -0
  479. f2dev/_bundle/terraform-modules/google_cloud/cloud-dns/versions.tf +9 -0
  480. f2dev/_bundle/terraform-modules/google_cloud/cloud-dns-recordset/main.tf +38 -0
  481. f2dev/_bundle/terraform-modules/google_cloud/cloud-dns-recordset/variables.tf +73 -0
  482. f2dev/_bundle/terraform-modules/google_cloud/cloud-dns-recordset/versions.tf +39 -0
  483. f2dev/_bundle/terraform-modules/google_cloud/composer/main.tf +213 -0
  484. f2dev/_bundle/terraform-modules/google_cloud/composer/outputs.tf +31 -0
  485. f2dev/_bundle/terraform-modules/google_cloud/composer/provider.tf +4 -0
  486. f2dev/_bundle/terraform-modules/google_cloud/composer/variables.tf +192 -0
  487. f2dev/_bundle/terraform-modules/google_cloud/create-ou-folder/main.tf +29 -0
  488. f2dev/_bundle/terraform-modules/google_cloud/create-ou-folder/output.tf +4 -0
  489. f2dev/_bundle/terraform-modules/google_cloud/create-ou-folder/providers.tf +6 -0
  490. f2dev/_bundle/terraform-modules/google_cloud/create-ou-folder/variables.tf +40 -0
  491. f2dev/_bundle/terraform-modules/google_cloud/create-ou-folder/versions.tf +8 -0
  492. f2dev/_bundle/terraform-modules/google_cloud/create-project/main.tf +18 -0
  493. f2dev/_bundle/terraform-modules/google_cloud/create-project/output.tf +8 -0
  494. f2dev/_bundle/terraform-modules/google_cloud/create-project/providers.tf +6 -0
  495. f2dev/_bundle/terraform-modules/google_cloud/create-project/variables.tf +27 -0
  496. f2dev/_bundle/terraform-modules/google_cloud/create-project/versions.tf +9 -0
  497. f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/README.md +188 -0
  498. f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/main.tf +135 -0
  499. f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/output.tf +16 -0
  500. f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/providers.tf +6 -0
  501. f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/variables.tf +54 -0
  502. f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/versions.tf +17 -0
  503. f2dev/_bundle/terraform-modules/google_cloud/enable_apis/main.tf +14 -0
  504. f2dev/_bundle/terraform-modules/google_cloud/enable_apis/provider.tf +7 -0
  505. f2dev/_bundle/terraform-modules/google_cloud/enable_apis/variables.tf +13 -0
  506. f2dev/_bundle/terraform-modules/google_cloud/enable_apis/versions.tf +10 -0
  507. f2dev/_bundle/terraform-modules/google_cloud/external-ip/README.md +89 -0
  508. f2dev/_bundle/terraform-modules/google_cloud/external-ip/main.tf +17 -0
  509. f2dev/_bundle/terraform-modules/google_cloud/external-ip/outputs.tf +19 -0
  510. f2dev/_bundle/terraform-modules/google_cloud/external-ip/variables.tf +43 -0
  511. f2dev/_bundle/terraform-modules/google_cloud/fw-add/main.tf +24 -0
  512. f2dev/_bundle/terraform-modules/google_cloud/fw-add/providers.tf +6 -0
  513. f2dev/_bundle/terraform-modules/google_cloud/fw-add/variables.tf +37 -0
  514. f2dev/_bundle/terraform-modules/google_cloud/fw-add/versions.tf +9 -0
  515. f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/README.md +10 -0
  516. f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/main.tf +459 -0
  517. f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/outputs.tf +44 -0
  518. f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/provider.tf +19 -0
  519. f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/variables.tf +354 -0
  520. f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/versions.tf +22 -0
  521. f2dev/_bundle/terraform-modules/google_cloud/kubeconfig/README.md +40 -0
  522. f2dev/_bundle/terraform-modules/google_cloud/kubeconfig/main.tf +54 -0
  523. f2dev/_bundle/terraform-modules/google_cloud/kubeconfig/outputs.tf +10 -0
  524. f2dev/_bundle/terraform-modules/google_cloud/kubeconfig/variables.tf +24 -0
  525. f2dev/_bundle/terraform-modules/google_cloud/kubeconfig/versions.tf +10 -0
  526. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/README.md +47 -0
  527. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/main.tf +51 -0
  528. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/net-address/README.md +103 -0
  529. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/net-address/main.tf +71 -0
  530. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/net-address/outputs.tf +71 -0
  531. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/net-address/variables.tf +82 -0
  532. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/net-address/versions.tf +27 -0
  533. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/outputs.tf +35 -0
  534. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/provider.tf +4 -0
  535. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/variables.tf +237 -0
  536. f2dev/_bundle/terraform-modules/oracle_cloud/README.md +3 -0
  537. f2dev/launcher.py +153 -0
  538. fast2dev-1.0.0.dist-info/METADATA +201 -0
  539. fast2dev-1.0.0.dist-info/RECORD +543 -0
  540. fast2dev-1.0.0.dist-info/WHEEL +4 -0
  541. fast2dev-1.0.0.dist-info/entry_points.txt +2 -0
  542. fast2dev-1.0.0.dist-info/licenses/LICENSE +202 -0
  543. fast2dev-1.0.0.dist-info/licenses/NOTICE +6 -0
@@ -0,0 +1,749 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Airbyte History Cleanup
4
+ =======================
5
+ Deletes jobs older than RETENTION_DAYS from PostgreSQL and their log files
6
+ from MinIO/S3. Respects all foreign key constraints by deleting in the
7
+ correct order (deepest child tables first, parent last).
8
+
9
+ Runs safely alongside a live Airbyte deployment โ€” only deletes completed
10
+ jobs (SUCCEEDED / FAILED / CANCELLED), never touches RUNNING or PENDING.
11
+
12
+ Environment variables (all sourced from K8s secrets/configmaps):
13
+ Required:
14
+ DATABASE_HOST - PostgreSQL host
15
+ DATABASE_PORT - PostgreSQL port (default: 5432)
16
+ DATABASE_DB - Database name
17
+ DATABASE_USER - Database username
18
+ DATABASE_PASSWORD - Database password
19
+ MINIO_ENDPOINT - MinIO endpoint URL (e.g. http://minio.minio.svc.cluster.local)
20
+ MINIO_ACCESS_KEY - MinIO / S3 access key
21
+ MINIO_SECRET_KEY - MinIO / S3 secret key
22
+ STORAGE_BUCKET_LOG - Bucket containing job logs
23
+
24
+ Optional:
25
+ RETENTION_DAYS - Delete jobs older than N days (default: 92)
26
+ BATCH_SIZE - Records per DB transaction (default: 100)
27
+ BATCH_SLEEP_SECONDS - Sleep between batches to reduce DB pressure (default: 2)
28
+ DRY_RUN - If "true", log actions but do NOT delete (default: true)
29
+ LOG_LEVEL - DEBUG / INFO / WARNING (default: INFO)
30
+ """
31
+
32
+ import os
33
+ import sys
34
+ import time
35
+ import logging
36
+ from datetime import datetime, timezone, timedelta
37
+ from dataclasses import dataclass, field
38
+ from typing import Optional
39
+
40
+ import psycopg2
41
+ import psycopg2.extras
42
+ import boto3
43
+ import botocore
44
+ from botocore.client import Config as BotocoreConfig
45
+ from rich.console import Console
46
+ from rich.logging import RichHandler
47
+ from rich.table import Table
48
+ from rich.panel import Panel
49
+ from rich import box
50
+
51
+ # ---------------------------------------------------------------------------
52
+ # Logging setup
53
+ # ---------------------------------------------------------------------------
54
+
55
+ LOG_LEVEL = os.environ.get("LOG_LEVEL", "INFO").upper()
56
+
57
+ logging.basicConfig(
58
+ level=LOG_LEVEL,
59
+ format="%(message)s",
60
+ datefmt="[%X]",
61
+ handlers=[RichHandler(rich_tracebacks=True, markup=True)],
62
+ )
63
+ log = logging.getLogger("airbyte-cleanup")
64
+ console = Console()
65
+
66
+ # ---------------------------------------------------------------------------
67
+ # Configuration
68
+ # ---------------------------------------------------------------------------
69
+
70
+ def _require_env(key: str) -> str:
71
+ val = os.environ.get(key, "").strip()
72
+ if not val:
73
+ log.error(f"โŒ Required environment variable [bold]{key}[/bold] is not set")
74
+ sys.exit(1)
75
+ return val
76
+
77
+
78
+ @dataclass
79
+ class Config:
80
+ # Database
81
+ db_host: str = field(default_factory=lambda: _require_env("DATABASE_HOST"))
82
+ db_port: int = field(default_factory=lambda: int(os.environ.get("DATABASE_PORT", "5432")))
83
+ db_name: str = field(default_factory=lambda: _require_env("DATABASE_DB"))
84
+ db_user: str = field(default_factory=lambda: _require_env("DATABASE_USER"))
85
+ db_password: str = field(default_factory=lambda: _require_env("DATABASE_PASSWORD"))
86
+
87
+ # MinIO / S3
88
+ minio_endpoint: str = field(default_factory=lambda: _require_env("MINIO_ENDPOINT"))
89
+ minio_access_key: str = field(default_factory=lambda: _require_env("MINIO_ACCESS_KEY"))
90
+ minio_secret_key: str = field(default_factory=lambda: _require_env("MINIO_SECRET_KEY"))
91
+ log_bucket: str = field(default_factory=lambda: _require_env("STORAGE_BUCKET_LOG"))
92
+
93
+ # Cleanup behaviour
94
+ retention_days: int = field(default_factory=lambda: int(os.environ.get("RETENTION_DAYS", "92")))
95
+ batch_size: int = field(default_factory=lambda: int(os.environ.get("BATCH_SIZE", "100")))
96
+ batch_sleep: float = field(default_factory=lambda: float(os.environ.get("BATCH_SLEEP_SECONDS", "2")))
97
+ dry_run: bool = field(default_factory=lambda: os.environ.get("DRY_RUN", "true").lower() == "true")
98
+
99
+ # ---------------------------------------------------------------------------
100
+ # Stats tracking
101
+ # ---------------------------------------------------------------------------
102
+
103
+ @dataclass
104
+ class CleanupStats:
105
+ jobs_deleted: int = 0
106
+ attempts_deleted: int = 0
107
+ sync_stats_deleted: int = 0
108
+ stream_stats_deleted: int = 0
109
+ stream_attempt_metadata_deleted: int = 0
110
+ normalization_summaries_deleted: int = 0
111
+ stream_statuses_deleted: int = 0
112
+ retry_states_deleted: int = 0
113
+ connection_timeline_events_deleted: int = 0
114
+ observability_jobs_stats_deleted: int = 0
115
+ observability_stream_stats_deleted: int = 0
116
+ workloads_deleted: int = 0
117
+ workload_queue_deleted: int = 0
118
+ workload_label_deleted: int = 0
119
+ dataplane_heartbeat_log_deleted: int = 0
120
+ minio_objects_deleted: int = 0
121
+ minio_objects_failed: int = 0
122
+ minio_orphans_deleted: int = 0
123
+ minio_orphans_failed: int = 0
124
+ batches_processed: int = 0
125
+ errors: list = field(default_factory=list)
126
+
127
+ # ---------------------------------------------------------------------------
128
+ # Database helpers
129
+ # ---------------------------------------------------------------------------
130
+
131
+ def get_db_connection(cfg: Config):
132
+ conn = psycopg2.connect(
133
+ host=cfg.db_host,
134
+ port=cfg.db_port,
135
+ dbname=cfg.db_name,
136
+ user=cfg.db_user,
137
+ password=cfg.db_password,
138
+ connect_timeout=10,
139
+ )
140
+ # Detect PgBouncer by querying its version โ€” vanilla Postgres will raise an error
141
+ try:
142
+ with conn.cursor() as cur:
143
+ cur.execute("SHOW pgbouncer_version")
144
+ conn.rollback()
145
+ log.info(" ๐Ÿ”€ PgBouncer detected โ€” statement_timeout will be skipped (not supported by pooler)")
146
+ except psycopg2.Error:
147
+ conn.rollback()
148
+ # Vanilla Postgres โ€” apply statement timeout as a safety net (60s per statement)
149
+ try:
150
+ with conn.cursor() as cur:
151
+ cur.execute("SET statement_timeout = 60000")
152
+ conn.commit()
153
+ log.debug(" โฑ๏ธ statement_timeout = 60s applied")
154
+ except psycopg2.Error as e:
155
+ conn.rollback()
156
+ log.warning(f" โš ๏ธ Could not set statement_timeout (non-fatal): {e}")
157
+ return conn
158
+
159
+
160
+ def table_exists(cur, table_name: str) -> bool:
161
+ cur.execute(
162
+ "SELECT EXISTS(SELECT 1 FROM information_schema.tables WHERE table_name = %s)",
163
+ (table_name,),
164
+ )
165
+ return cur.fetchone()[0]
166
+
167
+ # ---------------------------------------------------------------------------
168
+ # MinIO / S3 helper
169
+ # ---------------------------------------------------------------------------
170
+
171
+ def get_s3_client(cfg: Config):
172
+ return boto3.client(
173
+ "s3",
174
+ endpoint_url=cfg.minio_endpoint,
175
+ aws_access_key_id=cfg.minio_access_key,
176
+ aws_secret_access_key=cfg.minio_secret_key,
177
+ config=BotocoreConfig(signature_version="s3v4"),
178
+ region_name="us-east-1", # required by boto3, ignored by MinIO
179
+ )
180
+
181
+
182
+ def delete_minio_logs(
183
+ s3,
184
+ cfg: Config,
185
+ log_paths: list[str],
186
+ stats: CleanupStats,
187
+ ) -> None:
188
+ """Delete log files from MinIO bucket in batches of 1000 (S3 API limit)."""
189
+ if not log_paths:
190
+ return
191
+
192
+ prefix = "job-logging"
193
+ # log_path in DB may have a leading slash (e.g. /workspace/123/0/logs.log)
194
+ # strip it to avoid double-slash keys like job-logging//workspace/...
195
+ objects = [{"Key": f"{prefix}/{p.lstrip('/')}"} for p in log_paths if p]
196
+
197
+ # boto3 delete_objects accepts max 1000 per call
198
+ chunk_size = 1000
199
+ for i in range(0, len(objects), chunk_size):
200
+ chunk = objects[i : i + chunk_size]
201
+ if cfg.dry_run:
202
+ log.info(f" ๐Ÿชฃ [DRY-RUN] Would delete {len(chunk)} MinIO objects")
203
+ stats.minio_objects_deleted += len(chunk)
204
+ continue
205
+ try:
206
+ resp = s3.delete_objects(
207
+ Bucket=cfg.log_bucket,
208
+ Delete={"Objects": chunk, "Quiet": True},
209
+ )
210
+ deleted_count = len(chunk) - len(resp.get("Errors", []))
211
+ stats.minio_objects_deleted += deleted_count
212
+ for err in resp.get("Errors", []):
213
+ log.warning(f" โš ๏ธ MinIO delete error: {err['Key']} โ†’ {err['Message']}")
214
+ stats.minio_objects_failed += 1
215
+ except botocore.exceptions.ClientError as e:
216
+ log.error(f" โŒ MinIO batch delete failed: {e}")
217
+ stats.minio_objects_failed += len(chunk)
218
+ stats.errors.append(str(e))
219
+
220
+ # ---------------------------------------------------------------------------
221
+ # Core cleanup logic
222
+ # ---------------------------------------------------------------------------
223
+
224
+ def cleanup_jobs(conn, s3, cfg: Config, stats: CleanupStats, cutoff: datetime) -> None:
225
+ """
226
+ Delete jobs older than cutoff in batches.
227
+ Only deletes SUCCEEDED / FAILED / CANCELLED jobs โ€” never touches active ones.
228
+ FK deletion order: deepest child first, parent (jobs) last.
229
+ Matches Airbyte's DbPrune.pruneJobBatch() logic exactly.
230
+ """
231
+ log.info(f"๐Ÿ—„๏ธ Starting DB job cleanup (cutoff: {cutoff.date()}, batch: {cfg.batch_size})")
232
+
233
+ if cfg.dry_run:
234
+ # In dry-run mode: count once and report โ€” do NOT loop (nothing is deleted
235
+ # so the same rows would be returned on every iteration โ†’ infinite loop)
236
+ with conn.cursor() as cur:
237
+ cur.execute(
238
+ """
239
+ SELECT COUNT(*) FROM jobs
240
+ WHERE created_at < %s
241
+ AND status IN ('succeeded', 'failed', 'cancelled')
242
+ """,
243
+ (cutoff,),
244
+ )
245
+ eligible_jobs = cur.fetchone()[0]
246
+
247
+ cur.execute(
248
+ """
249
+ SELECT COUNT(*) FROM attempts a
250
+ JOIN jobs j ON j.id = a.job_id
251
+ WHERE j.created_at < %s
252
+ AND j.status IN ('succeeded', 'failed', 'cancelled')
253
+ """,
254
+ (cutoff,),
255
+ )
256
+ eligible_attempts = cur.fetchone()[0]
257
+
258
+ cur.execute(
259
+ """
260
+ SELECT COUNT(*) FROM attempts a
261
+ JOIN jobs j ON j.id = a.job_id
262
+ WHERE j.created_at < %s
263
+ AND j.status IN ('succeeded', 'failed', 'cancelled')
264
+ AND a.log_path IS NOT NULL
265
+ """,
266
+ (cutoff,),
267
+ )
268
+ eligible_log_paths = cur.fetchone()[0]
269
+
270
+ log.info(
271
+ f" ๐Ÿ” [DRY-RUN] Would delete:"
272
+ f" jobs={eligible_jobs}"
273
+ f" attempts={eligible_attempts}"
274
+ f" minio_log_objects={eligible_log_paths}"
275
+ )
276
+ stats.jobs_deleted = eligible_jobs
277
+ stats.attempts_deleted = eligible_attempts
278
+ stats.minio_objects_deleted = eligible_log_paths
279
+ return
280
+
281
+ # Live mode โ€” loop in batches until no more eligible jobs
282
+ while True:
283
+ with conn:
284
+ cur = conn.cursor()
285
+
286
+ # Step 1 โ€” identify a batch of eligible jobs
287
+ cur.execute(
288
+ """
289
+ SELECT id FROM jobs
290
+ WHERE created_at < %s
291
+ AND status IN ('succeeded', 'failed', 'cancelled')
292
+ ORDER BY created_at ASC
293
+ LIMIT %s
294
+ """,
295
+ (cutoff, cfg.batch_size),
296
+ )
297
+ job_ids = [row[0] for row in cur.fetchall()]
298
+
299
+ if not job_ids:
300
+ log.info(" โœ… No more eligible jobs found")
301
+ return
302
+
303
+ stats.batches_processed += 1
304
+ log.info(f" ๐Ÿ“ฆ Batch {stats.batches_processed}: {len(job_ids)} jobs")
305
+
306
+ # Step 2 โ€” collect attempt IDs + log_paths before deleting
307
+ cur.execute(
308
+ "SELECT id, log_path FROM attempts WHERE job_id = ANY(%s)",
309
+ (job_ids,),
310
+ )
311
+ attempt_rows = cur.fetchall()
312
+ attempt_ids = [r[0] for r in attempt_rows]
313
+ log_paths = [r[1] for r in attempt_rows if r[1]]
314
+
315
+ log.debug(f" attempts={len(attempt_ids)}, log_paths={len(log_paths)}")
316
+
317
+ # Step 3 โ€” delete child tables of attempts (FK โ†’ attempts.id)
318
+ if attempt_ids:
319
+ for table in [
320
+ "sync_stats",
321
+ "stream_stats",
322
+ "stream_attempt_metadata",
323
+ "normalization_summaries",
324
+ ]:
325
+ cur.execute(
326
+ f"DELETE FROM {table} WHERE attempt_id = ANY(%s)",
327
+ (attempt_ids,),
328
+ )
329
+ n = cur.rowcount
330
+ log.debug(f" {table}: -{n}")
331
+ attr = f"{table}_deleted"
332
+ setattr(stats, attr, getattr(stats, attr, 0) + n)
333
+
334
+ cur.execute("DELETE FROM attempts WHERE job_id = ANY(%s)", (job_ids,))
335
+ stats.attempts_deleted += cur.rowcount
336
+
337
+ # Step 4 โ€” delete child tables of jobs (FK โ†’ jobs.id)
338
+ cur.execute("DELETE FROM stream_statuses WHERE job_id = ANY(%s)", (job_ids,))
339
+ stats.stream_statuses_deleted += cur.rowcount
340
+
341
+ cur.execute("DELETE FROM retry_states WHERE job_id = ANY(%s)", (job_ids,))
342
+ stats.retry_states_deleted += cur.rowcount
343
+
344
+ if table_exists(cur, "data_worker_usage_reservation"):
345
+ cur.execute(
346
+ "DELETE FROM data_worker_usage_reservation WHERE job_id = ANY(%s)",
347
+ (job_ids,),
348
+ )
349
+
350
+ # Airbyte 2.x keeps per-job observability rows without a FK to jobs.
351
+ for table in ("observability_stream_stats", "observability_jobs_stats"):
352
+ if table_exists(cur, table):
353
+ cur.execute(f"DELETE FROM {table} WHERE job_id = ANY(%s)", (job_ids,))
354
+ attr = f"{table}_deleted"
355
+ setattr(stats, attr, getattr(stats, attr) + cur.rowcount)
356
+
357
+ # Step 4b โ€” delete connection_timeline_event rows that reference these
358
+ # jobs via summary->>'jobId'. No FK exists, but leaving them causes the
359
+ # UI to call get_without_logs for a deleted job โ†’ HTTP 500.
360
+ job_ids_str = [str(j) for j in job_ids]
361
+ cur.execute(
362
+ """
363
+ DELETE FROM connection_timeline_event
364
+ WHERE (summary->>'jobId')::bigint = ANY(%s::bigint[])
365
+ """,
366
+ (job_ids_str,),
367
+ )
368
+ n = cur.rowcount
369
+ stats.connection_timeline_events_deleted += n
370
+ log.debug(f" connection_timeline_event (job-linked): -{n}")
371
+
372
+ # Step 5 โ€” delete jobs (parent, last)
373
+ cur.execute("DELETE FROM jobs WHERE id = ANY(%s)", (job_ids,))
374
+ stats.jobs_deleted += cur.rowcount
375
+
376
+ # Step 6 โ€” clean MinIO logs for this batch (outside DB transaction)
377
+ if log_paths:
378
+ delete_minio_logs(s3, cfg, log_paths, stats)
379
+
380
+ log.info(f" โœ… Batch {stats.batches_processed} done")
381
+
382
+ if cfg.batch_sleep > 0:
383
+ time.sleep(cfg.batch_sleep)
384
+
385
+
386
+ def cleanup_connection_timeline_events(conn, cfg: Config, stats: CleanupStats, cutoff: datetime) -> None:
387
+ """
388
+ connection_timeline_event has no FK relations โ€” standalone table.
389
+ Safe to delete in large batches with no sleep between them.
390
+ Airbyte deletes this in a single statement; we batch at 5000 to avoid
391
+ long-running transactions while still being fast.
392
+ """
393
+ log.info("๐Ÿ—„๏ธ Cleaning connection_timeline_event table")
394
+
395
+ if cfg.dry_run:
396
+ with conn.cursor() as cur:
397
+ cur.execute(
398
+ "SELECT COUNT(*) FROM connection_timeline_event WHERE created_at < %s",
399
+ (cutoff,),
400
+ )
401
+ count = cur.fetchone()[0]
402
+ log.info(f" ๐Ÿ” [DRY-RUN] Would delete {count} connection_timeline_event rows")
403
+ stats.connection_timeline_events_deleted = count
404
+ return
405
+
406
+ batch_num = 0
407
+ last_log_at = time.monotonic()
408
+ LOG_INTERVAL_SECS = 30 # emit a progress line at least every 30 s
409
+
410
+ while True:
411
+ with conn:
412
+ cur = conn.cursor()
413
+ cur.execute(
414
+ """
415
+ DELETE FROM connection_timeline_event
416
+ WHERE id IN (
417
+ SELECT id FROM connection_timeline_event
418
+ WHERE created_at < %s
419
+ LIMIT %s
420
+ )
421
+ """,
422
+ (cutoff, cfg.batch_size),
423
+ )
424
+ deleted = cur.rowcount
425
+ stats.connection_timeline_events_deleted += deleted
426
+
427
+ if deleted == 0:
428
+ break
429
+
430
+ batch_num += 1
431
+ now = time.monotonic()
432
+ if now - last_log_at >= LOG_INTERVAL_SECS:
433
+ log.info(
434
+ f" โณ connection_timeline_event: batch {batch_num}"
435
+ f" โ€” {stats.connection_timeline_events_deleted} rows deleted so farโ€ฆ"
436
+ )
437
+ last_log_at = now
438
+
439
+ if cfg.batch_sleep > 0:
440
+ time.sleep(cfg.batch_sleep)
441
+
442
+ log.info(f" โœ… Deleted {stats.connection_timeline_events_deleted} connection_timeline_event rows")
443
+
444
+ # ---------------------------------------------------------------------------
445
+ # Workloads โ€” one row per launched pod (sync, check, discover, spec).
446
+ # These are the largest tables on a busy instance and Airbyte never prunes
447
+ # them. Only finished workloads are removed.
448
+ # ---------------------------------------------------------------------------
449
+
450
+ WORKLOAD_TERMINAL_STATUSES = ("success", "failure", "cancelled")
451
+
452
+
453
+ def cleanup_workloads(conn, cfg: Config, stats: CleanupStats, cutoff: datetime) -> None:
454
+ with conn.cursor() as cur:
455
+ if not table_exists(cur, "workload"):
456
+ log.info(" โญ๏ธ workload table not present โ€” skipping")
457
+ return
458
+ has_queue = table_exists(cur, "workload_queue")
459
+ has_label = table_exists(cur, "workload_label")
460
+ conn.commit()
461
+
462
+ log.info("๐Ÿ—„๏ธ Cleaning finished workloads")
463
+ terminal = list(WORKLOAD_TERMINAL_STATUSES)
464
+
465
+ if cfg.dry_run:
466
+ with conn.cursor() as cur:
467
+ cur.execute(
468
+ "SELECT COUNT(*) FROM workload WHERE updated_at < %s AND status::text = ANY(%s)",
469
+ (cutoff, terminal),
470
+ )
471
+ count = cur.fetchone()[0]
472
+ log.info(f" ๐Ÿ” [DRY-RUN] Would delete {count} workload rows")
473
+ stats.workloads_deleted = count
474
+ return
475
+
476
+ while True:
477
+ with conn:
478
+ cur = conn.cursor()
479
+ cur.execute(
480
+ """
481
+ SELECT id FROM workload
482
+ WHERE updated_at < %s AND status::text = ANY(%s)
483
+ ORDER BY updated_at ASC
484
+ LIMIT %s
485
+ """,
486
+ (cutoff, terminal, cfg.batch_size),
487
+ )
488
+ workload_ids = [row[0] for row in cur.fetchall()]
489
+ if not workload_ids:
490
+ break
491
+ if has_queue:
492
+ cur.execute("DELETE FROM workload_queue WHERE workload_id = ANY(%s)", (workload_ids,))
493
+ stats.workload_queue_deleted += cur.rowcount
494
+ if has_label:
495
+ cur.execute("DELETE FROM workload_label WHERE workload_id = ANY(%s)", (workload_ids,))
496
+ stats.workload_label_deleted += cur.rowcount
497
+ cur.execute("DELETE FROM workload WHERE id = ANY(%s)", (workload_ids,))
498
+ stats.workloads_deleted += cur.rowcount
499
+
500
+ if cfg.batch_sleep > 0:
501
+ time.sleep(cfg.batch_sleep)
502
+
503
+ log.info(f" โœ… Deleted {stats.workloads_deleted} workload rows")
504
+
505
+
506
+ def cleanup_dataplane_heartbeats(conn, cfg: Config, stats: CleanupStats, cutoff: datetime) -> None:
507
+ with conn.cursor() as cur:
508
+ present = table_exists(cur, "dataplane_heartbeat_log")
509
+ conn.commit()
510
+ if not present:
511
+ return
512
+
513
+ log.info("๐Ÿ—„๏ธ Cleaning dataplane_heartbeat_log table")
514
+ if cfg.dry_run:
515
+ with conn.cursor() as cur:
516
+ cur.execute("SELECT COUNT(*) FROM dataplane_heartbeat_log WHERE created_at < %s", (cutoff,))
517
+ stats.dataplane_heartbeat_log_deleted = cur.fetchone()[0]
518
+ log.info(f" ๐Ÿ” [DRY-RUN] Would delete {stats.dataplane_heartbeat_log_deleted} dataplane_heartbeat_log rows")
519
+ return
520
+
521
+ while True:
522
+ with conn:
523
+ cur = conn.cursor()
524
+ cur.execute(
525
+ """
526
+ DELETE FROM dataplane_heartbeat_log
527
+ WHERE id IN (
528
+ SELECT id FROM dataplane_heartbeat_log
529
+ WHERE created_at < %s
530
+ LIMIT %s
531
+ )
532
+ """,
533
+ (cutoff, cfg.batch_size),
534
+ )
535
+ deleted = cur.rowcount
536
+ stats.dataplane_heartbeat_log_deleted += deleted
537
+ if deleted == 0:
538
+ break
539
+ if cfg.batch_sleep > 0:
540
+ time.sleep(cfg.batch_sleep)
541
+
542
+ log.info(f" โœ… Deleted {stats.dataplane_heartbeat_log_deleted} dataplane_heartbeat_log rows")
543
+
544
+ # ---------------------------------------------------------------------------
545
+ # Orphan MinIO scan โ€” delete log objects older than cutoff by LastModified
546
+ # (no DB lookup needed โ€” works even when DB records are already gone)
547
+ # ---------------------------------------------------------------------------
548
+
549
+ def cleanup_minio_orphans(s3, cfg: Config, stats: CleanupStats, cutoff: datetime) -> None:
550
+ """
551
+ List all objects under job-logging/ in the bucket and delete any whose
552
+ LastModified timestamp is older than the cutoff. This catches orphaned
553
+ objects whose DB records were already deleted in a previous run.
554
+ """
555
+ log.info(f"๐Ÿชฃ Scanning MinIO for orphaned log objects (cutoff: {cutoff.date()})โ€ฆ")
556
+
557
+ prefix = "job-logging/"
558
+ paginator = s3.get_paginator("list_objects_v2")
559
+
560
+ to_delete: list[dict] = []
561
+ scanned = 0
562
+ last_log_at = time.monotonic()
563
+ LOG_INTERVAL_SECS = 30
564
+
565
+ for page in paginator.paginate(Bucket=cfg.log_bucket, Prefix=prefix):
566
+ for obj in page.get("Contents", []):
567
+ scanned += 1
568
+ last_modified = obj["LastModified"]
569
+ # boto3 returns timezone-aware datetime; cutoff is also tz-aware
570
+ if last_modified < cutoff:
571
+ to_delete.append({"Key": obj["Key"]})
572
+
573
+ # Flush in batches of 1000 (S3 API limit)
574
+ if len(to_delete) >= 1000:
575
+ _flush_minio_deletes(s3, cfg, to_delete, stats)
576
+ to_delete = []
577
+
578
+ now = time.monotonic()
579
+ if now - last_log_at >= LOG_INTERVAL_SECS:
580
+ log.info(
581
+ f" โณ MinIO orphan scan: {scanned} objects scanned"
582
+ f", {stats.minio_orphans_deleted} deleted so farโ€ฆ"
583
+ )
584
+ last_log_at = now
585
+
586
+ # Flush remainder
587
+ if to_delete:
588
+ _flush_minio_deletes(s3, cfg, to_delete, stats)
589
+
590
+ log.info(
591
+ f" โœ… MinIO orphan scan complete:"
592
+ f" scanned={scanned}"
593
+ f" deleted={stats.minio_orphans_deleted}"
594
+ f" failed={stats.minio_orphans_failed}"
595
+ + (" [DRY-RUN]" if cfg.dry_run else "")
596
+ )
597
+
598
+
599
+ def _flush_minio_deletes(s3, cfg: Config, objects: list[dict], stats: CleanupStats) -> None:
600
+ if cfg.dry_run:
601
+ log.info(f" ๐Ÿ” [DRY-RUN] Would delete {len(objects)} orphaned MinIO objects")
602
+ stats.minio_orphans_deleted += len(objects)
603
+ return
604
+ try:
605
+ resp = s3.delete_objects(
606
+ Bucket=cfg.log_bucket,
607
+ Delete={"Objects": objects, "Quiet": True},
608
+ )
609
+ deleted = len(objects) - len(resp.get("Errors", []))
610
+ stats.minio_orphans_deleted += deleted
611
+ for err in resp.get("Errors", []):
612
+ log.warning(f" โš ๏ธ MinIO orphan delete error: {err['Key']} โ†’ {err['Message']}")
613
+ stats.minio_orphans_failed += 1
614
+ except botocore.exceptions.ClientError as e:
615
+ log.error(f" โŒ MinIO orphan batch delete failed: {e}")
616
+ stats.minio_orphans_failed += len(objects)
617
+ stats.errors.append(str(e))
618
+
619
+
620
+ # ---------------------------------------------------------------------------
621
+ # Reporting
622
+ # ---------------------------------------------------------------------------
623
+
624
+ def print_summary(cfg: Config, stats: CleanupStats, duration_secs: float) -> None:
625
+ mode = "[bold yellow]DRY-RUN[/bold yellow]" if cfg.dry_run else "[bold green]LIVE[/bold green]"
626
+
627
+ table = Table(box=box.ROUNDED, show_header=True, header_style="bold cyan")
628
+ table.add_column("Table / Resource", style="dim")
629
+ table.add_column("Deleted", justify="right", style="bold")
630
+
631
+ rows = [
632
+ ("jobs", stats.jobs_deleted),
633
+ ("attempts", stats.attempts_deleted),
634
+ ("sync_stats", stats.sync_stats_deleted),
635
+ ("stream_stats", stats.stream_stats_deleted),
636
+ ("stream_attempt_metadata", stats.stream_attempt_metadata_deleted),
637
+ ("normalization_summaries", stats.normalization_summaries_deleted),
638
+ ("stream_statuses", stats.stream_statuses_deleted),
639
+ ("retry_states", stats.retry_states_deleted),
640
+ ("connection_timeline_event", stats.connection_timeline_events_deleted),
641
+ ("observability_jobs_stats", stats.observability_jobs_stats_deleted),
642
+ ("observability_stream_stats", stats.observability_stream_stats_deleted),
643
+ ("workload", stats.workloads_deleted),
644
+ ("workload_queue", stats.workload_queue_deleted),
645
+ ("workload_label", stats.workload_label_deleted),
646
+ ("dataplane_heartbeat_log", stats.dataplane_heartbeat_log_deleted),
647
+ ("MinIO log objects (DB-linked)", stats.minio_objects_deleted),
648
+ ("MinIO orphaned objects", stats.minio_orphans_deleted),
649
+ ]
650
+ for name, count in rows:
651
+ if count > 0:
652
+ table.add_row(name, str(count))
653
+
654
+ if stats.minio_objects_failed:
655
+ table.add_row("[red]MinIO failures[/red]", f"[red]{stats.minio_objects_failed}[/red]")
656
+ if stats.minio_orphans_failed:
657
+ table.add_row("[red]MinIO orphan failures[/red]", f"[red]{stats.minio_orphans_failed}[/red]")
658
+
659
+ console.print(
660
+ Panel(
661
+ table,
662
+ title=f"๐Ÿงน Airbyte Cleanup Summary โ€” {mode}",
663
+ subtitle=f"retention={cfg.retention_days}d batches={stats.batches_processed} duration={duration_secs:.1f}s",
664
+ border_style="green" if not cfg.dry_run else "yellow",
665
+ )
666
+ )
667
+
668
+ if stats.errors:
669
+ console.print("[bold red]Errors encountered:[/bold red]")
670
+ for e in stats.errors:
671
+ console.print(f" โŒ {e}")
672
+
673
+ if cfg.dry_run:
674
+ console.print(
675
+ "\n[bold yellow]โš ๏ธ DRY-RUN mode โ€” no data was deleted.[/bold yellow]\n"
676
+ "Set [bold]DRY_RUN=false[/bold] to perform actual cleanup."
677
+ )
678
+
679
+ # ---------------------------------------------------------------------------
680
+ # Entry point
681
+ # ---------------------------------------------------------------------------
682
+
683
+ def main() -> None:
684
+ cfg = Config()
685
+ stats = CleanupStats()
686
+ started_at = time.monotonic()
687
+
688
+ mode_label = "DRY-RUN" if cfg.dry_run else "LIVE"
689
+ console.print(
690
+ Panel(
691
+ f"๐Ÿš€ Airbyte Cleanup starting\n"
692
+ f" Mode: [bold]{'[yellow]' + mode_label + '[/yellow]' if cfg.dry_run else '[green]' + mode_label + '[/green]'}[/bold]\n"
693
+ f" Retention: [bold]{cfg.retention_days} days[/bold]\n"
694
+ f" Batch: [bold]{cfg.batch_size}[/bold] records (sleep {cfg.batch_sleep}s between batches)\n"
695
+ f" DB: [bold]{cfg.db_host}:{cfg.db_port}/{cfg.db_name}[/bold]\n"
696
+ f" MinIO: [bold]{cfg.minio_endpoint}[/bold] bucket=[bold]{cfg.log_bucket}[/bold]",
697
+ border_style="blue",
698
+ )
699
+ )
700
+
701
+ cutoff = datetime.now(timezone.utc) - timedelta(days=cfg.retention_days)
702
+ log.info(f"๐Ÿ• Cutoff date: {cutoff.isoformat()}")
703
+
704
+ # Connect to PostgreSQL
705
+ log.info("๐Ÿ”Œ Connecting to PostgreSQLโ€ฆ")
706
+ try:
707
+ conn = get_db_connection(cfg)
708
+ except Exception as e:
709
+ log.error(f"โŒ PostgreSQL connection failed: {e}")
710
+ sys.exit(1)
711
+ log.info(" โœ… Connected to PostgreSQL")
712
+
713
+ # Connect to MinIO
714
+ log.info("๐Ÿ”Œ Connecting to MinIOโ€ฆ")
715
+ try:
716
+ s3 = get_s3_client(cfg)
717
+ s3.head_bucket(Bucket=cfg.log_bucket)
718
+ except Exception as e:
719
+ log.error(f"โŒ MinIO connection / bucket check failed: {e}")
720
+ conn.close()
721
+ sys.exit(1)
722
+ log.info(f" โœ… MinIO bucket [bold]{cfg.log_bucket}[/bold] reachable")
723
+
724
+ try:
725
+ # Run timeline cleanup FIRST โ€” removes old events by date so the UI
726
+ # never shows events that reference jobs we are about to delete.
727
+ # cleanup_jobs() also deletes timeline events linked to each job batch
728
+ # (step 4b), covering events within the retention window that still
729
+ # reference an out-of-retention job.
730
+ cleanup_connection_timeline_events(conn, cfg, stats, cutoff)
731
+ cleanup_jobs(conn, s3, cfg, stats, cutoff)
732
+ cleanup_workloads(conn, cfg, stats, cutoff)
733
+ cleanup_dataplane_heartbeats(conn, cfg, stats, cutoff)
734
+ cleanup_minio_orphans(s3, cfg, stats, cutoff)
735
+ except Exception as e:
736
+ log.exception(f"โŒ Unexpected error during cleanup: {e}")
737
+ stats.errors.append(str(e))
738
+ finally:
739
+ conn.close()
740
+
741
+ duration = time.monotonic() - started_at
742
+ print_summary(cfg, stats, duration)
743
+
744
+ if stats.errors:
745
+ sys.exit(1)
746
+
747
+
748
+ if __name__ == "__main__":
749
+ main()