Project

General

Profile

Actions

Bug #20462

closed

Uploading a new workflow is failing

Added by Peter Amstutz over 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
CWL
Story points:
-
Release relationship:
Auto

Description

DEBUG EXIT mapper 1682618282.1297848 0.000244140625

DEBUG ENTER collectloc 1682618282.1298783

DEBUG EXIT collectloc 1682618282.132989 0.003110647201538086

DEBUG EXIT upload_dependencies wes-postalignment-tumor-only.cwl 1682618282.1488423 0.16721153259277344

DEBUG EXIT upload_workflow_deps 1682618282.1490312 15.242694616317749

ERROR Unhandled error:

string index out of range

Traceback (most recent call last):

File "/scratch/WES-Launcher-new/env/lib64/python3.7/site-packages/cwltool/main.py", line 1361, in main
tool, initialized_job_order_object, runtimeContext, logger=_logger
File "/scratch/WES-Launcher-new/env/lib64/python3.7/site-packages/arvados_cwl/executor.py", line 713, in arv_executor
jobmapper=jobmapper)
File "/scratch/WES-Launcher-new/env/lib64/python3.7/site-packages/arvados_cwl/arvworkflow.py", line 293, in upload_workflow
if f[n] != firstfile[n]:

IndexError: string index out of range


Subtasks 1 (0 open1 closed)

Task #20466: Review 20462-workflow-prefixResolvedPeter Amstutz05/01/2023Actions
Actions #1

Updated by Peter Amstutz over 1 year ago

  • Status changed from New to In Progress
Actions #2

Updated by Peter Amstutz over 1 year ago

  • Description updated (diff)
Actions #4

Updated by Brett Smith over 1 year ago

Would you accept this implementation that's O(n) instead of O(n²)? It passes all your tests.

def common_prefix(firstfile, all_files):
    common_parts = firstfile.split('/')
    common_parts[-1] = ''
    for f in all_files:
        f_parts = f.split('/')
        for index, (a, b) in enumerate(zip(common_parts, f_parts)):
            if a != b:
                common_parts = common_parts[:index + 1]
                common_parts[-1] = ''
                break
        if not any(common_parts):
            break
    return '/'.join(common_parts)

It seems like this function should be defined in cwl.util. That's where you wrote the tests, and multiple modules are using it, and it's just a generic string manipulation function. How about moving it?

Actions #5

Updated by Peter Amstutz over 1 year ago

Brett Smith wrote in #note-4:

Would you accept this implementation that's O(n) instead of O(n²)? It passes all your tests.

[...]

This feels a bit like code golf but sure, I can use your implementation.

It seems like this function should be defined in cwl.util. That's where you wrote the tests, and multiple modules are using it, and it's just a generic string manipulation function. How about moving it?

Sure.

Actions #6

Updated by Peter Amstutz over 1 year ago

  • Status changed from In Progress to Resolved
Actions #7

Updated by Peter Amstutz about 1 year ago

  • Release set to 66
Actions

Also available in: Atom PDF