From 8250aaab5d41f87f873fcf3e2a983aa9823d9171 Mon Sep 17 00:00:00 2001 From: Gorka Eguileor Date: Mon, 2 Jul 2018 18:41:43 +0200 Subject: [PATCH] Add Docker images Add Docker image files for automatically building of images, and update the documentation accordingly. --- .dockerignore | 13 ++++++++++++ Dockerfile | 9 ++++++++ Dockerfile-master | 14 +++++++++++++ README.md | 49 +++++++++++++++++++++++++++++++++++++++++++ README.rst | 10 ++++++++- docs/installation.rst | 26 ++++++++++++++++++++++- 6 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 Dockerfile-master create mode 100644 README.md diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..bbf5763 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,13 @@ +build/ +dist/ +docs/ +.venv/ +.tox/ +tests/ +tmp/ +.git/ +.github/ +*.py[cod] +.*.sw? +Dockerfile +Dockerfile-master diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6b72ef4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +# Based on centos +FROM centos:7.4.1708 +LABEL maintainers="Gorka Eguileor " +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"] diff --git a/Dockerfile-master b/Dockerfile-master new file mode 100644 index 0000000..5cb9190 --- /dev/null +++ b/Dockerfile-master @@ -0,0 +1,14 @@ +# Based on centos +FROM centos:7.4.1708 +LABEL maintainers="Gorka Eguileor " +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"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..0f9643b --- /dev/null +++ b/README.md @@ -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 diff --git a/README.rst b/README.rst index c882fe0..b08eb5a 100644 --- a/README.rst +++ b/README.rst @@ -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 diff --git a/docs/installation.rst b/docs/installation.rst index e8e16ae..4230c24 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -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 _______