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,179 @@
|
|
|
1
|
+
"""Restore a deployment from its encrypted deployment-files repository (``--from-repo``).
|
|
2
|
+
|
|
3
|
+
Phase 6 encrypts every generated file (Terraform inputs, Helm values, realm, the secrets
|
|
4
|
+
file and the installer state) and pushes it to the deployment repository. This module
|
|
5
|
+
clones that repository, decrypts it and puts every file back where the installer expects
|
|
6
|
+
it, so phases, upgrades or another phase 6 can run from a fresh machine.
|
|
7
|
+
"""
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import json
|
|
11
|
+
import os
|
|
12
|
+
import shutil
|
|
13
|
+
import subprocess
|
|
14
|
+
import tempfile
|
|
15
|
+
from dataclasses import dataclass, field
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
|
|
18
|
+
from cryptography.fernet import Fernet, InvalidToken
|
|
19
|
+
|
|
20
|
+
from cli.state import vault_structure_path
|
|
21
|
+
|
|
22
|
+
ROOT_FOLDERS = {
|
|
23
|
+
"core-infrastructure-deployment": "core_infrastructure",
|
|
24
|
+
"k8s-infrastructure-services-deployment": "k8s_core_services",
|
|
25
|
+
"k8s-data-platform-services-deployment": "k8s_data_services",
|
|
26
|
+
}
|
|
27
|
+
INSTALLER_FOLDER = "installer"
|
|
28
|
+
STATE_FILE_NAME = "deployment_state.json"
|
|
29
|
+
STRUCTURE_SUFFIX = "_customer_vault_structure.json"
|
|
30
|
+
SKIPPED_NAMES = {"README.md", "DR.md", "encrypt_files.py", "decrypt_files.py", ".gitignore"}
|
|
31
|
+
PRIVATE_FILES = (STRUCTURE_SUFFIX, STATE_FILE_NAME, "sa_key.txt", "kubeconfig", "_realm.json")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class RestoreError(RuntimeError):
|
|
35
|
+
pass
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@dataclass
|
|
39
|
+
class RestorePlan:
|
|
40
|
+
customer: str
|
|
41
|
+
cloud_provider: str
|
|
42
|
+
files: dict[Path, bytes] = field(default_factory=dict)
|
|
43
|
+
undecryptable: list[str] = field(default_factory=list)
|
|
44
|
+
|
|
45
|
+
def existing(self) -> list[Path]:
|
|
46
|
+
return sorted(p for p in self.files if p.exists())
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def clone(repo_url: str, target: Path, access_token: str | None = None) -> None:
|
|
50
|
+
url = repo_url
|
|
51
|
+
if access_token and url.startswith("https://"):
|
|
52
|
+
url = url.replace("https://", f"https://oauth2:{access_token}@", 1)
|
|
53
|
+
result = subprocess.run(["git", "clone", "--depth", "1", url, str(target)], capture_output=True, text=True)
|
|
54
|
+
if result.returncode != 0:
|
|
55
|
+
message = result.stderr.replace(access_token, "***") if access_token else result.stderr
|
|
56
|
+
raise RestoreError(f"git clone failed: {message.strip()[:300]}")
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def _source_resolver(customer: str, cloud_provider: str, terraform_state: str = "remote"):
|
|
60
|
+
from utils.infrastructure_deployment_operator import InfrastructureDeploymentOperator as Operator
|
|
61
|
+
|
|
62
|
+
operator = object.__new__(Operator)
|
|
63
|
+
operator.customer = customer
|
|
64
|
+
operator.cloud_provider = cloud_provider
|
|
65
|
+
operator.terraform_state = terraform_state
|
|
66
|
+
return operator._get_source_path
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def _decrypt(fernet: Fernet, path: Path) -> bytes | None:
|
|
70
|
+
try:
|
|
71
|
+
return fernet.decrypt(path.read_bytes())
|
|
72
|
+
except InvalidToken:
|
|
73
|
+
return None
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def build_plan(repo_dir: Path, key: str, state_file: str, root: Path = Path(".")) -> RestorePlan:
|
|
77
|
+
"""Decrypt the repository in memory and work out where every file goes. Writes nothing."""
|
|
78
|
+
try:
|
|
79
|
+
fernet = Fernet(key.encode())
|
|
80
|
+
except (ValueError, TypeError) as exc:
|
|
81
|
+
raise RestoreError("The encryption key is not a valid Fernet key") from exc
|
|
82
|
+
|
|
83
|
+
installer = repo_dir / INSTALLER_FOLDER
|
|
84
|
+
structures = sorted(installer.glob(f"*{STRUCTURE_SUFFIX}")) if installer.is_dir() else []
|
|
85
|
+
if not structures:
|
|
86
|
+
raise RestoreError("The repository has no installer/ secrets file; run phase 6 with this installer version first")
|
|
87
|
+
customer = structures[0].name[: -len(STRUCTURE_SUFFIX)]
|
|
88
|
+
|
|
89
|
+
secrets = _decrypt(fernet, structures[0])
|
|
90
|
+
if secrets is None:
|
|
91
|
+
raise RestoreError("The key does not decrypt this repository (wrong or older key)")
|
|
92
|
+
|
|
93
|
+
cloud_provider, terraform_state = "gcp", "remote"
|
|
94
|
+
state_bytes = None
|
|
95
|
+
if (installer / STATE_FILE_NAME).exists():
|
|
96
|
+
state_bytes = _decrypt(fernet, installer / STATE_FILE_NAME)
|
|
97
|
+
if state_bytes is not None:
|
|
98
|
+
config = json.loads(state_bytes).get("config", {})
|
|
99
|
+
cloud_provider = config.get("cloud_provider") or cloud_provider
|
|
100
|
+
terraform_state = config.get("gcp_terraform_state") or terraform_state
|
|
101
|
+
|
|
102
|
+
plan = RestorePlan(customer=customer, cloud_provider=cloud_provider)
|
|
103
|
+
plan.files[Path(vault_structure_path(customer))] = secrets
|
|
104
|
+
if state_bytes is not None:
|
|
105
|
+
plan.files[root / state_file] = state_bytes
|
|
106
|
+
from cli.command_record import RECORD_FILE
|
|
107
|
+
if (installer / RECORD_FILE.name).exists():
|
|
108
|
+
commands = _decrypt(fernet, installer / RECORD_FILE.name)
|
|
109
|
+
if commands is not None:
|
|
110
|
+
plan.files[root / RECORD_FILE] = commands
|
|
111
|
+
|
|
112
|
+
source_path = _source_resolver(customer, cloud_provider, terraform_state)
|
|
113
|
+
for folder in ROOT_FOLDERS:
|
|
114
|
+
base = repo_dir / folder
|
|
115
|
+
if not base.is_dir():
|
|
116
|
+
continue
|
|
117
|
+
for current, dirs, files in os.walk(base):
|
|
118
|
+
dirs[:] = [d for d in dirs if d != ".git"]
|
|
119
|
+
for name in files:
|
|
120
|
+
if name in SKIPPED_NAMES:
|
|
121
|
+
continue
|
|
122
|
+
encrypted = Path(current) / name
|
|
123
|
+
directory = os.path.relpath(current, base)
|
|
124
|
+
content = _decrypt(fernet, encrypted)
|
|
125
|
+
if content is None:
|
|
126
|
+
plan.undecryptable.append(str(encrypted.relative_to(repo_dir)))
|
|
127
|
+
continue
|
|
128
|
+
plan.files[root / source_path(directory, name)] = content
|
|
129
|
+
return plan
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def write_plan(plan: RestorePlan) -> list[Path]:
|
|
133
|
+
written = []
|
|
134
|
+
for path, content in sorted(plan.files.items()):
|
|
135
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
136
|
+
path.write_bytes(content)
|
|
137
|
+
if path.name.endswith(PRIVATE_FILES):
|
|
138
|
+
os.chmod(path, 0o600)
|
|
139
|
+
written.append(path)
|
|
140
|
+
return written
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def resolve_key(key_file: str | None, kubeconfig: str | None) -> str | None:
|
|
144
|
+
"""--key-file, then FAST2DEV_DEPLOYMENT_KEY, then the key phase 6 stored in Vault."""
|
|
145
|
+
if key_file:
|
|
146
|
+
return Path(key_file).read_text().strip()
|
|
147
|
+
if os.environ.get("FAST2DEV_DEPLOYMENT_KEY"):
|
|
148
|
+
return os.environ["FAST2DEV_DEPLOYMENT_KEY"].strip()
|
|
149
|
+
if kubeconfig:
|
|
150
|
+
from utils.vault_structure_sync import read_encryption_key
|
|
151
|
+
|
|
152
|
+
try:
|
|
153
|
+
return read_encryption_key(kubeconfig)
|
|
154
|
+
except Exception: # noqa: BLE001
|
|
155
|
+
return None
|
|
156
|
+
return None
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def restore_from_repo(repo_url: str, key: str, state_file: str, access_token: str | None = None,
|
|
160
|
+
confirm=lambda existing: False, echo=print) -> RestorePlan:
|
|
161
|
+
work = Path(tempfile.mkdtemp(prefix="fast2dev-restore-"))
|
|
162
|
+
try:
|
|
163
|
+
clone(repo_url, work / "repo", access_token)
|
|
164
|
+
plan = build_plan(work / "repo", key, state_file)
|
|
165
|
+
existing = plan.existing()
|
|
166
|
+
if existing and not confirm(existing):
|
|
167
|
+
raise RestoreError(f"{len(existing)} files already exist locally; nothing was written")
|
|
168
|
+
written = write_plan(plan)
|
|
169
|
+
echo(f"Restored {len(written)} files for customer '{plan.customer}' ({plan.cloud_provider})")
|
|
170
|
+
if plan.undecryptable:
|
|
171
|
+
echo(f"{len(plan.undecryptable)} files in the repository use another key and were skipped:")
|
|
172
|
+
for name in plan.undecryptable:
|
|
173
|
+
echo(f" - {name}")
|
|
174
|
+
return plan
|
|
175
|
+
finally:
|
|
176
|
+
shutil.rmtree(work, ignore_errors=True)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
__all__ = ["RestoreError", "RestorePlan", "build_plan", "clone", "resolve_key", "restore_from_repo", "write_plan"]
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"""What each service needs before it can deploy, and what "ready" means after it deployed.
|
|
2
|
+
|
|
3
|
+
The phase 4/5 runners call ``blocked_by`` before a service and ``run_gate`` after its
|
|
4
|
+
``run()`` returned. A service is marked deployed only when its gate passed. When a service it
|
|
5
|
+
depends on failed or was not deployed, it is skipped with the reason instead of failing later
|
|
6
|
+
with a confusing error.
|
|
7
|
+
|
|
8
|
+
Dependencies come from what the service's templates use:
|
|
9
|
+
ExternalSecret -> 1.0_secret_operator (Vault + External Secrets)
|
|
10
|
+
Certificate/ClusterIssuer -> 2.0_cert_manager
|
|
11
|
+
IngressRoute/Middleware/ServersTransport -> 4.0_traefik_lb (Traefik CRDs)
|
|
12
|
+
per-service DB users -> 5.0_stackgres_postgresql
|
|
13
|
+
OIDC clients -> 9.0_idp_sso_manager
|
|
14
|
+
Phase 5 runs only after phase 4 completed, so data services list in-phase dependencies only.
|
|
15
|
+
"""
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
import base64
|
|
19
|
+
from typing import Callable
|
|
20
|
+
|
|
21
|
+
from utils import readiness as r
|
|
22
|
+
from utils.vault_structure_sync import root_token
|
|
23
|
+
|
|
24
|
+
DEPENDS_ON: dict[str, list[str]] = {
|
|
25
|
+
# phase 4
|
|
26
|
+
"2.0_cert_manager": ["1.0_secret_operator"],
|
|
27
|
+
"3.0_external_dns": ["1.0_secret_operator"],
|
|
28
|
+
"4.0_traefik_lb": ["2.0_cert_manager"],
|
|
29
|
+
"5.0_stackgres_postgresql": ["1.0_secret_operator", "4.0_traefik_lb"],
|
|
30
|
+
"6.0_services_metrics": ["1.0_secret_operator"],
|
|
31
|
+
"7.0_services_monitoring": ["1.0_secret_operator", "2.0_cert_manager", "5.0_stackgres_postgresql"],
|
|
32
|
+
"9.0_idp_sso_manager": ["1.0_secret_operator", "2.0_cert_manager", "5.0_stackgres_postgresql"],
|
|
33
|
+
# phase 5
|
|
34
|
+
"3.0_data_cicd_workflows": ["2.0_object_storage_operator"],
|
|
35
|
+
"4.0_data_replication": ["2.0_object_storage_operator"],
|
|
36
|
+
"12.0_control_plane": ["2.0_object_storage_operator"],
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
NAMESPACE_TIMEOUT_S = 1200 # includes a node pool scale-up
|
|
40
|
+
GATE_TIMEOUT_S = 600
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def blocked_by(service_file: str, failed: set[str], is_deployed: Callable[[str], bool]) -> str | None:
|
|
44
|
+
"""Reason the service cannot deploy now, or None."""
|
|
45
|
+
for dep in DEPENDS_ON.get(service_file, []):
|
|
46
|
+
if dep in failed:
|
|
47
|
+
return f"{dep} failed in this run"
|
|
48
|
+
if not is_deployed(dep):
|
|
49
|
+
return f"{dep} is not deployed"
|
|
50
|
+
return None
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def run_gate(service_file: str, service, log: Callable[[str], None] = print,
|
|
54
|
+
since: float | None = None) -> None:
|
|
55
|
+
"""Raise ``readiness.GateError`` when the service is not ready."""
|
|
56
|
+
ns, kc = service.namespace, service.kube_config
|
|
57
|
+
log(f" 🔎 Checking {service_file} is ready...")
|
|
58
|
+
specific = SPECIFIC_GATES.get(service_file)
|
|
59
|
+
if specific:
|
|
60
|
+
specific(service, ns, kc, log)
|
|
61
|
+
r.wait_namespace_converged(ns, kc, NAMESPACE_TIMEOUT_S, log, since)
|
|
62
|
+
log(f" ✅ {service_file} is ready")
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
# --------------------------------------------------------------------------- specific gates
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _vault_exec(kc: str, ns: str, command: str) -> str:
|
|
69
|
+
"""Run a vault CLI command in vault-0 with the root token passed on stdin."""
|
|
70
|
+
script = f'read -r T; export VAULT_TOKEN="$T"; {command}'
|
|
71
|
+
res = r.kubectl(["exec", "-i", "vault-0", "-n", ns, "--", "sh", "-c", script], kc,
|
|
72
|
+
stdin=root_token(kc, ns) + "\n")
|
|
73
|
+
if res.returncode != 0:
|
|
74
|
+
raise r.GateError(f"vault command failed: {(res.stderr or res.stdout).strip()[:300]}")
|
|
75
|
+
return res.stdout
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def _gate_secret_operator(service, ns, kc, log):
|
|
79
|
+
def unsealed():
|
|
80
|
+
ok, body = r.api_proxy_get(ns, "vault", 8200, "v1/sys/health", kc)
|
|
81
|
+
return ok, "initialized and unsealed" if ok else (body[:120] or "sealed or not initialized")
|
|
82
|
+
r.wait_until(unsealed, GATE_TIMEOUT_S, "vault unsealed", log)
|
|
83
|
+
for job in ("vault-auth-config", "vault-populator"):
|
|
84
|
+
r.wait_job_complete(ns, job, kc, GATE_TIMEOUT_S, log)
|
|
85
|
+
|
|
86
|
+
def kv_mounted():
|
|
87
|
+
mounts = _vault_exec(kc, ns, "vault secrets list -format=json")
|
|
88
|
+
return '"secret/"' in mounts, "secret/ KV mount present" if '"secret/"' in mounts else "secret/ not mounted"
|
|
89
|
+
r.wait_until(kv_mounted, 120, "vault secret/ mount", log)
|
|
90
|
+
r.wait_condition("clustersecretstore/vault-backend", kc, timeout_s=GATE_TIMEOUT_S, log=log)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def _gate_cert_manager(service, ns, kc, log):
|
|
94
|
+
r.wait_service_endpoints(ns, "cert-manager-webhook", kc, GATE_TIMEOUT_S, log)
|
|
95
|
+
r.wait_all_ready("clusterissuers.cert-manager.io", kc, timeout_s=GATE_TIMEOUT_S, log=log)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def _gate_traefik(service, ns, kc, log):
|
|
99
|
+
ip = r.wait_loadbalancer_ip(ns, kc, GATE_TIMEOUT_S, log)
|
|
100
|
+
log(f" load balancer address: {ip}")
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def _gate_stackgres(service, ns, kc, log):
|
|
104
|
+
r.wait_job_complete(ns, "create-database-init-script", kc, GATE_TIMEOUT_S, log)
|
|
105
|
+
|
|
106
|
+
def scripts_done():
|
|
107
|
+
cluster = r.get_json(["get", "sgcluster", "fast2dev-global-psql", "-n", ns], kc)
|
|
108
|
+
if cluster is None:
|
|
109
|
+
return False, "SGCluster not found yet"
|
|
110
|
+
runs = ((cluster.get("status") or {}).get("managedSql") or {}).get("scripts") or []
|
|
111
|
+
failed = [s.get("failure", "") for run in runs
|
|
112
|
+
if run.get("failedAt") and run.get("failedAt") > (run.get("completedAt") or "")
|
|
113
|
+
for s in run.get("scripts") or [] if s.get("failure")]
|
|
114
|
+
if failed:
|
|
115
|
+
raise r.GateError("database init script failed: " + " | ".join(failed)[:500])
|
|
116
|
+
expected = len(((cluster.get("spec") or {}).get("managedSql") or {}).get("scripts") or [])
|
|
117
|
+
done = [run for run in runs if run.get("completedAt")]
|
|
118
|
+
return (len(done) >= expected and expected > 0), f"{len(done)}/{expected} managed SQL scripts completed"
|
|
119
|
+
r.wait_until(scripts_done, GATE_TIMEOUT_S, "database init scripts", log)
|
|
120
|
+
|
|
121
|
+
users = []
|
|
122
|
+
for sec in r.items(["get", "secrets", "-n", ns], kc):
|
|
123
|
+
if sec["metadata"]["name"].endswith("-database-secrets") and "username" in (sec.get("data") or {}):
|
|
124
|
+
users.append(base64.b64decode(sec["data"]["username"]).decode())
|
|
125
|
+
if not users:
|
|
126
|
+
return
|
|
127
|
+
pods = r.items(["get", "pods", "-n", ns, "-l", "app=StackGresCluster"], kc)
|
|
128
|
+
if not pods:
|
|
129
|
+
raise r.GateError("no StackGres cluster pod")
|
|
130
|
+
res = r.kubectl(["exec", pods[0]["metadata"]["name"], "-n", ns, "-c", "postgres-util", "--",
|
|
131
|
+
"psql", "-U", "postgres", "-tAc", "SELECT rolname FROM pg_roles"], kc)
|
|
132
|
+
roles = set(res.stdout.split())
|
|
133
|
+
missing = [u for u in users if u not in roles]
|
|
134
|
+
if res.returncode != 0 or missing:
|
|
135
|
+
raise r.GateError(f"database users missing: {', '.join(missing) or res.stderr.strip()[:200]}")
|
|
136
|
+
log(f" {len(users)} database users present")
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def _gate_idp_sso(service, ns, kc, log):
|
|
140
|
+
# Converged first: a crash-looping Keycloak is reported with its error, not as a timeout.
|
|
141
|
+
r.wait_namespace_converged(ns, kc, NAMESPACE_TIMEOUT_S, log)
|
|
142
|
+
svc = next((s["metadata"]["name"] for s in r.items(["get", "svc", "-n", ns], kc)
|
|
143
|
+
if (s.get("spec") or {}).get("clusterIP") not in (None, "None")
|
|
144
|
+
and any(p.get("port") == 80 for p in (s.get("spec") or {}).get("ports") or [])), None)
|
|
145
|
+
if not svc:
|
|
146
|
+
raise r.GateError("Keycloak HTTP service not found")
|
|
147
|
+
realm = service.customer
|
|
148
|
+
r.wait_http_ok(ns, svc, 80, f"realms/{realm}/.well-known/openid-configuration", kc, GATE_TIMEOUT_S, log)
|
|
149
|
+
log(f" realm {realm} answers OIDC discovery")
|
|
150
|
+
# Vault's OIDC login is configured by a Job that waits for Keycloak.
|
|
151
|
+
r.wait_job_complete("vault", "vault-oidc-config", kc, GATE_TIMEOUT_S, log)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
SPECIFIC_GATES: dict[str, Callable] = {
|
|
155
|
+
"1.0_secret_operator": _gate_secret_operator,
|
|
156
|
+
"2.0_cert_manager": _gate_cert_manager,
|
|
157
|
+
"4.0_traefik_lb": _gate_traefik,
|
|
158
|
+
"5.0_stackgres_postgresql": _gate_stackgres,
|
|
159
|
+
"9.0_idp_sso_manager": _gate_idp_sso,
|
|
160
|
+
}
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Deployment state persistence.
|
|
3
|
+
|
|
4
|
+
The :class:`DeploymentState` object holds everything the 6-phase
|
|
5
|
+
deployer needs to know to resume an interrupted deployment: the
|
|
6
|
+
collected config, the path to the kubeconfig, which phases have
|
|
7
|
+
completed, and per-service deployment metadata.
|
|
8
|
+
|
|
9
|
+
State is saved to ``cli/state/deployment_state.json`` (git-ignored)
|
|
10
|
+
so that ``python cli.py`` after a partial run can pick up where it
|
|
11
|
+
left off.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import os
|
|
18
|
+
from datetime import datetime
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
from typing import Any, Final
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# Legacy → current key renames for state files persisted by older deployers.
|
|
24
|
+
# Applied on load; idempotent; preserves deployment_info and deployed_at.
|
|
25
|
+
_LEGACY_DATA_SERVICE_RENAMES: Final[tuple[tuple[str, str], ...]] = (
|
|
26
|
+
("9.0_data_governance", "7.0_data_governance"),
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def migrate_legacy_keys(state_data: dict) -> dict:
|
|
31
|
+
"""One-shot rename of legacy data_services keys. Idempotent."""
|
|
32
|
+
if not isinstance(state_data, dict):
|
|
33
|
+
return state_data
|
|
34
|
+
deployed = state_data.get("deployed_services")
|
|
35
|
+
if not isinstance(deployed, dict):
|
|
36
|
+
return state_data
|
|
37
|
+
data_services = deployed.get("data_services")
|
|
38
|
+
if not isinstance(data_services, dict):
|
|
39
|
+
return state_data
|
|
40
|
+
for old_key, new_key in _LEGACY_DATA_SERVICE_RENAMES:
|
|
41
|
+
if old_key in data_services and new_key not in data_services:
|
|
42
|
+
data_services[new_key] = data_services.pop(old_key)
|
|
43
|
+
return state_data
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class DeploymentState:
|
|
47
|
+
"""Persistent state for an in-progress fast2.dev deployment.
|
|
48
|
+
|
|
49
|
+
Attributes
|
|
50
|
+
----------
|
|
51
|
+
config: dict
|
|
52
|
+
The collected configuration (customer, cloud, domain, ...).
|
|
53
|
+
kubeconfig_path: str | None
|
|
54
|
+
Path to the kubeconfig file written by Phase 1.
|
|
55
|
+
infrastructure_deployed / secrets_generated / repositories_configured
|
|
56
|
+
/ infra_services_deployed / data_services_deployed / deployment_finalized: bool
|
|
57
|
+
Phase-completion flags, one per phase.
|
|
58
|
+
deployed_services: dict
|
|
59
|
+
Per-service metadata::
|
|
60
|
+
|
|
61
|
+
{
|
|
62
|
+
"infrastructure_services": {"cert-manager": {...}, ...},
|
|
63
|
+
"data_services": {"airbyte": {...}, ...},
|
|
64
|
+
}
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
PHASE_FLAGS = (
|
|
68
|
+
"infrastructure_deployed",
|
|
69
|
+
"secrets_generated",
|
|
70
|
+
"repositories_configured",
|
|
71
|
+
"infra_services_deployed",
|
|
72
|
+
"data_services_deployed",
|
|
73
|
+
"deployment_finalized",
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
def __init__(self, path: str = "cli/state/deployment_state.json", record_progress: bool = True) -> None:
|
|
77
|
+
self.path = path
|
|
78
|
+
self.record_progress = record_progress
|
|
79
|
+
self.config: dict[str, Any] = {}
|
|
80
|
+
self.kubeconfig_path: str | None = None
|
|
81
|
+
self.infrastructure_deployed = False
|
|
82
|
+
self.secrets_generated = False
|
|
83
|
+
self.repositories_configured = False
|
|
84
|
+
self.infra_services_deployed = False
|
|
85
|
+
self.data_services_deployed = False
|
|
86
|
+
self.deployment_finalized = False
|
|
87
|
+
# Individual service deployment tracking
|
|
88
|
+
self.deployed_services: dict[str, dict[str, dict[str, Any]]] = {
|
|
89
|
+
"infrastructure_services": {},
|
|
90
|
+
"data_services": {},
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
# ------------------------------------------------------------------ I/O
|
|
94
|
+
|
|
95
|
+
def save_state(self, filename: str | None = None) -> None:
|
|
96
|
+
"""Save the state as JSON to ``filename``, or to the file it was loaded from.
|
|
97
|
+
|
|
98
|
+
With ``record_progress`` off (generate-only), only the collected
|
|
99
|
+
configuration is kept: phase flags, kubeconfig and per-service records
|
|
100
|
+
stay empty so a later real deployment starts from phase 1.
|
|
101
|
+
"""
|
|
102
|
+
filename = filename or self.path
|
|
103
|
+
Path(filename).parent.mkdir(parents=True, exist_ok=True)
|
|
104
|
+
|
|
105
|
+
state_data = {
|
|
106
|
+
"config": self.config,
|
|
107
|
+
"kubeconfig_path": self.kubeconfig_path,
|
|
108
|
+
"infrastructure_deployed": self.infrastructure_deployed,
|
|
109
|
+
"secrets_generated": self.secrets_generated,
|
|
110
|
+
"repositories_configured": self.repositories_configured,
|
|
111
|
+
"infra_services_deployed": self.infra_services_deployed,
|
|
112
|
+
"data_services_deployed": self.data_services_deployed,
|
|
113
|
+
"deployment_finalized": self.deployment_finalized,
|
|
114
|
+
"deployed_services": self.deployed_services,
|
|
115
|
+
}
|
|
116
|
+
if not self.record_progress:
|
|
117
|
+
state_data.update(
|
|
118
|
+
{flag: False for flag in self.PHASE_FLAGS},
|
|
119
|
+
kubeconfig_path=None,
|
|
120
|
+
deployed_services={"infrastructure_services": {}, "data_services": {}},
|
|
121
|
+
)
|
|
122
|
+
with open(filename, "w") as f:
|
|
123
|
+
json.dump(state_data, f, indent=2)
|
|
124
|
+
|
|
125
|
+
def load_state(self, filename: str | None = None) -> None:
|
|
126
|
+
"""Load state from ``filename`` if it exists; otherwise keep defaults.
|
|
127
|
+
|
|
128
|
+
Later ``save_state()`` calls without a filename write back to ``filename``.
|
|
129
|
+
"""
|
|
130
|
+
filename = filename or self.path
|
|
131
|
+
self.path = filename
|
|
132
|
+
if not Path(filename).exists():
|
|
133
|
+
return
|
|
134
|
+
with open(filename, "r") as f:
|
|
135
|
+
state_data = json.load(f)
|
|
136
|
+
# Migrate legacy data-service keys (one-shot, idempotent).
|
|
137
|
+
state_data = migrate_legacy_keys(state_data)
|
|
138
|
+
self.config = state_data.get("config", {})
|
|
139
|
+
self.kubeconfig_path = state_data.get("kubeconfig_path")
|
|
140
|
+
self.infrastructure_deployed = state_data.get("infrastructure_deployed", False)
|
|
141
|
+
self.secrets_generated = state_data.get("secrets_generated", False)
|
|
142
|
+
self.repositories_configured = state_data.get("repositories_configured", False)
|
|
143
|
+
self.infra_services_deployed = state_data.get("infra_services_deployed", False)
|
|
144
|
+
self.data_services_deployed = state_data.get("data_services_deployed", False)
|
|
145
|
+
self.deployment_finalized = state_data.get("deployment_finalized", False)
|
|
146
|
+
self.deployed_services = state_data.get(
|
|
147
|
+
"deployed_services",
|
|
148
|
+
{"infrastructure_services": {}, "data_services": {}},
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
# ---------------------------------------------------------------- service metadata
|
|
152
|
+
|
|
153
|
+
def mark_service_deployed(
|
|
154
|
+
self,
|
|
155
|
+
service_type: str,
|
|
156
|
+
service_name: str,
|
|
157
|
+
deployment_info: dict | None = None,
|
|
158
|
+
) -> None:
|
|
159
|
+
"""Mark a single service as deployed (records timestamp + info)."""
|
|
160
|
+
if service_type not in self.deployed_services:
|
|
161
|
+
self.deployed_services[service_type] = {}
|
|
162
|
+
self.deployed_services[service_type][service_name] = {
|
|
163
|
+
"deployed": True,
|
|
164
|
+
"deployed_at": datetime.now().isoformat(),
|
|
165
|
+
"deployment_info": deployment_info or {},
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
def is_service_deployed(self, service_type: str, service_name: str) -> bool:
|
|
169
|
+
"""True if the given service was already marked deployed."""
|
|
170
|
+
return bool(
|
|
171
|
+
self.deployed_services.get(service_type, {})
|
|
172
|
+
.get(service_name, {})
|
|
173
|
+
.get("deployed", False)
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
# ---------------------------------------------------------------------------
|
|
178
|
+
# Secrets store (per-customer, on disk, survives reboots)
|
|
179
|
+
# ---------------------------------------------------------------------------
|
|
180
|
+
# Anything secret-bearing that must survive a reboot of the deployer host
|
|
181
|
+
# lives under ``cli/state/secrets/`` (git-ignored). The directory is
|
|
182
|
+
# created with ``0o700``; every file written here is ``0o600``.
|
|
183
|
+
#
|
|
184
|
+
# Public surface
|
|
185
|
+
# --------------
|
|
186
|
+
# - :func:`vault_structure_path` — absolute path to the per-customer
|
|
187
|
+
# vault structure JSON used by every deployer that reads generated
|
|
188
|
+
# secrets.
|
|
189
|
+
# - :func:`scratch_path` — path for short-lived intermediates (Snowflake
|
|
190
|
+
# keys, ...) that must survive a process
|
|
191
|
+
# crash but should be cleaned up at deploy end.
|
|
192
|
+
# - :func:`record` / :func:`mark_phase_used` / :func:`cleanup` — tiny
|
|
193
|
+
# manifest that tracks which files belong to which customer and which
|
|
194
|
+
# phases still need them, so the final-phase cleanup can safely
|
|
195
|
+
# delete them.
|
|
196
|
+
# - :envvar:`FAST2DEV_SECRETS_DIR` — overrides the secrets directory
|
|
197
|
+
# (mostly for tests).
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
_HERE: Final[Path] = Path(__file__).resolve().parent
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
def _resolve_secrets_dir() -> Path:
|
|
204
|
+
"""Default: ``cli/state/secrets/``. Override with ``FAST2DEV_SECRETS_DIR``.
|
|
205
|
+
|
|
206
|
+
Re-read each call so test runs (and rebind) work without module
|
|
207
|
+
reload gymnastics.
|
|
208
|
+
"""
|
|
209
|
+
override = os.environ.get("FAST2DEV_SECRETS_DIR")
|
|
210
|
+
if override:
|
|
211
|
+
return Path(override).expanduser()
|
|
212
|
+
return _HERE / "state" / "secrets"
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def secrets_dir() -> Path:
|
|
216
|
+
"""Live SECRETS_DIR — uses current env, not import-time capture."""
|
|
217
|
+
return _resolve_secrets_dir()
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
def _vault_filename(customer: str) -> str:
|
|
221
|
+
return f"{customer}_customer_vault_structure.json"
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
def vault_structure_path(customer: str) -> Path:
|
|
225
|
+
"""Absolute path of the per-customer vault structure JSON."""
|
|
226
|
+
return secrets_dir() / _vault_filename(customer)
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
def scratch_path(name: str, customer: str | None = None) -> Path:
|
|
230
|
+
"""Path for short-lived intermediates under ``cli/state/secrets/``."""
|
|
231
|
+
if customer:
|
|
232
|
+
return secrets_dir() / f"{customer}_{name}"
|
|
233
|
+
return secrets_dir() / name
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
def _manifest_path() -> Path:
|
|
237
|
+
return secrets_dir() / "secrets_manifest.json"
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
_MANIFEST: Final[Path] = _manifest_path()
|
|
241
|
+
|
|
242
|
+
_PHASE_ORDER: Final[tuple[str, ...]] = (
|
|
243
|
+
"infrastructure_deployed",
|
|
244
|
+
"secrets_generated",
|
|
245
|
+
"repositories_configured",
|
|
246
|
+
"infra_services_deployed",
|
|
247
|
+
"data_services_deployed",
|
|
248
|
+
"deployment_finalized",
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
def _load_manifest() -> dict:
|
|
253
|
+
mp = _manifest_path()
|
|
254
|
+
if not mp.exists():
|
|
255
|
+
return {}
|
|
256
|
+
try:
|
|
257
|
+
with mp.open("r") as f:
|
|
258
|
+
return json.load(f)
|
|
259
|
+
except (json.JSONDecodeError, OSError):
|
|
260
|
+
return {}
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
def _save_manifest(manifest: dict) -> None:
|
|
264
|
+
mp = _manifest_path()
|
|
265
|
+
secrets_dir().mkdir(parents=True, exist_ok=True, mode=0o700)
|
|
266
|
+
fd = os.open(
|
|
267
|
+
str(mp),
|
|
268
|
+
os.O_WRONLY | os.O_CREAT | os.O_TRUNC,
|
|
269
|
+
0o600,
|
|
270
|
+
)
|
|
271
|
+
os.fchmod(fd, 0o600)
|
|
272
|
+
with os.fdopen(fd, "w") as f:
|
|
273
|
+
json.dump(manifest, f, indent=2)
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
def record(customer: str, file: Path, phases_remaining: list[str]) -> None:
|
|
277
|
+
"""Track a secrets file as still in use."""
|
|
278
|
+
manifest = _load_manifest()
|
|
279
|
+
manifest[str(file)] = {
|
|
280
|
+
"customer": customer,
|
|
281
|
+
"phases_remaining": list(phases_remaining),
|
|
282
|
+
}
|
|
283
|
+
_save_manifest(manifest)
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
def mark_phase_used(customer: str, current_phase: str, file: Path | None = None) -> None:
|
|
287
|
+
"""Drop ``current_phase`` from each tracked file's remaining list."""
|
|
288
|
+
manifest = _load_manifest()
|
|
289
|
+
changed = False
|
|
290
|
+
for path, meta in manifest.items():
|
|
291
|
+
if meta.get("customer") != customer:
|
|
292
|
+
continue
|
|
293
|
+
if file is not None and Path(path) != file:
|
|
294
|
+
continue
|
|
295
|
+
phases = meta.get("phases_remaining", [])
|
|
296
|
+
if current_phase in phases:
|
|
297
|
+
phases.remove(current_phase)
|
|
298
|
+
meta["phases_remaining"] = phases
|
|
299
|
+
changed = True
|
|
300
|
+
if changed:
|
|
301
|
+
_save_manifest(manifest)
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
def cleanup(customer: str) -> list[Path]:
|
|
305
|
+
"""Delete this customer's secret files whose phases are exhausted."""
|
|
306
|
+
manifest = _load_manifest()
|
|
307
|
+
removed: list[Path] = []
|
|
308
|
+
survivors: dict[str, dict] = {}
|
|
309
|
+
for path_str, meta in manifest.items():
|
|
310
|
+
if meta.get("customer") != customer:
|
|
311
|
+
survivors[path_str] = meta
|
|
312
|
+
continue
|
|
313
|
+
remaining = meta.get("phases_remaining", [])
|
|
314
|
+
if remaining:
|
|
315
|
+
survivors[path_str] = meta
|
|
316
|
+
continue
|
|
317
|
+
p = Path(path_str)
|
|
318
|
+
try:
|
|
319
|
+
if p.exists():
|
|
320
|
+
p.unlink()
|
|
321
|
+
removed.append(p)
|
|
322
|
+
except OSError:
|
|
323
|
+
survivors[path_str] = meta
|
|
324
|
+
_save_manifest(survivors)
|
|
325
|
+
return removed
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
def init_secrets_dir() -> Path:
|
|
329
|
+
"""Ensure ``secrets_dir()`` exists with mode 0o700."""
|
|
330
|
+
sd = secrets_dir()
|
|
331
|
+
sd.mkdir(parents=True, exist_ok=True, mode=0o700)
|
|
332
|
+
return sd
|