Metadata-Version: 1.1
Name: pyspaces
Version: 1.3
Summary: Create process in linux namespaces
Home-page: https://github.com/Friz-zy/pyspaces
Author: Filipp Frizzy
Author-email: filipp.s.frizzy@gmail.com
License: MIT
Description: pyspaces
        ========
        
        Works with Linux namespaces througth glibc with pure python
        
        |License| |Latest Version| |Downloads| |Docs|
        
        discuss:
        `reddit <https://www.reddit.com/r/Python/comments/33z84l/linux_namespaces_througth_glibc_with_pure_python/>`__,
        `habrahabr <http://habrahabr.ru/company/wargaming/blog/256647/>`__
        
        Goals
        -----
        
        There is so many beautiful tools like
        `docker <https://github.com/docker/docker>`__,
        `rocket <https://github.com/coreos/rkt>`__ and
        `vagga <https://github.com/tailhook/vagga>`__ written on go and rust,
        but no one on python. I think that is because there is no easy way to
        works with linux namespaces on python:
        
        -  you can use `asylum <https://pypi.python.org/pypi/asylum/0.4.1>`__ -
           project that looks like dead and with codebase hosted not on
           mainstream hub like github
        -  or you can use
           `python-libvirt <https://pypi.python.org/pypi/libvirt-python/1.2.13>`__
           bindings with big layer of abstraction
        -  or just use native glibc library with ctypes
        -  otherwise subprocess.Popen your choice
        
        I want to change it: i want to create native python bindings to glibc
        with interface of python multiprocessing.Process.
        
        PS: you can look at
        `python-nsenter <https://github.com/zalando/python-nsenter>`__ too, it's
        looks awesome.
        
        PPS: new project from author of asylum -
        `butter <https://pypi.python.org/pypi/butter/0.10>`__
        
        Example
        -------
        
        First simple example:
        
        .. code:: python
        
            import os
            from pyspaces import Container
        
        
            def execute(argv):
                os.execvp(argv[0], argv)
        
            cmd = "mount -t proc proc /proc; ps ax"
            c = Container(target=execute, args=(('bash', '-c', cmd),),
                          uid_map='0 1000 1',
                          newpid=True, newuser=True, newns=True
                          )
            c.start()
            print("PID of child created by clone() is %ld\n" % c.pid)
            c.join()
            print("Child returned: pid %s, status %s" % (c.pid, c.exitcode))
        
        output:
        
        .. code:: bash
        
            PID of child created by clone() is 15978
        
            PID TTY      STAT   TIME COMMAND
            1   pts/19   S+     0:00 bash -c mount -t proc proc /proc; ps ax
            3   pts/19   R+     0:00 ps ax
        
            Child returned: pid 15978, status 0
        
        CLI
        ---
        
        .. code:: bash
        
            space -v execute --pid --mnt --user --uid '0 1000 1' bash -c 'mount -t proc /proc; ps ax'
        
        .. code:: bash
        
            space chroot --pid --uid '0 1000 1' ~/.local/share/lxc/ubuntu/rootfs/ /bin/ls /home/
        
        Note: If the program you're trying to exec is dynamic linked, and the
        dynamic linker is not present in /lib in the chroot environment - you
        would get the "OSError: [Errno 2] No such file or directory" error.
        You'd need all the other files the dynamic-linked program depends on,
        including shared libraries and any essential configuration/table/etc in
        the new root directories.
        `src <http://www.ciiycode.com/0JiJzPgggqPg/why-doesnt-exec-work-after-chroot>`__
        
        TODO
        ----
        
        -  [x] clone & Container
        -  [x] CLI
        -  [x] Chroot
        -  [ ] process list
        -  [ ] inject
        -  [ ] move CLI to separate package
        -  [ ] addons
        -  [ ] support for lxc, vagga, rocket, docker, etc...
        -  [ ] ...
        -  [ ] one tool for rule them all!!1
        
        .. |License| image:: https://pypip.in/license/pyspaces/badge.svg
           :target: https://pypi.python.org/pypi/pyspaces/
        .. |Latest Version| image:: https://pypip.in/version/pyspaces/badge.svg
           :target: https://pypi.python.org/pypi/pyspaces/
        .. |Downloads| image:: https://pypip.in/download/pyspaces/badge.svg
           :target: https://pypi.python.org/pypi/pyspaces/
        .. |Docs| image:: https://readthedocs.org/projects/pyspaces/badge/
           :target: https://pyspaces.readthedocs.org/en/latest/
        
Keywords: linux,container,namespaces
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: OSI Approved :: BSD License
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Clustering
Classifier: Topic :: System :: Systems Administration
