https://dagster.io/ logo
#dagster-support
Title
# dagster-support
t

Tim Chan

08/17/2022, 12:13 AM
I would like to run an image using https://docs.dagster.io/_apidocs/libraries/dagster-k8s#dagster_k8s.k8s_job_op and use the stdout output from the this op as input to another op. Is this possible?
🤖 1
When I inspect the path from
Handled output "result" using IO manager "io_manager"
I don't see any data.
s

sandy

08/17/2022, 3:32 PM
hey Tim - my first suggestion would be to write your own version of this op that outputs that data you could basically copy the code here: https://github.com/dagster-io/dagster/blob/master/python_modules/libraries/dagster-k8s/dagster_k8s/ops/k8s_job_op.py but augment the second-to-last code section to store the
log_entry
values in a local variable:
Copy code
log_entries = []
    while True:
        if timeout and time.time() - start_time > timeout:
            watch.stop()
            raise Exception("Timed out waiting for pod to finish")

        try:
            log_entry = next(log_stream)
            log_entries.append(log_entry)
            print(log_entry)  # pylint: disable=print-call
        except StopIteration:
            break
and then return
log_entries
at the end would that work for you?
t

Tim Chan

08/17/2022, 4:18 PM
I'll try it out and let you know how it goes! Thank you @sandy
👍 1
This solution worked perfectly! Thanks again.
s

sandy

08/17/2022, 11:55 PM
awesome
5 Views