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.
- f2dev/__init__.py +1 -0
- f2dev/__main__.py +5 -0
- f2dev/_bundle/platform/.dockerignore +80 -0
- f2dev/_bundle/platform/.gitignore +82 -0
- f2dev/_bundle/platform/LICENSE +202 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/template_values.yaml +1731 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/Chart.yaml +9 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-airflow-deploy.yaml +60 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-bi-sync.yaml +46 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-checkout.yaml +49 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-console-sync.yaml +41 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-e2e-label.yaml +48 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-e2e-run.yaml +43 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-e2e-teardown.yaml +47 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-governance.yaml +40 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-lint.yaml +37 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-notify.yaml +32 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-quality.yaml +38 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-refresh.yaml +36 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-supersede.yaml +30 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-tags.yaml +44 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/pipeline-branch.yaml +138 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/pipeline-main.yaml +150 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/pipeline-pr.yaml +184 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/templates/NOTES.txt +18 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/templates/settings-configmap.yaml +14 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/templates/workflowtemplates.yaml +31 -0
- f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/values.yaml +41 -0
- f2dev/_bundle/platform/charts/data_services_charts/cicd_workload_runner/github/template_github_values.yaml +436 -0
- f2dev/_bundle/platform/charts/data_services_charts/cicd_workload_runner/github/template_github_values_extra.yaml +49 -0
- f2dev/_bundle/platform/charts/data_services_charts/cicd_workload_runner/gitlab/template_gitlab_values.yaml +551 -0
- f2dev/_bundle/platform/charts/data_services_charts/cicd_workload_runner/gitlab/template_gitlab_values_extra.yaml +9 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_analysis/lightdash/template_values.yaml +359 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_analysis/metabase/template_values.yaml +384 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_analysis/superset/template_values.yaml +1562 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_analysis/template_values.yaml +269 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/.helmignore +15 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/Chart.yaml +20 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/template_values.yaml.j2 +175 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/NOTES.txt +19 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/_helpers.tpl +50 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/cicd-rbac.yaml +30 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/configmap.yaml +142 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/extras.yaml +14 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/ingress.yaml +69 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/promtail-configmap.yaml +68 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/secret.yaml +31 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/service.yaml +15 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/serviceaccount.yaml +12 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/statefulset.yaml +276 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/valkey.yaml +113 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/warehouse-stats-cronjob.yaml +107 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/values.yaml +828 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_dbt_server/template_values.yaml +385 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_governance/template_dh_prerequisites_values.yaml +118 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_governance/template_dh_values.yaml +1671 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_governance/template_kafka_values.yaml +112 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_governance/template_opensearch_values.yaml +662 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_governance/template_values.yaml +738 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/Chart.yaml +6 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/files/argo-openapi.json +681 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/templates/_helpers.tpl +17 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/templates/argo-rbac.yaml +35 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/templates/backends.yaml +327 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/templates/gateway.yaml +150 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/values.yaml +91 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/template_values.yaml +142 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_modeling/template_values.yaml +1167 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_modeling/template_values_extra.yaml +99 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/airflow-cleanup/Dockerfile +10 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/airflow-cleanup/build.sh +38 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/airflow-cleanup/cleanup.py +452 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/airflow-cleanup/requirements.txt +3 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/docs/keycloak-oidc-setup.md +106 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/template_values.yaml +5536 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/template_values_extra.yaml +379 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/webserver-config/configmap.yaml +459 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/webserver-config/fast2dev_auth.py +285 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/webserver-config/fast2dev_mcp_plugin.py +24 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/webserver-config/webserver_config.py +130 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/Dockerfile +10 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/build.sh +38 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/cleanup.py +749 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/k8s/configmap.yaml +24 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/k8s/cronjob.yaml +137 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/requirements.txt +3 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/.helmignore +26 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/Chart.lock +3 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/Chart.yaml +15 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/README.md +243 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/NOTES.txt +31 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/_helpers.tpl +245 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/_images.tpl +17 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-auth-secret.yaml +35 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-bootloader/bootloader-secrets.yaml +19 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-bootloader/pod.yaml +126 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-connector-rollout-worker/deployment.yaml +171 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-cron/cron-secrets.yaml +19 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-cron/deployment.yaml +149 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-db.yaml +88 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/_helpers.tpl +111 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/deployment.yaml +169 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/hpa.yaml +23 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/pdb.yaml +17 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/service.yaml +25 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/serviceaccount.yaml +10 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-featureflag-server/deployment.yaml +161 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-featureflag-server/service.yaml +25 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-keycloak/service.yaml +62 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-keycloak/statefulset.yaml +182 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-manifest-server/_helpers.tpl +54 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-manifest-server/deployment.yaml +152 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-manifest-server/service.yaml +23 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-manifest-server/serviceaccount.yaml +10 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-metrics/deployment.yaml +124 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-server/deployment.yaml +227 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-server/service.yaml +29 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-stigg-sidecar/deployment.yaml +184 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-stigg-sidecar/service.yaml +21 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-temporal/configmap.yaml +55 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-temporal/deployment.yaml +220 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-temporal/service.yaml +21 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-temporal-ui/deployment.yaml +122 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-temporal-ui/service.yaml +23 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-webapp/deployment.yaml +146 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-webapp/ingress.yaml +63 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-webapp/service.yaml +32 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-worker/deployment.yaml +229 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-workload-api-server/deployment.yaml +191 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-workload-api-server/service.yaml +25 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-workload-launcher/deployment.yaml +232 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-workload-launcher/jobs-secrets.yaml +21 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_auth.tpl +944 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_aws.tpl +109 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_cluster.tpl +82 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_common.tpl +370 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_connector.tpl +58 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_connectorRollout.tpl +141 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_connectorRolloutWorker.tpl +56 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_cron.tpl +62 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_customerio.tpl +56 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_database.tpl +375 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_dataplaneGroups.tpl +38 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_directJobRunner.tpl +122 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_featureFlags.tpl +126 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_java.tpl +38 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_jobs.tpl +422 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_keycloak.tpl +542 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_logging.tpl +38 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_metrics.tpl +214 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_micronaut.tpl +43 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_minio.tpl +64 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_secretsManager.tpl +628 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_server.tpl +533 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_shopify.tpl +83 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_stigg.tpl +157 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_storage.tpl +468 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_temporal.tpl +943 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_topology.tpl +98 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_tracking.tpl +82 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_webapp.tpl +38 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_worker.tpl +366 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_workloadApiServer.tpl +62 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_workloadLauncher.tpl +395 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_workloads.tpl +770 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/env-configmap.yaml +62 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/gcs-log-creds-secret.yaml +19 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/ingress.yaml +69 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/minio.yaml +161 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/secret.yaml +31 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/serviceaccount.yaml +50 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/telemetry-configmap.yaml +32 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/tests/test-webapp.yaml +34 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/values.yaml +3158 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/.helmignore +12 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/Chart.yaml +16 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/README.md +172 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/templates/_helpers.tpl +42 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/templates/deployment.yaml +105 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/templates/externalsecret.yaml +23 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/templates/pdb.yaml +15 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/templates/service.yaml +18 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/values.yaml +97 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/feature-flags-configmap.yaml +16 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/template_metrics_values.yaml +13 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/template_oauth2proxy_values.yaml +1200 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_replication/template_values.yaml +3255 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/Chart.yaml +7 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/hazelcast-client.yaml +27 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/hazelcast-master.yaml +38 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/hazelcast-worker.yaml +29 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/jvm_client_options +24 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/jvm_master_options +6 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/jvm_worker_options +6 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/log4j2.properties +109 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/seatunnel.yaml +36 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/_helpers.tpl +70 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/configmap.yaml +11 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/deployment-master.yaml +120 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/deployment-worker.yaml +118 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/rbac.yaml +32 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/services.yaml +33 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/values.yaml +101 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/template_oauth2proxy_values.yaml +196 -0
- f2dev/_bundle/platform/charts/data_services_charts/data_streaming/template_values.yaml +75 -0
- f2dev/_bundle/platform/charts/data_services_charts/object_storage_operator/template_values.yaml +506 -0
- f2dev/_bundle/platform/charts/infra_services_charts/cert_manager/csi_driver_values.yaml +193 -0
- f2dev/_bundle/platform/charts/infra_services_charts/cert_manager/template_pdns_webhook_values.yaml +91 -0
- f2dev/_bundle/platform/charts/infra_services_charts/cert_manager/template_values.yaml +1777 -0
- f2dev/_bundle/platform/charts/infra_services_charts/cert_manager/template_values_extra.yaml +253 -0
- f2dev/_bundle/platform/charts/infra_services_charts/cluster_cleaner/template_values.yaml +57 -0
- f2dev/_bundle/platform/charts/infra_services_charts/external_dns/template_values.yaml +476 -0
- f2dev/_bundle/platform/charts/infra_services_charts/external_dns/template_values_extra.yaml +131 -0
- f2dev/_bundle/platform/charts/infra_services_charts/idp_sso_manager/realm_template.json +4785 -0
- f2dev/_bundle/platform/charts/infra_services_charts/idp_sso_manager/template_values.yaml +657 -0
- f2dev/_bundle/platform/charts/infra_services_charts/pvc_autoscaller/template_values.yaml +36 -0
- f2dev/_bundle/platform/charts/infra_services_charts/pvc_autoscaller/template_values_extra.yaml +352 -0
- f2dev/_bundle/platform/charts/infra_services_charts/secret_manager/template_values.yaml +1218 -0
- f2dev/_bundle/platform/charts/infra_services_charts/secret_manager/template_values_extra.yaml +845 -0
- f2dev/_bundle/platform/charts/infra_services_charts/secret_manager_operator/template_values.yaml +561 -0
- f2dev/_bundle/platform/charts/infra_services_charts/secret_manager_operator/template_values_extra.yaml +23 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_logs/template_alloy_events_values.yaml +59 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_logs/template_alloy_values.yaml +185 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_logs/template_loki_values.yaml +108 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_metrics/template_values.yaml +1530 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/00-main/.gitkeep +0 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/00-main/f2d-main.json +2871 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/01-platform/.gitkeep +0 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/01-platform/f2d-k8s-cluster.json +1751 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/01-platform/f2d-microservices.json +1682 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/01-platform/f2d-pvc-storage.json +1320 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/01-platform/f2d-service.json +1193 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/.gitkeep +0 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/f2d-cert-manager.json +755 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/f2d-keycloak.json +746 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/f2d-object-storage.json +881 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/f2d-postgresql.json +1590 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/f2d-traefik.json +1375 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/.gitkeep +0 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-cicd-workflows-trends.json +1916 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-cicd-workflows.json +1330 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-analysis.json +631 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-freshness.json +1362 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-governance.json +1958 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-modeling.json +764 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-orchestration-trends.json +2352 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-orchestration.json +1506 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-quality.json +1549 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-replication-trends.json +2799 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-replication.json +2153 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-streaming-trends.json +1536 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-streaming.json +1209 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/04-data-warehouse/.gitkeep +0 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/04-data-warehouse-bigquery/.gitkeep +0 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/04-data-warehouse-bigquery/f2d-bigquery.json +990 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/05-logs/.gitkeep +0 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/05-logs/f2d-logs.json +630 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/folders.yaml +17 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/requirements.yaml +8 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/template_alerts_cm.yaml +2031 -0
- f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/template_values.yaml +1315 -0
- f2dev/_bundle/platform/charts/infra_services_charts/stackgres_postgres_db/template_values.yaml +550 -0
- f2dev/_bundle/platform/charts/infra_services_charts/stackgres_postgres_db/template_values_extra.yaml +742 -0
- f2dev/_bundle/platform/charts/infra_services_charts/traefik_lb/template_values.yaml +1758 -0
- f2dev/_bundle/platform/cli/README.md +866 -0
- f2dev/_bundle/platform/cli/__init__.py +42 -0
- f2dev/_bundle/platform/cli/__main__.py +17 -0
- f2dev/_bundle/platform/cli/cert_providers.py +369 -0
- f2dev/_bundle/platform/cli/command_record.py +144 -0
- f2dev/_bundle/platform/cli/config/data_services_config.json +217 -0
- f2dev/_bundle/platform/cli/config/environment_profiles.yaml +183 -0
- f2dev/_bundle/platform/cli/config/images.json +129 -0
- f2dev/_bundle/platform/cli/config/infrastructure_services_config.json +141 -0
- f2dev/_bundle/platform/cli/config.py +252 -0
- f2dev/_bundle/platform/cli/deployment_configuration_aws_example.yaml +117 -0
- f2dev/_bundle/platform/cli/deployment_configuration_gcp_example.yaml +130 -0
- f2dev/_bundle/platform/cli/deployment_configuration_onprem_example.yaml +71 -0
- f2dev/_bundle/platform/cli/destroy.py +677 -0
- f2dev/_bundle/platform/cli/dns_check.py +27 -0
- f2dev/_bundle/platform/cli/dns_providers.py +405 -0
- f2dev/_bundle/platform/cli/exit_codes.py +32 -0
- f2dev/_bundle/platform/cli/fixers.py +56 -0
- f2dev/_bundle/platform/cli/generate_only.py +336 -0
- f2dev/_bundle/platform/cli/health_report.py +114 -0
- f2dev/_bundle/platform/cli/logging.py +206 -0
- f2dev/_bundle/platform/cli/main.py +5293 -0
- f2dev/_bundle/platform/cli/precheck.py +1523 -0
- f2dev/_bundle/platform/cli/prerequisites/README.md +208 -0
- f2dev/_bundle/platform/cli/prerequisites/install-prerequisites.bat +107 -0
- f2dev/_bundle/platform/cli/prerequisites/install-prerequisites.ps1 +343 -0
- f2dev/_bundle/platform/cli/prerequisites/install-prerequisites.sh +207 -0
- f2dev/_bundle/platform/cli/prerequisites/linux/install-linux.sh +775 -0
- f2dev/_bundle/platform/cli/prerequisites/macos/install-macos.sh +634 -0
- f2dev/_bundle/platform/cli/prerequisites/requirements.txt +41 -0
- f2dev/_bundle/platform/cli/prerequisites/verify-prerequisites.ps1 +150 -0
- f2dev/_bundle/platform/cli/prerequisites/verify-prerequisites.sh +418 -0
- f2dev/_bundle/platform/cli/prerequisites/versions.yaml +43 -0
- f2dev/_bundle/platform/cli/prerequisites/windows/install-windows.ps1 +1005 -0
- f2dev/_bundle/platform/cli/restore.py +179 -0
- f2dev/_bundle/platform/cli/service_gates.py +160 -0
- f2dev/_bundle/platform/cli/state.py +332 -0
- f2dev/_bundle/platform/cli/wizard.py +782 -0
- f2dev/_bundle/platform/cli.py +235 -0
- f2dev/_bundle/platform/deployers/__init__.py +4 -0
- f2dev/_bundle/platform/deployers/base_deployer.py +8 -0
- f2dev/_bundle/platform/deployers/clouds/__init__.py +0 -0
- f2dev/_bundle/platform/deployers/clouds/aws_cloud.py +619 -0
- f2dev/_bundle/platform/deployers/clouds/azure_cloud.py +0 -0
- f2dev/_bundle/platform/deployers/clouds/google_cloud.py +785 -0
- f2dev/_bundle/platform/deployers/clouds/terragrunt_progress.py +56 -0
- f2dev/_bundle/platform/deployers/services/data_services/1.0_cicd_workload_runner.py +644 -0
- f2dev/_bundle/platform/deployers/services/data_services/12.0_control_plane.py +321 -0
- f2dev/_bundle/platform/deployers/services/data_services/13.0_data_mcp_hub.py +362 -0
- f2dev/_bundle/platform/deployers/services/data_services/2.0_object_storage_operator.py +416 -0
- f2dev/_bundle/platform/deployers/services/data_services/2.5_services_logs.py +482 -0
- f2dev/_bundle/platform/deployers/services/data_services/3.0_data_cicd_workflows.py +361 -0
- f2dev/_bundle/platform/deployers/services/data_services/4.0_data_replication.py +534 -0
- f2dev/_bundle/platform/deployers/services/data_services/4.5_data_streaming.py +303 -0
- f2dev/_bundle/platform/deployers/services/data_services/5.0_data_orchestration.py +760 -0
- f2dev/_bundle/platform/deployers/services/data_services/6.0_data_modeling.py +753 -0
- f2dev/_bundle/platform/deployers/services/data_services/7.0_data_governance.py +795 -0
- f2dev/_bundle/platform/deployers/services/data_services/8.0_data_analysis.py +587 -0
- f2dev/_bundle/platform/deployers/services/infra_services/1.0_secret_operator.py +467 -0
- f2dev/_bundle/platform/deployers/services/infra_services/10.0_cluster_pvc_autoscaller.py +500 -0
- f2dev/_bundle/platform/deployers/services/infra_services/2.0_cert_manager.py +963 -0
- f2dev/_bundle/platform/deployers/services/infra_services/3.0_external_dns.py +823 -0
- f2dev/_bundle/platform/deployers/services/infra_services/4.0_traefik_lb.py +604 -0
- f2dev/_bundle/platform/deployers/services/infra_services/5.0_stackgres_postgresql.py +652 -0
- f2dev/_bundle/platform/deployers/services/infra_services/6.0_services_metrics.py +515 -0
- f2dev/_bundle/platform/deployers/services/infra_services/7.0_services_monitoring.py +787 -0
- f2dev/_bundle/platform/deployers/services/infra_services/8.0_cluster_cleaner.py +439 -0
- f2dev/_bundle/platform/deployers/services/infra_services/9.0_idp_sso_manager.py +790 -0
- f2dev/_bundle/platform/readme.md +47 -0
- f2dev/_bundle/platform/requirements.txt +14 -0
- f2dev/_bundle/platform/terraform/aws_cloud/templates/backend.tf_template +10 -0
- f2dev/_bundle/platform/terraform/aws_cloud/templates/defaults.yaml_template +11 -0
- f2dev/_bundle/platform/terraform/aws_cloud/templates/env.yaml_template +2 -0
- f2dev/_bundle/platform/terraform/aws_cloud/templates/root.hcl_advanced_template +134 -0
- f2dev/_bundle/platform/terraform/aws_cloud/templates/root.hcl_basic_template +134 -0
- f2dev/_bundle/platform/terraform/aws_cloud/templates/terragrunt.hcl_advanced_template +134 -0
- f2dev/_bundle/platform/terraform/aws_cloud/templates/terragrunt.hcl_basic_template +134 -0
- f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/01-apps-vpc/terragrunt.hcl +26 -0
- f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/02-create-dns-ns-record/terragrunt.hcl +16 -0
- f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/03-eks-cluster/terragrunt.hcl +21 -0
- f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/04-external_dns_sa/terragrunt.hcl +28 -0
- f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/01-apps-vpc/terragrunt.hcl +25 -0
- f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/02-eks-cluster/terragrunt.hcl +32 -0
- f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/03-external-dns-irsa/terragrunt.hcl +34 -0
- f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/04-cert-manager-irsa/terragrunt.hcl +34 -0
- f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/05-create-dns-zone/terragrunt.hcl +22 -0
- f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/06-create-dns-ns-record/terragrunt.hcl +44 -0
- f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/empty.yaml +1 -0
- f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/empty.yaml +1 -0
- f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/env.hcl +2 -0
- f2dev/_bundle/platform/terraform/azure_cloud/README.md +3 -0
- f2dev/_bundle/platform/terraform/azure_cloud/templates/_keep_structure.txt +0 -0
- f2dev/_bundle/platform/terraform/google_cloud/README.md +20 -0
- f2dev/_bundle/platform/terraform/google_cloud/templates/backend.tf_template +7 -0
- f2dev/_bundle/platform/terraform/google_cloud/templates/defaults.yaml_template +12 -0
- f2dev/_bundle/platform/terraform/google_cloud/templates/env.yaml_template +2 -0
- f2dev/_bundle/platform/terraform/google_cloud/templates/root.hcl_advanced_template +114 -0
- f2dev/_bundle/platform/terraform/google_cloud/templates/root.hcl_basic_template +116 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/.gitignore +3 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/00-create-ou-folder/terragrunt.hcl +15 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/01-create-project/terragrunt.hcl +30 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/02-enable-apis/terragrunt.hcl +25 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/03-0-apps-vpc/terragrunt.hcl +134 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/04-external-ip-traefik/terragrunt.hcl +29 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/05-create-dns-zone/terragrunt.hcl +25 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/06-create-dns-ns-record/terragrunt.hcl +43 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/07-gke-cluster/terragrunt.hcl +103 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/08-dbt_deploy_sa/terragrunt.hcl +36 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/09-dbt_sa/terragrunt.hcl +40 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/10-cert_manager_sa/terragrunt.hcl +34 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/11-external_dns_sa/terragrunt.hcl +30 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/12-monitoring_sa/terragrunt.hcl +52 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/13-data_replication_sa/terragrunt.hcl +35 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/14-data_orchestration_sa/terragrunt.hcl +35 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/15-bi_data_sa/terragrunt.hcl +43 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/16-whitelist-external-ip-on-common/terragrunt.hcl +30 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/17-kubeconfig/terragrunt.hcl +23 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/18-data_streaming_sa/terragrunt.hcl +24 -0
- f2dev/_bundle/platform/terraform/google_cloud/terragrunt/empty.yaml +1 -0
- f2dev/_bundle/platform/utils/__init__.py +0 -0
- f2dev/_bundle/platform/utils/customer_data_platform_repository_operator.py +1098 -0
- f2dev/_bundle/platform/utils/customer_secret_manager_operations.py +1635 -0
- f2dev/_bundle/platform/utils/environment_profiles.py +58 -0
- f2dev/_bundle/platform/utils/helm_utils.py +215 -0
- f2dev/_bundle/platform/utils/infrastructure_deployment_operator.py +1532 -0
- f2dev/_bundle/platform/utils/keycloak_realm_reconcile.py +320 -0
- f2dev/_bundle/platform/utils/kubeconfig_fixer.py +265 -0
- f2dev/_bundle/platform/utils/raw_extras.py +34 -0
- f2dev/_bundle/platform/utils/readiness.py +330 -0
- f2dev/_bundle/platform/utils/secret_structure_upgrade.py +194 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/.gitignore +7 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/README.md +33 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/analyses/.gitkeep +0 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/dbt_project.yml +52 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/macros/.gitkeep +0 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/macros/fast2dev_bq_time_zones.sql +12 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/macros/fast2dev_monitoring_grain.sql +23 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_daily_spend.sql +19 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_daily_spend.yml +25 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_model_costs_daily.sql +16 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_model_costs_daily.yml +24 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_storage_by_dataset.sql +12 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_storage_by_dataset.yml +21 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_user_costs_daily.sql +14 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_user_costs_daily.yml +22 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_weekly_kpi.sql +52 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_weekly_kpi.yml +42 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_weekly_spend.sql +74 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_weekly_spend.yml +49 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/sources/billing_export.yml +9 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/staging/fast2dev_bq_billing_export.sql +9 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/staging/fast2dev_bq_billing_export.yml +4 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/packages.yml +5 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/profiles.yml +15 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/scripts/run_monitoring.py +201 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/seeds/.gitkeep +0 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/snapshots/.gitkeep +0 -0
- f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/tests/.gitkeep +0 -0
- f2dev/_bundle/platform/utils/templates/dry_run/gcp_sa.json +12 -0
- f2dev/_bundle/platform/utils/templates/dry_run/kubeconfig.yaml +18 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/data_orchestrator/repository_structure/README.MD +50 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/data_orchestrator/repository_structure/dags/dbt/README.MD +47 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/data_orchestrator/repository_structure/dags/fast2dev_healthcheck.py_template_airflow_3.x +158 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/bitbucket/bitbucket-pipelines.yml_template +144 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitea/.gitea/PR_VALIDATION.md +52 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitea/.gitea/pull_request_template.md +48 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitea/.gitea/workflows/argo-workflows.yml_template +143 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitea/.gitea/workflows/pr-agent.yml +30 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitea/.gitea/workflows/validate-pr-description.yml +38 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/github/.github/PR_VALIDATION.md +52 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/github/.github/pull_request_template.md +48 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/github/.github/workflows/argo-workflows.yml_template +143 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/github/.github/workflows/pr-agent.yml +37 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/github/.github/workflows/validate-pr-description.yml +157 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitlab/.gitlab/PR_VALIDATION.md +43 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitlab/.gitlab/merge_request_templates/Default.md +48 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitlab/.gitlab-ci.yml_template +181 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/repository_structure/.gitignore +21 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/repository_structure/.pr_agent.toml +82 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/repository_structure/AGENTS.md +126 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/repository_structure/README.MD +101 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/infrastructure_deployment_files/DR.md +341 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/infrastructure_deployment_files/README.md.j2 +81 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/infrastructure_deployment_files/decrypt_files.py +331 -0
- f2dev/_bundle/platform/utils/templates/git_repo_templates/infrastructure_deployment_files/encrypt_files.py +321 -0
- f2dev/_bundle/platform/utils/templates/secret_structure_template/customer_vault_structure.json +502 -0
- f2dev/_bundle/platform/utils/vault_structure_sync.py +96 -0
- f2dev/_bundle/terraform-modules/README.md +12 -0
- f2dev/_bundle/terraform-modules/aws_cloud/README.md +7 -0
- f2dev/_bundle/terraform-modules/aws_cloud/eks/addons-roles.tf +298 -0
- f2dev/_bundle/terraform-modules/aws_cloud/eks/main.tf +313 -0
- f2dev/_bundle/terraform-modules/aws_cloud/eks/outputs.tf +3 -0
- f2dev/_bundle/terraform-modules/aws_cloud/eks/policies/lb-controller-policy.json +219 -0
- f2dev/_bundle/terraform-modules/aws_cloud/eks/provider.tf +36 -0
- f2dev/_bundle/terraform-modules/aws_cloud/eks/variables.tf +107 -0
- f2dev/_bundle/terraform-modules/aws_cloud/eks/versions.tf +10 -0
- f2dev/_bundle/terraform-modules/aws_cloud/gcp_aws_zone/main.tf +25 -0
- f2dev/_bundle/terraform-modules/aws_cloud/gcp_aws_zone/provider.tf +17 -0
- f2dev/_bundle/terraform-modules/aws_cloud/gcp_aws_zone/variables.tf +41 -0
- f2dev/_bundle/terraform-modules/aws_cloud/vpc/main.tf +34 -0
- f2dev/_bundle/terraform-modules/aws_cloud/vpc/outputs.tf +44 -0
- f2dev/_bundle/terraform-modules/aws_cloud/vpc/provider.tf +12 -0
- f2dev/_bundle/terraform-modules/aws_cloud/vpc/variables.tf +118 -0
- f2dev/_bundle/terraform-modules/aws_cloud/vpc/versions.tf +10 -0
- f2dev/_bundle/terraform-modules/azure_cloud/README.md +3 -0
- f2dev/_bundle/terraform-modules/google_cloud/README.md +17 -0
- f2dev/_bundle/terraform-modules/google_cloud/artifact-registry/main.tf +8 -0
- f2dev/_bundle/terraform-modules/google_cloud/artifact-registry/providers.tf +6 -0
- f2dev/_bundle/terraform-modules/google_cloud/artifact-registry/variables.tf +17 -0
- f2dev/_bundle/terraform-modules/google_cloud/artifact-registry/versions.tf +8 -0
- f2dev/_bundle/terraform-modules/google_cloud/cloud-dns/main.tf +24 -0
- f2dev/_bundle/terraform-modules/google_cloud/cloud-dns/outputs.tf +25 -0
- f2dev/_bundle/terraform-modules/google_cloud/cloud-dns/providers.tf +7 -0
- f2dev/_bundle/terraform-modules/google_cloud/cloud-dns/variables.tf +17 -0
- f2dev/_bundle/terraform-modules/google_cloud/cloud-dns/versions.tf +9 -0
- f2dev/_bundle/terraform-modules/google_cloud/cloud-dns-recordset/main.tf +38 -0
- f2dev/_bundle/terraform-modules/google_cloud/cloud-dns-recordset/variables.tf +73 -0
- f2dev/_bundle/terraform-modules/google_cloud/cloud-dns-recordset/versions.tf +39 -0
- f2dev/_bundle/terraform-modules/google_cloud/composer/main.tf +213 -0
- f2dev/_bundle/terraform-modules/google_cloud/composer/outputs.tf +31 -0
- f2dev/_bundle/terraform-modules/google_cloud/composer/provider.tf +4 -0
- f2dev/_bundle/terraform-modules/google_cloud/composer/variables.tf +192 -0
- f2dev/_bundle/terraform-modules/google_cloud/create-ou-folder/main.tf +29 -0
- f2dev/_bundle/terraform-modules/google_cloud/create-ou-folder/output.tf +4 -0
- f2dev/_bundle/terraform-modules/google_cloud/create-ou-folder/providers.tf +6 -0
- f2dev/_bundle/terraform-modules/google_cloud/create-ou-folder/variables.tf +40 -0
- f2dev/_bundle/terraform-modules/google_cloud/create-ou-folder/versions.tf +8 -0
- f2dev/_bundle/terraform-modules/google_cloud/create-project/main.tf +18 -0
- f2dev/_bundle/terraform-modules/google_cloud/create-project/output.tf +8 -0
- f2dev/_bundle/terraform-modules/google_cloud/create-project/providers.tf +6 -0
- f2dev/_bundle/terraform-modules/google_cloud/create-project/variables.tf +27 -0
- f2dev/_bundle/terraform-modules/google_cloud/create-project/versions.tf +9 -0
- f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/README.md +188 -0
- f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/main.tf +135 -0
- f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/output.tf +16 -0
- f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/providers.tf +6 -0
- f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/variables.tf +54 -0
- f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/versions.tf +17 -0
- f2dev/_bundle/terraform-modules/google_cloud/enable_apis/main.tf +14 -0
- f2dev/_bundle/terraform-modules/google_cloud/enable_apis/provider.tf +7 -0
- f2dev/_bundle/terraform-modules/google_cloud/enable_apis/variables.tf +13 -0
- f2dev/_bundle/terraform-modules/google_cloud/enable_apis/versions.tf +10 -0
- f2dev/_bundle/terraform-modules/google_cloud/external-ip/README.md +89 -0
- f2dev/_bundle/terraform-modules/google_cloud/external-ip/main.tf +17 -0
- f2dev/_bundle/terraform-modules/google_cloud/external-ip/outputs.tf +19 -0
- f2dev/_bundle/terraform-modules/google_cloud/external-ip/variables.tf +43 -0
- f2dev/_bundle/terraform-modules/google_cloud/fw-add/main.tf +24 -0
- f2dev/_bundle/terraform-modules/google_cloud/fw-add/providers.tf +6 -0
- f2dev/_bundle/terraform-modules/google_cloud/fw-add/variables.tf +37 -0
- f2dev/_bundle/terraform-modules/google_cloud/fw-add/versions.tf +9 -0
- f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/README.md +10 -0
- f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/main.tf +459 -0
- f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/outputs.tf +44 -0
- f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/provider.tf +19 -0
- f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/variables.tf +354 -0
- f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/versions.tf +22 -0
- f2dev/_bundle/terraform-modules/google_cloud/kubeconfig/README.md +40 -0
- f2dev/_bundle/terraform-modules/google_cloud/kubeconfig/main.tf +54 -0
- f2dev/_bundle/terraform-modules/google_cloud/kubeconfig/outputs.tf +10 -0
- f2dev/_bundle/terraform-modules/google_cloud/kubeconfig/variables.tf +24 -0
- f2dev/_bundle/terraform-modules/google_cloud/kubeconfig/versions.tf +10 -0
- f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/README.md +47 -0
- f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/main.tf +51 -0
- f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/net-address/README.md +103 -0
- f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/net-address/main.tf +71 -0
- f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/net-address/outputs.tf +71 -0
- f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/net-address/variables.tf +82 -0
- f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/net-address/versions.tf +27 -0
- f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/outputs.tf +35 -0
- f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/provider.tf +4 -0
- f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/variables.tf +237 -0
- f2dev/_bundle/terraform-modules/oracle_cloud/README.md +3 -0
- f2dev/launcher.py +153 -0
- fast2dev-1.0.0.dist-info/METADATA +201 -0
- fast2dev-1.0.0.dist-info/RECORD +543 -0
- fast2dev-1.0.0.dist-info/WHEEL +4 -0
- fast2dev-1.0.0.dist-info/entry_points.txt +2 -0
- fast2dev-1.0.0.dist-info/licenses/LICENSE +202 -0
- 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()
|