8000 setupPrivateMounts() method implementation is missing from net.py · Issue #7 · USC-NSL/miniNExT · GitHub
[go: up one dir, main page]

Skip to content

setupPrivateMounts() method implementation is missing from net.py #7

Open

Description

@mjnovice

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 ?

Activity

  1. mjnovice commented on Mar 14, 2016

    @mjnovice
    Author

    Any thoughts people ?

  2. bschlinker commented on Mar 18, 2016

    @bschlinker
    Member

    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.

  3. mjnovice commented on Mar 22, 2016

    @mjnovice
    Author

    @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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0