From 7e5705298a7ed5ef327f2c13b8fe7918b3b5780f Mon Sep 17 00:00:00 2001 From: Ertugrul Aypek Date: Thu, 16 Jan 2025 15:50:42 +0100 Subject: [PATCH] skip memory override --- deploy/stage/common-values-iris-mpc.yaml | 2 +- iris-mpc/src/bin/server.rs | 43 +++++++++++++----------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/deploy/stage/common-values-iris-mpc.yaml b/deploy/stage/common-values-iris-mpc.yaml index 5ab160c60..1751a8fd4 100644 --- a/deploy/stage/common-values-iris-mpc.yaml +++ b/deploy/stage/common-values-iris-mpc.yaml @@ -1,4 +1,4 @@ -image: "ghcr.io/worldcoin/iris-mpc:v0.13.20" +image: "ghcr.io/worldcoin/iris-mpc:4c877cd1cc8d69588cef9447bb35c1c3cb6d2e4f" environment: stage replicaCount: 1 diff --git a/iris-mpc/src/bin/server.rs b/iris-mpc/src/bin/server.rs index efe0d3c42..e6a94f8c4 100644 --- a/iris-mpc/src/bin/server.rs +++ b/iris-mpc/src/bin/server.rs @@ -62,6 +62,7 @@ use std::{ mem, net::IpAddr, panic, + process::exit, sync::{ atomic::{AtomicBool, AtomicUsize, Ordering}, Arc, LazyLock, Mutex, @@ -1079,6 +1080,7 @@ async fn server_main(config: Config) -> eyre::Result<()> { let load_chunks_parallelism = config.load_chunks_parallelism; let db_chunks_bucket_name = config.db_chunks_bucket_name.clone(); let db_chunks_folder_name = config.db_chunks_folder_name.clone(); + let env = config.environment.clone(); let (tx, rx) = oneshot::channel(); background_tasks.spawn_blocking(move || { @@ -1206,7 +1208,6 @@ async fn server_main(config: Config) -> eyre::Result<()> { let left_masks = actor.left_mask_db_slices.code_gr.clone(); let right_masks = actor.right_mask_db_slices.code_gr.clone(); let device_manager_clone = actor.device_manager.clone(); - let page_lock_handle = spawn_blocking(move || { for db in [&left_codes, &right_codes] { register_host_memory( @@ -1249,13 +1250,13 @@ async fn server_main(config: Config) -> eyre::Result<()> { StoredIris::DB(iris) => { n_loaded_from_db += 1; serial_ids_from_db.insert(iris.id()); - actor.load_single_record_from_db( - iris.index() - 1, - iris.left_code(), - iris.left_mask(), - iris.right_code(), - iris.right_mask(), - ); + // actor.load_single_record_from_db( + // iris.index() - 1, + // iris.left_code(), + // iris.left_mask(), + // iris.right_code(), + // iris.right_mask(), + // ); } StoredIris::S3(iris) => { if serial_ids_from_db.contains(&iris.id()) { @@ -1267,17 +1268,17 @@ async fn server_main(config: Config) -> eyre::Result<()> { continue; } n_loaded_from_s3 += 1; - actor.load_single_record_from_s3( - iris.index() - 1, - iris.left_code_odd(), - iris.left_code_even(), - iris.right_code_odd(), - iris.right_code_even(), - iris.left_mask_odd(), - iris.left_mask_even(), - iris.right_mask_odd(), - iris.right_mask_even(), - ); + // actor.load_single_record_from_s3( + // iris.index() - 1, + // iris.left_code_odd(), + // iris.left_code_even(), + // iris.right_code_odd(), + // iris.right_code_even(), + // iris.left_mask_odd(), + // iris.left_mask_even(), + // iris.right_mask_odd(), + // iris.right_mask_even(), + // ); } }; @@ -1313,6 +1314,10 @@ async fn server_main(config: Config) -> eyre::Result<()> { time_loading_into_memory, ); + if env.eq("stage") { + tracing::info!("Test environment detected, exiting"); + exit(0); + } // Clear the memory allocated by temp HashSet serial_ids_from_db.clear(); serial_ids_from_db.shrink_to_fit();