Refactor: separate go-virtualbox package#70
Conversation
Make verbose and vbm pointers so we can do late binding and pass them to other packages.
There was a problem hiding this comment.
Should this package be part of this project? It is difficult to review when it is elsewhere.
There was a problem hiding this comment.
I usually use git-subtree to include 3rd-party dependency. I'm not sure how I'm supposed to do it here. Any suggestions?
There was a problem hiding this comment.
I was thinking of just making a subdirectory within this project, something like:
vbx "github.com/boot2docker/boot2docker-cli/go-virtualbox"That way we can keep all the dependencies within the same project.
There was a problem hiding this comment.
Yep, that's exactly what you get with git-subtree :)
There was a problem hiding this comment.
please, don't use git subtrees for this, follow the example that the docker project uses for dependencies.
given that the virtualbox module is the important sauce for boot2docker-cli, please do not move it out of this repository - otherwise we'll have to fork it to maintaine it.
There was a problem hiding this comment.
I was hoping that by separating the go-virtualbox package out into its own repo, other people can use and improve it too, and we benefit as a result. The Docker approach seems to be put external dependencies into a vendor directory. Do you want me to add the dep into a similar folder?
There was a problem hiding this comment.
if we separate out all the important parts of boot2docker-cli, then we have no way to maintain the code we're using. Please keep the important stuff - and go-virtualbox is important, here. Other people can use and improve it here too.
Its way too early to make it hard for the b2d-cli contributors to refactor the code.
There was a problem hiding this comment.
OK, I'll move it here in a moment.
Reuse the flag package to parse the configuration profile so we do not need to use a separate pacakge. The trick is to transform the key=value pairs in the profile into string slice of the form --key=value, then insert the string slice between os.Args[0] and os.Args[1:]. The flag.Parse() will take care of the rest. Less work to do and more consistent results. Win-win! Additionally, changed the type of some flags to reflect its nature.
This is to wait for the VM to properly boot. Initial booting will take a bit longer due to the need to format disk and configure other settings, during which time the SSH daemon might not be reachable.
There was a problem hiding this comment.
Why are you forking this library, and then into your own repo?
There was a problem hiding this comment.
There are changes to the pflag package I made that hasn't been merged to the upstream yet. See ogier/pflag#4
There was a problem hiding this comment.
in that case, please put the modified version into this repo - else b2d will have to do it all again if you're busy.
There was a problem hiding this comment.
Do you want to make the pflag package part of the repo in the same way as the go-virtualbox package, or do you want it to be part of the 3rd-party vendor directory?
There was a problem hiding this comment.
I would hope that the pflag PR gets merged (or fixed until it does..) and its not really core to what boot2docker is, so I'd vendor that
There was a problem hiding this comment.
Makes sense. I'm not very sure how Docker manages the vendor directory. Could you explain a little bit what I should do to vendor it?
There was a problem hiding this comment.
The pflag PR has been merged.
|
For the included import vbx "github.com/boot2docker/boot2docker-cli/virtualbox"I'm wondering where do you guys put your forked repo? Do you put it under |
There was a problem hiding this comment.
// A NATNet defines a network.
|
After addressing my comments as you see fit, LGTM. |
|
LGTM |
Refactor: separate go-virtualbox package
Revert "Merge pull request #70 from riobard/refactor/vbx"
|
@riobard I don't know what went wrong - I suspect you will need to make a new PR, as github is a little primitive when things go bad |
Revert "Revert "Merge pull request #70 from riobard/refactor/vbx""
…k-not-UTC virtual box / set hwclock in VM to not beeing UTC
I factored out interactions with VirtualBox into a separate package (https://github.com/riobard/go-virtualbox). Hopefully the code for
boot2docker-cliis nice, clean and type-safe now.Additionally, this could be the first step to allow another VM solution to be used (Hyper-V on Windows?) by hooking in another package (e.g.
go-hyperv)