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

Docs on running a subprocess in completion handler #5050

Open
nick-youngblut opened this issue Jun 5, 2024 · 0 comments
Open

Docs on running a subprocess in completion handler #5050

nick-youngblut opened this issue Jun 5, 2024 · 0 comments

Comments

@nick-youngblut
Copy link
Contributor

nick-youngblut commented Jun 5, 2024

It would be helpful to include docs on how to run a subprocess in the completion handler. For instance:

workflow.onComplete{
     def proc = ['./bin/final_checks.sh'].execute()
     proc.waitForProcessOutput()
}

...or another example:

workflow.onComplete {
    if (!workflow.success) {
        def proc = ['./bin/run_llm_model_to_eval_the_error.sh'].execute()
        def output = new StringBuffer()
        def error = new StringBuffer()
        proc.consumeProcessOutput(output, error)
        proc.waitFor()
        
        if (proc.exitValue() != 0) {
            println "Error running LLM model script: ${error.toString()}"
        } else {
            println "LLM model script output: ${output.toString()}"
        }
    }
}

Currently the completion handler docs just discuss workflow introspection:

workflow.onComplete {
    println "Pipeline completed at: $workflow.complete"
    println "Execution status: ${ workflow.success ? 'OK' : 'failed' }"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant