-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Basic Qemu driver implementation #24
Conversation
* upstream/master: Removed debug logging Added tests for docker, improved logging, and fixed a few bugs Added initial implementation for the docker driver; tests pending
* master: (66 commits) Use a single implementation of GenerateUUID scheduler: use update strategy for rolling updates nomad: adding helper structs scheduler: Adding CreateEval to Planner nomad: worker supports create eval nomad: guard eval creation based on parent eval nomad: adding Eval.Create endpoint nomad: support time wait for evaluations nomad: adding fields to cause an evaluation to 'wait' scheduler: support in-place allocation updates scheduler: util method to diff task groups nomad: helper struct func nomad: PopUpdate should minimize plan size nomad: adding helper to manipulate plans scheduler: share context and stack scheduler: allow updating the base nodes scheduler: allow StaticIterator to update base set scheduler: pull node shuffle into util nomad: adding node GC nomad: using Raft StartAsLeader to make tests faster ...
} | ||
|
||
// compute and check checksum | ||
if check, ok := task.Config["checksum"]; ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This looks like a great piece we could reuse as a generic downloader.
Looks awesome! 👍 for merge. |
resp, err := http.Get(source) | ||
if err != nil { | ||
return nil, fmt.Errorf("Error downloading source for Qemu driver: %s", err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need a defer resp.Body.Close()
here. If we don't explicitly close the body reader, we end up leaking file handles and eventually exhausting the OS of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch, thanks!
end up leaking file handles and eventually exhausting the OS of them
Been there, not the most fun of times 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 12903f7
Merging so I can sync with this in some other updates. Nice job @catsby ! |
Basic Qemu driver implementation
Clarify how Persist() is supposed to work.
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
This is a basic implementation of a Qemu driver. It's pretty bare bones, don't doing much more than basic lifecycle management. It's modeled after the
exec
driver (meaning it usedexec.Command
and friends), and borrowed heavily from Ryan Uber's prior art.The Qemu driver accepts a source image and attempts to download it from the internet and run it.
Limitations:
qemu-system-x86_64
here. Conceivably we could support other emulation types (qemu-system-i386
)httptestserver
init.d
to start any services you're expecting to runuser
, which may be slower.tap
is possible, given the correct permissions for Nomad to run as root/privilegedFuture knobs:
Links: http://qemu.weilnetz.de/qemu-doc.html