You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.
10000
You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
setupPrivateMounts() method implementation is missing from net.py #7
I could not find any implementation for the same. I was wanting to add some privateMounts while adding hosts to a topology. Is there any solution for it, currently ?
Interesting -- it looks like I didn't reimplement setupPrivateMounts() when I changed the architecture of MiniNExT ~1.5 years ago. My apologizes -- I haven't been able to put nearly as much time into this project as I'd hoped.
However, the process required to set up a private mount is very similar to the logic used to setup the private run and private log mounts in node.py
For instance, the following code is used for setting up a container's private log directory, binding it to the path provided in privateLogDir (a string).
def setupPrivateLogs(self, privateLogDir):
...
# Create the PathProperties and MountProperties objects
logPathProperties = PathProperties(path=privateLogDir,
perms=getObjectPerms('/var/log'),
create=True,
createRecursive=True,
setPerms=False)
mount = MountProperties(target='/var/log', source=logPathProperties)
# Pass the created mountPoint off...
self.setupMountPoint(mount)
Note that you could also just create a mount without defining a path properties object if you don't need the mount point to be created / permissions to be set / etc.
mount = MountProperties(target='/var/log', source='/var/log/mininext/container1')
self.setupMountPoint(mount)
You should be able to call setupMountPoint and create a MountProperties object outside of node.py (you can do it in your topo setup), or you could implement setupPrivateMounts().
Let me know if this makes sense and/or if I've misunderstood your question.
@bschlinker Thanks for replying. It completely makes sense. I needed to implement setupPrivateMounts() because I needed to specify privateMounts at the time of adding the nodes to a topology object, something like topo.addHost(privateMounts={'a':'b', 'c':'d'}). For this I implemented this in my forked repo mjnovice@e4f3a36. However the implementation, might be a bit hacky. Feel free to comment on it, and suggest improvements on it, so that it could be merged into your repo. :)
Activity
mjnovice commentedon Mar 14, 2016
Any thoughts people ?
bschlinker commentedon Mar 18, 2016
Interesting -- it looks like I didn't reimplement
setupPrivateMounts()when I changed the architecture of MiniNExT ~1.5 years ago. My apologizes -- I haven't been able to put nearly as much time into this project as I'd hoped.However, the process required to set up a private mount is very similar to the logic used to setup the private run and private log mounts in
node.pyFor instance, the following code is used for setting up a container's private log directory, binding it to the path provided in
privateLogDir(a string).Note that you could also just create a mount without defining a path properties object if you don't need the mount point to be created / permissions to be set / etc.
You should be able to call setupMountPoint and create a MountProperties object outside of node.py (you can do it in your topo setup), or you could implement setupPrivateMounts().
Let me know if this makes sense and/or if I've misunderstood your question.
mjnovice commentedon Mar 22, 2016
@bschlinker Thanks for replying. It completely makes sense. I needed to implement setupPrivateMounts() because I needed to specify privateMounts at the time of adding the nodes to a topology object, something like topo.addHost(privateMounts={'a':'b', 'c':'d'}). For this I implemented this in my forked repo mjnovice@e4f3a36. However the implementation, might be a bit hacky. Feel free to comment on it, and suggest improvements on it, so that it could be merged into your repo. :)