Add Docker images

Add Docker image files for automatically building of images, and update
the documentation accordingly.
This commit is contained in:
Gorka Eguileor 2018-07-02 18:41:43 +02:00
parent fe9922d21c
commit 8250aaab5d
6 changed files with 119 additions and 2 deletions

13
.dockerignore Normal file
View File

@ -0,0 +1,13 @@
build/
dist/
docs/
.venv/
.tox/
tests/
tmp/
.git/
.github/
*.py[cod]
.*.sw?
Dockerfile
Dockerfile-master

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
# Based on centos
FROM centos:7.4.1708
LABEL maintainers="Gorka Eguileor <geguileo@redhat.com>"
LABEL description="Cinderlib"
RUN yum -y install targetcli iscsi-initiator-utils device-mapper-multipath epel-release https://repos.fedorapeople.org/repos/openstack/openstack-pike/rdo-release-pike-1.noarch.rpm && yum -y install python2-pip centos-release-openstack-pike && yum -y install openstack-cinder python-rbd ceph-common && yum clean all && rm -rf /var/cache/yum && pip install --no-cache-dir --process-dependency-links cinderlib 'krest>=1.3.0' 'purestorage>=1.6.0'
# Define default command
CMD ["bash"]

14
Dockerfile-master Normal file
View File

@ -0,0 +1,14 @@
# Based on centos
FROM centos:7.4.1708
LABEL maintainers="Gorka Eguileor <geguileo@redhat.com>"
LABEL description="Cinderlib"
RUN yum -y install targetcli iscsi-initiator-utils device-mapper-multipath epel-release https://repos.fedorapeople.org/repos/openstack/openstack-pike/rdo-release-pike-1.noarch.rpm && yum -y install python2-pip centos-release-openstack-pike && yum -y install openstack-cinder python-rbd ceph-common && yum clean all && rm -rf /var/cache/yum && pip install --no-cache-dir 'krest>=1.3.0' 'purestorage>=1.6.0' && mkdir /csi
# Copy cinderlib
COPY . /cinderlib
RUN pip install -e /cinderlib
# Define default command
CMD ["bash"]

49
README.md Normal file
View File

@ -0,0 +1,49 @@
# Cinder library
Cinder Library is a Python library that allows using storage drivers outside of
Cinder.
* Free software: Apache Software License 2.0
* Full Documentation: [https://cinderlib.readthedocs.io](https://cinderlib.readthedocs.io).
This library is currently in Alpha stage and is primarily intended as a proof
of concept at this stage. While some drivers have been manually validated most
drivers have not, so there's a good chance that they could experience issues.
When using this library one should be aware that this is in no way close to the
robustness or feature richness that the Cinder project provides, for detailed
information on the current limitations please refer to the documentation.
Due to the limited access to Cinder backends and time constraints the list of
drivers that have been manually tested are (I'll try to test more):
- LVM with LIO
- Dell EMC XtremIO
- Dell EMC VMAX
- Kaminario K2
- Ceph/RBD
- NetApp SolidFire
If you try the library with another storage array I would appreciate a note on
the library version, Cinder release, and results of your testing.
Features
--------
* Use a Cinder driver without running a DBMS, Message broker, or Cinder
service.
* Using multiple simultaneous drivers on the same program.
* Basic operations support:
- Create volume
- Delete volume
- Extend volume
- Clone volume
- Create snapshot
- Delete snapshot
- Create volume from snapshot
- Connect volume
- Disconnect volume
- Local attach
- Local detach
- Validate connector

View File

@ -89,7 +89,15 @@ Example
The following example uses CentOS 7 and the Cinder LVM driver, which should be
the easiest to setup and test.
First you need to setup your system:
First you need to setup your system.
You can either use a container:
.. code-block:: shell
$ docker run --name=cinderlib --privileged --net=host -v /etc/iscsi:/etc/iscsi -v /dev:/dev -it akrog/cinderlib python
Or install things on baremetal/VM:
.. code-block:: shell

View File

@ -62,9 +62,33 @@ you through the process.
.. _pip: https://pip.pypa.io
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
From source
Container
_________
There is a docker image, in case you prefer trying the library without any
installation.
The image is called `akrog/cinderlib:stable`, and we can run Python dirrectly
with:
.. code-block:: console
$ docker run --name=cinderlib --privileged --net=host -v /etc/iscsi:/etc/iscsi -v /dev:/dev -it akrog/cinderlib:stable python
Latest code
-----------
Container
_________
A Docker image is automatically built on every commit to the *master* branch.
Running a Python shell with the latest *cinderlib* code is as simple as:
.. code-block:: console
$ docker run --name=cinderlib --privileged --net=host -v /etc/iscsi:/etc/iscsi -v /dev:/dev -it akrog/cinderlib python
Drivers
_______