Beispiel #1
0
def run(
        cwl_document: str,
        input_params: str,
        exec_profile=LocalToolExec,  # please note here class not 
        # the path to the module is required
    outdir=os.path.abspath('.'),
        tmp_outdir_prefix=cwltool.utils.DEFAULT_TMP_PREFIX,
        cachedir="",
        move_outputs="move",  # one of "move", "copy", or "leave"
        debug=False):
    """
        Main API entry point. Executes c2wl_rocket.__main__.main"
    """
    args = argparse.Namespace(debug=debug,
                              exec_profile=exec_profile,
                              cwl_document=cwl_document,
                              input_params=[input_params],
                              outdir=outdir,
                              tmp_outdir_prefix=tmp_outdir_prefix,
                              cachedir=cachedir,
                              move_outputs=move_outputs)
    main(args)
                else:
                    logger.error("Workflow cannot make any more progress.")
                    break

        while self.jobs:
            try:
                self.cond.acquire()
                self.cond.wait()
            finally:
                self.cond.release()


        if self.final_output is None:
            raise cwltool.workflow.WorkflowException("Workflow did not return a result.")

        return self.final_output


def main(args, stdout, stderr):
    runner = GGPCwlRunner()
    args.insert(0, "--leave-outputs")
    parser = cwltool.main.arg_parser()
    parser.add_argument("--project", default=None)
    parser.add_argument("--bucket", default=None)

    return cwltool.main.main(args, executor=runner.ggp_executor, makeTool=runner.ggp_maketool, parser=parser)


if __name__ == "__main__":
    main(sys.argv[1:], sys.stdout, sys.stderr)
Beispiel #3
0
    if not options.basedir:
        options.basedir = os.path.dirname(os.path.abspath(options.cwljob))

    outdir = options.outdir

    print "> the cwl file is for a ", t.tool["class"]
    if t.tool["class"] == "Workflow":
        print generateScriptForWorkflow(t, job, outdir)
    elif t.tool["class"] == "CommandLineTool":
        print generateScriptForTool(t, job, outdir)

    return 0


if __name__ == "__main__":
    sys.exit(main(sys.argv[1:]))


# ---------------- some notes and tests for interactive debugging ----------- #
def test():
    # cwltool and cwljob the two .cwl and .json files
    print "i am in ", pwd
    mycwltool = "src/cwl2script/test/revsort.cwl"
    cwljob = ""

    # help("cwltool.main")
    # help("cwltool.main.load_tool")

    help("cwltool.workflow")

    # create a tool
Beispiel #4
0
        worker.start(web_server_host=args.web_server_host,
                     web_server_port=int(args.web_server_port))


def run(
        cwl_document: str,
        input_params: str,
        exec_profile=LocalToolExec,  # please note here class not 
        # the path to the module is required
    outdir=os.path.abspath('.'),
        tmp_outdir_prefix=cwltool.utils.DEFAULT_TMP_PREFIX,
        cachedir="",
        move_outputs="move",  # one of "move", "copy", or "leave"
        debug=False):
    """
        Main API entry point. Executes c2wl_rocket.__main__.main"
    """
    args = argparse.Namespace(debug=debug,
                              exec_profile=exec_profile,
                              cwl_document=cwl_document,
                              input_params=[input_params],
                              outdir=outdir,
                              tmp_outdir_prefix=tmp_outdir_prefix,
                              cachedir=cachedir,
                              move_outputs=move_outputs)
    main(args)


if __name__ == "__main__":
    main()
Beispiel #5
0
                         default=True,
                         help="Run jobs in parallel (the default)")
    exgroup.add_argument("--serial",
                         action="store_false",
                         dest="parallel",
                         help="Run jobs in parallel (the default)")

    parser.add_argument(
        "workflow",
        type=Text,
        nargs="?",
        default=None,
        metavar='cwl_document',
        help="path or URL to a CWL Workflow, "
        "CommandLineTool, or ExpressionTool. If the `inputs_object` has a "
        "`cwl:tool` field indicating the path or URL to the cwl_document, "
        " then the `workflow` argument is optional.")
    parser.add_argument(
        "job_order",
        nargs=argparse.REMAINDER,
        metavar='inputs_object',
        help="path or URL to a YAML or JSON "
        "formatted description of the required input values for the given "
        "`cwl_document`.")

    return parser


if __name__ == "__main__":
    sys.exit(main())
Beispiel #6
0
                        action="store_true",
                        help="Print command line help for tool")

    parser.add_argument(
        "--project-uuid",
        type=str,
        help=
        "Project that will own the workflow jobs, if not provided, will go to home project."
    )
    parser.add_argument(
        "--ignore-docker-for-reuse",
        action="store_true",
        help=
        "Ignore Docker image version when deciding whether to reuse past jobs.",
        default=False)

    parser.add_argument("workflow",
                        type=str,
                        nargs="?",
                        default=None,
                        help="The workflow to execute")
    parser.add_argument("job_order",
                        nargs=argparse.REMAINDER,
                        help="The input object to the workflow.")

    return parser


if __name__ == '__main__':
    sys.exit(main(sys.argv[1:]))