yuch7 / cwlexec

A new open source tool to run CWL workflows on LSF
Other
36 stars 8 forks source link

basename is not recognized in JS evaluation of directory #10

Closed drjrm3 closed 6 years ago

drjrm3 commented 6 years ago

The Directory specification requires a basename attribute but this is currently being evaluated as a null object by cwlexec since it is not included in the fields.

The attached shows a simple example of attempting to evaluate a basename of a directory where all required fields except basename are included so cwlexec fails:

09:50:13.340 default [pool-4-thread-1] DEBUG c.i.s.c.e.util.evaluator.JSEvaluator - Evaluate js expression "$(inputs.out_dir.basename)" with context
[var inputs={"sample":"MySample","out_dir":{"location":"/research/rgs01/home/clusterHome/kbrown1/DirectoryBasenameError/outdir/MySample","path":"/home/kbrown1/DirectoryBasenameError/workdir/d9623834-8552-4554-b8b5-c58184d22730/MySample","srcPath":"/research/rgs01/home/clusterHome/kbrown1/DirectoryBasenameError/outdir/MySample","listing":[],"class":"Directory"}};]
09:50:13.353 default [pool-4-thread-1] DEBUG c.i.s.c.e.util.evaluator.JSEvaluator - Evaluated js expression "$(inputs.out_dir.basename)" to A null object
09:50:13.353 default [pool-4-thread-1] ERROR c.i.s.c.e.e.lsf.LSFBwaitExecutorTask - Failed to wait for job touch_sample <42464255>, null
09:50:13.354 default [pool-4-thread-1] ERROR c.i.s.c.e.e.lsf.LSFBwaitExecutorTask - The exception stacks:
java.lang.NullPointerException: null
    at java.lang.String.replace(String.java:2240)
    at com.ibm.spectrumcomputing.cwl.exec.util.evaluator.JSEvaluator.parsePlaceholder(JSEvaluator.java:136)
    at com.ibm.spectrumcomputing.cwl.exec.util.evaluator.JSEvaluator.parseExpr(JSEvaluator.java:171)
    at com.ibm.spectrumcomputing.cwl.exec.util.evaluator.JSEvaluator.evaluate(JSEvaluator.java:56)
    at com.ibm.spectrumcomputing.cwl.exec.util.evaluator.CommandOutputBindingEvaluator.evalGlob(CommandOutputBindingEvaluator.java:64)
    at com.ibm.spectrumcomputing.cwl.exec.util.outputs.OutputsCapturer.captureCommandOutputs(OutputsCapturer.java:92)
    at com.ibm.spectrumcomputing.cwl.exec.executor.lsf.LSFBwaitExecutorTask.captureStepOutputs(LSFBwaitExecutorTask.java:376)
    at com.ibm.spectrumcomputing.cwl.exec.executor.lsf.LSFBwaitExecutorTask.makeStepSuccessful(LSFBwaitExecutorTask.java:140)
    at com.ibm.spectrumcomputing.cwl.exec.executor.lsf.LSFBwaitExecutorTask.waitSteps(LSFBwaitExecutorTask.java:133)
    at com.ibm.spectrumcomputing.cwl.exec.executor.lsf.LSFBwaitExecutorTask.run(LSFBwaitExecutorTask.java:98)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

DirectoryBasenameError.tar.gz

liuboxa commented 6 years ago

Yes, if the basename is not defined, we didn't set it, currently, if it is not defined, we set it from the path

Fix at 5f19723