Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions flytekit/core/container_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def __init__(
secret_requests: Optional[List[Secret]] = None,
pod_template: Optional["PodTemplate"] = None,
pod_template_name: Optional[str] = None,
local_logs: bool = False,
**kwargs,
):
sec_ctx = None
Expand Down Expand Up @@ -93,6 +94,7 @@ def __init__(
requests=requests if requests else Resources(), limits=limits if limits else Resources()
)
self.pod_template = pod_template
self.local_logs = local_logs

@property
def resources(self) -> ResourceSpec:
Expand Down Expand Up @@ -249,6 +251,11 @@ def execute(self, **kwargs) -> LiteralMap:
)
# Wait for the container to finish the task
# TODO: Add a 'timeout' parameter to control the max wait time for the container to finish the task.

if self.local_logs:
Comment thread
pingsutw marked this conversation as resolved.
for log in container.logs(stream=True):
print(f"[Local Container] {log.strip()}")

container.wait()

output_dict = self._get_output_dict(output_directory)
Expand Down