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,166 @@
|
|
|
1
|
+
"""Managed-host selection and reconciliation of development authority."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
from collections.abc import Callable
|
|
7
|
+
from dataclasses import dataclass
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
from fdai_deployment_cli.development_authority_profile import (
|
|
11
|
+
DevelopmentAuthorityDeploymentProfile,
|
|
12
|
+
apply_development_authority_profile,
|
|
13
|
+
clear_development_authority_profile,
|
|
14
|
+
load_development_authority_profile,
|
|
15
|
+
staged_development_authority_profile_from_path,
|
|
16
|
+
validate_deployment_target,
|
|
17
|
+
)
|
|
18
|
+
from fdai_deployment_cli.standalone_operational_evidence import bind_service_database_role
|
|
19
|
+
|
|
20
|
+
_PROFILE_ENV = "FDAI_FULL_AUTHORITY_DEVELOPMENT_PROFILE_JSON"
|
|
21
|
+
_EXECUTOR_ENV = "FDAI_FULL_AUTHORITY_DEVELOPMENT_EXECUTOR_PRINCIPAL"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@dataclass(frozen=True, slots=True)
|
|
25
|
+
class ManagedDevelopmentAuthority:
|
|
26
|
+
"""One explicitly selected profile operation on the managed host."""
|
|
27
|
+
|
|
28
|
+
profile: DevelopmentAuthorityDeploymentProfile | None
|
|
29
|
+
clear: bool
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def input_digest(self) -> str:
|
|
33
|
+
return self.profile.input_digest if self.profile is not None else ""
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def development_authority_from_args(
|
|
37
|
+
args: argparse.Namespace,
|
|
38
|
+
*,
|
|
39
|
+
absolute: Callable[[Path], Path],
|
|
40
|
+
) -> ManagedDevelopmentAuthority:
|
|
41
|
+
"""Load the staged profile and reject an ambiguous select-and-clear request."""
|
|
42
|
+
|
|
43
|
+
path = getattr(args, "development_authority_profile", None)
|
|
44
|
+
if path is not None and not isinstance(path, Path):
|
|
45
|
+
raise TypeError("development authority profile path is invalid")
|
|
46
|
+
profile = staged_development_authority_profile_from_path(
|
|
47
|
+
absolute(path) if path is not None else None
|
|
48
|
+
)
|
|
49
|
+
clear = bool(getattr(args, "clear_development_authority_profile", False))
|
|
50
|
+
if profile is not None and clear:
|
|
51
|
+
raise ValueError("development authority profile and clear request are mutually exclusive")
|
|
52
|
+
return ManagedDevelopmentAuthority(profile=profile, clear=clear)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def reconcile_retained_development_authority(
|
|
56
|
+
selection: ManagedDevelopmentAuthority,
|
|
57
|
+
*,
|
|
58
|
+
retained: dict[str, object],
|
|
59
|
+
values: dict[str, object],
|
|
60
|
+
tenant_id: str,
|
|
61
|
+
subscription_id: str,
|
|
62
|
+
resource_groups: tuple[str, ...],
|
|
63
|
+
) -> bool:
|
|
64
|
+
"""Apply an explicit select or clear operation after source rebinding."""
|
|
65
|
+
|
|
66
|
+
if selection.clear:
|
|
67
|
+
changed = clear_development_authority_profile(values)
|
|
68
|
+
return retained.pop("development_authority_profile_digest", None) is not None or changed
|
|
69
|
+
if selection.profile is None:
|
|
70
|
+
return False
|
|
71
|
+
validate_deployment_target(
|
|
72
|
+
selection.profile,
|
|
73
|
+
tenant_id=tenant_id,
|
|
74
|
+
subscription_id=subscription_id,
|
|
75
|
+
resource_groups=resource_groups,
|
|
76
|
+
source_revision=str(retained.get("source_commit", "")),
|
|
77
|
+
)
|
|
78
|
+
apply_development_authority_profile(values, selection.profile)
|
|
79
|
+
changed = retained.get("development_authority_profile_digest") != selection.profile.input_digest
|
|
80
|
+
retained["development_authority_profile_digest"] = selection.profile.input_digest
|
|
81
|
+
return changed
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def apply_initial_development_authority(
|
|
85
|
+
selection: ManagedDevelopmentAuthority,
|
|
86
|
+
*,
|
|
87
|
+
values: dict[str, object],
|
|
88
|
+
tenant_id: str,
|
|
89
|
+
subscription_id: str,
|
|
90
|
+
resource_groups: tuple[str, ...],
|
|
91
|
+
source_revision: str,
|
|
92
|
+
) -> str:
|
|
93
|
+
"""Bind a selected profile on a new install, or reject an impossible clear."""
|
|
94
|
+
|
|
95
|
+
if selection.clear:
|
|
96
|
+
raise ValueError("development authority profile cannot be cleared on a new installation")
|
|
97
|
+
if selection.profile is None:
|
|
98
|
+
return ""
|
|
99
|
+
validate_deployment_target(
|
|
100
|
+
selection.profile,
|
|
101
|
+
tenant_id=tenant_id,
|
|
102
|
+
subscription_id=subscription_id,
|
|
103
|
+
resource_groups=resource_groups,
|
|
104
|
+
source_revision=source_revision,
|
|
105
|
+
)
|
|
106
|
+
apply_development_authority_profile(values, selection.profile)
|
|
107
|
+
return selection.profile.input_digest
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def apply_service_update_development_authority(
|
|
111
|
+
args: argparse.Namespace,
|
|
112
|
+
*,
|
|
113
|
+
context: dict[str, object],
|
|
114
|
+
workload: dict[str, object],
|
|
115
|
+
source_revision: str,
|
|
116
|
+
) -> tuple[str, str]:
|
|
117
|
+
"""Apply one explicit Core select/clear operation to retained workload variables."""
|
|
118
|
+
|
|
119
|
+
component = workload.get("component")
|
|
120
|
+
environment = workload.get("environment")
|
|
121
|
+
if component is not None:
|
|
122
|
+
if not isinstance(component, str) or not isinstance(environment, dict):
|
|
123
|
+
raise TypeError("service workload database-role inputs are invalid")
|
|
124
|
+
workload["environment"] = bind_service_database_role(component, environment)
|
|
125
|
+
path = getattr(args, "development_authority_profile", None)
|
|
126
|
+
if path is not None and not isinstance(path, Path):
|
|
127
|
+
raise TypeError("development authority profile path is invalid")
|
|
128
|
+
clear = bool(getattr(args, "clear_development_authority_profile", False))
|
|
129
|
+
if path is not None and clear:
|
|
130
|
+
raise ValueError("development authority profile and clear request are mutually exclusive")
|
|
131
|
+
if path is None and not clear:
|
|
132
|
+
return "preserve", ""
|
|
133
|
+
environment = workload.get("environment")
|
|
134
|
+
if not isinstance(environment, dict):
|
|
135
|
+
raise TypeError("Core workload environment is invalid")
|
|
136
|
+
if clear:
|
|
137
|
+
changed = environment.pop(_PROFILE_ENV, None) is not None
|
|
138
|
+
changed = environment.pop(_EXECUTOR_ENV, None) is not None or changed
|
|
139
|
+
if not changed:
|
|
140
|
+
raise ValueError("Core workload has no retained development profile to clear")
|
|
141
|
+
return "clear", ""
|
|
142
|
+
if path is None:
|
|
143
|
+
raise RuntimeError("development authority profile is unavailable")
|
|
144
|
+
profile = load_development_authority_profile(path.absolute())
|
|
145
|
+
validate_deployment_target(
|
|
146
|
+
profile,
|
|
147
|
+
tenant_id=str(context["tenant_id"]),
|
|
148
|
+
subscription_id=str(context["subscription_id"]),
|
|
149
|
+
resource_groups=(
|
|
150
|
+
str(context["resource_group_name"]),
|
|
151
|
+
str(context["state_resource_group"]),
|
|
152
|
+
),
|
|
153
|
+
source_revision=source_revision,
|
|
154
|
+
)
|
|
155
|
+
environment[_PROFILE_ENV] = profile.profile_json
|
|
156
|
+
environment[_EXECUTOR_ENV] = profile.executor_principal
|
|
157
|
+
return "select", profile.input_digest
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
__all__ = [
|
|
161
|
+
"ManagedDevelopmentAuthority",
|
|
162
|
+
"apply_initial_development_authority",
|
|
163
|
+
"apply_service_update_development_authority",
|
|
164
|
+
"development_authority_from_args",
|
|
165
|
+
"reconcile_retained_development_authority",
|
|
166
|
+
]
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"""Select and complete recovered Foundation adoption for standalone deployment."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Callable
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
from fdai_deployment_cli.application_state_adoption import ApplicationStateAdoption
|
|
9
|
+
from fdai_deployment_cli.catalog_review_profile import CatalogReviewDeploymentProfile
|
|
10
|
+
from fdai_deployment_cli.control_package import ControlPackage
|
|
11
|
+
from fdai_deployment_cli.deployment_deadline import DeploymentDeadline
|
|
12
|
+
from fdai_deployment_cli.deployment_kit import DeploymentKit
|
|
13
|
+
from fdai_deployment_cli.deployment_progress import begin_stage, progress_detail
|
|
14
|
+
from fdai_deployment_cli.foundation_adoption import stage_recovered_foundation
|
|
15
|
+
from fdai_deployment_cli.operational_evidence_verifier_input import (
|
|
16
|
+
OperationalEvidenceVerifierDeploymentInput,
|
|
17
|
+
)
|
|
18
|
+
from fdai_deployment_cli.runtime_profile import RuntimeDeploymentProfile
|
|
19
|
+
from fdai_deployment_cli.standalone_application_completion import complete_application
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def deploy_with_adopted_foundation(
|
|
23
|
+
*,
|
|
24
|
+
foundation_directory: Path | None,
|
|
25
|
+
recovery_directory: Path | None,
|
|
26
|
+
adopt_runner_image_receipt: Path | None,
|
|
27
|
+
work_dir: Path,
|
|
28
|
+
kit: DeploymentKit,
|
|
29
|
+
tenant_id: str,
|
|
30
|
+
subscription_id: str,
|
|
31
|
+
region: str,
|
|
32
|
+
monthly_cost_ceiling: int,
|
|
33
|
+
deadline: DeploymentDeadline,
|
|
34
|
+
selected_runtime: RuntimeDeploymentProfile,
|
|
35
|
+
trial_token: Path | None,
|
|
36
|
+
application_state_adoption: ApplicationStateAdoption | None,
|
|
37
|
+
catalog_review_profile: CatalogReviewDeploymentProfile | None,
|
|
38
|
+
operational_evidence_verifier_input: OperationalEvidenceVerifierDeploymentInput | None,
|
|
39
|
+
current_operator_object_id: Callable[[], str],
|
|
40
|
+
control_package: ControlPackage | None = None,
|
|
41
|
+
) -> dict[str, object] | None:
|
|
42
|
+
"""Return a completed adopted deployment, or None when adoption isn't selected."""
|
|
43
|
+
|
|
44
|
+
inputs = (foundation_directory, recovery_directory)
|
|
45
|
+
if any(value is not None for value in inputs) and not all(
|
|
46
|
+
value is not None for value in inputs
|
|
47
|
+
):
|
|
48
|
+
raise ValueError("Foundation adoption requires both retained directories")
|
|
49
|
+
if not all(value is not None for value in inputs):
|
|
50
|
+
return None
|
|
51
|
+
if adopt_runner_image_receipt is not None:
|
|
52
|
+
raise ValueError("Foundation adoption cannot combine with runner-image adoption")
|
|
53
|
+
assert foundation_directory is not None
|
|
54
|
+
assert recovery_directory is not None
|
|
55
|
+
scripts = kit.bundle_root / "scripts/deployment/azure"
|
|
56
|
+
if not scripts.is_dir() or scripts.is_symlink():
|
|
57
|
+
raise ValueError("verified deployment bundle is missing Azure orchestration")
|
|
58
|
+
begin_stage("foundation")
|
|
59
|
+
progress_detail("Adopting the verified existing Foundation without repeating effects")
|
|
60
|
+
adoption = stage_recovered_foundation(
|
|
61
|
+
foundation_directory=foundation_directory,
|
|
62
|
+
recovery_directory=recovery_directory,
|
|
63
|
+
destination=work_dir / "run",
|
|
64
|
+
application_source_commit=kit.source_commit,
|
|
65
|
+
kit_manifest_digest=kit.verification.manifest_digest,
|
|
66
|
+
runtime_release_digest=kit.runtime.digest,
|
|
67
|
+
tenant_id=tenant_id,
|
|
68
|
+
subscription_id=subscription_id,
|
|
69
|
+
region=region,
|
|
70
|
+
monthly_cost_ceiling=monthly_cost_ceiling,
|
|
71
|
+
)
|
|
72
|
+
return complete_application(
|
|
73
|
+
kit=kit,
|
|
74
|
+
prepared=adoption.prepared,
|
|
75
|
+
status=adoption.status,
|
|
76
|
+
scripts=scripts,
|
|
77
|
+
deadline=deadline,
|
|
78
|
+
selected_runtime=selected_runtime,
|
|
79
|
+
trial_token=trial_token,
|
|
80
|
+
application_state_adoption=application_state_adoption,
|
|
81
|
+
foundation_state_receipt_digest=str(adoption.receipt["foundation_state_receipt_digest"]),
|
|
82
|
+
foundation_adoption_receipt_digest=str(adoption.receipt["receipt_digest"]),
|
|
83
|
+
catalog_review_profile=catalog_review_profile,
|
|
84
|
+
operational_evidence_verifier_input=operational_evidence_verifier_input,
|
|
85
|
+
current_operator_object_id=current_operator_object_id,
|
|
86
|
+
control_package=control_package,
|
|
87
|
+
)
|