{ "info": { "author": "Raghavendra Prabhu", "author_email": "me@rdprabhu.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "===============================\nPyVolume\n===============================\n\n[![Build Status](https://travis-ci.org/ronin13/pyvolume.svg?branch=master)](https://travis-ci.org/ronin13/pyvolume)\n[![Coverage Status](https://coveralls.io/repos/github/ronin13/pyvolume/badge.svg?branch=master)](https://coveralls.io/github/ronin13/pyvolume?branch=master)\n[![Updates](https://pyup.io/repos/github/ronin13/pyvolume/shield.svg)](https://pyup.io/repos/github/ronin13/pyvolume/)\n[![Python 3](https://pyup.io/repos/github/ronin13/pyvolume/python-3-shield.svg)](https://pyup.io/repos/github/ronin13/pyvolume/)\n[![Code Health](https://landscape.io/github/ronin13/pyvolume/master/landscape.svg?style=flat)](https://landscape.io/github/ronin13/pyvolume/master)\n\n\n![python](images/python.png)\n![docker](images/docker-whale.png)\n\n\nPython Docker Volume driver.\n\nSupports pluggable implementations, currently there are three written.\n\nImplements:\n * '/Plugin.Activate'\n * '/VolumeDriver.Create'\n * '/VolumeDriver.Remove'\n * '/VolumeDriver.List'\n * '/VolumeDriver.Path'\n * '/VolumeDriver.Mount'\n * '/VolumeDriver.Unmount'\n * '/VolumeDriver.Get'\n * '/VolumeDriver.Capabilities'\n\nfor [Docker Volume](https://docs.docker.com/engine/extend/plugins_volume/).\n\nand\n * '/'\n * '/shutdown'\n\nfor management.\n\nThe volume manager (common to all drivers) uses [Flask](http://flask.pocoo.org/) for routing and\nhandles multiple invocations of Mount and Unmount for same volume as per\ndocker specifications. It also passes options passed through API to the drivers.\nCleanup is also handled on shutdown.\n\n\n### Current Implementations\n![Zookeeper](https://www.dropbox.com/s/7vmgl4mo9qvlncp/zookeeper.png?dl=1)\n![Openssh](https://www.dropbox.com/s/8v7e8cu1wcwcipr/openssh.jpg?dl=1)\n\n- [Ephemeral FileSystem](pyvolume/local.py)\n- [SSHFS FileSystem](pyvolume/sshfs.py)\n- [Zookeeper FileSystem](pyvolume/zkfuse.py)\n - This uses [docker-zkfuse](https://github.com/ronin13/docker-zkfuse) for using [zkfuse](https://github.com/apache/zookeeper/tree/master/src/contrib/zkfuse) and mounts zkfuse from container to host through shared mounting of volume from host to container.\n\nInstalling\n-----------\n1. Install the package.\n\n```\n\npip install -r requirements.txt --user\npython2 setup.py install --prefix=/usr/local\n\n```\n\nAfter this pyvolume should be available as /usr/local/bin/pyvolume.\n\n2. Copy the pyvolume.json to /etc/docker/plugins/\n\n### Dependencies:\n\n### Installation\n1. Python 2.7 and python related dependencies - pip, virtualenv etc.\n2. sshfs for SSHFileSystem (default).\n\n#### Integration Testing Dependencies.\n1. ssh-add and sshfs.\n2. curl\n3. util-linux (for mount etc.)\n4. Python-related tools such as virtualenv.\n\nUsage\n-------\n\n#### Permissions\n\n- Make sure you have write permissions for base mount directory which is /mnt by default.\n - If not, make sure to chown as the user you run pyvolume as.\n- For ZookeeperFileSystem, make sure the pyvolume's user can do docker run without sudo.\n - If not, add the pyvolume's user to docker group.\n\n\n#### For SSH FileSystem\n\nArguments for docker volume create:\n\n- remote_path: as host:directory (Required)\n- ssh_config: path to ssh config directory if it is not default.\n- sshfs_options: any options to pass to sshfs.\n\n\nAfter Installing,\n\n1. Make sure the ssh keys are available through the ssh-agent.\n\n```\nssh-add -l\n```\n\n2. Start the pyvolume server.\n\n```\n $ /usr/local/bin/pyvolume\n INFO:werkzeug: * Running on http://0.0.0.0:1331/ (Press CTRL+C to quit)\n\n```\n\n3. Create a docker volume.\n\n```\n docker volume create -d pyvolume --name myvolume2 -o 'remote_path=server:/home/user' -o 'ssh_config=/home/rprabhu/.ssh.bkp/config.server'\n```\n\n4. Run docker as usual, providing the newly created volume name.\n\n```\n docker run -it -v myvolume2:/data busybox:latest sh\n```\n\n5. PROFIT!\n\n\n#### For ZooKeeper FileSystem\n\nArguments for docker volume create:\n\n- zookeeper_string - host:port (or a list of tuples) to running zookeeper instance. (Required)\n- docker_opt - any options to pass to docker.\n\n\n1. Start the pyvolume server.\n\n```\n $ /usr/local/bin/pyvolume -t zookeeper\n INFO:werkzeug: * Running on http://0.0.0.0:1331/ (Press CTRL+C to quit)\n\n```\n\n3. Create a docker volume.\n\n```\n docker volume create -d pyvolume --name zoo -o 'zookeeper_string=0.0.0.0:2181' -o 'docker_opt=--net=host'\n```\n\nThis assumes that you have a local zookeeper running on host at 0.0.0.0:2181.\nSince it is running on host, you need '--net=host' as well.\n\nOtherwise, if you have zookeeper running on $host:$port, following will do:\n\n```\n docker volume create -d pyvolume --name zoo -o \"zookeeper_string=$host:$port\"\n```\n\n4. Run docker as usual, providing the newly created volume name.\n\n```\n docker run -it -v zoo:/data busybox:latest sh\n```\n\nand you can access the zookeeper znodes through /data/ after this.\n\nLocal Installation and Running\n-------\n\n1. Look above for dependencies.\n2.\n\n```\n $ make devenv\n $ source devenv/bin/activate\n\n $ ./devenv/bin/pyvolume --help\n\n usage: pyvolume [-h] [-t {sshfs,ephemeral}] [-H HOST] [-p PORT] [-m BASE]\n\n Arguments to volume router\n\n optional arguments:\n -h, --help show this help message and exit\n -t {sshfs,ephemeral}, --driver {sshfs,ephemeral}\n Type of driver to use\n -H HOST, --host HOST Host to listen on\n -p PORT, --port PORT Port to listen on\n -m BASE, --base BASE Base directory to mount over\n\n $ ./devenv/bin/pyvolume\n INFO:werkzeug: * Running on http://0.0.0.0:1331/ (Press CTRL+C to quit)\n```\n\n\nTesting\n----------\n\n### Integration test.\n\n1. Set the required environment variables.\n\n```\n a. export SSH_CONFIG=/home/rprabhu/.ssh.bkp/config.server\n b. export REMOTE_PATH='server:/home/user'\n c. make itest\n```\n\n2. itest log - https://gist.github.com/ronin13/83d99b801202e63f07523c1c5b2be450\n\n### Unit test.\n\n1. make test\n\n```\n make test\n tox2 -e py27\n GLOB sdist-make: /home/rprabhu/repo/pyvolume/setup.py\n py27 create: /home/rprabhu/repo/pyvolume/.tox/py27\n py27 installdeps: -r/home/rprabhu/repo/pyvolume/requirements_dev.txt\n py27 inst: /home/rprabhu/repo/pyvolume/.tox/dist/pyvolume-0.1.0.zip\n py27 installed: You are using pip version 8.1.2, however version 9.0.0 is available.,You should consider upgrading via the 'pip install --upgrade pip' command.,alabaster==0.7.9,argh==0.26.2,Babel==2.3.4,bumpversion==0.5.3,cffi==1.8.3,click==6.6,coverage==4.1,cryptography==1.4,docutils==0.12,enum34==1.1.6,flake8==2.6.0,Flask==0.11.1,idna==2.1,imagesize==0.7.1,ipaddress==1.0.17,itsdangerous==0.24,Jinja2==2.8,MarkupSafe==0.23,mccabe==0.5.2,pathtools==0.1.2,pluggy==0.3.1,plumbum==1.6.2,py==1.4.31,pyasn1==0.1.9,pycodestyle==2.0.0,pycparser==2.17,pyflakes==1.2.3,Pygments==2.1.3,pytest==2.9.2,pytz==2016.7,pyvolume==0.1.0,PyYAML==3.11,six==1.10.0,snowballstemmer==1.2.1,Sphinx==1.4.8,tox==2.3.1,virtualenv==15.0.3,watchdog==0.8.3,Werkzeug==0.11.11\n py27 runtests: PYTHONHASHSEED='2628874551'\n py27 runtests: commands[0] | pip install -U pip\n Collecting pip\n Using cached pip-9.0.0-py2.py3-none-any.whl\n Installing collected packages: pip\n Found existing installation: pip 8.1.2\n Uninstalling pip-8.1.2:\n Successfully uninstalled pip-8.1.2\n Successfully installed pip-9.0.0\n py27 runtests: commands[1] | py.test\n ==================================================================================================== test session starts ====================================================================================================\n platform linux2 -- Python 2.7.12, pytest-2.9.2, py-1.4.31, pluggy-0.3.1\n rootdir: /home/rprabhu/repo/pyvolume, inifile: tox.ini\n collected 3 items\n\n test_pyvolume_sshfs.py ...\n\n ================================================================================================= 3 passed in 0.09 seconds ==================================================================================================\n __________________________________________________________________________________________________________ summary __________________________________________________________________________________________________________\n py27: commands succeeded\n congratulations :)\n```\n\nLicense\n--------\n\n* Free software: MIT license\n\nCredits\n---------\n\nThis package was created with Cookiecutter_ and the 'audreyr/cookiecutter-pypackage' project template.\n\n* Cookiecutter: https://github.com/audreyr/cookiecutter\n* audreyr/cookiecutter-pypackage: https://github.com/audreyr/cookiecutter-pypackage\n\n\n=======\nHistory\n=======\n\n0.1.0 (2016-11-06)\n------------------\n\n* First release of pyvolume.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ronin13/pyvolume", "keywords": "pyvolume", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "pyvolume", "package_url": "https://pypi.org/project/pyvolume/", "platform": "", "project_url": "https://pypi.org/project/pyvolume/", "project_urls": { "Homepage": "https://github.com/ronin13/pyvolume" }, "release_url": "https://pypi.org/project/pyvolume/0.1.2/", "requires_dist": null, "requires_python": "", "summary": "Python Docker Volume driver", "version": "0.1.2" }, "last_serial": 2499299, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "ffce33fda4b2a2df436b815f08e5d307", "sha256": "533186a1eb29cd905000dfcd32c17e983d3b27db9c5594aebcc0ad8f26c79c66" }, "downloads": -1, "filename": "pyvolume-0.1.2.tar.gz", "has_sig": false, "md5_digest": "ffce33fda4b2a2df436b815f08e5d307", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31612, "upload_time": "2016-12-05T00:57:10", "url": "https://files.pythonhosted.org/packages/c4/33/fa08f22f59c7e5206debbfc460205eb2caf3c3244d032d55c57a7b6a5fac/pyvolume-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ffce33fda4b2a2df436b815f08e5d307", "sha256": "533186a1eb29cd905000dfcd32c17e983d3b27db9c5594aebcc0ad8f26c79c66" }, "downloads": -1, "filename": "pyvolume-0.1.2.tar.gz", "has_sig": false, "md5_digest": "ffce33fda4b2a2df436b815f08e5d307", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31612, "upload_time": "2016-12-05T00:57:10", "url": "https://files.pythonhosted.org/packages/c4/33/fa08f22f59c7e5206debbfc460205eb2caf3c3244d032d55c57a7b6a5fac/pyvolume-0.1.2.tar.gz" } ] }