python docker卷驱动程序
pyvolume的Python项目详细描述
一、二、二、二、三、三、三、三、三、三、三、三、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、[构建状态](https://travis-ci.org/ronin13/pyvolume.svg?branch=master)(https://travis ci.org/ronin13/pyvolume)
[![覆盖状态](https://coveralls.io/repos/github/ronin13/pyvolume/badge.svg?branch=master)(https://coveralls.io/github/ronin13/pyvolume?分支=主)
[![更新](https://pyup.io/repos/github/ronin13/pyvolume/shield.svg)(https://pyup.io/repos/github/ronin13/pyvolume/)
[![python 3](https://pyup.io/repos/github/ronin13/pyvolume/python-3-shield.svg)(https://pyup.io/repos/github/ronin13/pyvolume/)
[![代码运行状况](https://landscape.io/github/ronin13/pyvolume/master/landscape.svg?style=flat)(https://landscape.io/github/ronin13/pyvolume/master)
![python](images/python.png)
![docker](images/docker whale.png)
python docker卷驱动程序。
>支持可插入的实现,目前有三个已编写。
*>实现:
*'/plugin.activate'
*'/volume driver.create'
*'/volumedriver.remove'
*'/volumedriver.list'
*'/volumedriver.path'
*'/volumedriver.mount'
*'/volumedriver.unmount'
*'/volumedriver.get'
*'/volumedriver.capabilities'
for[docker volume](https://docs.docker.com/engine/extend/plugins/u volume/)。
*'/'
*'/shutdown'
volume manager(所有驱动程序通用)使用[flask](http://flask.pocorg/)用于路由和
根据
Docker规范处理同一卷的多次装载和卸载调用。它还将通过api传递的选项传递给驱动程序。
关闭时也会处理清理。
\[动物园管理员](https://www.dropbox.com/s/7vmgl4mo9qvlncp/zookeeper.png?dl=1)< BR>[openssh](https://www.dropbox.com/s/8v7e8cu1wcwcipr/openssh.jpg?dl=1)
-[临时文件系统](pyvolume/local.py)
-[sshfs文件系统](pyvolume/sshfs.py)
-[zookeeper文件系统](pyvolume/zkfuse.py)
-这使用[docker zkfuse](https://github.com/ronin13/docker-zkfuse)使用[zkfuse](https://github.com/apache/zookeeper/tree/master/src/contrib/zkfuse)并从容器安装zkfuse通过将卷从主机共享装载到容器来承载。
安装
----
1。安装软件包。
```
pip install-r requirements.txt--用户
python2安装程序。py install--前缀=/usr/local
````
将pyvolume.json复制到/etc/docker/plugins/
依赖项:
安装
1。python 2.7和与python相关的依赖项-pip、virtualenv等
2。sshf文件系统的sshfs(默认)。
ssh add和sshfs。
2.卷曲<BR/> 3。util linux(用于mount等)
4.与python相关的工具,如virtualenv。
-如果没有,则将pyvolume的用户添加到docker组中;对于ssh文件系统,则
对于docker卷创建的参数:
-remote路径:as host:host:host:directory(必需)
-ssh-config:如果不是默认设置,则ssh-config目录路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径是的ing,
1.确保ssh密钥通过ssh代理可用。
````
ssh add-l
````
2。启动pyvolume服务器。
````
$/usr/local/bin/pyvolume
info:werkzeug:*运行在http://0.0.0:1331/(按ctrl+c退出)
````
3上。创建一个DOcker volume.
```
docker volume create-d pyvolume--name myvolume2-o'remote_path=server:/home/user'-o'ssh_config=/home/rprabhu/.ssh.bkp/config.server'
```
4.照常运行docker,提供新创建的卷名。
```
docker run-it-v myvolume2:/data busybox:latest sh
```
5。利润!
(必需)
-docker_opt-传递给docker的任何选项。
1。启动pyvolume服务器。
```
$/usr/local/bin/pyvolume-t zookeeper
info:werkzeug:*运行于http://0.0.0.0:1331/(按ctrl+c退出)
```
3。创建一个docker卷。
```
docker volume create-d pyvolume--name zoo-o'zookeeper_string=0.0.0:2181'-o'docker_opt=--net=host'
```
'另外。
否则,如果zookeeper在$host:$port上运行,则可以执行以下操作:
````
docker volume create-d pyvolume--name zoo-o"zookeeper_string=$host:$port"
````
4。照常运行docker,提供新创建的卷名。
```
docker run-it-v zoo:/data busybox:latest sh
```
查看上面的依赖项。
2.
````
$make devenv
$source devenv/bin/activate
$./devenv/bin/pyvolume--help
用法:pyvolume[-h][-t{sshfs,ephemeral}[-h host][-p port][-m base]
volume router的参数
optional参数:
-h,--help显示此帮助消息并退出
-t{sshfs,ephemeral},--driver{sshfs,ephemeral}
要使用的驱动程序类型
-h主机,--要侦听的主机主机主机
-p端口,--要侦听的端口端口
-m base,--要在
$./devenv/bin/pyvolume上装载的基本基本目录
info:werkzeug:*运行在http://0.0.0:1331/(按ctrl+c退出)
````
----
设置所需的环境变量。
```
a.导出ssh-config=/home/rprabhu/.ssh.bkp/config.server
b.导出remote-path=/server/home/user'
c.生成itest
```
2.ITEST日志-https://gist.github.com/ronin13/83d99b801202e63f07523c1c5b2be450
单元测试。
1.进行测试
```
make test
tox2-e py27
glob sdist make:/home/rprabhu/repo/pyvolume/setup.py
py27 create:/home/rprabhu/repo/pyvolume/.tox/py27
py27 installdeps:-r/home/rprabhu/repo/pyvolume/requirements\dev.txt
py27 inst:/home/rprabhu/repo/pyvolume/.tox/dist/pyvolume-0.1.0.zip
py27已安装:您使用的是pip版本8.1.2,但版本9.0.0可用。您应该考虑通过"pip install--upgrade pip"命令进行升级,alabaster==0.7.9,argh==0.26.2,babel==2.3.4,bumpversion==0.5.3,cffi==1.8.3,单击==6.6,覆盖率==4.1,密码学==1.4,DoCutils==0.12,Enum34==1.1.6,Fla088==2.6.0,Flask==0.11.1,IDNA==2.1,ImageSize==0.7.1,IP地址==1.0.17,危险=0.24,Jinja2==2.8,Markupsafe==0.23,McCabe==0.5.2,Pathtools==0.1.2,Plugy==0.3.1,PlumpuGy==0.3.1,Plumum==1.6.2,Py==1.6.2,Py==1=1.1.1.1.1.1.6..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,6==1.10.0,SnowballStemmer==1.2.1,Sphinx==1.4.8,Tox==2.3.1,VirtualenV==15.0.3,Watchedog==0.8.3,Werkzeug==0.11.11
Py27 RunTests:PythonHashSeed==2628888744874484874747448484848484848484848483,Watchedog==0.8.3 551'
py27运行测试:命令[0]pip install-u pip
使用缓存的pip-9.0.0-py2.py3无任何。whl
安装收集的包:pip
找到现有安装:pip 8.1.2
卸载pip-8.1.2:
成功卸载pip-8.1.2
成功安装pip-9.0.0
py27运行测试:命令[1]py.test
==================================================================================================== test session starts ====================================================================================================
platform linux2 -- Python 2.7.12, pytest-2.9.2, py-1.4.31, plug3.1
rootdir/home/rprabhu/repo/pyvolume/repo/pyvolume,inifile:tox.ini
收集了3个项目
=3在0.09秒内通过==================================================================================================
__________________________________________________________________________________________________________ summary ________________________________________________________________________________________________________
py27:命令成功
恭喜:)
```
license
--
*免费软件:MIT license
credits
--
此软件包是使用Cookiecutter和"Audreyr/Cookiecutter pypackage"项目模板创建的。
*Cookiecutter:https://github.com/audreyr/cookiecutter
*audreyr/cookiecutter-pypackage:https://github.com/audreyr/cookiecutter-pypackage
==
==
<0.1.0(2016-11-06)
----
*pyvolume的首次发布。
[![覆盖状态](https://coveralls.io/repos/github/ronin13/pyvolume/badge.svg?branch=master)(https://coveralls.io/github/ronin13/pyvolume?分支=主)
[![更新](https://pyup.io/repos/github/ronin13/pyvolume/shield.svg)(https://pyup.io/repos/github/ronin13/pyvolume/)
[![python 3](https://pyup.io/repos/github/ronin13/pyvolume/python-3-shield.svg)(https://pyup.io/repos/github/ronin13/pyvolume/)
[![代码运行状况](https://landscape.io/github/ronin13/pyvolume/master/landscape.svg?style=flat)(https://landscape.io/github/ronin13/pyvolume/master)
![python](images/python.png)
![docker](images/docker whale.png)
python docker卷驱动程序。
>支持可插入的实现,目前有三个已编写。
*>实现:
*'/plugin.activate'
*'/volume driver.create'
*'/volumedriver.remove'
*'/volumedriver.list'
*'/volumedriver.path'
*'/volumedriver.mount'
*'/volumedriver.unmount'
*'/volumedriver.get'
*'/volumedriver.capabilities'
for[docker volume](https://docs.docker.com/engine/extend/plugins/u volume/)。
*'/'
*'/shutdown'
volume manager(所有驱动程序通用)使用[flask](http://flask.pocorg/)用于路由和
根据
Docker规范处理同一卷的多次装载和卸载调用。它还将通过api传递的选项传递给驱动程序。
关闭时也会处理清理。
\[动物园管理员](https://www.dropbox.com/s/7vmgl4mo9qvlncp/zookeeper.png?dl=1)< BR>[openssh](https://www.dropbox.com/s/8v7e8cu1wcwcipr/openssh.jpg?dl=1)
-[临时文件系统](pyvolume/local.py)
-[sshfs文件系统](pyvolume/sshfs.py)
-[zookeeper文件系统](pyvolume/zkfuse.py)
-这使用[docker zkfuse](https://github.com/ronin13/docker-zkfuse)使用[zkfuse](https://github.com/apache/zookeeper/tree/master/src/contrib/zkfuse)并从容器安装zkfuse通过将卷从主机共享装载到容器来承载。
安装
----
1。安装软件包。
```
pip install-r requirements.txt--用户
python2安装程序。py install--前缀=/usr/local
````
将pyvolume.json复制到/etc/docker/plugins/
依赖项:
安装
1。python 2.7和与python相关的依赖项-pip、virtualenv等
2。sshf文件系统的sshfs(默认)。
ssh add和sshfs。
2.卷曲<BR/> 3。util linux(用于mount等)
4.与python相关的工具,如virtualenv。
-如果没有,则将pyvolume的用户添加到docker组中;对于ssh文件系统,则
对于docker卷创建的参数:
-remote路径:as host:host:host:directory(必需)
-ssh-config:如果不是默认设置,则ssh-config目录路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径路径是的ing,
1.确保ssh密钥通过ssh代理可用。
````
ssh add-l
````
2。启动pyvolume服务器。
````
$/usr/local/bin/pyvolume
info:werkzeug:*运行在http://0.0.0:1331/(按ctrl+c退出)
````
3上。创建一个DOcker volume.
```
docker volume create-d pyvolume--name myvolume2-o'remote_path=server:/home/user'-o'ssh_config=/home/rprabhu/.ssh.bkp/config.server'
```
4.照常运行docker,提供新创建的卷名。
```
docker run-it-v myvolume2:/data busybox:latest sh
```
5。利润!
(必需)
-docker_opt-传递给docker的任何选项。
1。启动pyvolume服务器。
```
$/usr/local/bin/pyvolume-t zookeeper
info:werkzeug:*运行于http://0.0.0.0:1331/(按ctrl+c退出)
```
3。创建一个docker卷。
```
docker volume create-d pyvolume--name zoo-o'zookeeper_string=0.0.0:2181'-o'docker_opt=--net=host'
```
'另外。
否则,如果zookeeper在$host:$port上运行,则可以执行以下操作:
````
docker volume create-d pyvolume--name zoo-o"zookeeper_string=$host:$port"
````
4。照常运行docker,提供新创建的卷名。
```
docker run-it-v zoo:/data busybox:latest sh
```
查看上面的依赖项。
2.
````
$make devenv
$source devenv/bin/activate
$./devenv/bin/pyvolume--help
用法:pyvolume[-h][-t{sshfs,ephemeral}[-h host][-p port][-m base]
volume router的参数
optional参数:
-h,--help显示此帮助消息并退出
-t{sshfs,ephemeral},--driver{sshfs,ephemeral}
要使用的驱动程序类型
-h主机,--要侦听的主机主机主机
-p端口,--要侦听的端口端口
-m base,--要在
$./devenv/bin/pyvolume上装载的基本基本目录
info:werkzeug:*运行在http://0.0.0:1331/(按ctrl+c退出)
````
----
设置所需的环境变量。
```
a.导出ssh-config=/home/rprabhu/.ssh.bkp/config.server
b.导出remote-path=/server/home/user'
c.生成itest
```
2.ITEST日志-https://gist.github.com/ronin13/83d99b801202e63f07523c1c5b2be450
单元测试。
1.进行测试
```
make test
tox2-e py27
glob sdist make:/home/rprabhu/repo/pyvolume/setup.py
py27 create:/home/rprabhu/repo/pyvolume/.tox/py27
py27 installdeps:-r/home/rprabhu/repo/pyvolume/requirements\dev.txt
py27 inst:/home/rprabhu/repo/pyvolume/.tox/dist/pyvolume-0.1.0.zip
py27已安装:您使用的是pip版本8.1.2,但版本9.0.0可用。您应该考虑通过"pip install--upgrade pip"命令进行升级,alabaster==0.7.9,argh==0.26.2,babel==2.3.4,bumpversion==0.5.3,cffi==1.8.3,单击==6.6,覆盖率==4.1,密码学==1.4,DoCutils==0.12,Enum34==1.1.6,Fla088==2.6.0,Flask==0.11.1,IDNA==2.1,ImageSize==0.7.1,IP地址==1.0.17,危险=0.24,Jinja2==2.8,Markupsafe==0.23,McCabe==0.5.2,Pathtools==0.1.2,Plugy==0.3.1,PlumpuGy==0.3.1,Plumum==1.6.2,Py==1.6.2,Py==1=1.1.1.1.1.1.6..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,6==1.10.0,SnowballStemmer==1.2.1,Sphinx==1.4.8,Tox==2.3.1,VirtualenV==15.0.3,Watchedog==0.8.3,Werkzeug==0.11.11
Py27 RunTests:PythonHashSeed==2628888744874484874747448484848484848484848483,Watchedog==0.8.3 551'
py27运行测试:命令[0]pip install-u pip
使用缓存的pip-9.0.0-py2.py3无任何。whl
安装收集的包:pip
找到现有安装:pip 8.1.2
卸载pip-8.1.2:
成功卸载pip-8.1.2
成功安装pip-9.0.0
py27运行测试:命令[1]py.test
==================================================================================================== test session starts ====================================================================================================
platform linux2 -- Python 2.7.12, pytest-2.9.2, py-1.4.31, plug3.1
rootdir/home/rprabhu/repo/pyvolume/repo/pyvolume,inifile:tox.ini
收集了3个项目
=3在0.09秒内通过==================================================================================================
__________________________________________________________________________________________________________ summary ________________________________________________________________________________________________________
py27:命令成功
恭喜:)
```
license
--
*免费软件:MIT license
credits
--
此软件包是使用Cookiecutter和"Audreyr/Cookiecutter pypackage"项目模板创建的。
*Cookiecutter:https://github.com/audreyr/cookiecutter
*audreyr/cookiecutter-pypackage:https://github.com/audreyr/cookiecutter-pypackage
==
==
<0.1.0(2016-11-06)
----
*pyvolume的首次发布。