Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Migrations for Enclave Changes to UserCode and CodeHistory #8986

16 changes: 15 additions & 1 deletion packages/syft/src/syft/service/code/user_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -1952,27 +1952,41 @@ def migrate_usercode_v4_to_v5() -> list[Callable]:
return [
make_set_default("origin_node_side_type", NodeSideType.HIGH_SIDE),
make_set_default("l0_deny_reason", None),
make_set_default("runtime_policy_type", EmptyRuntimePolicy),
make_set_default("runtime_policy_init_kwargs", None),
make_set_default("runtime_policy_state", b""),
drop("enclave_metadata"),
]


@migrate(UserCode, UserCodeV4)
def migrate_usercode_v5_to_v4() -> list[Callable]:
return [
drop(["origin_node_side_type", "l0_deny_reason"]),
make_set_default("enclave_metadata", None),
drop(
[
"origin_node_side_type",
"l0_deny_reason",
"runtime_policy_type",
"runtime_policy_init_kwargs",
"runtime_policy_state",
]
),
]


@migrate(SubmitUserCodeV4, SubmitUserCode)
def upgrade_submitusercode() -> list[Callable]:
return [
make_set_default("runtime_policy_type", EmptyRuntimePolicy),
make_set_default("runtime_policy_init_kwargs", None),
drop("enclave_metadata"),
]


@migrate(SubmitUserCode, SubmitUserCodeV4)
def downgrade_submitusercode() -> list[Callable]:
return [
drop(["runtime_policy_type", "runtime_policy_init_kwargs"]),
make_set_default("enclave_metadata", None),
]
Loading