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,1098 @@
1
+ import os
2
+ import re
3
+ import sys
4
+ import json
5
+ import logging
6
+ import argparse
7
+ import tempfile
8
+ import shutil
9
+ import subprocess
10
+ from typing import Any
11
+ from jinja2 import Environment, FileSystemLoader
12
+ from cli.state import vault_structure_path
13
+
14
+ AIRFLOW_VERSIONED_TEMPLATE = re.compile(r"^(.+)_template_airflow_(\d+)\.x$")
15
+
16
+ # Configure logging
17
+ logging.basicConfig(
18
+ level=logging.INFO,
19
+ format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
20
+ handlers=[
21
+ logging.StreamHandler(sys.stdout)
22
+ ]
23
+ )
24
+ logger = logging.getLogger('customer_data_platform_repository_operator')
25
+
26
+ GENERATED_REPOS_DIR = os.path.join("cli", "state", "generated")
27
+
28
+ class CustomerDataPlatformRepositoryOperator:
29
+ def __init__(self,
30
+ customer: str,
31
+ domain: str,
32
+ git_provider: str | None = None,
33
+ repo_authentication: str = "deploy_keys",
34
+ data_orchestrator_repo_url: str | None = None,
35
+ data_model_repo_url: str | None = None,
36
+ data_orchestrator_repo_private_key: str | None = None,
37
+ data_model_repo_private_key: str | None = None,
38
+ global_access_token: str | None = None,
39
+ data_orchestrator_repo_access_token: str | None = None,
40
+ data_model_repo_access_token: str | None = None,
41
+ argo_server_url_type: str = "internal",
42
+ argo_cli_version: str = "v4.1.7",
43
+ cicd_workflows_template_version: str = "latest",
44
+ airflow_version: str = "3",
45
+ dry_run: bool = False):
46
+ """Initialize the repository operator with configuration parameters."""
47
+
48
+ self.customer = customer
49
+ self.domain = domain
50
+ self.git_provider = git_provider
51
+ self.repo_authentication = repo_authentication
52
+ self.data_orchestrator_repo_url = data_orchestrator_repo_url
53
+ self.data_model_repo_url = data_model_repo_url
54
+ self.data_orchestrator_repo_private_key = data_orchestrator_repo_private_key
55
+ self.data_model_repo_private_key = data_model_repo_private_key
56
+ self.global_access_token = global_access_token
57
+ self.data_orchestrator_repo_access_token = data_orchestrator_repo_access_token
58
+ self.data_model_repo_access_token = data_model_repo_access_token
59
+ self.dry_run = dry_run
60
+
61
+ # Initialize public key attributes (will be loaded from vault if needed)
62
+ self.data_orchestrator_repo_public_key = None
63
+ self.data_model_repo_public_key = None
64
+ self.argo_server_url_type = argo_server_url_type if argo_server_url_type else "internal"
65
+ self.argo_cli_version = argo_cli_version
66
+ self.cicd_workflows_template_version = cicd_workflows_template_version
67
+ self.airflow_major = str(airflow_version).strip().lstrip("vV").split(".")[0]
68
+
69
+ self.secret_file = str(vault_structure_path(customer))
70
+ if not os.path.exists(self.secret_file):
71
+ raise FileNotFoundError(f"Secret file not found: {self.secret_file}")
72
+
73
+ # Set up temporary directory for repository operations. A dry run keeps the
74
+ # rendered repositories in a known folder for review instead.
75
+ if self.dry_run:
76
+ self.temp_dir = os.path.join(GENERATED_REPOS_DIR, f"{self.customer}_repos")
77
+ shutil.rmtree(self.temp_dir, ignore_errors=True)
78
+ os.makedirs(self.temp_dir)
79
+ else:
80
+ self.temp_dir = tempfile.mkdtemp(prefix=f"{self.customer}_repos_")
81
+ logger.info(f"Created working directory: {self.temp_dir}")
82
+
83
+ # Load secrets if not provided
84
+ self._load_secrets_if_needed()
85
+
86
+ def __del__(self):
87
+ """Cleanup temporary directory on object destruction."""
88
+ try:
89
+ if getattr(self, 'dry_run', False):
90
+ return
91
+ if hasattr(self, 'temp_dir') and os.path.exists(self.temp_dir):
92
+ shutil.rmtree(self.temp_dir)
93
+ logger.info(f"Cleaned up temporary directory: {self.temp_dir}")
94
+ except Exception as e:
95
+ logger.error(f"Error cleaning up temporary directory: {e}")
96
+
97
+ def _load_secrets_if_needed(self) -> None:
98
+ """Load required secrets from vault if not provided."""
99
+ try:
100
+ # Load git provider if not provided
101
+ if not self.git_provider:
102
+ self.git_provider = self.get_secret_from_vault(
103
+ "GIT_PROVIDER", "/data-cicd-workflows/customer-cicd-variables/"
104
+ )
105
+ if not self.git_provider:
106
+ self.git_provider = "gitlab" # Default to gitlab if not found in vault
107
+ logger.info(f"Using git provider from vault: {self.git_provider}")
108
+
109
+ # Load repository URLs if not provided
110
+ if not self.data_orchestrator_repo_url:
111
+ self.data_orchestrator_repo_url = self.get_secret_from_vault(
112
+ "dag_repo_url", "/data-platform-runner/git_provider_repo_urls/"
113
+ )
114
+ if not self.data_model_repo_url:
115
+ self.data_model_repo_url = self.get_secret_from_vault(
116
+ "data_repo_url", "/data-platform-runner/git_provider_repo_urls/"
117
+ )
118
+
119
+ # Load authentication credentials based on method
120
+ if self.repo_authentication == "deploy_keys":
121
+ if not self.data_orchestrator_repo_private_key:
122
+ self.data_orchestrator_repo_private_key = self.get_secret_from_vault(
123
+ "private", "/data-platform-runner/ssh-keys-data-orchestrator-repo/"
124
+ )
125
+ if not self.data_model_repo_private_key:
126
+ self.data_model_repo_private_key = self.get_secret_from_vault(
127
+ "private", "/data-platform-runner/ssh-keys-data-model-repo/"
128
+ )
129
+
130
+ # Validate that SSH keys were loaded
131
+ if not self.data_orchestrator_repo_private_key:
132
+ raise ValueError("Failed to load orchestrator SSH private key from vault")
133
+ if not self.data_model_repo_private_key:
134
+ raise ValueError("Failed to load data model SSH private key from vault")
135
+
136
+ logger.info("SSH private keys loaded successfully from vault")
137
+ else: # access_token
138
+ if not self.global_access_token:
139
+ self.global_access_token = self.get_secret_from_vault(
140
+ "PRIVATE-TOKEN", "/data-platform-runner/ci-access-tokens/"
141
+ )
142
+ if not self.data_orchestrator_repo_access_token:
143
+ self.data_orchestrator_repo_access_token = self.global_access_token
144
+ if not self.data_model_repo_access_token:
145
+ self.data_model_repo_access_token = self.global_access_token
146
+
147
+ # Load public keys for deploy keys
148
+ if not self.data_model_repo_public_key:
149
+ self.data_model_repo_public_key = self.get_secret_from_vault(
150
+ "public", "/data-platform-runner/ssh-keys-data-model-repo/"
151
+ )
152
+ if not self.data_orchestrator_repo_public_key:
153
+ self.data_orchestrator_repo_public_key = self.get_secret_from_vault(
154
+ "public", "/data-platform-runner/ssh-keys-data-orchestrator-repo/"
155
+ )
156
+
157
+ # Display deploy keys information immediately after loading
158
+ # Deploy keys are ALWAYS required for data orchestrator service regardless of authentication method
159
+ if self.data_orchestrator_repo_public_key and self.data_model_repo_public_key:
160
+ # Use both logger and click.echo to ensure visibility
161
+ import click
162
+
163
+ deploy_keys_message = f"""
164
+ {"="*80}
165
+ 🔑 DEPLOY KEYS CONFIGURATION REQUIRED
166
+ {"="*80}
167
+
168
+ ⚠️ ATTENTION: Deploy keys are MANDATORY for the Data Orchestrator repository
169
+ Even if 'access_token' was selected, deploy keys are required for DAG execution.
170
+ The Airflow service pulls DAGs from the repository using SSH keys.
171
+
172
+ You need to add the following deploy keys to your GitLab repositories:
173
+
174
+ 📁 DATA ORCHESTRATOR REPOSITORY (REQUIRED for Airflow DAG execution):
175
+ Repository: {self.data_orchestrator_repo_url}
176
+ Deploy Key Title: Fast2.Dev Data Orchestrator Deploy Key
177
+ Public Key:
178
+ {self.data_orchestrator_repo_public_key}
179
+
180
+ 📁 DATA MODEL REPOSITORY:
181
+ Repository: {self.data_model_repo_url}
182
+ Deploy Key Title: Fast2.Dev Data Model Deploy Key
183
+ Public Key:
184
+ {self.data_model_repo_public_key}
185
+
186
+ 📋 INSTRUCTIONS:
187
+ 1. Go to each repository in GitLab
188
+ 2. Navigate to Settings > Repository > Deploy Keys
189
+ 3. Click 'Add deploy key'
190
+ 4. Enter the title and paste the corresponding public key
191
+ 5. Check 'Grant write permissions to this key' if needed
192
+ 6. Click 'Add key'
193
+
194
+ ⚠️ CRITICAL: The Data Orchestrator repository deploy key is MANDATORY
195
+ The Airflow service requires SSH access to pull DAGs from the repository.
196
+
197
+ {"="*80}
198
+ """
199
+
200
+ # Display using click.echo for CLI visibility
201
+ click.echo(deploy_keys_message)
202
+
203
+ # Also log for file logging
204
+ logger.info(deploy_keys_message)
205
+
206
+ # Create CI/CD Argo Server URL based on type
207
+ if self.argo_server_url_type == "internal":
208
+ self.argo_server_url = "data-platform-argo-workflows-server.data-cicd-workflows:2746"
209
+ elif self.argo_server_url_type == "external":
210
+ self.argo_server_url = f"https://workflows.{self.customer}.{self.domain}:443"
211
+ else:
212
+ raise ValueError(f"Invalid argo_server_url_type: {self.argo_server_url_type}")
213
+
214
+ except Exception as e:
215
+ logger.error(f"Failed to load secrets: {str(e)}")
216
+ raise
217
+
218
+ def _get_template_paths(self, repo_type: str) -> dict[str, str]:
219
+ """Get template paths for the given repository type."""
220
+ base_path = "utils/templates/git_repo_templates"
221
+
222
+ # Map fast2dev to gitlab since fast2dev is just a self-hosted GitLab instance
223
+ git_provider = "gitlab" if self.git_provider == "fast2dev" else self.git_provider
224
+
225
+ paths = {
226
+ 'base': os.path.join(base_path, repo_type),
227
+ 'repository_structure': os.path.join(base_path, repo_type, "repository_structure"),
228
+ 'git_provider': os.path.join(base_path, repo_type, git_provider)
229
+ }
230
+
231
+ # Validate paths exist
232
+ for path_type, path in paths.items():
233
+ if not os.path.exists(path):
234
+ if path_type == 'repository_structure':
235
+ raise FileNotFoundError(f"Required repository structure template not found: {path}")
236
+ elif path_type == 'git_provider':
237
+ logger.warning(f"{path_type} template path not found: {path} - this is optional and will be skipped")
238
+ else:
239
+ logger.warning(f"{path_type} template path not found: {path}")
240
+
241
+ return paths
242
+
243
+ def _copy_repository_structure(self, repo_type: str, work_dir: str) -> None:
244
+ """Copy base repository structure from templates."""
245
+ try:
246
+ # Get template paths
247
+ template_paths = self._get_template_paths(repo_type)
248
+ repo_structure_dir = template_paths['repository_structure']
249
+
250
+ logger.info(f"Copying repository structure from {repo_structure_dir} to {work_dir}")
251
+
252
+ if os.path.exists(repo_structure_dir):
253
+ for root, _, files in os.walk(repo_structure_dir):
254
+ rel = os.path.relpath(root, repo_structure_dir)
255
+ dst_dir = os.path.normpath(os.path.join(work_dir, rel))
256
+ os.makedirs(dst_dir, exist_ok=True)
257
+ for file in files:
258
+ src = os.path.join(root, file)
259
+ match = AIRFLOW_VERSIONED_TEMPLATE.match(file)
260
+ if not match:
261
+ shutil.copy2(src, os.path.join(dst_dir, file))
262
+ continue
263
+ target_name, major = match.group(1), match.group(2)
264
+ if major == self.airflow_major:
265
+ shutil.copy2(src, os.path.join(dst_dir, target_name))
266
+ logger.info(f"Using Airflow {major}.x variant for {os.path.join(rel, target_name)}")
267
+ else:
268
+ stale = os.path.join(dst_dir, target_name)
269
+ if os.path.exists(stale):
270
+ os.remove(stale)
271
+ logger.info(f"Removed Airflow {major}.x file {os.path.join(rel, target_name)}")
272
+ else:
273
+ logger.warning(f"Repository structure directory not found: {repo_structure_dir}")
274
+
275
+ logger.info(f"Copied base repository structure for {repo_type}")
276
+
277
+ except Exception as e:
278
+ logger.error(f"Failed to copy repository structure: {str(e)}")
279
+ raise
280
+
281
+ def _setup_git_provider_files(self, work_dir: str, repo_type: str) -> None:
282
+ """Set up git provider specific files with proper rendering."""
283
+ try:
284
+ # Get template paths
285
+ template_paths = self._get_template_paths(repo_type)
286
+ provider_dir = template_paths['git_provider']
287
+
288
+ if not os.path.exists(provider_dir):
289
+ logger.warning(f"Git provider directory not found: {provider_dir}")
290
+ return
291
+
292
+ logger.info(f"Setting up git provider files from {provider_dir}")
293
+
294
+ # Recursively process all files in the provider directory
295
+ template_files_found = 0
296
+ for root, dirs, files in os.walk(provider_dir):
297
+ # Calculate relative path from provider_dir
298
+ rel_path = os.path.relpath(root, provider_dir)
299
+
300
+ # Create corresponding directory in work_dir
301
+ if rel_path != '.':
302
+ target_dir = os.path.join(work_dir, rel_path)
303
+ os.makedirs(target_dir, exist_ok=True)
304
+ else:
305
+ target_dir = work_dir
306
+
307
+ # Process files in current directory
308
+ for file in files:
309
+ src_path = os.path.join(root, file)
310
+
311
+ # Handle template files
312
+ if file.endswith('_template'):
313
+ template_files_found += 1
314
+ base_name = file[:-9] # Remove '_template' suffix
315
+ dest_path = os.path.join(target_dir, base_name)
316
+
317
+ # Ensure directory exists
318
+ os.makedirs(os.path.dirname(dest_path), exist_ok=True)
319
+
320
+ # Check if this is a hybrid template (contains both Jinja2 and GitHub Actions syntax)
321
+ with open(src_path, 'r') as f:
322
+ content = f.read()
323
+
324
+ if '{{' in content and '{% raw %}' in content:
325
+ # This is a hybrid template - render Jinja2 first, then it becomes a GitHub Actions file
326
+ self._render_template_file(src_path, dest_path)
327
+ logger.info(f"Rendered hybrid template {src_path} to {dest_path} (Jinja2 + GitHub Actions)")
328
+ elif '${{ env.' in content and '{{' not in content:
329
+ # This is a pure GitHub Actions file, copy as-is without Jinja2 rendering
330
+ shutil.copy2(src_path, dest_path)
331
+ logger.info(f"Copied pure GitHub Actions template {src_path} to {dest_path} (no Jinja2 rendering)")
332
+ else:
333
+ # This is a regular Jinja2 template, render it
334
+ self._render_template_file(src_path, dest_path)
335
+ logger.info(f"Rendered Jinja2 template {src_path} to {dest_path}")
336
+ else:
337
+ # Copy non-template files as is
338
+ dest_path = os.path.join(target_dir, file)
339
+ shutil.copy2(src_path, dest_path)
340
+
341
+ logger.info(f"Set up git provider specific files for {repo_type} - processed {template_files_found} template files")
342
+
343
+ # Debug: List all files in the work directory
344
+ logger.debug(f"Files in {work_dir} after template processing:")
345
+ for root, dirs, files in os.walk(work_dir):
346
+ rel_path = os.path.relpath(root, work_dir)
347
+ if files:
348
+ logger.debug(f" {rel_path}: {files}")
349
+
350
+ except Exception as e:
351
+ logger.error(f"Failed to set up git provider files: {str(e)}")
352
+ raise
353
+
354
+ def _render_template_file(self, template_path: str, output_path: str) -> None:
355
+ """Render a template file with context."""
356
+ try:
357
+ # Prepare rendering context
358
+ context = {
359
+ 'customer': self.customer,
360
+ 'git_provider': self.git_provider,
361
+ 'argo_server_url_type': self.argo_server_url_type,
362
+ 'ARGO_SERVER_URL': self.argo_server_url,
363
+ 'ARGO_CLI_VERSION': self.argo_cli_version,
364
+ 'ARGO_UI_URL': f"https://workflows.{self.customer}.{self.domain}",
365
+ }
366
+
367
+ # Create template environment
368
+ env = Environment(
369
+ loader=FileSystemLoader(os.path.dirname(template_path)),
370
+ trim_blocks=True,
371
+ lstrip_blocks=True
372
+ )
373
+
374
+ # Render template
375
+ template = env.get_template(os.path.basename(template_path))
376
+ rendered_content = template.render(context)
377
+
378
+ # Ensure output directory exists
379
+ os.makedirs(os.path.dirname(output_path), exist_ok=True)
380
+
381
+ # Write rendered content
382
+ with open(output_path, 'w') as f:
383
+ f.write(rendered_content)
384
+
385
+ logger.debug(f"Rendered template {template_path} to {output_path}")
386
+
387
+ except Exception as e:
388
+ logger.error(f"Failed to render template {template_path}: {str(e)}")
389
+ raise
390
+
391
+ def _setup_deploy_keys(self) -> None:
392
+ """Set up SSH deploy keys for Git authentication."""
393
+ if self.dry_run:
394
+ logger.info("[DRY-RUN] Nothing is cloned; deploy keys stay in the secrets file only")
395
+ return
396
+ try:
397
+ logger.info("Setting up SSH deploy keys for Git authentication")
398
+
399
+ # Validate SSH keys are present
400
+ if not self.data_orchestrator_repo_private_key:
401
+ raise ValueError("Orchestrator SSH private key not available")
402
+ if not self.data_model_repo_private_key:
403
+ raise ValueError("Data model SSH private key not available")
404
+
405
+ # Create .ssh directory in the temporary directory
406
+ ssh_dir = os.path.join(self.temp_dir, '.ssh')
407
+ os.makedirs(ssh_dir, mode=0o700, exist_ok=True)
408
+
409
+ # Write private keys to files
410
+ orchestrator_key_path = os.path.join(ssh_dir, 'orchestrator_id_ed25519')
411
+ data_model_key_path = os.path.join(ssh_dir, 'data_model_id_ed25519')
412
+
413
+ with open(orchestrator_key_path, 'w') as f:
414
+ f.write(self.data_orchestrator_repo_private_key)
415
+ os.chmod(orchestrator_key_path, 0o600)
416
+
417
+ with open(data_model_key_path, 'w') as f:
418
+ f.write(self.data_model_repo_private_key)
419
+ os.chmod(data_model_key_path, 0o600)
420
+
421
+ # Create SSH config
422
+ git_host = self._extract_git_host()
423
+
424
+ # Use per-repository host aliases to ensure the right key is used
425
+ config_content = f"""Host orchestrator
426
+ HostName {git_host}
427
+ User git
428
+ IdentityFile {orchestrator_key_path}
429
+ StrictHostKeyChecking no
430
+ UserKnownHostsFile /dev/null
431
+ IdentitiesOnly yes
432
+
433
+ Host data_model
434
+ HostName {git_host}
435
+ User git
436
+ IdentityFile {data_model_key_path}
437
+ StrictHostKeyChecking no
438
+ UserKnownHostsFile /dev/null
439
+ IdentitiesOnly yes
440
+ """
441
+ config_path = os.path.join(ssh_dir, 'config')
442
+ with open(config_path, 'w') as f:
443
+ f.write(config_content)
444
+ os.chmod(config_path, 0o600)
445
+
446
+ # Set environment variables for Git to use our SSH configuration
447
+ os.environ['GIT_SSH_COMMAND'] = f'ssh -F {config_path}'
448
+ os.environ['SSH_AUTH_SOCK'] = '' # Disable SSH agent to force use of our keys
449
+
450
+ logger.info(f"SSH configuration set up successfully in {ssh_dir}")
451
+
452
+ except Exception as e:
453
+ logger.error(f"Failed to set up deploy keys: {str(e)}")
454
+ raise
455
+
456
+ def _setup_access_token(self) -> None:
457
+ """Set up Git access token authentication."""
458
+ if self.dry_run:
459
+ logger.info("[DRY-RUN] Nothing is cloned; git credentials are not written")
460
+ return
461
+ try:
462
+ # Configure git to use the access tokens
463
+ subprocess.run(['git', 'config', '--global', 'credential.helper', 'store'], check=True)
464
+ credential_file = os.path.expanduser('~/.git-credentials')
465
+
466
+ git_host = self._extract_git_host()
467
+
468
+ # Write credentials for both repositories
469
+ with open(credential_file, 'w') as f:
470
+ if self.data_orchestrator_repo_access_token:
471
+ f.write(f"https://oauth2:{self.data_orchestrator_repo_access_token}@{git_host}\n")
472
+ if self.data_model_repo_access_token and self.data_model_repo_access_token != self.data_orchestrator_repo_access_token:
473
+ f.write(f"https://oauth2:{self.data_model_repo_access_token}@{git_host}\n")
474
+ elif self.global_access_token:
475
+ f.write(f"https://oauth2:{self.global_access_token}@{git_host}\n")
476
+
477
+ os.chmod(credential_file, 0o600)
478
+
479
+ except Exception as e:
480
+ logger.error(f"Failed to set up access token: {str(e)}")
481
+ raise
482
+
483
+ def _extract_git_host(self) -> str:
484
+ """Extract git host from repository URL."""
485
+ url = self.data_orchestrator_repo_url or self.data_model_repo_url
486
+ if not url:
487
+ raise ValueError("No repository URL provided")
488
+
489
+ if url.startswith('git@'):
490
+ return url.split('@')[1].split(':')[0]
491
+ elif url.startswith('http'):
492
+ return url.split('/')[2]
493
+ else:
494
+ raise ValueError(f"Invalid repository URL format: {url}")
495
+
496
+ def _render_repository_templates(self, repo_dir: str, repo_type: str) -> None:
497
+ """Render repository templates with context."""
498
+ try:
499
+ for root, _, files in os.walk(repo_dir):
500
+ for file in files:
501
+ if file.endswith('_template'):
502
+ template_path = os.path.join(root, file)
503
+ output_path = template_path[:-9] # Remove '_template' suffix
504
+ self._render_template_file(template_path, output_path)
505
+ os.remove(template_path) # Remove template file after rendering
506
+
507
+ except Exception as e:
508
+ logger.error(f"Failed to render repository templates: {str(e)}")
509
+ raise
510
+
511
+ def get_secret_from_vault(self, secret_name: str, secret_path: str) -> str:
512
+ """Retrieve a secret from the local vault JSON file."""
513
+ try:
514
+ with open(self.secret_file, 'r') as f:
515
+ vault_data = json.load(f)
516
+
517
+ # Navigate through the JSON structure based on the secret path
518
+ current = vault_data
519
+ for part in secret_path.strip('/').split('/'):
520
+ if part not in current:
521
+ raise KeyError(f"Path {secret_path} not found in vault structure")
522
+ current = current[part]
523
+
524
+ if secret_name not in current:
525
+ raise KeyError(f"Secret {secret_name} not found at path {secret_path}")
526
+
527
+ return current[secret_name]
528
+ except Exception as e:
529
+ logger.error(f"Failed to get secret from local vault: {str(e)}")
530
+ raise
531
+
532
+ def prepare_repository_structure(self, repo_type: str) -> None:
533
+ """Prepare the repository structure based on the repository type."""
534
+ try:
535
+ # Determine repository URL
536
+ repo_url = self.data_orchestrator_repo_url if repo_type == "data_orchestrator" else self.data_model_repo_url
537
+
538
+ if not repo_url:
539
+ raise ValueError(f"Repository URL not provided for {repo_type}")
540
+
541
+ # Use separate flow for dry-run mode
542
+ if self.dry_run:
543
+ self._prepare_repository_structure_dry_run(repo_type, repo_url)
544
+ return
545
+
546
+ # Normal execution: full git operations
547
+ work_dir = os.path.join(self.temp_dir, f"{self.customer}_{repo_type}")
548
+
549
+ # Check repository accessibility
550
+ if not self._check_repository_accessibility(repo_url):
551
+ raise ValueError(f"Repository {repo_url} is not accessible or does not exist")
552
+
553
+ # Clone repository using appropriate authentication
554
+ self._clone_repository(repo_url, work_dir, repo_type)
555
+
556
+ # Copy base repository structure
557
+ self._copy_repository_structure(repo_type, work_dir)
558
+
559
+ # Render and copy git provider specific files
560
+ self._setup_git_provider_files(work_dir, repo_type)
561
+
562
+ # Commit and push changes
563
+ self._commit_and_push_changes(work_dir, repo_type)
564
+
565
+ except Exception as e:
566
+ logger.error(f"Failed to prepare repository structure: {str(e)}")
567
+ raise
568
+
569
+ def _prepare_repository_structure_dry_run(self, repo_type: str, repo_url: str) -> None:
570
+ """Prepare repository structure in dry-run mode - only render files locally, no git operations."""
571
+ try:
572
+ work_dir = os.path.join(self.temp_dir, f"{self.customer}_{repo_type}")
573
+
574
+ logger.info(f"[DRY-RUN] Preparing repository structure for {repo_type} locally")
575
+ print(f"\n{'='*80}")
576
+ print(f"[DRY-RUN] Repository: {repo_type}")
577
+ print(f"[DRY-RUN] Target URL: {repo_url}")
578
+ print(f"[DRY-RUN] Local directory: {work_dir}")
579
+ print(f"{'='*80}")
580
+
581
+ # Create work directory
582
+ os.makedirs(work_dir, exist_ok=True)
583
+ logger.info(f"[DRY-RUN] Created directory: {work_dir}")
584
+
585
+ # Copy base repository structure (renders template files)
586
+ print(f"[DRY-RUN] Rendering base repository structure...")
587
+ self._copy_repository_structure(repo_type, work_dir)
588
+ logger.info(f"[DRY-RUN] Base repository structure rendered")
589
+
590
+ # Render and copy git provider specific files (renders template files)
591
+ print(f"[DRY-RUN] Rendering git provider-specific files...")
592
+ self._setup_git_provider_files(work_dir, repo_type)
593
+ logger.info(f"[DRY-RUN] Git provider files rendered")
594
+
595
+ # Show what would have been done (but skip actual git operations)
596
+ print(f"\n[DRY-RUN] Skipped operations:")
597
+ print(f" - Would clone repository: {repo_url}")
598
+ print(f" - Would commit changes to repository")
599
+ print(f" - Would push changes to remote repository")
600
+ print(f"\n✅ Repository files generated in: {work_dir}")
601
+ print(f"{'='*80}\n")
602
+
603
+ logger.info(f"[DRY-RUN] Repository structure prepared successfully for {repo_type}")
604
+
605
+ except Exception as e:
606
+ logger.error(f"[DRY-RUN] Failed to prepare repository structure: {str(e)}")
607
+ raise
608
+
609
+ def _check_repository_accessibility(self, repo_url: str) -> bool:
610
+ """Check if the repository is accessible and exists."""
611
+ try:
612
+ # Apply the same URL transformation logic as in _clone_repository
613
+ check_url = repo_url
614
+
615
+ if self.repo_authentication == "deploy_keys":
616
+ # Convert HTTPS URL to SSH URL if needed
617
+ if repo_url.startswith('https://'):
618
+ # Properly convert https://github.com/owner/repo.git to git@github.com:owner/repo.git
619
+ url_without_protocol = repo_url.replace('https://', '')
620
+ if '/' in url_without_protocol:
621
+ domain, path = url_without_protocol.split('/', 1)
622
+ check_url = f"git@{domain}:{path}"
623
+
624
+ # For HTTPS URLs, try to access the repository
625
+ if check_url.startswith('https://'):
626
+ # Remove authentication tokens for the check
627
+ clean_url = check_url
628
+ if 'oauth2:' in clean_url:
629
+ clean_url = clean_url.replace('https://oauth2:', 'https://').split('@', 1)[1]
630
+
631
+ # Try to access the repository using curl or requests
632
+ import requests
633
+ try:
634
+ response = requests.head(clean_url, timeout=10, allow_redirects=True)
635
+ # Many providers (e.g., GitHub) return 404 for private repos when unauthenticated.
636
+ # Treat 200/401/403/404 as "likely exists" and let the actual clone/auth step be authoritative.
637
+ if response.status_code in [200, 401, 403, 404]:
638
+ if response.status_code == 404:
639
+ logger.info(f"Repository {clean_url} responded 404 (likely private without auth); proceeding")
640
+ else:
641
+ logger.info(f"Repository {clean_url} is accessible (status {response.status_code})")
642
+ return True
643
+ else:
644
+ logger.warning(f"Repository {clean_url} returned status {response.status_code}; proceeding conservatively")
645
+ return True # Assume it exists if we get any response
646
+ except requests.RequestException as e:
647
+ logger.warning(f"Could not check repository accessibility: {e}")
648
+ return True # Assume it exists if we can't check
649
+
650
+ # For SSH URLs, we can't easily check without SSH keys
651
+ elif check_url.startswith('git@'):
652
+ logger.info(f"SSH repository {check_url} - accessibility check skipped")
653
+ return True
654
+
655
+ return True
656
+
657
+ except Exception as e:
658
+ logger.warning(f"Error checking repository accessibility: {e}")
659
+ return True # Assume it exists if we can't check
660
+
661
+ def _clone_repository(self, repo_url: str, work_dir: str, repo_type: str) -> None:
662
+ """Clone repository using appropriate authentication method."""
663
+ try:
664
+ # Prepare repository URL based on authentication method
665
+ if self.repo_authentication == "deploy_keys":
666
+ # Convert HTTPS URL to SSH URL if needed
667
+ if repo_url.startswith('https://'):
668
+ # Properly convert https://github.com/owner/repo.git to git@github.com:owner/repo.git
669
+ url_without_protocol = repo_url.replace('https://', '')
670
+ if '/' in url_without_protocol:
671
+ domain, path = url_without_protocol.split('/', 1)
672
+ repo_url = f"git@{domain}:{path}"
673
+
674
+ # Force using per-repo host alias to ensure correct key selection
675
+ alias = "orchestrator" if repo_type == "data_orchestrator" else "data_model"
676
+ if repo_url.startswith('git@'):
677
+ # git@<host>:<path> -> git@<alias>:<path>
678
+ at_split = repo_url.split('@', 1)
679
+ host_and_path = at_split[1]
680
+ host, sep, path = host_and_path.partition(':')
681
+ clone_url = f"git@{alias}:{path}"
682
+ else:
683
+ clone_url = repo_url
684
+ else:
685
+ # Use HTTPS URL with token
686
+ if repo_url.startswith('git@'):
687
+ # Convert git@github.com:owner/repo.git to https://github.com/owner/repo.git
688
+ at_split = repo_url.split('@', 1)
689
+ host_and_path = at_split[1]
690
+ host, sep, path = host_and_path.partition(':')
691
+ repo_url = f"https://{host}/{path}"
692
+
693
+ token = (self.data_orchestrator_repo_access_token
694
+ if repo_type == "data_orchestrator"
695
+ else self.data_model_repo_access_token) or self.global_access_token
696
+
697
+ # For GitHub, use the token directly as username, for others use oauth2
698
+ if 'github.com' in repo_url:
699
+ clone_url = repo_url.replace('https://', f'https://{token}@')
700
+ else:
701
+ clone_url = repo_url.replace('https://', f'https://oauth2:{token}@')
702
+
703
+ # Clone repository
704
+ logger.info(f"Cloning {repo_type} repository to {work_dir}")
705
+
706
+ try:
707
+ subprocess.run(['git', 'clone', clone_url, work_dir], check=True)
708
+ logger.info(f"Successfully cloned {repo_type} repository")
709
+ except subprocess.CalledProcessError as e:
710
+ # Check if the error is due to empty repository
711
+ if "warning: You appear to have cloned an empty repository" in str(e.stderr) or "empty repository" in str(e.stderr):
712
+ logger.info("Repository is empty, initializing with default branch")
713
+ # Try to clone with --allow-empty-repository flag if available
714
+ try:
715
+ subprocess.run(['git', 'clone', '--allow-empty-repository', clone_url, work_dir], check=True)
716
+ logger.info("Successfully cloned empty repository")
717
+ except subprocess.CalledProcessError:
718
+ # Fallback: clone and initialize manually
719
+ subprocess.run(['git', 'clone', clone_url, work_dir], check=False)
720
+ # Initialize the repository manually
721
+ self._initialize_empty_repository(work_dir)
722
+ else:
723
+ # Re-raise the original error if it's not about empty repository
724
+ raise
725
+
726
+ except subprocess.CalledProcessError as e:
727
+ # Check if the error is about repository not existing or access denied
728
+ error_output = e.stderr.decode('utf-8') if e.stderr else str(e.stderr)
729
+ if "could not be found" in error_output or "don't have permission" in error_output or "Permission denied" in error_output:
730
+ logger.error(f"Repository access failed: {error_output}")
731
+ logger.error("")
732
+ logger.error("🔧 MANUAL ACTION REQUIRED:")
733
+ logger.error(f"The repository {repo_url} either doesn't exist or you don't have access to it.")
734
+ logger.error("")
735
+ logger.error("Please check the following:")
736
+ logger.error("1. Ensure the repository exists in your GitLab instance")
737
+ logger.error("2. Verify you have access to the repository")
738
+ logger.error("3. If using deploy keys, ensure the deploy key has been added to this repository")
739
+ logger.error("4. Check the repository URL is correct")
740
+ logger.error("")
741
+ logger.error(f"Repository URL: {repo_url}")
742
+ logger.error("")
743
+
744
+ # Create a custom exception with helpful message
745
+ raise Exception(f"Repository {repo_url} not accessible. Please ensure the repository exists and you have proper access permissions.")
746
+ else:
747
+ # Re-raise if it's a different error
748
+ raise
749
+ except Exception as e:
750
+ logger.error(f"Error during repository cloning: {str(e)}")
751
+ raise
752
+
753
+ def _initialize_empty_repository(self, work_dir: str) -> None:
754
+ """Initialize an empty repository with a default branch."""
755
+ try:
756
+ logger.info(f"Initializing empty repository in {work_dir}")
757
+
758
+ # Initialize git repository
759
+ subprocess.run(['git', 'init'], cwd=work_dir, check=True)
760
+
761
+ # Add remote origin
762
+ # Extract the original URL without authentication tokens
763
+ original_url = self.data_orchestrator_repo_url if "data_orchestrator" in work_dir else self.data_model_repo_url
764
+ if original_url.startswith('https://oauth2:'):
765
+ # Remove the oauth2 token from URL
766
+ original_url = original_url.replace('https://oauth2:', 'https://').split('@', 1)[1]
767
+
768
+ subprocess.run(['git', 'remote', 'add', 'origin', original_url], cwd=work_dir, check=True)
769
+
770
+ # Create initial commit with README
771
+ readme_content = f"# {os.path.basename(work_dir)}\n\nInitial repository setup by Fast2.Dev Platform.\n"
772
+ with open(os.path.join(work_dir, 'README.md'), 'w') as f:
773
+ f.write(readme_content)
774
+
775
+ # Add and commit the README
776
+ subprocess.run(['git', 'add', 'README.md'], cwd=work_dir, check=True)
777
+ subprocess.run(['git', 'commit', '-m', 'Initial commit'], cwd=work_dir, check=True)
778
+
779
+ # Create and switch to main branch
780
+ subprocess.run(['git', 'branch', '-M', 'main'], cwd=work_dir, check=True)
781
+
782
+ logger.info("Successfully initialized empty repository with main branch")
783
+
784
+ except subprocess.CalledProcessError as e:
785
+ logger.error(f"Failed to initialize empty repository: {e}")
786
+ raise
787
+ except Exception as e:
788
+ logger.error(f"Error initializing empty repository: {str(e)}")
789
+ raise
790
+
791
+ def _get_default_branch(self, repo_dir: str) -> str:
792
+ """Get the default branch of the repository."""
793
+ try:
794
+ # Try to get the current branch
795
+ result = subprocess.run(
796
+ ['git', 'rev-parse', '--abbrev-ref', 'HEAD'],
797
+ cwd=repo_dir,
798
+ capture_output=True,
799
+ text=True,
800
+ check=True
801
+ )
802
+ current_branch = result.stdout.strip()
803
+
804
+ # Check if repository is empty (no commits)
805
+ try:
806
+ subprocess.run(
807
+ ['git', 'rev-parse', 'HEAD'],
808
+ cwd=repo_dir,
809
+ capture_output=True,
810
+ check=True
811
+ )
812
+ # If we get here, repository has commits
813
+ return current_branch
814
+ except subprocess.CalledProcessError:
815
+ # Repository is empty, use 'main' as default
816
+ logger.info("Repository is empty, using 'main' as default branch")
817
+ return 'main'
818
+
819
+ except subprocess.CalledProcessError as e:
820
+ logger.warning(f"Failed to get default branch: {e}")
821
+ return 'main' # Default to 'main' if we can't determine
822
+
823
+ def _commit_and_push_changes(self, work_dir: str, repo_type: str) -> None:
824
+ """Commit and push changes to the repository."""
825
+ try:
826
+ # Configure git
827
+ subprocess.run(['git', 'config', 'user.email', f"{self.customer}@fast2.dev"], cwd=work_dir, check=True)
828
+ subprocess.run(['git', 'config', 'user.name', "Fast2.Dev Bot"], cwd=work_dir, check=True)
829
+
830
+ # Get default branch
831
+ default_branch = self._get_default_branch(work_dir)
832
+ logger.info(f"Using branch: {default_branch}")
833
+
834
+ # For empty repositories, we need to create the branch
835
+ if default_branch == 'main':
836
+ try:
837
+ # Try to create and checkout main branch
838
+ subprocess.run(['git', 'checkout', '-b', 'main'], cwd=work_dir, check=True)
839
+ except subprocess.CalledProcessError:
840
+ # Branch might already exist
841
+ subprocess.run(['git', 'checkout', 'main'], cwd=work_dir, check=True)
842
+
843
+ # Add all changes
844
+ subprocess.run(['git', 'add', '.'], cwd=work_dir, check=True)
845
+
846
+ # Check if there are any changes to commit
847
+ status = subprocess.run(
848
+ ['git', 'status', '--porcelain'],
849
+ cwd=work_dir,
850
+ capture_output=True,
851
+ text=True,
852
+ check=True
853
+ )
854
+
855
+ # Debug: Log git status output
856
+ if status.stdout.strip():
857
+ logger.info(f"Git status shows changes: {status.stdout.strip()}")
858
+ else:
859
+ logger.info("Git status shows no changes to commit")
860
+
861
+ if status.stdout.strip():
862
+ # Changes exist, commit them
863
+ commit_message = f"Initial repository structure for {repo_type}"
864
+ subprocess.run(['git', 'commit', '-m', commit_message], cwd=work_dir, check=True)
865
+
866
+ # Try to push changes to the correct branch
867
+ try:
868
+ # First, try to push with upstream tracking
869
+ subprocess.run(['git', 'push', '-u', 'origin', default_branch], cwd=work_dir, check=True)
870
+ logger.info(f"Successfully pushed changes to {repo_type} repository on branch {default_branch}")
871
+ except subprocess.CalledProcessError as e:
872
+ # Check if the error is about default branch not existing or protected branch or permissions
873
+ error_output = e.stderr.decode('utf-8') if e.stderr else str(e.stderr)
874
+ if ("pre-receive hook declined" in error_output or "default branch" in error_output or
875
+ "protected branch" in error_output or "not permitted" in error_output or "You are not allowed to push" in error_output):
876
+ logger.error("Push failed due to remote permissions or default branch configuration.")
877
+ logger.error(f"Remote error:\n{error_output}")
878
+ logger.error("")
879
+ logger.error("🔧 MANUAL ACTION LIKELY REQUIRED:")
880
+ logger.error("- Ensure the deploy key has WRITE permissions on the repository")
881
+ logger.error("- Ensure the default branch is configured in GitLab (e.g., 'main' or 'master')")
882
+ logger.error("- Verify the branch is not protected against pushes")
883
+ logger.error("")
884
+ raise
885
+ else:
886
+ # Re-raise if it's a different error
887
+ raise
888
+ else:
889
+ # No changes to commit
890
+ logger.info(f"No changes to commit for {repo_type} repository, structure is already up to date")
891
+
892
+ except subprocess.CalledProcessError as e:
893
+ logger.error(f"Git command failed: {e.cmd}")
894
+ if e.stderr:
895
+ logger.error(f"Error output: {e.stderr}")
896
+ if e.stdout:
897
+ logger.error(f"Command output: {e.stdout}")
898
+ raise
899
+ except Exception as e:
900
+ logger.error(f"Failed to commit and push changes: {str(e)}")
901
+ raise
902
+
903
+ def run(self) -> dict[str, Any]:
904
+ """Main execution method to set up both repositories."""
905
+ try:
906
+ logger.info(f"Starting repository setup for customer: {self.customer}")
907
+
908
+ # Set up Git credentials based on authentication method
909
+ if self.repo_authentication == "deploy_keys":
910
+ self._setup_deploy_keys()
911
+ elif self.repo_authentication == "access_token":
912
+ self._setup_access_token()
913
+ else:
914
+ raise ValueError(f"Unsupported authentication method: {self.repo_authentication}")
915
+
916
+ # Process data orchestrator repository
917
+ logger.info("Setting up data orchestrator repository")
918
+ self.prepare_repository_structure("data_orchestrator")
919
+
920
+ # Process dbt data model repository
921
+ logger.info("Setting up dbt data model repository")
922
+ self.prepare_repository_structure("dbt_data_model")
923
+
924
+ # Add information about required secret variables
925
+ logger.info("\nIMPORTANT: For the dbt data model repository, you need to add the following secret variables:")
926
+ logger.info("1. CI_ACCESS_TOKEN_NAME - GitLab access token name")
927
+ logger.info("2. CI_ACCESS_TOKEN - GitLab access token value")
928
+ logger.info("3. ARGO_WORKFLOW_SA_TOKEN - Argo workflow service account token")
929
+ logger.info("These secrets will be provided during the platform deployment process.")
930
+
931
+ return {
932
+ "status": "success",
933
+ "message": "Successfully set up both repositories. Please note that the dbt data model repository requires additional secret variables to be configured. As well as the deploy keys for the repositories.",
934
+ "customer": self.customer,
935
+ "repositories": {
936
+ "data_orchestrator": self.data_orchestrator_repo_url,
937
+ "dbt_data_model": self.data_model_repo_url
938
+ },
939
+ "required_secrets": {
940
+ "dbt_data_model": [
941
+ "CI_ACCESS_TOKEN_NAME",
942
+ "CI_ACCESS_TOKEN",
943
+ "ARGO_WORKFLOW_SA_TOKEN"
944
+ ]
945
+ },
946
+ "required_ssh_deploy_keys": {
947
+ "dbt_data_model": {
948
+ "public_key": self.data_model_repo_public_key,
949
+ "key_title": "Deploy Key for dbt_data_model repository"
950
+ },
951
+ "data_orchestrator": {
952
+ "public_key": self.data_orchestrator_repo_public_key,
953
+ "key_title": "Deploy Key for data_orchestrator repository"
954
+ }
955
+ }
956
+ }
957
+
958
+ except Exception as e:
959
+ logger.error(f"Repository setup failed: {str(e)}")
960
+ return {
961
+ "status": "error",
962
+ "message": str(e),
963
+ "customer": self.customer
964
+ }
965
+
966
+ @classmethod
967
+ def from_cli_args(cls, args):
968
+ """Create an instance from CLI arguments."""
969
+ return cls(
970
+ customer=args.customer,
971
+ domain=args.domain,
972
+ git_provider=args.git_provider,
973
+ repo_authentication=args.repo_authentication,
974
+ data_orchestrator_repo_url=args.data_orchestrator_repo_url,
975
+ data_model_repo_url=args.data_model_repo_url,
976
+ data_orchestrator_repo_private_key=args.data_orchestrator_repo_private_key,
977
+ data_model_repo_private_key=args.data_model_repo_private_key,
978
+ global_access_token=args.global_access_token,
979
+ data_orchestrator_repo_access_token=args.data_orchestrator_repo_access_token,
980
+ data_model_repo_access_token=args.data_model_repo_access_token,
981
+ argo_server_url_type=args.argo_server_url_type,
982
+ argo_cli_version=args.argo_cli_version,
983
+ cicd_workflows_template_version=args.cicd_workflows_template_version,
984
+ airflow_version=args.airflow_version
985
+ )
986
+
987
+ def main():
988
+ parser = argparse.ArgumentParser(
989
+ description="Customer Data Platform Repository Operator",
990
+ formatter_class=argparse.RawDescriptionHelpFormatter
991
+ )
992
+
993
+ # Required arguments
994
+ required_args = parser.add_argument_group('required arguments')
995
+ required_args.add_argument(
996
+ '--customer',
997
+ required=True,
998
+ help='Customer name'
999
+ )
1000
+ required_args.add_argument(
1001
+ '--domain',
1002
+ required=True,
1003
+ help='Domain name (e.g., fast2.dev)'
1004
+ )
1005
+ required_args.add_argument(
1006
+ '--argo_server_url_type',
1007
+ choices=['internal', 'external'],
1008
+ required=True,
1009
+ help='Argo server URL type (internal: data-platform-argo-workflows-server.data-cicd-workflows:2746, external: https://workflows.<customer>.<domain>:443)'
1010
+ )
1011
+
1012
+ # Optional arguments with defaults
1013
+ optional_args = parser.add_argument_group('optional arguments')
1014
+ optional_args.add_argument(
1015
+ '--repo_authentication',
1016
+ choices=['deploy_keys', 'access_token'],
1017
+ default='deploy_keys',
1018
+ help='Repository authentication method (default: deploy_keys)'
1019
+ )
1020
+ optional_args.add_argument(
1021
+ '--git_provider',
1022
+ choices=['gitlab', 'github', 'bitbucket', 'gitea'],
1023
+ help='Git provider (default: from vault or gitlab)'
1024
+ )
1025
+
1026
+ # Advanced configuration (all optional)
1027
+ advanced_args = parser.add_argument_group('advanced configuration (optional)')
1028
+ advanced_args.add_argument(
1029
+ '--data_orchestrator_repo_url',
1030
+ help='Data orchestrator repository URL'
1031
+ )
1032
+ advanced_args.add_argument(
1033
+ '--data_model_repo_url',
1034
+ help='Data model repository URL'
1035
+ )
1036
+ advanced_args.add_argument(
1037
+ '--data_orchestrator_repo_private_key',
1038
+ help='Private key for data orchestrator repository'
1039
+ )
1040
+ advanced_args.add_argument(
1041
+ '--data_model_repo_private_key',
1042
+ help='Private key for data model repository'
1043
+ )
1044
+ advanced_args.add_argument(
1045
+ '--global_access_token',
1046
+ help='Global access token for all repositories'
1047
+ )
1048
+ advanced_args.add_argument(
1049
+ '--data_orchestrator_repo_access_token',
1050
+ help='Access token for data orchestrator repository'
1051
+ )
1052
+ advanced_args.add_argument(
1053
+ '--data_model_repo_access_token',
1054
+ help='Access token for data model repository'
1055
+ )
1056
+ advanced_args.add_argument(
1057
+ '--argo_cli_version',
1058
+ default='v4.1.7',
1059
+ help='Argo CLI version downloaded by the data-repo CI trigger (must match the cluster)'
1060
+ )
1061
+ advanced_args.add_argument(
1062
+ '--airflow_version',
1063
+ default='3',
1064
+ help='Airflow version of the data orchestration service; selects *_template_airflow_<major>.x files'
1065
+ )
1066
+ advanced_args.add_argument(
1067
+ '--cicd_workflows_template_version',
1068
+ default='latest',
1069
+ help='Deprecated: WorkflowTemplates ship with the Argo release; this flag is ignored'
1070
+ )
1071
+
1072
+ # Debug option
1073
+ parser.add_argument(
1074
+ '--debug',
1075
+ action='store_true',
1076
+ help='Enable debug logging'
1077
+ )
1078
+
1079
+ args = parser.parse_args()
1080
+
1081
+ # Set debug logging if requested
1082
+ if args.debug:
1083
+ logger.setLevel(logging.DEBUG)
1084
+ logger.debug("Debug logging enabled")
1085
+
1086
+ try:
1087
+ operator = CustomerDataPlatformRepositoryOperator.from_cli_args(args)
1088
+ result = operator.run()
1089
+ print(json.dumps(result, indent=2))
1090
+ sys.exit(0 if result["status"] == "success" else 1)
1091
+ except Exception as e:
1092
+ logger.error(f"Error: {str(e)}")
1093
+ if args.debug:
1094
+ logger.exception("Detailed error information:")
1095
+ sys.exit(1)
1096
+
1097
+ if __name__ == "__main__":
1098
+ main()