Publish curated ITWorx-ModelForge source from 990401737f96c8d46a9f7b0d84994516cadcb6a0
This commit is contained in:
1 parent
7082ab955a
commit
848f0d8f8a
434 files changed
+67298
-4315
No files matched your search
@@ -19,6 +19,49 @@ def upgrade() -> None:
|
||||
# The declarative metadata is the reviewed M0 schema contract. create_all is
|
||||
# used only from this baseline migration; later changes require explicit ops.
|
||||
Base.metadata.create_all(bind=op.get_bind(), checkfirst=False)
|
||||
# BenchmarkRun was part of M0. The evolving metadata also contains RC-LAB-02's later
|
||||
# capability-target, actor/idempotency and environment fields, so rebuild its original
|
||||
# shape here; migration 0039 adds those fields at the correct historical boundary.
|
||||
op.drop_table("benchmark_runs")
|
||||
op.create_table(
|
||||
"benchmark_runs",
|
||||
sa.Column("id", sa.Uuid(), nullable=False),
|
||||
sa.Column("deployment_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("suite_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("model_revision_sha", sa.String(length=64), nullable=False),
|
||||
sa.Column("artifact_sha256", sa.String(length=64), nullable=False),
|
||||
sa.Column("runtime_type", sa.String(length=32), nullable=False),
|
||||
sa.Column("runtime_version", sa.String(length=128), nullable=False),
|
||||
sa.Column("runtime_image_digest", sa.String(length=71), nullable=True),
|
||||
sa.Column("launch_arguments", sa.JSON(), nullable=False),
|
||||
sa.Column("suite_revision", sa.String(length=128), nullable=False),
|
||||
sa.Column("dataset_revision", sa.String(length=255), nullable=False),
|
||||
sa.Column("environment_fingerprint", sa.JSON(), nullable=False),
|
||||
sa.Column("environment_digest", sa.String(length=64), nullable=False),
|
||||
sa.Column("seed", sa.Integer(), nullable=True),
|
||||
sa.Column("results", sa.JSON(), nullable=False),
|
||||
sa.Column("status", sa.String(length=32), nullable=False),
|
||||
sa.Column("comparable", sa.Boolean(), nullable=False),
|
||||
sa.Column("stale_reason", sa.Text(), nullable=True),
|
||||
sa.Column("started_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.Column("completed_at", sa.DateTime(timezone=True), nullable=True),
|
||||
sa.ForeignKeyConstraint(["deployment_id"], ["deployments.id"], ondelete="RESTRICT"),
|
||||
sa.ForeignKeyConstraint(["suite_id"], ["benchmark_suites.id"], ondelete="RESTRICT"),
|
||||
sa.PrimaryKeyConstraint("id"),
|
||||
)
|
||||
op.create_index("ix_benchmark_runs_deployment_id", "benchmark_runs", ["deployment_id"])
|
||||
op.create_index("ix_benchmark_runs_suite_id", "benchmark_runs", ["suite_id"])
|
||||
op.create_index("ix_benchmark_runs_artifact_sha256", "benchmark_runs", ["artifact_sha256"])
|
||||
op.create_index(
|
||||
"ix_benchmark_runs_environment_digest", "benchmark_runs", ["environment_digest"]
|
||||
)
|
||||
op.create_index(
|
||||
"ix_benchmark_runs_deployment_completed",
|
||||
"benchmark_runs",
|
||||
["deployment_id", "completed_at"],
|
||||
)
|
||||
op.drop_constraint("ck_capability_serving_generation", "capability_contracts", type_="check")
|
||||
op.drop_column("capability_contracts", "serving_generation")
|
||||
# Freeze the original M0 shape even though the declarative metadata evolves.
|
||||
# Remove newer foreign-key columns before dropping the tables they target.
|
||||
for column in (
|
||||
@@ -36,6 +79,27 @@ def upgrade() -> None:
|
||||
# Later milestone tables are present in the evolving declarative metadata
|
||||
# used to build this baseline. Drop dependants before their M5/M0 targets
|
||||
# so a fresh upgrade still reconstructs each historical revision exactly.
|
||||
"model_change_cases",
|
||||
"selected_model_comparisons",
|
||||
"external_creative_action_attestations",
|
||||
"external_creative_profile_observations",
|
||||
"external_creative_resources",
|
||||
"external_creative_allocations",
|
||||
"model_update_notices",
|
||||
"model_update_watches",
|
||||
"portfolio_repository_observations",
|
||||
"portfolio_reconciliation_runs",
|
||||
"platform_secret_activations",
|
||||
"platform_secret_tests",
|
||||
"platform_secret_versions",
|
||||
"platform_secret_state",
|
||||
"managed_operator_credential_activations",
|
||||
"managed_operator_credentials",
|
||||
"managed_operator_identities",
|
||||
"managed_operator_state",
|
||||
"configuration_revisions",
|
||||
"project_onboarding",
|
||||
"configuration_state",
|
||||
"audit_chain_heads",
|
||||
"node_decommission_operations",
|
||||
# M15 recovery tables come first: artifact_recovery_operations references
|
||||
@@ -50,6 +114,8 @@ def upgrade() -> None:
|
||||
"recovery_asset_records",
|
||||
"recovery_policy_revisions",
|
||||
"incident_timeline_events",
|
||||
# The M37 outbox restricts deletion of its alert history parent.
|
||||
"alert_notification_deliveries",
|
||||
"alert_history_events",
|
||||
"operational_alerts",
|
||||
"operational_incidents",
|
||||
@@ -107,6 +173,9 @@ def upgrade() -> None:
|
||||
"project_evaluation_bindings",
|
||||
"serving_gpu_leases",
|
||||
"serving_jobs",
|
||||
# M38 durable LAB history owns a restrictive reference to gateway_requests;
|
||||
# drop it before the M0 gateway table while reconstructing the historical baseline.
|
||||
"lab_execution_runs",
|
||||
"gateway_requests",
|
||||
"residency_allocations",
|
||||
"service_credentials",
|
||||
|
||||
Reference in new issue
Block a user