-
Notifications
You must be signed in to change notification settings - Fork 15
[DCP Ingestion] Add preprocessing stage to workflow #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ main: | |
| - execution_error: null | ||
| - postprocessing_result: null | ||
| - embedding_result: null | ||
| - current_stage: "dataflow" | ||
| - current_stage: "preprocessing" | ||
| - job_id: null | ||
| - lock_timeout: ${lock_acquisition_timeout} | ||
| - lock_retries: 0 | ||
|
|
@@ -96,6 +96,15 @@ main: | |
| - sanitized_short_import: '$${text.substring(combined_import_name, 0, substring_end)}' | ||
| - dataflow_job_name: '$${"${clean_namespace_prefix}" + sanitized_short_import + "-" + string(int(sys.now()))}' | ||
|
|
||
| - update_history_preprocessing: | ||
| call: update_history | ||
| args: | ||
| workflow_id: '$${workflow_id}' | ||
| status: 'RUNNING' | ||
| stage: 'preprocessing' | ||
| job_id: null | ||
| import_list: '$${imports_history_list}' | ||
|
Comment on lines
+99
to
+106
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue: Missing Error Handling for Preprocessing StageThe new If the preprocessing Cloud Run job fails or if reading the handshake file fails, the workflow will terminate immediately. Because the global RecommendationWrap the preprocessing and handshake steps in a For example: - preprocessing_stage:
try:
steps:
- update_history_preprocessing:
call: update_history
args:
workflow_id: '$${workflow_id}'
status: 'RUNNING'
stage: 'preprocessing'
job_id: null
import_list: '$${imports_history_list}'
- run_preprocessing:
call: launch_and_poll_preprocessing_job
args:
job_name: '$${prep_job_name}'
workflow_id: '$${workflow_id}'
temp_location: '$${input.tempLocation}'
imports_arg: '$${comma_separated_imports}'
region: '$${input.region}'
project_id: '${project_id}'
result: prep_res
- read_handshake_file:
call: googleapis.storage.v1.objects.get
args:
bucket: '$${bucket_name}'
object: '$${text.url_encode(temp_path_prefix + "/datacommons/ingestion_records/" + workflow_id + ".json")}'
alt: 'media'
result: handshake_data
- update_launch_params:
assign:
- launch_params.importList: '$${handshake_data.importList}'
- decoded_imports: '$${json.decode(handshake_data.importList)}'
except:
as: e
steps:
- update_history_preprocessing_failure:
call: update_history
args:
workflow_id: '$${workflow_id}'
status: 'FAILURE'
stage: 'preprocessing'
job_id: null
import_list: '$${imports_history_list}'
- raise_preprocessing_error:
raise: $${e} |
||
|
|
||
| - run_preprocessing: | ||
| call: launch_and_poll_preprocessing_job | ||
| args: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initializing
current_stageto"preprocessing"is logical, but please note that theexceptblock that usescurrent_stageto report failures is defined inside theprocess_ingestionstep (lines 173-294). Sinceprocess_ingestionis only executed after lock acquisition, any failure during the actual preprocessing stage (which runs before lock acquisition) will not trigger thatexceptblock. Therefore, initializingcurrent_stagehere does not automatically protect the preprocessing stage from leaving the history in aRUNNINGstate upon failure.