kazuhisya / docker-volume-sheepdog Goto Github PK
View Code? Open in Web Editor NEWDocker Volume Plugin for Sheepdog
License: MIT License
Docker Volume Plugin for Sheepdog
License: MIT License
I think this is no problem with MIT License, but I will need to check dependencies.
dog
and tgtadm
can connect to remote sheep port.
We should be able to configure this in config. Currently it is closed only for localhost and unix socket.
like this way.
$ docker version
Client:
Version: 1.13.1
API version: 1.26
Package version: <unknown>
Go version: go1.8.3
Git commit: e98ceaa
Built: Thu Sep 7 18:08:36 2017
OS/Arch: linux/amd64
At a minimum, we need the compile date and golang version.
Now only display the software version.
$ ./docker-volume-sheepdog -version
Docker Volume Plugin for Sheepdog
Version : 0.0.1
After installing package, service does not start.
# systemctl start docker-volume-sheepdog.service
systemd[1]: Starting Docker Volume Plugin for Sheepdog...
docker-volume-sheepdog[3375]: time="2017-09-26T12:00:43+09:00" level=info msg="Starting sheepdog-docker-driver version: 0.1.0"
docker-volume-sheepdog[3375]: time="2017-09-26T12:00:43+09:00" level=fatal msg="Error reading config file: open /etc/sheepdog/dockerdriver.json: no such file or directory"
systemd[1]: docker-volume-sheepdog.service: main process exited, code=exited, status=1/FAILURE
systemd[1]: Unit docker-volume-sheepdog.service entered failed state.
systemd[1]: docker-volume-sheepdog.service failed.
its file path in the systemd unit file is incorrect.
Reproduction: 100%
[root@sheep docker-volume-sheepdog]# docker volume create -d sheepdog vol1
vol1
[root@sheep docker-volume-sheepdog]# dog vdi list
Name Id Size Used Shared Creation time VDI id Copies Tag Block Size Shift
dvp-vol1 0 10 GB 0.0 MB 0.0 MB 2017-09-19 17:14 5dd725 3 22
[root@sheep docker-volume-sheepdog]# rm /mnt/sheepdog/vol1/ -rf
[root@sheep docker-volume-sheepdog]# docker volume rm vol1
Error response from daemon: Error while removing volume vol1: remove vol1: VolumeDriver.Remove: remove /mnt/sheepdog/vol1: no such file or directory
[root@sheep docker-volume-sheepdog]# dog vdi list
Name Id Size Used Shared Creation time VDI id Copies Tag Block Size Shift
DEBU[0188] vdi exist
INFO[0188] Remove: vol1
DEBU[0188] Count %s0
DEBU[0188] Begin utils.dogVdiDelete: dvp-vol1
DEBU[0188] Result of dogVdiDelete:
DEBU[0188] remove path: /mnt/sheepdog/vol1
ERRO[0188] Failed to remove Mount directory: remove /mnt/sheepdog/vol1: no such file or directory
One of the special features of sheepdog is its ability to handle snapshots very easily.
Current docker-volume-sheepdog does not make use of this function.
docker-volume-sheepdog/utils.go
Lines 82 to 84 in 18005c8
*grep ^=
: using only volumes that are not explicitly snapshots
How can we apply to docker-volume-sheepdog this function? We may need to consider.
Prepare .rpm
(and .deb
?).
The target is at least RHEL 7, CentOS 7. (what about fedora?)
but it is more better if Ubuntu 16.04 LTS (Xenial), 14.04 LTS (Trusty) can also be prepared.
.rpm
.deb
I think we can add to some badges to readme.
e.g.
[![TravisCI](https://travis-ci.org/kazuhisya/docker-volume-sheepdog.svg)](https://travis-ci.org/kazuhisya/docker-volume-sheepdog)
[![Go Report Card](https://goreportcard.com/badge/github.com/kazuhisya/docker-volume-sheepdog)](https://goreportcard.com/report/github.com/kazuhisya/docker-volume-sheepdog)
When deleting a volume created with the dog
command or a volume created by another server, an error is recorded.
This is because that directory does not exist on the host.
Reproduction: 100%
$ dog vdi create dvp-vol1 10G
$ docker volume rm vol1
DEBU[0426] vdi exist
INFO[0426] Remove: vol1
DEBU[0426] Count %s0
DEBU[0426] Begin utils.dogVdiDelete: dvp-vol1
DEBU[0426] utils.dogVdiCreate sheep options:
DEBU[0426] Result of dogVdiDelete:
DEBU[0426] remove path: /mnt/sheepdog/vol1
ERRO[0426] Failed to remove Mount directory: remove /mnt/sheepdog/vol1: no such file or directory
Currently output logs are not constant and are not useful.
It is necessary to clearance the contents of the log output.
Attempting to mount with multiple containers will fail.
I feel that this is missing implementation.
We need to judge when mount that volume is already in use.
and it is necessary to judge this when unmount too.
# docker run -itd --rm -v vol1:/data docker.io/alpine sh
63140544c1f94f10c9d288a8cc879977d05a2d29b80230371f886788bb021265
#
# docker run -itd --rm -v vol1:/data docker.io/alpine sh
dd95540bef82d81ef79461fdf239f01c70dc7a297a58a91b3ee68c067e443a6f
/usr/bin/docker-latest: Error response from daemon: error while mounting volume '/mnt/sheepdog/vol1': VolumeDriver.Mount: Problem mounting docker volume.
DEBU[8606] path found: /dev/disk/by-path/ip-127.0.0.1:3260-iscsi-iqn.2017-09.org.sheepdog-project-lun-2
DEBU[8606] volume path found: /dev/disk/by-path/ip-127.0.0.1:3260-iscsi-iqn.2017-09.org.sheepdog-project-lun-2
DEBU[8606] path: /dev/disk/by-path/ip-127.0.0.1:3260-iscsi-iqn.2017-09.org.sheepdog-project-lun-2
DEBU[8606] Begin utils.getDeviceFileFromIscsiPath: /dev/disk/by-path/ip-127.0.0.1:3260-iscsi-iqn.2017-09.org.sheepdog-project-lun-2
DEBU[8606] Found device: [lrwxrwxrwx 1 root root 9 Sep 11 18:20 /dev/disk/by-path/ip-127.0.0.1:3260-iscsi-iqn.2017-09.org.sheepdog-project-lun-2 -> sdb
]
DEBU[8606] using base of: /dev/sdb
DEBU[8606] realdevice: %s/dev/sdb
DEBU[8606] Begin utils.getFSType: /dev/sdb
DEBU[8606] Begin utils.mount device: /dev/sdb on: /mnt/sheepdog/vol1
DEBU[8606] Response from mount /dev/sdb at /mnt/sheepdog/vol1: mount: wrong fs type, bad option, bad superblock on /dev/sdb,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
ERRO[8606] Error in mount: exit status 32
ERRO[8606] Problem mounting docker volume
docker-volume-sheepdog
acts as a daemon. we should prepare a unit file of systemd.
Now, The default path to the config file is below.
/etc/sheepdog/dockerdriver.json
I feel this path is not suitable. for example, the following path may be better.
/etc/docker-volume-plugin.d/sheepdog.json
How do you think? anyway, I need to decide this soon.
Currently the only -o
options we can specify is size
(and also vdiname
).
It is even better to be able to select prealloc
, hyper
, copies
etc...
In particular, it is a good idea to specify erasure code with copies
.
# dog vdi create -h
Usage: dog vdi create [-P] [-y] [-c copies] [-a address] [-p port] [-h] [-r] [-v] [-z block_size_shift] [-T] <vdiname> <size>
Options:
-P, --prealloc preallocate all the data objects
-y, --hyper create a hyper volume
-c, --copies specify the data redundancy level
-a, --address specify the daemon address (default: localhost)
-p, --port specify the daemon port
-h, --help display this help and exit
-r, --raw raw output mode: omit headers, separate fields with
single spaces and print all sizes in decimal bytes
-v, --verbose print more information than default
-z, --block_size_shift specify the bit shift num for data object size
-T, --time show elapsed time
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.