-
Notifications
You must be signed in to change notification settings - Fork 68
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
minimega/vmconfiger: several bug fixes, fix #854 #889
Conversation
CPU wasn't included in the list.
Adds pretty simple support for maps to vmconfiger.
Should have been update for commas in slices.
When printing maps.
Allows you to specify multiple volumes to bind mount for a container. Fixes sandia-minimega#854.
Use new vmconfiger map support to remove Tags special case.
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.
LGTM; I'd like to test with some use cases before merging.
Note: I left a TODO to handle spaces in the paths. @activeshadow: want to give this a test drive? |
Of course! I'll try to give it a whirl this weekend. Thx!
… On Mar 17, 2017, at 14:57, Jon Crussell ***@***.***> wrote:
Note: I left a TODO to handle spaces in the paths.
@activeshadow: want to give this a test drive?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Sorry, got waylaid last week w/ work. I'm going to take a look at this right now. |
@jcrussell OK, so I'm seeing some errors when I try to use the new Here's my config (
And here's the commands I ran (as root):
Since I launched the Do the source/target have to be directories, or can they be actual files too (like I'm assuming they can be here)? |
I know what the bug is -- need to deep copy a map. I can fix it later today. Hm, I had only considered directories initially but it might be possible to handle files as well. @djfritz, what do you think? |
Glad I could help identify the bug!
Files vs directories isn't critical. I'm used to it from Docker but directories only works just as good!
… On Mar 28, 2017, at 09:28, Jon Crussell ***@***.***> wrote:
I know what the bug is -- need to deep copy a map. I can fix it later today.
Hm, I had only considered directories initially but it might be possible to handle files as well. @djfritz, what do you think?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Need to deep copy volumes map so that all VMs don't share the same one.
@activeshadow -- that bug should be fixed. You still won't be able to use files as volumes though. |
@jcrussell OK, I'll test it out shortly and let you know how it goes. Thanks! |
While you can bind mount an individual file, it's dangerous. If something like vim rewrites the file (which is does by default), a new inode will get created, effectively undoing the bind mount. The only safe way to write to a bind mounted file is to append to it, which isn't terribly useful. How does docker do this? A symlink? |
docker has the same issue: |
From the docker docs: Note: Many tools used to edit files including vi and sed --in-place may result in an inode change. Since Docker v1.1.0, this will produce an error such as “sed: cannot rename ./sedKdJ9Dy: Device or resource busy”. In the case where you want to edit the mounted file, it is often easiest to instead mount the parent directory. |
So, no, I suspect we won't support individual files anymore than docker does. |
@jcrussell maybe support this in the same way but bind mount non-directories as RO and throw a warning? |
It sounds like directories are good enough for @activeshadow's use case. I could add a check to make sure that the source is a directory (and error otherwise). |
@jcrussell @djfritz volume mounts are working for me! So. Very. Awesome. Thanks! |
Use helper function instead of generating the same code every time. Move header from a bunch of printfs to single template.
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.
LGTM
Few related things in this PR:
vm config volume
API, fixing Question: can preinit be used to inject files from host into container filesystem? #854.map[string]string
tovmconfiger
.BaseConfig.Tags
to use new map support.nuke
.