Metadata-Version: 2.0
Name: poppycdn
Version: 2015.1.b1
Summary: A modular, vendor-neutral API, that wraps provisioning instructions for all CDN vendors that support it.
Home-page: http://www.openstack.org/
Author: OpenStack
Author-email: openstack-dev@lists.openstack.org
License: UNKNOWN
Platform: UNKNOWN
Classifier: Environment :: OpenStack
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 2.6
Requires-Dist: ordereddict
Requires-Dist: Babel (>=1.3)
Requires-Dist: WebOb (>=1.2.3,<1.3)
Requires-Dist: pecan (==0.8.1)
Requires-Dist: oslo.config (>=1.2.0)
Requires-Dist: pbr (>=0.5.21,<1.0)
Requires-Dist: boto (>=2.31.1)
Requires-Dist: cdn-fastly (==1.0.4)
Requires-Dist: iso8601 (>=0.1.8)
Requires-Dist: pyrax
Requires-Dist: python-keystoneclient (>=0.4.1)
Requires-Dist: sphinx
Requires-Dist: sphinxcontrib-httpdomain
Requires-Dist: pymongo (>=2.4)
Requires-Dist: jsonschema (>=1.3.0,!=1.4.0)
Requires-Dist: oslosphinx
Requires-Dist: six (>=1.4.1)
Requires-Dist: msgpack-python
Requires-Dist: httplib2 (>=0.8)
Requires-Dist: sphinxcontrib-pecanwsme
Requires-Dist: cassandra-driver (>=1.0.0)
Requires-Dist: stevedore (>=0.10)
Requires-Dist: edgegrid-python
Requires-Dist: netaddr (>=0.7.6)

Poppy
=======

CDN Provider Management as a Service

Note: This is a work in progress and is not currently recommended for production use.

What is Poppy
============

Users have come to expect exceptional speed in their applications, websites, and video experiences.  Because of this, using a CDN has become standard for companies, no matter their size.  

Poppy will take all the guess work out of the CDN market for our users.  Poppy will give them a consistently speedy experience from integrated partners, with an easy to use RESTful API.

Vendor lock-in to a particular CDN provider is removed by abstracting away the plethora of vendor API's available.  This means that a customer only has to integrate with one CDN API, and reap the benefits of using multiple providers.

Your content can be distributed to multiple providers seamlessly instead of just one.

Running performance benchmarks against each configured CDN provider allows you to simply repoint your DNS at the new provider; and with that simple change you can ensure your application is running using the fastest provider at the time.  It will also allow you to handle CDN failures and minimize disruption to your application from CDN outages.


Features
---------

+ Wraps third party CDN provider API's
    - Fastly (http://www.fastly.com)
    - Amazon CloudFront
    - MaxCDN
    - Your CDN Here...
+ Sends configurations to *n* configured CDN providers
+ Supports multiple backends (CassandraDB recommended)
    - CassandraDB
    - Your DB provider here
+ Openstack Compatable
    - Uses Keystone for authentication
+ Multiple Origins to pull from (including Rackspace Cloud Files)
+ Supports Multiple Domains
+ Custom Caching and TTL rules
+ Set Restrictions on who can access cached content


What Poppy is not
----------------------

Poppy does not run its own Edge Cache or POP servers.  This is purely a management API to abstract away the myriad of CDN providers on the market.



Getting Started
-------------------------------------------

**Note:** These instructions are for running a local instance of CDN and
not all of these steps are required. It is assumed you have `CassandraDB`
installed and running.

1. From your home folder create the ``~/.poppy`` folder and clone the repo::

    $ cd
    $ mkdir .poppy
    $ git clone https://github.com/rackerlabs/cdn.git

2. Copy the Poppy config files to the directory ``~/.poppy``::

    $ cp poppy/etc/poppy.conf ~/.poppy/poppy.conf
    $ cp poppy/etc/logging.conf ~/.poppy/logging.conf

3. Find the ``[drivers:storage:cassandradb]`` section in
   ``~/.poppy/poppy.conf`` and modify the URI to point
   to your local casssandra cluster::

    [drivers:storage:cassandra]
    cluster = "localhost"
    keyspace = poppy

4. By using cassandra storage plugin, you will need to create the default 
   keyspace "poppy" on your cassandra host/cluster. So log into cqlsh, do::

    cqlsh> CREATE KEYSPACE poppy WITH REPLICATION = { 'class' : 'SimpleStrategy' , 'replication_factor' :  1}  ;

5. For logging, find the ``[DEFAULT]`` section in
   ``~/.poppy/poppy.conf`` and modify as desired::

    log_file = server.log

6. Change directories back to your local copy of the repo::

    $ cd poppy


7. Install general requirements::

    $ pip install -r requirements/requirements.txt

   Install Requirements for each Provider configured::

    $ pip install -r poppy/providers/fastly/requirements.txt

   Run the following so you can see the results of any changes you
   make to the code without having to reinstall the package each time::

    $ pip install -e .


8. Start the Poppy server::

    $ poppy-server

9. Test out that Poppy is working by requesting the home doc (with a sample project ID)::

    $ curl -i -X GET http://0.0.0.0:8888/v1.0/123

You should get an **HTTP 200** along with some headers that will look
similar to this::

    HTTP/1.0 200 OK
    Date: Thu, 13 Feb 2014 14:34:21 GMT
    Server: WSGIServer/0.1 Python/2.7.3
    Content-Length: 464
    Content-Type: application/json-home
    Cache-Control: max-age=86400

10. To run unit/functional test::

    $ tox

To run a full test suite with api test, you will need to put in correct
CDN vendor configuration (in ``~/.poppy/poppy.conf``) first, e.g::

    [drivers:provider:fastly]
    apikey = "<your_fastly_api_key>"

Then start a poppy server::

    $ poppy-server -v

 And run test suite with api test::

    $ tox -- --exclude=none



Installing Cassandra Locally
-----------------------------

Mac OSX
-------

1. Update your Java SDK to the latest version (v7+)::

    http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

   You can check the version currently running with::

    $java -version

2. Follow the instructions on the datastax site to install cassandra for Mac OSX::

    http://www.datastax.com/2012/01/working-with-apache-cassandra-on-mac-os-x

3. Create a Keyspace with Replication::

    CREATE KEYSPACE poppy WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };

4. Import the Cassandra Schema to set up the required tables that CDN will need::

    Open ./cqlsh and import the /poppy/storage/cassandra/schema.cql file



Running tests
-----------------------------

First install the additional requirements::

    $ pip install tox

And then run tests::

    $ tox


.. _`CassandraDB` : http://cassandra.apache.org
.. _`pyenv` : https://github.com/yyuu/pyenv/
.. _`virtualenv` : https://pypi.python.org/pypi/virtualenv/



