diff --git a/server/data_model/src/lib.rs b/server/data_model/src/lib.rs index b15052e43..0f0156037 100644 --- a/server/data_model/src/lib.rs +++ b/server/data_model/src/lib.rs @@ -97,7 +97,6 @@ pub struct ImageInformation { pub base_image: String, pub run_strs: Vec, pub image_hash: String, - pub version: ImageVersion, // this gets updated when the hash changes pub image_uri: Option, pub sdk_version: Option, } @@ -122,7 +121,6 @@ impl ImageInformation { base_image, run_strs, image_hash: format!("{:x}", image_hasher.finalize()), - version: ImageVersion::default(), image_uri: None, sdk_version, } @@ -390,17 +388,7 @@ impl ComputeGraph { self.edges = update.edges; self.start_fn = update.start_fn; self.runtime_information = update.runtime_information; - - // if the image has changed, increment the version. - let mut updated_nodes = update.nodes.clone(); - for (node_name, updated_node) in updated_nodes.iter_mut() { - if let Some(existing_node) = self.nodes.get(node_name) { - if existing_node.image_hash() != updated_node.image_hash() { - updated_node.set_image_version(existing_node.clone().image_version_next()); - } - } - } - self.nodes = updated_nodes; + self.nodes = update.nodes.clone(); graph_version = Some(self.into_version()); } @@ -855,7 +843,6 @@ impl TaskBuilder { .ok_or(anyhow!("ingestion data object id is not present"))?; let graph_version = self .graph_version - .clone() .ok_or(anyhow!("graph version is not present"))?; let reducer_output_id = self.reducer_output_id.clone().flatten(); let id = uuid::Uuid::new_v4().to_string(); @@ -1371,15 +1358,6 @@ mod tests { assert_eq!(graph.version, GraphVersion(2), "update version"); assert_eq!(graph.nodes.len(), 2, "update nodes"); - let fn_a_image_version = *graph - .nodes - .iter() - .find(|(k, _)| *k == "fn_a") - .unwrap() - .1 - .image_version(); - assert_eq!(fn_a_image_version, 1, "update node fn_a image version"); - let version = version.expect("version should be created"); assert_eq!(version.version, GraphVersion(2), "update version"); assert_eq!(version.nodes.len(), 2, "version nodes"); @@ -1410,15 +1388,6 @@ mod tests { "update node" ); - let fn_a_image_version = *graph - .nodes - .iter() - .find(|(k, _)| *k == "fn_a") - .unwrap() - .1 - .image_version(); - assert_eq!(fn_a_image_version, 2, "update node fn_a image version"); - assert_eq!(graph.created_at, 5, "created_at should not change"); let version = version.expect("version should be created"); @@ -1429,14 +1398,6 @@ mod tests { "some_hash_fn_a_updated", "version node" ); - let fn_a_image_version = *version - .nodes - .iter() - .find(|(k, _)| *k == "fn_a") - .unwrap() - .1 - .image_version(); - assert_eq!(fn_a_image_version, 2, "version node fn_a image version"); }, ); } diff --git a/server/data_model/src/test_objects.rs b/server/data_model/src/test_objects.rs index c25ed8b4a..b8897e1ce 100644 --- a/server/data_model/src/test_objects.rs +++ b/server/data_model/src/test_objects.rs @@ -205,7 +205,6 @@ pub mod tests { "run 3".to_string(), ], image_hash: "".to_string(), - version: Default::default(), image_uri: Some("1234567890.dkr.ecr.us-east-1.amazonaws.com/test".to_string()), sdk_version: Some("1.2.3".to_string()), }, diff --git a/server/state_store/src/lib.rs b/server/state_store/src/lib.rs index 5488c26e9..56f8a975c 100644 --- a/server/state_store/src/lib.rs +++ b/server/state_store/src/lib.rs @@ -756,10 +756,6 @@ mod tests { assert!(compute_graphs.iter().any(|cg| cg.name == "graph_A")); let nodes = &compute_graphs[0].nodes; - assert_eq!(*nodes["fn_a"].image_version(), 1); - assert_eq!(*nodes["fn_b"].image_version(), 1); - assert_eq!(*nodes["fn_c"].image_version(), 1); - assert_eq!(nodes["fn_a"].image_hash(), "Old Hash"); assert_eq!(nodes["fn_b"].image_hash(), "Old Hash"); assert_eq!(nodes["fn_c"].image_hash(), "Old Hash"); @@ -781,10 +777,6 @@ mod tests { assert_eq!(nodes["fn_a"].image_hash(), new_hash.clone()); assert_eq!(nodes["fn_b"].image_hash(), new_hash.clone()); assert_eq!(nodes["fn_c"].image_hash(), new_hash.clone()); - - assert_eq!(*nodes["fn_a"].image_version(), i); - assert_eq!(*nodes["fn_b"].image_version(), i); - assert_eq!(*nodes["fn_c"].image_version(), i); } Ok(())