|
3 | 3 | The recipe referred to here is stored on GitLab. |
4 | 4 | """ |
5 | 5 |
|
| 6 | +from logging import getLogger |
6 | 7 | from pathlib import Path |
7 | 8 | from typing import Optional |
8 | 9 |
|
|
11 | 12 | except AttributeError: |
12 | 13 | pass # Ignore if ISPyB credentials environment variable not set |
13 | 14 |
|
| 15 | +logger = getLogger("murfey.workflows.clem.process_raw_lifs") |
| 16 | + |
14 | 17 |
|
15 | 18 | def zocalo_cluster_request( |
16 | 19 | file: Path, |
@@ -43,24 +46,28 @@ def zocalo_cluster_request( |
43 | 46 | # Load machine config to get the feedback queue |
44 | 47 | feedback_queue: str = messenger.feedback_queue |
45 | 48 |
|
46 | | - # Send the message |
47 | | - # The keys under "parameters" will populate all the matching fields in {} |
48 | | - # in the processing recipe |
49 | | - messenger.send( |
50 | | - "processing_recipe", |
51 | | - { |
52 | | - "recipes": ["clem-lif-to-stack"], |
53 | | - "parameters": { |
54 | | - # Job parameters |
55 | | - "lif_file": f"{str(file)}", |
56 | | - "root_folder": root_folder, |
57 | | - # Other recipe parameters |
58 | | - "session_dir": f"{str(session_dir)}", |
59 | | - "session_id": session_id, |
60 | | - "job_name": job_name, |
61 | | - "feedback_queue": feedback_queue, |
62 | | - }, |
| 49 | + # Construct recipe and submit it for processing |
| 50 | + recipe = { |
| 51 | + "recipes": ["clem-lif-to-stack"], |
| 52 | + "parameters": { |
| 53 | + # Job parameters |
| 54 | + "lif_file": f"{str(file)}", |
| 55 | + "root_folder": root_folder, |
| 56 | + # Other recipe parameters |
| 57 | + "session_dir": f"{str(session_dir)}", |
| 58 | + "session_id": session_id, |
| 59 | + "job_name": job_name, |
| 60 | + "feedback_queue": feedback_queue, |
63 | 61 | }, |
| 62 | + } |
| 63 | + logger.debug( |
| 64 | + f"Submitting LIF processing request to {messenger.feedback_queue!r} " |
| 65 | + "with the following recipe: \n" |
| 66 | + f"{recipe}" |
| 67 | + ) |
| 68 | + messenger.send( |
| 69 | + queue="processing_recipe", |
| 70 | + message=recipe, |
64 | 71 | new_connection=True, |
65 | 72 | ) |
66 | 73 | else: |
|
0 commit comments