https://prefect.io logo
s

sark

09/25/2020, 7:20 AM
hi guys with a prefect function task i can return a result simply with
return
like this:
Copy code
@task
def start_job():
   return job_id
i was wondering if it was possible to do the same for a container task created with
CreateContainer
in my case what i am trying to do is to return the job id of the job started by that container, so that another task can use it to stop the job
j

josh

09/25/2020, 1:29 PM
Hey @sark by job do you mean a job that the container is creating itself? I don’t think there is a way natively in those tasks to retrieve data returned from that container but we encourage contributions to the task library! As a side thought you may be able to use some combination of
GetContainerLogs
and
WaitOnContainer
to get the information you want but other than that it would have to be implemented.
s

sark

09/28/2020, 3:27 AM
yeah a job (unrelated to prefect) the container is creating itself
yeah i guess a container task is not something which can be treated as a function and so should not have a return value of that sort