Skip to content

[Core Feature] Local logs for local container task executions. #5436

Description

@dansola

It would be nice if we could have something like a boolean flag that controls if local container tasks output logs to the terminal.

I think think could be added somewhere around here using the .logs() method of the docker client shown on this page.

An example of the SDK UX could be something like this:

from flytekit import ContainerTask, workflow

echo_container_task = ContainerTask(
    name="echo",
    image="alpine:latest",
    command=["echo", "'a test to show stdout'"],
    local_logs=True,
)

@workflow
def echo_workflow() -> None:
    return echo_container_task()

if __name__ == "__main__":
    print(echo_workflow())

where local_logs is ignored if it is a remote execution.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions