diff --git a/infra/dcp/modules/ingestion/workflow/main.tf b/infra/dcp/modules/ingestion/workflow/main.tf index 34f0bc78..79f2a51f 100644 --- a/infra/dcp/modules/ingestion/workflow/main.tf +++ b/infra/dcp/modules/ingestion/workflow/main.tf @@ -30,7 +30,11 @@ resource "google_workflows_workflow" "ingestion_orchestrator" { dataflow_ip_configuration = var.dataflow_ip_configuration dataflow_subnetwork = var.dataflow_subnetwork embeddings_timeout = var.embeddings_timeout + preprocessing_job_timeout = var.preprocessing_job_timeout + postprocessing_job_timeout = var.postprocessing_job_timeout clean_namespace_prefix = local.clean_namespace_prefix + + enable_redis_cache_clearing = var.enable_redis_cache_clearing preprocessing_job_name = var.preprocessing_job_name postprocessing_job_name = var.postprocessing_job_name diff --git a/infra/dcp/modules/ingestion/workflow/variables.tf b/infra/dcp/modules/ingestion/workflow/variables.tf index 04c5a752..6711cba1 100644 --- a/infra/dcp/modules/ingestion/workflow/variables.tf +++ b/infra/dcp/modules/ingestion/workflow/variables.tf @@ -47,6 +47,20 @@ variable "embeddings_timeout" { default = 1800 } +variable "preprocessing_job_timeout" { + type = number + description = "Timeout in seconds for the preprocessing Cloud Run job execution" + default = 21600 +} + +variable "postprocessing_job_timeout" { + type = number + description = "Timeout in seconds for the postprocessing Cloud Run job execution" + default = 21600 +} + + + variable "ingestion_helper_service_name" { type = string description = "Name of the ingestion helper Cloud Run service" diff --git a/infra/dcp/modules/ingestion/workflow/workflow.yaml b/infra/dcp/modules/ingestion/workflow/workflow.yaml index 6c4ba413..acfa5cec 100644 --- a/infra/dcp/modules/ingestion/workflow/workflow.yaml +++ b/infra/dcp/modules/ingestion/workflow/workflow.yaml @@ -386,7 +386,10 @@ run_postprocessing_job: - "--import_list" - '$${json.encode_to_string(import_list)}' - "--no-dry_run" + connector_params: + timeout: ${postprocessing_job_timeout} result: run_res + - call_poll_postprocessing: call: poll_cloud_run_job_execution args: @@ -520,8 +523,12 @@ launch_and_poll_preprocessing_job: - name: 'DATA_RUN_MODE' value: 'dcpbridge' args: '$${container_args}' + connector_params: + timeout: ${preprocessing_job_timeout} result: run_res + + - assign_execution_name: assign: - execution_name: '$${run_res.metadata.name}' diff --git a/infra/dcp/modules/stack/main.tf b/infra/dcp/modules/stack/main.tf index a6e75975..bd3ae486 100644 --- a/infra/dcp/modules/stack/main.tf +++ b/infra/dcp/modules/stack/main.tf @@ -224,10 +224,13 @@ module "ingestion_workflow" { dataflow_template_gcs_path = var.ingestion_config.dataflow_template_gcs_path preprocessing_job_name = var.ingestion_config.enable_ingestion ? module.ingestion_preprocessing_job[0].job_name : "" postprocessing_job_name = var.ingestion_config.enable_ingestion ? module.ingestion_postprocessing_job[0].job_name : "" + preprocessing_job_timeout = tonumber(replace(var.ingestion_config.preprocessing_job_timeout, "s", "")) + postprocessing_job_timeout = tonumber(replace(var.ingestion_config.postprocessing_job_timeout, "s", "")) depends_on = [module.ingestion_helper_service] } + module "redis" { source = "../redis" count = var.redis_config.enable ? 1 : 0