Skip to content
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

update translator service to bclconvert manager #299

Merged
merged 26 commits into from
May 30, 2024

Conversation

raylrui
Copy link
Contributor

@raylrui raylrui commented May 16, 2024

Update translator service to bclconvert manager

As discussed,

  1. translator service will be included in BclConvert Manager.
  2. event scheme from bcm to bclconvertmanager
  3. modify in event schemas
  4. add SampleSheet Output, RunID and BaseSpace ID SampleSheet Output, RunID and BaseSpace ID should be outputs of the bclconvert manager #301

new schema example

{
 "version": "0",
 "id": "f71aaaaa-5b36-40c2-f7dc-804ca6270cd6",
 "detail-type": "WorkflowRunStateChange",
 "source": "orcabus.bclconvertmanager",
 "account": "123456789012",
 "time": "2024-05-01T09:25:44Z",
 "region": "ap-southeast-2",
 "resources": [],
 "detail": {
   "portalRunId": "202405012397actg",
   "timestamp": "2024-05-01T09:25:44Z",
   "status": "SUCCEEDED",
   "workflowName": "BclConvert",
   "workflowVersion": "4.2.7",
   "workflowRunName": "540424_A01001_0193_BBBBMMDRX5_c754de_bd822f",
   "payload": {
     "refId": null,
     "version": "0.1.0",
     "data": {
       "projectId": "bxxxxxxxx-dxxx-4xxxx-adcc-xxxxxxxxx",
       "analysisId": "aaaaafe8-238c-4200-b632-d5dd8c8db94a",
       "userReference": "540424_A01001_0193_BBBBMMDRX5_c754de_bd822f",
       "timeCreated": "2024-05-01T10:11:35Z",
       "timeModified": "2024-05-01T11:24:29Z",
       "pipelineId": "bfffffff-cb27-4dfa-846e-acd6eb081aca",
       "pipelineCode": "BclConvert v4_2_7",
       "pipelineDescription": "This is an autolaunch BclConvert pipeline for use by the metaworkflow",
       "pipelineUrn": "urn:ilmn:ica:pipeline:bfffffff-cb27-4dfa-846e-acd6eb081aca#BclConvert_v4_2_7",
       "instrumentRunId": "12345_A12345_1234_ABCDE12345",
       "basespaceRunId": "1234567",
       "samplesheetB64gz": "H4sIAFGBVWYC/9VaUW+jOBD+Kyvu9VqBgST0njhWh046..."
     }
   }
 }
}

@raylrui raylrui self-assigned this May 16, 2024
@victorskl
Copy link
Member

Morning Ray. Great start.

Could you do me favour; can you create a github issue/ticket with the same description - and, label "pipeline" "refactor".

Then, pls link it to; this PR > Development > Link issue from this repository (at the right panel)

Thank so much.

@raylrui raylrui marked this pull request as ready for review May 29, 2024 01:05
@raylrui
Copy link
Contributor Author

raylrui commented May 29, 2024

Hi @reisingerf @victorskl @alexiswl ;
update for bclconvert manager:

  1. create BclConvertManager stack which include translator service.
  2. add "instrumentRunId", "basespaceRunId", "samplesheetB64gz" in the required field of orcabus.bclconvertmanager@PayloadDataSucceeded according SampleSheet Output, RunID and BaseSpace ID should be outputs of the bclconvert manager #301
  3. The event tranlator then returns the following:

(Non-SUCCEEDED Event without payload)

{
    "portalRunId": '20xxxxxxxxxx',
    "executionId": "valid_payload_id",
    "timestamp": "2024-00-25T00:07:00Z",
    "status": "SUCCEEDED",
    "workflowName": "BclConvert",
    "workflowVersion": "4.2.7",
    "workflowRunName": "123456_A1234_0000_TestingPattern",
}

(SUCCEEDED Event)

{
    "portalRunId": '20xxxxxxxxxx',
    "executionId": "valid_payload_id",
    "timestamp": "2024-00-25T00:07:00Z",
    "status": "SUCCEEDED",
    "workflowName": "BclConvert",
    "workflowVersion": "4.2.7",
    "workflowRunName": "123456_A1234_0000_TestingPattern",
    "payload": {
        "refId": None,
        "version": "0.1.0",
        "data": {
            "projectId": "valid_project_id",
            "analysisId": "valid_payload_id",
            "userReference": "123456_A1234_0000_TestingPattern",
            "timeCreated": "2024-01-01T00:11:35Z",
            "timeModified": "2024-01-01T01:24:29Z",
            "pipelineId": "valid_pipeline_id",
            "pipelineCode": "BclConvert v0_0_0",
            "pipelineDescription": "BclConvert pipeline.",
            "pipelineUrn": "urn:ilmn:ica:pipeline:123456-abcd-efghi-1234-acdefg1234a#BclConvert_v0_0_0"
            "instrumentRunId": "12345_A12345_1234_ABCDE12345",
            "basespaceRunId": "1234567",
            "samplesheetB64gz": "H4sIAFGBVWYC/9VaUW+jOBD+Kyvu9VqBgST0njhWh046..."
        }
    }
}

Copy link
Member

@reisingerf reisingerf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Minor comments.

'id_type': {'S': 'db_uuid'},
'analysis_id': {'S': internal_ica_event.detail.payload.get('data', '').get("analysisId", '')},
'analysis_status': {'S': internal_ica_event.detail.status},
# 'SUCCEEDED', 'FAILED', 'INPROGRESS', 'ABORTED', 'UNKNOWN
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does "UNKNOWN" come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may come from old draft, already deleted.

"portalRunId": '20xxxxxxxxxx',
"executionId": "valid_payload_id",
"timestamp": "2024-00-25T00:07:00Z",
"status": "SUCCEEDED",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably not be "SUCCEEDED".
The code will use whatever was the status from the input event, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

"workflowVersion": "4.2.7",
workflowRunName: "123456_A1234_0000_TestingPattern",
"payload": {
"refId": None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"refId" is no longer needed. (I think the code is already updated)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refId deleted as not required

# Convert from entity module to internal event details
def get_event_details(event) -> WorkflowRunStateChange:
# Extract relevant fields from the event payload
analysis_status = event.get("eventParameters", {}).get("analysisStatus", '')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would "UNSPECIFIED" be a better default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, added


event_name, version = parse_event_code(pipeline.get("code", ''))

if analysis_status != "SUCCEEDED":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty payload for all non-SUCCEEDED events is fine for now.
In the future we may want to handle all known statuses, for example add an error message payload for FAILED events. Happy to put that on the backlog though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, new backlog added here
I think for non-final status "Requested", "Queued", "Initializing", "Preparing Inputs", "In Progress", "Generating outputs", "Aborting", we can leave it empty;
for final status "Aborted", "Failed", "Succeeded", we may need add additional specific information in the future.

Copy link
Member

@victorskl victorskl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of naming convention spotted but bypassing those for now. Looking good otherwise.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just heads up; this file is deprecated and superseded by JSON Schema in main branch. When you rebase to main, pls see if you can adapt to the latest arrangement. It should be the same meaning in schema-wise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, will deleted the deprecated PayloadDataSucceeded file.

@raylrui raylrui merged commit bae74da into main May 30, 2024
5 checks passed
@raylrui raylrui deleted the feature/update-to-bclconvert-manager branch May 30, 2024 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants