From 4f4849d4e677dfe8e014e578bc485a8501647946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Greinhofer?= Date: Tue, 28 May 2024 18:54:58 -0500 Subject: [PATCH] Generate pipeline UUIDs (#209) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the name of the pipelines are now human readable names, we need to generate UUIDs to be able to store information about the progress in the database. This a a temporary step, and a proper patch with a schema update will come later. Signed-off-by: Rémy Greinhofer --- lambdas/src/bna-fargate-run.rs | 6 ++---- lambdas/src/bna-setup.rs | 6 ++---- lambdas/src/bna-sqs-parse.rs | 3 ++- lambdas/src/bna-teardown.rs | 5 ++--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lambdas/src/bna-fargate-run.rs b/lambdas/src/bna-fargate-run.rs index 7453140..632ab95 100644 --- a/lambdas/src/bna-fargate-run.rs +++ b/lambdas/src/bna-fargate-run.rs @@ -6,7 +6,7 @@ use aws_sdk_ecs::types::{ use bnacore::aws::get_aws_parameter_value; use bnalambdas::{ authenticate_service_account, update_pipeline, AnalysisParameters, BrokenspokePipeline, - BrokenspokeState, Context, AWSS3, + BrokenspokeState, AWSS3, }; use lambda_runtime::{run, service_fn, Error, LambdaEvent}; use serde::{Deserialize, Serialize}; @@ -16,7 +16,6 @@ use tracing::info; struct TaskInput { analysis_parameters: AnalysisParameters, aws_s3: AWSS3, - context: Context, } #[derive(Serialize)] @@ -45,8 +44,7 @@ async fn function_handler(event: LambdaEvent) -> Result) -> Result) -> Result) -> Result<(), Error> { +async fn function_handler(_event: LambdaEvent) -> Result<(), Error> { // Retrieve API hostname. let api_hostname = get_aws_parameter_value("BNA_API_HOSTNAME").await?; @@ -36,8 +36,7 @@ async fn function_handler(event: LambdaEvent) -> Result<(), Error> { .map_err(|e| format!("cannot authenticate service account: {e}"))?; // Read the task inputs. - let state_machine_context = &event.payload.context; - let (state_machine_id, _) = state_machine_context.execution.ids()?; + let (state_machine_id, _) = (uuid::Uuid::new_v4(), uuid::Uuid::new_v4()); // Update the pipeline status. let patch_url = format!("{url}/{state_machine_id}");