https://prefect.io logo
Title
l

Lawrence Finn

06/24/2021, 7:28 PM
Is there a way to get the output from a kubernetes
RunNamespacedJob
and use it as an input for another task?
k

Kevin Kho

06/24/2021, 7:30 PM
@Lawrence Finn, what output are you looking for? Does your job produce some data that you want to read?
l

Lawrence Finn

06/24/2021, 7:31 PM
I haven’t built anything yet, but wondering how I would go about getting output (or generating output). Would it be via stdout? A file?
k

Kevin Kho

06/24/2021, 7:31 PM
I think you’d probably want it to be a file that would then have to be read in a downstream task if you know the location
l

Lawrence Finn

06/24/2021, 7:32 PM
Would you recommend something like the Job uploads results to s3 or something and the task reads from that?
k

Kevin Kho

06/24/2021, 7:33 PM
I would yeah. That’s the easiest in my opinion
l

Lawrence Finn

06/24/2021, 7:34 PM
ah. but nothing is built in to handle stdout or logs or whatever?
k

Kevin Kho

06/24/2021, 7:36 PM
There actually is , but I’m not 100% sure this is working right now. The code has a section to read the pod logs.
Our task library doesn’t have strong guarantees in general because a lot is community contributed, but at the same time, if you had to tweak it for your use case, it might be a good starting point
\But I think the current code is just to stream the logs to the Prefect logs. You might need the ReadNamespaceLogs task
l

Lawrence Finn

06/24/2021, 7:42 PM
does that exist? or would i have to write it?
oh i see it