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

runproc sample #21

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

runproc sample #21

wants to merge 16 commits into from

Conversation

mcqueenorama
Copy link

This was pretty easy to get going. It still has json on stdin, but it closes stdin, returns stdout, and scrubs the element. Is this a decent way to proceed? This already makes it much more shell friendly. This kind of thing looks nice:

https://gist.github.com/8c7864a67b24eac38ab8

Also I added a --all flag so it will go across the entire circuit. This example does a netstat and tags each line of output and does the entire circuit. The calls across the circuit go asyncronously.

cat netstat.in | circuit runproc --tag --all -d circuit://10.9.201.38:11022/9317/Q18f5f14751995021

The input json looks like this:

{
"Path": "/usr/bin/sudo",
"Args":["/bin/netstat", "-pant"],
"Name": "netstat"
}

args := x.Args()

if len(args) != 1 && !x.Bool("all") {
fatalf("runproc needs an anchor argument or use the --all flag to do the entire circuit")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"to do the entire circuit" should be "to execute on every host in the circuit"

@petar
Copy link
Member

petar commented May 7, 2015

Let me know if any of the comments are unclear.

@mcqueenorama
Copy link
Author

Good comments. I wanted your feedback on the timeout thing. I knew it was bad.

@mcqueenorama
Copy link
Author

I think I've got it all fixed up.

@hoijui
Copy link

hoijui commented Apr 20, 2019

I took this branch, merged current master back in, and fixed the resulting compile errors:
https://github.com/hoijui/circuit/tree/mcqueenorama

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