From 6b493bdeeb94cd5031fddd490756361cbf28a59d Mon Sep 17 00:00:00 2001 From: Jun Aishima Date: Thu, 1 Oct 2026 14:26:21 -0400 Subject: [PATCH 1/7] add tla to repo/package names in deployment file * this is an easy spot to miss if only looking for items to change by searching for "tla" or "TLA" --- prefect.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prefect.yaml b/prefect.yaml index 7f8e2c9..aaa775d 100644 --- a/prefect.yaml +++ b/prefect.yaml @@ -9,7 +9,7 @@ pull: - prefect.deployments.steps.set_working_directory: directory: /repo - prefect.deployments.steps.git_clone: - repository: https://github.com/nsls2/nsls2-workflows-template.git + repository: https://github.com/nsls2/tla-workflows.git branch: main deployments: @@ -24,7 +24,7 @@ deployments: schedule: {} work_pool: job_variables: - image: ghcr.io/nsls2/nsls2-workflows-template:main + image: ghcr.io/nsls2/tla-workflows:main image_pull_policy: Always network: slirp4netns volumes: From a6f1b690a92fae32b609138755a129f0f09c7d2a Mon Sep 17 00:00:00 2001 From: Jun Aishima Date: Thu, 1 Oct 2026 14:29:39 -0400 Subject: [PATCH 2/7] make the text to replace consistently TLA across the entire repo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fe373ed..f9d14f3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# {endstation or TLA}-workflows +# {TLA}-workflows > Replace all instances of {endstation or TLA} with the name of the endstation > or the **lower-case** three-letter acronym of the beamline, if an endstation From 8192863a002b44c458426554c0f34be76b0db62e Mon Sep 17 00:00:00 2001 From: Jun Aishima Date: Thu, 1 Oct 2026 14:31:51 -0400 Subject: [PATCH 3/7] rename to mon_prefect_instrument * no need to modify the name of the variable across beamlines, just the contents --- end_of_run_workflow.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/end_of_run_workflow.py b/end_of_run_workflow.py index d3f9f24..0b4db60 100644 --- a/end_of_run_workflow.py +++ b/end_of_run_workflow.py @@ -27,7 +27,7 @@ def end_of_run_workflow(stop_doc, api_key=None, dry_run=False): # Load slack credentials that are saved in Prefect. mon_prefect = SlackWebhook.load("mon-prefect") mon_bluesky = SlackWebhook.load("mon-bluesky") - mon_prefect_tla = SlackWebhook.load("mon-prefect-tla") + mon_prefect_instrument = SlackWebhook.load("mon-prefect-tla") mon_prefect_program = SlackWebhook.load("mon-prefect-program") # Get the uid. @@ -49,7 +49,7 @@ def end_of_run_workflow(stop_doc, api_key=None, dry_run=False): # Send a message to mon-prefect-tla if flow-run is successful. message = f":white_check_mark: {CATALOG_NAME} flow-run successful. (*{flow_run_name}*)\n ```run_start: {uid}\nscan_id: {scan_id}```" - mon_prefect_tla.notify(message) + mon_prefect_instrument.notify(message) return result except Exception as e: tb = traceback.format_exception_only(e) @@ -57,7 +57,7 @@ def end_of_run_workflow(stop_doc, api_key=None, dry_run=False): # Send a message to mon-prefect-tla, mon-prefect if flow-run failed. message = f":bangbang: {CATALOG_NAME} flow-run failed. (*{flow_run_name}*)\n ```run_start: {uid}\nscan_id: {scan_id}``` ```{tb[-1]}```" mon_prefect.notify(message) - mon_prefect_tla.notify(message) + mon_prefect_instrument.notify(message) flow_run = FlowRunContext.get().flow_run # Add link to flow-run for the message to mon-prefect-program. program_message = ( From 1c4e65490f2a7448a421ec2d813190470793dbc0 Mon Sep 17 00:00:00 2001 From: Jun Aishima Date: Thu, 1 Oct 2026 14:33:22 -0400 Subject: [PATCH 4/7] make it TLA consistently to enable quick replacement --- end_of_run_workflow.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/end_of_run_workflow.py b/end_of_run_workflow.py index 0b4db60..24e09ec 100644 --- a/end_of_run_workflow.py +++ b/end_of_run_workflow.py @@ -7,13 +7,13 @@ from data_validation import get_run_migration from dotenv import load_dotenv -CATALOG_NAME = "tla" +CATALOG_NAME = "TLA" def slack(func): """ Send a message to mon-prefect and mon-prefect-program slack channels if the flow-run failed. - Send a message to mon-prefect-tla slack channel with the flow-run status. + Send a message to mon-prefect-TLA slack channel with the flow-run status. Send a message to mon-bluesky slack channel if the bluesky-run failed. NOTE: the name of this inner function is the same as the real end_of_workflow() function because @@ -27,7 +27,7 @@ def end_of_run_workflow(stop_doc, api_key=None, dry_run=False): # Load slack credentials that are saved in Prefect. mon_prefect = SlackWebhook.load("mon-prefect") mon_bluesky = SlackWebhook.load("mon-bluesky") - mon_prefect_instrument = SlackWebhook.load("mon-prefect-tla") + mon_prefect_instrument = SlackWebhook.load("mon-prefect-TLA") mon_prefect_program = SlackWebhook.load("mon-prefect-program") # Get the uid. @@ -47,14 +47,14 @@ def end_of_run_workflow(stop_doc, api_key=None, dry_run=False): try: result = func(stop_doc, api_key=api_key, dry_run=dry_run) - # Send a message to mon-prefect-tla if flow-run is successful. + # Send a message to mon-prefect-TLA if flow-run is successful. message = f":white_check_mark: {CATALOG_NAME} flow-run successful. (*{flow_run_name}*)\n ```run_start: {uid}\nscan_id: {scan_id}```" mon_prefect_instrument.notify(message) return result except Exception as e: tb = traceback.format_exception_only(e) - # Send a message to mon-prefect-tla, mon-prefect if flow-run failed. + # Send a message to mon-prefect-TLA, mon-prefect if flow-run failed. message = f":bangbang: {CATALOG_NAME} flow-run failed. (*{flow_run_name}*)\n ```run_start: {uid}\nscan_id: {scan_id}``` ```{tb[-1]}```" mon_prefect.notify(message) mon_prefect_instrument.notify(message) From a5da0a9f5160e7b001a3d47fea6216d692455b88 Mon Sep 17 00:00:00 2001 From: Jun Aishima Date: Thu, 1 Oct 2026 14:34:19 -0400 Subject: [PATCH 5/7] use TLA for ease-of-changing later --- prefect.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/prefect.yaml b/prefect.yaml index aaa775d..4425d2c 100644 --- a/prefect.yaml +++ b/prefect.yaml @@ -1,4 +1,4 @@ -name: prefect-docker-pixi-tiled-tla +name: prefect-docker-pixi-tiled-TLA prefect-version: 3.6.10 build: null @@ -9,14 +9,14 @@ pull: - prefect.deployments.steps.set_working_directory: directory: /repo - prefect.deployments.steps.git_clone: - repository: https://github.com/nsls2/tla-workflows.git + repository: https://github.com/nsls2/TLA-workflows.git branch: main deployments: - - name: tla-end-of-run-workflow-docker + - name: TLA-end-of-run-workflow-docker version: 0.1.2 tags: - - tla + - TLA - main description: Deploy the updated Docker image entrypoint: end_of_run_workflow.py:end_of_run_workflow @@ -24,13 +24,13 @@ deployments: schedule: {} work_pool: job_variables: - image: ghcr.io/nsls2/tla-workflows:main + image: ghcr.io/nsls2/TLA-workflows:main image_pull_policy: Always network: slirp4netns volumes: - - /nsls2/data/tla/proposals:/nsls2/data/tla/proposals - - /srv/prefect3-docker-worker-tla/app:/srv # replace tla here + - /nsls2/data/TLA/proposals:/nsls2/data/TLA/proposals + - /srv/prefect3-docker-worker-TLA/app:/srv # replace TLA here container_create_kwargs: - userns_mode: "keep-id:uid=402xxx,gid=402xxx" # workflow-tla:workflow-tla + userns_mode: "keep-id:uid=402xxx,gid=402xxx" # workflow-TLA:workflow-TLA auto_remove: true - name: tla-work-pool-docker + name: TLA-work-pool-docker From f928aa3f2a41bb5c737c0495ef1ba94e96056736 Mon Sep 17 00:00:00 2001 From: Jun Aishima Date: Thu, 1 Oct 2026 14:35:56 -0400 Subject: [PATCH 6/7] add a line for instruction on a way to set the correct names --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f9d14f3..0d1ad14 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,9 @@ > name does not apply. Finally, delete all instructions -- lines that start with > `>` +> It would be quick and easy to perform a text replace call for "TLA" to "tla" where +"tla" is the acronym for the instrument name. + > Choose one of the following descriptions; delete the other. For beamlines with endstations: "Repository of workflows for the {endstation} From 511701d388530f55e2716ce47537b189c2c0745b Mon Sep 17 00:00:00 2001 From: Jun Aishima Date: Wed, 7 Oct 2026 11:50:31 -0400 Subject: [PATCH 7/7] update README - now using {TLA} instead of previous text --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0d1ad14..dcd69af 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,11 @@ # {TLA}-workflows -> Replace all instances of {endstation or TLA} with the name of the endstation -> or the **lower-case** three-letter acronym of the beamline, if an endstation -> name does not apply. Finally, delete all instructions -- lines that start with -> `>` +> Replace all instances of {TLA} with the name of the endstation or the +> **lower-case** three-letter acronym of the beamline, if an endstation name +> does not apply. Finally, delete all instructions -- lines that start with `>` -> It would be quick and easy to perform a text replace call for "TLA" to "tla" where -"tla" is the acronym for the instrument name. +> It would be quick and easy to perform a text replace call for "TLA" to "tla" +> where "tla" is the acronym for the instrument name. > Choose one of the following descriptions; delete the other.