diff --git a/apps/cli/executables/pexable/carta_envoy/README.md b/apps/cli/executables/pexable/carta_envoy/README.md index 579a37e9d16e292776be43a412ca85bca134977f..2d721ec6ab5b3aad87507e517e9d4719a4ea64ab 100644 --- a/apps/cli/executables/pexable/carta_envoy/README.md +++ b/apps/cli/executables/pexable/carta_envoy/README.md @@ -6,10 +6,18 @@ the NRAO Archive or upon completion of a Workspaces image processing request. ## Usage `carta_envoy [-h] -d DIRECTORY [-n NOTIFY] [-r READY] [--parallel] [--single] [-wf WORKFLOW_REQUEST] [-i IMAGE]` -## Example -To run carta envoy from command line: example on wirth-vml +## Examples + +### To run carta envoy from command line: example on wirth-vml 1. download image(s) from webtest 2. `ssh vlapipe@wirth-vml` 3. `activate_profile dsoc-dev` 4. cd download location on lustre, e.g., */lustre/aoc/cluster/pipeline/dsoc-dev/spool/820190220* 5. `/lustre/aoc/cluster/pipeline/dsoc-dev/workspaces/sbin/carta_envoy -d ./VLASS1.1.ql.T01t01.J000228-363000.10.2048.v1/rawdata -r true -n jgoldste@nrao.edu` + +### To run CARTA from the workspaces UI on dev +Pick a completed capability request from the database that has image products and open the request page for it; +there will be a "launch carta" button. + +https://ws-dev.nrao.edu/workspaces/request-status/21 + \ No newline at end of file diff --git a/apps/cli/executables/pexable/carta_envoy/img.png b/apps/cli/executables/pexable/carta_envoy/img.png new file mode 100644 index 0000000000000000000000000000000000000000..9cf5520dddf284ac0797a1444601258359ce5264 Binary files /dev/null and b/apps/cli/executables/pexable/carta_envoy/img.png differ diff --git a/shared/workspaces/test/test_capability_service.py b/shared/workspaces/test/test_capability_service.py index 909b93dd2cb270e4f2d9f86438dd7c46cc3a9063..42534ea916ade33816cf422cefb0ecb0fcaa8cc5 100644 --- a/shared/workspaces/test/test_capability_service.py +++ b/shared/workspaces/test/test_capability_service.py @@ -59,13 +59,13 @@ class TestCapabilityService: :return: """ - wf_request_id = -1 + wf_request_id = -2 carta_url = "decartes_image_carta_url" fake_carta_ready_msg = { "service": "capability", "routing_key": "capability", "carta_url": carta_url, - "subject": {"workflow_request_id": wf_request_id}, + "subject": {"workflow_request_id": wf_request_id, "argument": {"parent_wf_request_id": -1}}, "type": "carta-ready", } diff --git a/shared/workspaces/workspaces/capability/services/capability_service.py b/shared/workspaces/workspaces/capability/services/capability_service.py index d863968da2a48f6ff91e75ee73896c0757ebc843..755bf5db636b038f90f5563eb96933acda76bec8 100644 --- a/shared/workspaces/workspaces/capability/services/capability_service.py +++ b/shared/workspaces/workspaces/capability/services/capability_service.py @@ -171,9 +171,10 @@ class CapabilityService(CapabilityServiceIF): """ logger.info(f"RECEIVED CARTA READY MESSAGE: {message}") - wf_request_id = int(message["subject"]["workflow_request_id"]) + subject = message["subject"] + parent_wf_request_id = int(subject["argument"]["parent_wf_request_id"]) - execution = self.capability_info.lookup_execution_by_workflow_request_id(wf_request_id) + execution = self.capability_info.lookup_execution_by_workflow_request_id(parent_wf_request_id) request_version = execution.version request_version.workflow_metadata = {"carta_url": message["carta_url"]} diff --git a/shared/workspaces/workspaces/capability/services/interfaces.py b/shared/workspaces/workspaces/capability/services/interfaces.py index 9ba7a1d0ba32a624d2c27dd20410e3888dd0e80d..51645a5d3bde6c2a1be05003158b05daec699e07 100644 --- a/shared/workspaces/workspaces/capability/services/interfaces.py +++ b/shared/workspaces/workspaces/capability/services/interfaces.py @@ -173,6 +173,12 @@ class CapabilityInfoIF(QueueReporterIF, metaclass=ABCMeta): def lookup_execution(self, execution_id: int) -> CapabilityExecutionIF: raise NotImplementedError + @abstractmethod + def lookup_execution_by_workflow_request_id( + self, workflow_request_id: int + ) -> CapabilityExecutionIF: + raise NotImplementedError + @abstractmethod def save_execution(self, execution: CapabilityExecutionIF): pass