fdai-deployment-cli 0.1.2__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.
- fdai_deployment_cli/__about__.py +3 -0
- fdai_deployment_cli/__init__.py +5 -0
- fdai_deployment_cli/__main__.py +5 -0
- fdai_deployment_cli/acr_publish.py +585 -0
- fdai_deployment_cli/aks_catalog_review.py +137 -0
- fdai_deployment_cli/aks_historical_reconciliation.py +732 -0
- fdai_deployment_cli/aks_job_environment.py +59 -0
- fdai_deployment_cli/aks_job_execution.py +794 -0
- fdai_deployment_cli/aks_kubernetes_defaults.py +66 -0
- fdai_deployment_cli/aks_preflight.py +422 -0
- fdai_deployment_cli/aks_readiness.py +220 -0
- fdai_deployment_cli/aks_service_update.py +180 -0
- fdai_deployment_cli/aks_workload_jobs.py +281 -0
- fdai_deployment_cli/application_state_adoption.py +347 -0
- fdai_deployment_cli/azure_actor.py +61 -0
- fdai_deployment_cli/azure_naming.py +252 -0
- fdai_deployment_cli/azure_retail_prices.py +173 -0
- fdai_deployment_cli/bootstrap_approval.py +99 -0
- fdai_deployment_cli/bootstrap_channel.py +321 -0
- fdai_deployment_cli/bootstrap_executor.py +311 -0
- fdai_deployment_cli/bootstrap_plan.py +237 -0
- fdai_deployment_cli/bootstrap_reconcile.py +402 -0
- fdai_deployment_cli/bootstrap_support.py +138 -0
- fdai_deployment_cli/bootstrap_worker.py +448 -0
- fdai_deployment_cli/bundle.py +352 -0
- fdai_deployment_cli/capacity.py +143 -0
- fdai_deployment_cli/catalog_review_profile.py +306 -0
- fdai_deployment_cli/cli.py +798 -0
- fdai_deployment_cli/cli_help.py +214 -0
- fdai_deployment_cli/cli_parser.py +791 -0
- fdai_deployment_cli/cli_plan.py +450 -0
- fdai_deployment_cli/compiler.py +99 -0
- fdai_deployment_cli/console_artifact.py +218 -0
- fdai_deployment_cli/console_config.py +214 -0
- fdai_deployment_cli/console_update.py +832 -0
- fdai_deployment_cli/contracts.py +307 -0
- fdai_deployment_cli/control_package.py +140 -0
- fdai_deployment_cli/deadline_transport.py +70 -0
- fdai_deployment_cli/deployment_cost.py +131 -0
- fdai_deployment_cli/deployment_deadline.py +28 -0
- fdai_deployment_cli/deployment_kit.py +790 -0
- fdai_deployment_cli/deployment_kit_cache.py +191 -0
- fdai_deployment_cli/deployment_progress.py +648 -0
- fdai_deployment_cli/development_authority_cli.py +56 -0
- fdai_deployment_cli/development_authority_profile.py +319 -0
- fdai_deployment_cli/doctor.py +136 -0
- fdai_deployment_cli/entitlement_preflight.py +68 -0
- fdai_deployment_cli/entitlement_transport.py +49 -0
- fdai_deployment_cli/entra_bootstrap.py +579 -0
- fdai_deployment_cli/entra_control_profile.py +214 -0
- fdai_deployment_cli/entra_graph.py +349 -0
- fdai_deployment_cli/entra_profiles.py +215 -0
- fdai_deployment_cli/entra_source.py +244 -0
- fdai_deployment_cli/execution_bundle.py +478 -0
- fdai_deployment_cli/execution_copies.py +63 -0
- fdai_deployment_cli/foundation_adoption.py +438 -0
- fdai_deployment_cli/foundation_adoption_evidence.py +245 -0
- fdai_deployment_cli/foundation_adoption_host.py +157 -0
- fdai_deployment_cli/foundation_adoption_transport.py +51 -0
- fdai_deployment_cli/foundation_failure.py +72 -0
- fdai_deployment_cli/foundation_image.py +168 -0
- fdai_deployment_cli/foundation_input.py +235 -0
- fdai_deployment_cli/foundation_output.py +154 -0
- fdai_deployment_cli/foundation_plan.py +381 -0
- fdai_deployment_cli/foundation_process.py +64 -0
- fdai_deployment_cli/foundation_progress.py +231 -0
- fdai_deployment_cli/github_actions.py +171 -0
- fdai_deployment_cli/github_apply_artifact.py +259 -0
- fdai_deployment_cli/github_artifact_io.py +48 -0
- fdai_deployment_cli/github_dispatch.py +248 -0
- fdai_deployment_cli/github_plan_artifact.py +181 -0
- fdai_deployment_cli/github_provider_artifact.py +170 -0
- fdai_deployment_cli/github_transport.py +46 -0
- fdai_deployment_cli/github_workflow_values.py +312 -0
- fdai_deployment_cli/hub_image_deploy.py +354 -0
- fdai_deployment_cli/hub_image_stage.py +162 -0
- fdai_deployment_cli/hub_image_trust.py +281 -0
- fdai_deployment_cli/hub_ownership.py +161 -0
- fdai_deployment_cli/hub_workload_handoff.py +264 -0
- fdai_deployment_cli/hub_workload_handoff_inputs.py +227 -0
- fdai_deployment_cli/identity_profile.py +227 -0
- fdai_deployment_cli/image_targets.py +197 -0
- fdai_deployment_cli/installation_scope.py +280 -0
- fdai_deployment_cli/license.py +311 -0
- fdai_deployment_cli/license_issue.py +239 -0
- fdai_deployment_cli/lifecycle_authorization.py +252 -0
- fdai_deployment_cli/lifecycle_commands.py +173 -0
- fdai_deployment_cli/lifecycle_configuration.py +722 -0
- fdai_deployment_cli/lifecycle_configuration_artifact.py +45 -0
- fdai_deployment_cli/lifecycle_configuration_cli.py +324 -0
- fdai_deployment_cli/lifecycle_configuration_document.py +74 -0
- fdai_deployment_cli/lifecycle_configuration_entities.py +146 -0
- fdai_deployment_cli/lifecycle_configuration_package.py +492 -0
- fdai_deployment_cli/lifecycle_configuration_publication.py +277 -0
- fdai_deployment_cli/lifecycle_configuration_publication_cli.py +191 -0
- fdai_deployment_cli/lifecycle_configuration_sealing.py +127 -0
- fdai_deployment_cli/lifecycle_enrollment.py +45 -0
- fdai_deployment_cli/lifecycle_infrastructure_agent.py +174 -0
- fdai_deployment_cli/lifecycle_installation_binding.py +65 -0
- fdai_deployment_cli/lifecycle_native.py +247 -0
- fdai_deployment_cli/lifecycle_native_reconciliation.py +568 -0
- fdai_deployment_cli/lifecycle_native_transition.py +339 -0
- fdai_deployment_cli/lifecycle_ownership_exclusion.py +78 -0
- fdai_deployment_cli/lifecycle_plan.py +800 -0
- fdai_deployment_cli/lifecycle_promotion.py +185 -0
- fdai_deployment_cli/lifecycle_release.py +308 -0
- fdai_deployment_cli/lifecycle_self_upgrade.py +202 -0
- fdai_deployment_cli/lifecycle_upgrade_bundle.py +176 -0
- fdai_deployment_cli/notification_recipients_input.py +222 -0
- fdai_deployment_cli/observer_artifact.py +106 -0
- fdai_deployment_cli/oci_archive.py +353 -0
- fdai_deployment_cli/offline_kit.py +797 -0
- fdai_deployment_cli/offline_prepare.py +135 -0
- fdai_deployment_cli/operational_evidence_verifier_input.py +575 -0
- fdai_deployment_cli/plan_input.py +101 -0
- fdai_deployment_cli/private_output.py +192 -0
- fdai_deployment_cli/profile.py +70 -0
- fdai_deployment_cli/progress.py +183 -0
- fdai_deployment_cli/readiness.py +286 -0
- fdai_deployment_cli/run_command_receiver.py +418 -0
- fdai_deployment_cli/runtime_build.py +386 -0
- fdai_deployment_cli/runtime_profile.py +287 -0
- fdai_deployment_cli/runtime_release.py +745 -0
- fdai_deployment_cli/runtime_stage.py +82 -0
- fdai_deployment_cli/runtime_support_installation.py +215 -0
- fdai_deployment_cli/simulation.py +80 -0
- fdai_deployment_cli/source_application_inputs.py +397 -0
- fdai_deployment_cli/source_azure.py +586 -0
- fdai_deployment_cli/source_change_cli.py +107 -0
- fdai_deployment_cli/source_change_parser.py +75 -0
- fdai_deployment_cli/source_change_plan.py +181 -0
- fdai_deployment_cli/source_changed_update.py +196 -0
- fdai_deployment_cli/source_deploy.py +170 -0
- fdai_deployment_cli/source_foundation.py +174 -0
- fdai_deployment_cli/source_host_tools.py +163 -0
- fdai_deployment_cli/source_image_stage.py +400 -0
- fdai_deployment_cli/source_input.py +173 -0
- fdai_deployment_cli/source_projection.py +164 -0
- fdai_deployment_cli/source_receiver.py +76 -0
- fdai_deployment_cli/source_recovery.py +264 -0
- fdai_deployment_cli/source_runtime.py +81 -0
- fdai_deployment_cli/source_runtime_support.py +368 -0
- fdai_deployment_cli/source_service_update.py +726 -0
- fdai_deployment_cli/source_service_update_cli.py +47 -0
- fdai_deployment_cli/source_snapshot.py +178 -0
- fdai_deployment_cli/source_teardown.py +574 -0
- fdai_deployment_cli/source_terraform.py +85 -0
- fdai_deployment_cli/source_transport.py +399 -0
- fdai_deployment_cli/standalone_aks_inventory.py +558 -0
- fdai_deployment_cli/standalone_aks_job_execution.py +769 -0
- fdai_deployment_cli/standalone_aks_nodepool_guard.py +141 -0
- fdai_deployment_cli/standalone_application.py +977 -0
- fdai_deployment_cli/standalone_application_completion.py +151 -0
- fdai_deployment_cli/standalone_application_input_recovery.py +107 -0
- fdai_deployment_cli/standalone_application_recovery.py +116 -0
- fdai_deployment_cli/standalone_approval_input.py +24 -0
- fdai_deployment_cli/standalone_catalog_checkpoint.py +122 -0
- fdai_deployment_cli/standalone_catalog_review.py +251 -0
- fdai_deployment_cli/standalone_checkpoint_failure.py +127 -0
- fdai_deployment_cli/standalone_console_publish.py +174 -0
- fdai_deployment_cli/standalone_database_principals.py +41 -0
- fdai_deployment_cli/standalone_deploy.py +638 -0
- fdai_deployment_cli/standalone_development_authority.py +166 -0
- fdai_deployment_cli/standalone_foundation_adoption.py +87 -0
- fdai_deployment_cli/standalone_foundation_transition.py +767 -0
- fdai_deployment_cli/standalone_host.py +4608 -0
- fdai_deployment_cli/standalone_host_rebind.py +226 -0
- fdai_deployment_cli/standalone_host_residual.py +104 -0
- fdai_deployment_cli/standalone_host_state.py +145 -0
- fdai_deployment_cli/standalone_host_values.py +563 -0
- fdai_deployment_cli/standalone_kubernetes_tools.py +100 -0
- fdai_deployment_cli/standalone_license_installation.py +177 -0
- fdai_deployment_cli/standalone_management_egress.py +83 -0
- fdai_deployment_cli/standalone_migration_evidence.py +38 -0
- fdai_deployment_cli/standalone_operational_evidence.py +356 -0
- fdai_deployment_cli/standalone_planned_outputs.py +147 -0
- fdai_deployment_cli/standalone_private_access_probe.py +100 -0
- fdai_deployment_cli/standalone_product_profile.py +110 -0
- fdai_deployment_cli/standalone_remote_prepare.py +442 -0
- fdai_deployment_cli/standalone_residual_apply.py +540 -0
- fdai_deployment_cli/standalone_residual_successor.py +431 -0
- fdai_deployment_cli/standalone_review.py +266 -0
- fdai_deployment_cli/standalone_service_update_finalization.py +116 -0
- fdai_deployment_cli/standalone_service_update_recovery.py +277 -0
- fdai_deployment_cli/standalone_stage_targets.py +325 -0
- fdai_deployment_cli/standalone_status.py +67 -0
- fdai_deployment_cli/standalone_terraform_environment.py +237 -0
- fdai_deployment_cli/standalone_transfer_cleanup.py +237 -0
- fdai_deployment_cli/standalone_trial_activation.py +193 -0
- fdai_deployment_cli/state.py +434 -0
- fdai_deployment_cli/state_handoff.py +253 -0
- fdai_deployment_cli/status_projection.py +97 -0
- fdai_deployment_cli/support_install.py +257 -0
- fdai_deployment_cli/target.py +46 -0
- fdai_deployment_cli/trust/capabilities.json +62 -0
- fdai_deployment_cli/trust/deployment-bundle-root.pub +3 -0
- fdai_deployment_cli/trust/deployment-release-root.pub +3 -0
- fdai_deployment_cli/trust/upstream-signing-key.pub +3 -0
- fdai_deployment_cli/trust_roots.py +50 -0
- fdai_deployment_cli-0.1.2.dist-info/METADATA +112 -0
- fdai_deployment_cli-0.1.2.dist-info/RECORD +203 -0
- fdai_deployment_cli-0.1.2.dist-info/WHEEL +4 -0
- fdai_deployment_cli-0.1.2.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"""Resolve an AKS catalog-review Job from a protected GitOps binding."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
from collections.abc import Mapping
|
|
7
|
+
from dataclasses import dataclass
|
|
8
|
+
|
|
9
|
+
_GIT_REF_NAME = re.compile(r"^[A-Za-z0-9](?:[A-Za-z0-9_.-]{0,99})$")
|
|
10
|
+
_SECRET_ID = re.compile(
|
|
11
|
+
r"^/subscriptions/[^/]+/resourceGroups/[^/]+/providers/"
|
|
12
|
+
r"Microsoft[.]KeyVault/vaults/[^/]+/secrets/([^/]+)$",
|
|
13
|
+
re.IGNORECASE,
|
|
14
|
+
)
|
|
15
|
+
_SOURCE_REVISION = re.compile(r"^[0-9a-f]{40}$")
|
|
16
|
+
|
|
17
|
+
FROZEN_MANIFEST_PATH = (
|
|
18
|
+
"services/core-control-plane/tests/scenarios/operational-learning/"
|
|
19
|
+
"v2026.08-governed-learning.json"
|
|
20
|
+
)
|
|
21
|
+
FROZEN_SCENARIO_DIRECTORY = "services/core-control-plane/tests/scenarios/v2026.09"
|
|
22
|
+
REQUIRED_GITHUB_APP_PERMISSIONS = {
|
|
23
|
+
"contents": "write",
|
|
24
|
+
"issues": "write",
|
|
25
|
+
"metadata": "read",
|
|
26
|
+
"pull_requests": "write",
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass(frozen=True, slots=True)
|
|
31
|
+
class AksCatalogReviewConfiguration:
|
|
32
|
+
"""Value-only and secret-reference inputs for one suspended Job template."""
|
|
33
|
+
|
|
34
|
+
environment: dict[str, str]
|
|
35
|
+
secret_environment: dict[str, str]
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def aks_catalog_review_configuration(
|
|
39
|
+
binding: object,
|
|
40
|
+
*,
|
|
41
|
+
selected: bool,
|
|
42
|
+
source_revision: str,
|
|
43
|
+
) -> AksCatalogReviewConfiguration | None:
|
|
44
|
+
"""Validate one Terraform-owned private binding without resolving its secret."""
|
|
45
|
+
|
|
46
|
+
if not selected:
|
|
47
|
+
if binding is not None:
|
|
48
|
+
raise ValueError("unselected catalog review has an unexpected GitOps binding")
|
|
49
|
+
return None
|
|
50
|
+
if binding is None:
|
|
51
|
+
raise ValueError("selected catalog review private GitOps binding is unavailable")
|
|
52
|
+
if _SOURCE_REVISION.fullmatch(source_revision) is None:
|
|
53
|
+
raise ValueError("catalog review source revision MUST be an exact git SHA")
|
|
54
|
+
value = _mapping(binding)
|
|
55
|
+
if value.get("enabled") is not True:
|
|
56
|
+
raise ValueError("catalog review GitOps binding is not enabled")
|
|
57
|
+
owner = _required_name(value, "owner")
|
|
58
|
+
repo = _required_name(value, "repo")
|
|
59
|
+
auth_mode = value.get("auth_mode")
|
|
60
|
+
default_branch = value.get("default_branch")
|
|
61
|
+
permissions = value.get("permissions")
|
|
62
|
+
if (
|
|
63
|
+
auth_mode != "github_app"
|
|
64
|
+
or not isinstance(default_branch, str)
|
|
65
|
+
or not default_branch
|
|
66
|
+
or permissions != REQUIRED_GITHUB_APP_PERMISSIONS
|
|
67
|
+
):
|
|
68
|
+
raise ValueError("catalog review requires the exact GitHub App permission projection")
|
|
69
|
+
environment = {
|
|
70
|
+
"FDAI_CATALOG_REVIEW_ENABLED": "1",
|
|
71
|
+
"FDAI_CATALOG_REVIEW_PROTECTED_BINDING": "1",
|
|
72
|
+
"FDAI_CATALOG_REVIEW_SOURCE_REVISION": source_revision,
|
|
73
|
+
"FDAI_CATALOG_REVIEW_EXPECTED_SCENARIO_SET_VERSION": "v2026.08",
|
|
74
|
+
"FDAI_CATALOG_REVIEW_FROZEN_MANIFEST": FROZEN_MANIFEST_PATH,
|
|
75
|
+
"FDAI_CATALOG_REVIEW_SCENARIO_DIR": FROZEN_SCENARIO_DIRECTORY,
|
|
76
|
+
"FDAI_CATALOG_REVIEW_SCENARIO_SET_ID": "v2026.09",
|
|
77
|
+
"FDAI_CATALOG_REVIEW_POLICY_VERSION": "operational-catalog-policy-v1",
|
|
78
|
+
"FDAI_CATALOG_REVIEW_TIMEOUT_SECONDS": "240",
|
|
79
|
+
"FDAI_EXECUTION_VENUE": "deployed",
|
|
80
|
+
"FDAI_GITOPS_OWNER": owner,
|
|
81
|
+
"FDAI_GITOPS_REPO": repo,
|
|
82
|
+
"FDAI_GITOPS_DEFAULT_BRANCH": default_branch,
|
|
83
|
+
}
|
|
84
|
+
client_id = value.get("app_client_id")
|
|
85
|
+
installation_id = value.get("app_installation_id")
|
|
86
|
+
if (
|
|
87
|
+
not isinstance(client_id, str)
|
|
88
|
+
or not client_id.strip()
|
|
89
|
+
or len(client_id) > 256
|
|
90
|
+
or not isinstance(installation_id, str)
|
|
91
|
+
or re.fullmatch(r"[1-9][0-9]*", installation_id) is None
|
|
92
|
+
):
|
|
93
|
+
raise ValueError("catalog review GitHub App binding is incomplete")
|
|
94
|
+
environment.update(
|
|
95
|
+
{
|
|
96
|
+
"FDAI_GITHUB_APP_CLIENT_ID": client_id.strip(),
|
|
97
|
+
"FDAI_GITHUB_APP_INSTALLATION_ID": installation_id,
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
secret_environment = {
|
|
101
|
+
"FDAI_GITHUB_APP_PRIVATE_KEY": _secret_name(value.get("app_private_key_secret_id"))
|
|
102
|
+
}
|
|
103
|
+
return AksCatalogReviewConfiguration(
|
|
104
|
+
environment=environment,
|
|
105
|
+
secret_environment=secret_environment,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def _required_name(value: Mapping[str, object], key: str) -> str:
|
|
110
|
+
item = value.get(key)
|
|
111
|
+
if not isinstance(item, str) or item != item.strip() or _GIT_REF_NAME.fullmatch(item) is None:
|
|
112
|
+
raise ValueError(f"catalog review GitOps {key} is invalid")
|
|
113
|
+
return item
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def _secret_name(value: object) -> str:
|
|
117
|
+
if not isinstance(value, str):
|
|
118
|
+
raise ValueError("catalog review private GitOps credential binding is unavailable")
|
|
119
|
+
match = _SECRET_ID.fullmatch(value)
|
|
120
|
+
if match is None or _GIT_REF_NAME.fullmatch(match.group(1)) is None:
|
|
121
|
+
raise ValueError("catalog review private GitOps credential binding is unavailable")
|
|
122
|
+
return match.group(1)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def _mapping(value: object) -> Mapping[str, object]:
|
|
126
|
+
if not isinstance(value, Mapping) or any(not isinstance(key, str) for key in value):
|
|
127
|
+
raise ValueError("catalog review GitOps binding MUST be an object")
|
|
128
|
+
return value
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
__all__ = [
|
|
132
|
+
"AksCatalogReviewConfiguration",
|
|
133
|
+
"FROZEN_MANIFEST_PATH",
|
|
134
|
+
"FROZEN_SCENARIO_DIRECTORY",
|
|
135
|
+
"REQUIRED_GITHUB_APP_PERMISSIONS",
|
|
136
|
+
"aks_catalog_review_configuration",
|
|
137
|
+
]
|