Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make output unbuffered #317

Merged
merged 2 commits into from
Jul 7, 2020
Merged

Conversation

terceiro
Copy link
Contributor

This makes it possible to pipe the output of itamae to other tool and
have the output as it happens. Otherwise, the output is buffered and is
only available after itamae finishes.

This makes it possible to pipe the output of itamae to other tool and
have the output as it happens. Otherwise, the output is buffered and is
only available after itamae finishes.
@unasuke
Copy link
Member

unasuke commented Jun 24, 2020

@terceiro Thanks! Could you tell me concretely usage of the "pipe the output of itamae to other tool"?

Sync stdout makes a little slow but it's not such a big issue I though. I want to another opinion.

@terceiro
Copy link
Contributor Author

@terceiro Thanks! Could you tell me concretely usage of the "pipe the output of itamae to other tool"?

itamae [...] | cat is enough to reproduce this issue

Sync stdout makes a little slow but it's not such a big issue I though. I want to another opinion.

well it's already the default when stdout is a tty, and also the time it takes to actually process each resource in a recipe is probably orders or magnitude larger than the time it takes to flush the corresponding logs to a non-tty stdout.

@terceiro
Copy link
Contributor Author

the travis failure (Itamae::Resource::HttpRequest::HTTPClientError) seems unrelated to my change. is that the case, or am I missing something?

@unasuke
Copy link
Member

unasuke commented Jun 25, 2020

itamae [...] | cat is enough to reproduce this issue

Yes, I know how to "get" itamae's output from stdout, I want to know "what" to use itamae's output.

The travis failure is httpbin.org's issue. 😉

@unasuke
Copy link
Member

unasuke commented Jun 25, 2020

It's just my curiosity.

@terceiro
Copy link
Contributor Author

Yes, I know how to "get" itamae's output from stdout, I want to know "what" to use itamae's output.

ah, ok. sorry.

I'm the author of a tool called chake which I created originally to provide a way of using Chef™ without having a Chef™ server; I am now migrating my stuff to itamae, and adding support for it in chake. chake supports applying config to multiple servers in parallel, and for that it runs the underlying tool with its output to a pipe, so that it can display the output prefixed with the hostname while the tool does its job on each server.

@unasuke unasuke requested a review from sue445 June 28, 2020 06:22
@sue445 sue445 merged commit e2b0c2c into itamae-kitchen:master Jul 7, 2020
@sue445
Copy link
Member

sue445 commented Jul 7, 2020

I released as v1.10.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants