Giter VIP home page Giter VIP logo

docker-volume-sheepdog's People

Contributors

kazuhisya avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-volume-sheepdog's Issues

Add License file

I think this is no problem with MIT License, but I will need to check dependencies.

Connect to the remote sheep port

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.

Display date and version of the build.

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

Service does not start

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.

Unnecessary errors may be displayed when vdi is removed.

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

Support snapshot?

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.

if sheepip == "" {
cmd = "sudo dog vdi list -r |grep ^= | grep -w " + vdiname + "|cut -d' ' -f 2"
} else {

*grep ^=: using only volumes that are not explicitly snapshots

How can we apply to docker-volume-sheepdog this function? We may need to consider.

Distribution package

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

Add badge to readme

I think we can add to some badges to readme.

e.g.

TravisCI Go Report Card

[![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) 

An error occurs when deleting a volume with the docker command

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

Clearance of log output

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

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

systemd support

docker-volume-sheepdog acts as a daemon. we should prepare a unit file of systemd.

config file path

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.

Pass options to the dog command when vdi create

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.