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

Provide access to sandbox logs #91

Merged
merged 5 commits into from
Jun 9, 2016
Merged

Conversation

alde
Copy link
Contributor

@alde alde commented Jun 8, 2016

Add /stdout and /stderr endpoints on a task resource to access logs from the sandbox

Rickard Dybeck added 2 commits June 8, 2016 19:08
using the /task/<task_id>/{stdout,stderr} endpoint it is possible to
fetch the output from the run.
@alde alde force-pushed the provide-access-to-sandbox-logs branch from a54103c to 1528cfc Compare June 8, 2016 17:12
return
}
defer response.Body.Close()
body, err := ioutil.ReadAll(response.Body)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This could be buffering several MB of data before starting the response. I think go has some method for writing a stream directly to a http response.

)

// getFile handles the actual fetching of file from the agent.
func getFile(file string, task types.EremeticTask) (int, interface{}) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

interface{} => something

io.ReadCloser ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure how that'd work with the string returns, but maybe the string returns are wrong

Copy link
Collaborator

Choose a reason for hiding this comment

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

aha, I see. maybe it should actually be (err, io.whatever) and the "Unable to fetch upstream file" could be the message of the error object?

@keis
Copy link
Collaborator

keis commented Jun 9, 2016

Looks good to me. GetFile still looks a bit iffy but I have no excellent suggestions at this time. If it gets the job done, eh?

@alde
Copy link
Contributor Author

alde commented Jun 9, 2016

Yeah, I think it's good for now.

@alde alde merged commit dc5aa8c into master Jun 9, 2016
@alde alde deleted the provide-access-to-sandbox-logs branch June 9, 2016 07:57
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