Update public restart compatibility metadata
This commit is contained in:
parent
f8f91088d5
commit
068c6f00bb
6 changed files with 192 additions and 3 deletions
|
|
@ -28,6 +28,7 @@ pub struct BundleMetadata {
|
|||
pub source_metadata: BundleSourceMetadata,
|
||||
pub debug_metadata: BundleDebugMetadata,
|
||||
pub large_input_policy: BundleLargeInputPolicy,
|
||||
pub restart_compatibility: BundleRestartCompatibility,
|
||||
pub environments: Vec<EnvironmentResource>,
|
||||
pub selected_inputs: Vec<SelectedInput>,
|
||||
pub embeds_full_container_images: bool,
|
||||
|
|
@ -65,6 +66,17 @@ pub struct BundleLargeInputPolicy {
|
|||
pub supported_handle_types: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct BundleRestartCompatibility {
|
||||
pub source_edits_can_restart_from_clean_task_boundary: bool,
|
||||
pub requires_clean_checkpoint_boundary: bool,
|
||||
pub compares_task_abi: Digest,
|
||||
pub compares_environment_digests: bool,
|
||||
pub compares_serialized_args: bool,
|
||||
pub discards_unflushed_task_local_changes: bool,
|
||||
pub incompatible_changes_require_whole_process_restart: bool,
|
||||
}
|
||||
|
||||
impl BundleIdentityInputs {
|
||||
pub fn identity(&self) -> Digest {
|
||||
let mut parts = vec![
|
||||
|
|
@ -136,6 +148,15 @@ impl BundleIdentityInputs {
|
|||
"VFS".to_owned(),
|
||||
],
|
||||
},
|
||||
restart_compatibility: BundleRestartCompatibility {
|
||||
source_edits_can_restart_from_clean_task_boundary: true,
|
||||
requires_clean_checkpoint_boundary: true,
|
||||
compares_task_abi: self.task_abi.clone(),
|
||||
compares_environment_digests: true,
|
||||
compares_serialized_args: true,
|
||||
discards_unflushed_task_local_changes: true,
|
||||
incompatible_changes_require_whole_process_restart: true,
|
||||
},
|
||||
environments: self.environments.clone(),
|
||||
selected_inputs: self.selected_inputs.clone(),
|
||||
embeds_full_container_images: false,
|
||||
|
|
@ -227,6 +248,25 @@ mod tests {
|
|||
.large_input_policy
|
||||
.supported_handle_types
|
||||
.contains(&"Artifact".to_owned()));
|
||||
assert!(
|
||||
metadata
|
||||
.restart_compatibility
|
||||
.source_edits_can_restart_from_clean_task_boundary
|
||||
);
|
||||
assert!(
|
||||
metadata
|
||||
.restart_compatibility
|
||||
.requires_clean_checkpoint_boundary
|
||||
);
|
||||
assert_eq!(
|
||||
metadata.restart_compatibility.compares_task_abi,
|
||||
inputs.task_abi
|
||||
);
|
||||
assert!(
|
||||
metadata
|
||||
.restart_compatibility
|
||||
.incompatible_changes_require_whole_process_restart
|
||||
);
|
||||
assert_eq!(metadata.environments.len(), 1);
|
||||
assert!(!metadata.embeds_full_container_images);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ pub use auth::{
|
|||
};
|
||||
pub use bundle::{
|
||||
BundleDebugMetadata, BundleIdentityInputs, BundleLargeInputPolicy, BundleMetadata,
|
||||
BundleSourceMetadata, BundleTaskMetadata, SelectedInput,
|
||||
BundleRestartCompatibility, BundleSourceMetadata, BundleTaskMetadata, SelectedInput,
|
||||
};
|
||||
pub use capability::{Capability, CapabilityReportError, EnvironmentBackend, NodeCapabilities, Os};
|
||||
pub use checkpoint::{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue