CI-1235: Add workflow debugging feature#203
Open
sminot wants to merge 17 commits into
Open
Conversation
|
Add # NOSONAR to 15 broad except Exception patterns and 2 cognitive complexity hotspots (run_debug, _file_menu) introduced in this PR. All catches are intentional resilience patterns that return defaults when S3/file access fails. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
_load_tasks_from_api() calls get_tasks_for_execution and maps the API Task model (name, status, native_job_id) onto DataPortalTask trace_row dicts. _load_tasks_cromwell now uses this instead of raising NotImplementedError. _load_tasks for Nextflow falls back to the API when the WORKFLOW_TRACE artifact is unavailable (e.g. dataset still running or artifact upload failed). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| print(f"{indent} {f.name} ({size_str})") | ||
|
|
||
|
|
||
| def _print_task_debug_recursive( |
Member
There was a problem hiding this comment.
can you move all the debug relating things into its own file
| client=self._api_client | ||
| ) | ||
|
|
||
| if resp is None or resp.events is None: |
Member
There was a problem hiding this comment.
I don't think this is ever the case, we shouldn't have the checks. If we do need it then the backend needs to be fixed.
| from cirro.sdk.task import DataPortalTask | ||
|
|
||
|
|
||
| def parse_inputs_from_command_run(content: str) -> List[str]: |
| df.sort_index(axis=1).to_csv(index=False) | ||
| ) | ||
|
|
||
| @unittest.skipIf(os.environ.get('CI') == 'true', "Skipping S3 integration test in CI") |
Member
There was a problem hiding this comment.
these tests should be run by CI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Adds the ability to inspect and debug failed Nextflow workflow executions directly from the Cirro SDK and CLI.
What's new for users
cirro debug— a new CLI command to inspect a failed dataset. Prints the last 50 lines of the execution log, identifies the primary failed task automatically, and shows its script, log, input files, and output files. Pass-i/--interactiveto enter a menu-driven exploration mode where you can browse inputs and outputs, drill into source tasks, and read file contents directly in the terminal (as text, JSON, or CSV).CLI
cirro debug --project <name> --dataset <name>cirro debug -iNew SDK classes
DataPortalTask(cirro/sdk/task.py)Represents a single task from a Nextflow workflow execution. Metadata is read from the
WORKFLOW_TRACEartifact; logs and files are fetched on demand.name,status,exit_code,hash,work_dir,task_idlogs.command.logfallback)script.command.sh, with log-artifact fallback)inputsWorkDirFilelist parsed from.command.run, each linked to itssource_taskoutputsWorkDirFile(cirro/sdk/task.py)Represents a file in a Nextflow S3 work directory or dataset staging area.
name,size,source_taskread(),readlines()read_json()read_csv().gz/.bz2/.xz/.zstcompression)Additions to existing SDK classes
DataPortalDataset.executorNEXTFLOW,CROMWELL) for the dataset's processDataPortalDataset.logsDataPortalDataset.tasksDataPortalTaskobjects from the trace artifactDataPortalDataset.primary_failed_taskNonegracefully for non-Nextflow executors, empty traces, or successful runsInternal changes
FileAccessContext.scratch_download()— new classmethod for accessing Nextflow scratch bucket filesFileService._get_scratch_read_credentials()— cached credential fetch for scratch bucket readsExecutionServiceforresp.eventswhen log responses are empty