commit
d4ab07a5d1
@ -1,5 +1,5 @@
|
|||||||
[run]
|
[run]
|
||||||
omit = *cdn/openstack*
|
omit = *poppy/openstack*
|
||||||
|
|
||||||
[report]
|
[report]
|
||||||
exclude_lines =
|
exclude_lines =
|
||||||
|
12
HACKING.rst
12
HACKING.rst
@ -86,7 +86,7 @@ Template::
|
|||||||
\n
|
\n
|
||||||
{{third-party lib imports in human alphabetical order}}
|
{{third-party lib imports in human alphabetical order}}
|
||||||
\n
|
\n
|
||||||
{{cdn imports in human alphabetical order}}
|
{{poppy imports in human alphabetical order}}
|
||||||
\n
|
\n
|
||||||
\n
|
\n
|
||||||
{{begin your code}}
|
{{begin your code}}
|
||||||
@ -102,9 +102,9 @@ Example::
|
|||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
|
|
||||||
import cdn.common
|
import poppy.common
|
||||||
from cdn import test
|
from poppy import test
|
||||||
import cdn.storage.cassandra
|
import poppy.storage.cassandra
|
||||||
|
|
||||||
|
|
||||||
More Import Examples
|
More Import Examples
|
||||||
@ -112,11 +112,11 @@ More Import Examples
|
|||||||
|
|
||||||
**INCORRECT** ::
|
**INCORRECT** ::
|
||||||
|
|
||||||
import cdn.transport.wsgi as wsgi
|
import poppy.transport.wsgi as wsgi
|
||||||
|
|
||||||
**CORRECT** ::
|
**CORRECT** ::
|
||||||
|
|
||||||
from cdn.transport import wsgi
|
from poppy.transport import wsgi
|
||||||
|
|
||||||
Docstrings
|
Docstrings
|
||||||
----------
|
----------
|
||||||
|
51
README.rst
51
README.rst
@ -1,16 +1,16 @@
|
|||||||
CDN
|
Poppy
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Content Delivery Network Management as a Service
|
CDN Provider Management as a Service
|
||||||
|
|
||||||
Note: This is a work in progress and is not currently recommended for production use.
|
Note: This is a work in progress and is not currently recommended for production use.
|
||||||
|
|
||||||
What is CDN
|
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.
|
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.
|
||||||
|
|
||||||
CDN will take all the guess work out of the CDN market for our users. CDN will give them a consistently speedy experience from integrated partners, with an easy to use RESTful API.
|
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.
|
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.
|
||||||
|
|
||||||
@ -39,10 +39,10 @@ Features
|
|||||||
+ Set Restrictions on who can access cached content
|
+ Set Restrictions on who can access cached content
|
||||||
|
|
||||||
|
|
||||||
What CDN is not
|
What Poppy is not
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
CDN 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.
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -53,38 +53,38 @@ Getting Started
|
|||||||
not all of these steps are required. It is assumed you have `CassandraDB`
|
not all of these steps are required. It is assumed you have `CassandraDB`
|
||||||
installed and running.
|
installed and running.
|
||||||
|
|
||||||
1. From your home folder create the ``~/.cdn`` folder and clone the repo::
|
1. From your home folder create the ``~/.poppy`` folder and clone the repo::
|
||||||
|
|
||||||
$ cd
|
$ cd
|
||||||
$ mkdir .cdn
|
$ mkdir .poppy
|
||||||
$ git clone https://github.com/rackerlabs/cdn.git
|
$ git clone https://github.com/rackerlabs/cdn.git
|
||||||
|
|
||||||
2. Copy the CDN config files to the directory ``~/.cdn``::
|
2. Copy the Poppy config files to the directory ``~/.poppy``::
|
||||||
|
|
||||||
$ cp cdn/etc/cdn.conf ~/.cdn/cdn.conf
|
$ cp poppy/etc/poppy.conf ~/.poppy/poppy.conf
|
||||||
$ cp cdn/etc/logging.conf ~/.cdn/logging.conf
|
$ cp poppy/etc/logging.conf ~/.poppy/logging.conf
|
||||||
|
|
||||||
3. Find the ``[drivers:storage:cassandradb]`` section in
|
3. Find the ``[drivers:storage:cassandradb]`` section in
|
||||||
``~/.cdn/cdn.conf`` and modify the URI to point
|
``~/.poppy/poppy.conf`` and modify the URI to point
|
||||||
to your local casssandra cluster::
|
to your local casssandra cluster::
|
||||||
|
|
||||||
[drivers:storage:cassandra]
|
[drivers:storage:cassandra]
|
||||||
cluster = "localhost"
|
cluster = "localhost"
|
||||||
keyspace = cdn
|
keyspace = poppy
|
||||||
|
|
||||||
4. By using cassandra storage plugin, you will need to create the default
|
4. By using cassandra storage plugin, you will need to create the default
|
||||||
keyspace "cdn" on your cassandra host/cluster. So log into cqlsh, do::
|
keyspace "poppy" on your cassandra host/cluster. So log into cqlsh, do::
|
||||||
|
|
||||||
cqlsh> CREATE KEYSPACE cdn WITH REPLICATION = { 'class' : 'SimpleStrategy' , 'replication_factor' : 1} ;
|
cqlsh> CREATE KEYSPACE poppy WITH REPLICATION = { 'class' : 'SimpleStrategy' , 'replication_factor' : 1} ;
|
||||||
|
|
||||||
5. For logging, find the ``[DEFAULT]`` section in
|
5. For logging, find the ``[DEFAULT]`` section in
|
||||||
``~/.cdn/cdn.conf`` and modify as desired::
|
``~/.poppy/poppy.conf`` and modify as desired::
|
||||||
|
|
||||||
log_file = server.log
|
log_file = server.log
|
||||||
|
|
||||||
6. Change directories back to your local copy of the repo::
|
6. Change directories back to your local copy of the repo::
|
||||||
|
|
||||||
$ cd cdn
|
$ cd poppy
|
||||||
|
|
||||||
|
|
||||||
7. Install general requirements::
|
7. Install general requirements::
|
||||||
@ -93,7 +93,7 @@ installed and running.
|
|||||||
|
|
||||||
Install Requirements for each Provider configured::
|
Install Requirements for each Provider configured::
|
||||||
|
|
||||||
$ pip install -r cdn/providers/fastly/requirements.txt
|
$ pip install -r poppy/providers/fastly/requirements.txt
|
||||||
|
|
||||||
Run the following so you can see the results of any changes you
|
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::
|
make to the code without having to reinstall the package each time::
|
||||||
@ -101,14 +101,11 @@ installed and running.
|
|||||||
$ pip install -e .
|
$ pip install -e .
|
||||||
|
|
||||||
|
|
||||||
Installing the fastly client library may have issues. Copy the `README.md` file to `README` and try again.
|
8. Start the Poppy server::
|
||||||
|
|
||||||
|
$ poppy-server
|
||||||
|
|
||||||
8. Start the CDN server::
|
9. Test out that Poppy is working by requesting the home doc (with a sample project ID)::
|
||||||
|
|
||||||
$ cdn-server
|
|
||||||
|
|
||||||
9. Test out that CDN 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
|
$ curl -i -X GET http://0.0.0.0:8888/v1.0/123
|
||||||
|
|
||||||
@ -143,11 +140,11 @@ Mac OSX
|
|||||||
|
|
||||||
3. Create a Keyspace with Replication::
|
3. Create a Keyspace with Replication::
|
||||||
|
|
||||||
CREATE KEYSPACE cdn WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
|
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::
|
4. Import the Cassandra Schema to set up the required tables that CDN will need::
|
||||||
|
|
||||||
Open ./cqlsh and import the /cdn/storage/cassandra/schema.cql file
|
Open ./cqlsh and import the /poppy/storage/cassandra/schema.cql file
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -160,7 +157,7 @@ First install the additional requirements::
|
|||||||
|
|
||||||
And then run tests::
|
And then run tests::
|
||||||
|
|
||||||
$ tox -e py27
|
$ tox
|
||||||
|
|
||||||
|
|
||||||
.. _`CassandraDB` : http://cassandra.apache.org
|
.. _`CassandraDB` : http://cassandra.apache.org
|
||||||
|
246
doc/source/conf.py
Normal file
246
doc/source/conf.py
Normal file
@ -0,0 +1,246 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# poppy documentation build configuration file, created by
|
||||||
|
# sphinx-quickstart on Wed Aug 6 16:54:51 2014.
|
||||||
|
#
|
||||||
|
# This file is execfile()d with the current directory set to its
|
||||||
|
# containing dir.
|
||||||
|
#
|
||||||
|
# Note that not all possible configuration values are present in this
|
||||||
|
# autogenerated file.
|
||||||
|
#
|
||||||
|
# All configuration values have a default; values that are commented out
|
||||||
|
# serve to show the default.
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
# If extensions (or modules to document with autodoc) are in another directory,
|
||||||
|
# add these directories to sys.path here. If the directory is relative to the
|
||||||
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||||
|
sys.path.insert(0, os.path.abspath('../../'))
|
||||||
|
sys.path.insert(0, os.path.abspath('../'))
|
||||||
|
sys.path.insert(0, os.path.abspath('./'))
|
||||||
|
|
||||||
|
# -- General configuration ------------------------------------------------
|
||||||
|
|
||||||
|
# If your documentation needs a minimal Sphinx version, state it here.
|
||||||
|
#needs_sphinx = '1.0'
|
||||||
|
|
||||||
|
# Add any Sphinx extension module names here, as strings. They can be
|
||||||
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||||
|
# ones.
|
||||||
|
extensions = ['sphinx.ext.autodoc',
|
||||||
|
'sphinx.ext.intersphinx',
|
||||||
|
'sphinx.ext.coverage',
|
||||||
|
'sphinx.ext.pngmath',
|
||||||
|
'sphinx.ext.ifconfig',
|
||||||
|
'sphinx.ext.graphviz',
|
||||||
|
'oslosphinx',
|
||||||
|
]
|
||||||
|
|
||||||
|
# autodoc generation is a bit aggressive and a nuisance
|
||||||
|
# when doing heavy text edit cycles. Execute "export SPHINX_DEBUG=1"
|
||||||
|
# in your terminal to disable
|
||||||
|
|
||||||
|
todo_include_todos = True
|
||||||
|
|
||||||
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
|
templates_path = []
|
||||||
|
if os.getenv('HUDSON_PUBLISH_DOCS'):
|
||||||
|
templates_path = ['_ga', '_templates']
|
||||||
|
else:
|
||||||
|
templates_path = ['_templates']
|
||||||
|
|
||||||
|
# The suffix of source filenames.
|
||||||
|
source_suffix = '.rst'
|
||||||
|
|
||||||
|
# The encoding of source files.
|
||||||
|
#source_encoding = 'utf-8'
|
||||||
|
|
||||||
|
# The master toctree document.
|
||||||
|
master_doc = 'index'
|
||||||
|
|
||||||
|
|
||||||
|
# General information about the project.
|
||||||
|
project = u'Poppy'
|
||||||
|
copyright = u'2010-present, OpenStack Foundation'
|
||||||
|
|
||||||
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
|
# |version| and |release|, also used in various other places throughout the
|
||||||
|
# built documents.
|
||||||
|
#
|
||||||
|
from poppy.version import version_info
|
||||||
|
# The full version, including alpha/beta/rc tags.
|
||||||
|
release = version_info.release_string()
|
||||||
|
# The short X.Y version.
|
||||||
|
version = version_info.version_string()
|
||||||
|
|
||||||
|
|
||||||
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
|
# for a list of supported languages.
|
||||||
|
#language = None
|
||||||
|
|
||||||
|
# There are two options for replacing |today|: either, you set today to some
|
||||||
|
# non-false value, then it is used:
|
||||||
|
#today = ''
|
||||||
|
# Else, today_fmt is used as the format for a strftime call.
|
||||||
|
#today_fmt = '%B %d, %Y'
|
||||||
|
|
||||||
|
# List of patterns, relative to source directory, that match files and
|
||||||
|
# directories to ignore when looking for source files.
|
||||||
|
exclude_patterns = []
|
||||||
|
|
||||||
|
# The reST default role (used for this markup: `text`) to use for all
|
||||||
|
# documents.
|
||||||
|
#default_role = None
|
||||||
|
|
||||||
|
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||||
|
#add_function_parentheses = True
|
||||||
|
|
||||||
|
# If true, the current module name will be prepended to all description
|
||||||
|
# unit titles (such as .. function::).
|
||||||
|
#add_module_names = True
|
||||||
|
|
||||||
|
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||||
|
# output. They are ignored by default.
|
||||||
|
#show_authors = False
|
||||||
|
|
||||||
|
# The name of the Pygments (syntax highlighting) style to use.
|
||||||
|
pygments_style = 'sphinx'
|
||||||
|
|
||||||
|
# A list of ignored prefixes for module index sorting.
|
||||||
|
modindex_common_prefix = ['poppy.']
|
||||||
|
|
||||||
|
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||||
|
#keep_warnings = False
|
||||||
|
|
||||||
|
|
||||||
|
# -- Options for HTML output ----------------------------------------------
|
||||||
|
|
||||||
|
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||||
|
# a list of builtin themes.
|
||||||
|
#html_theme = 'default'
|
||||||
|
|
||||||
|
# Theme options are theme-specific and customize the look and feel of a theme
|
||||||
|
# further. For a list of options available for each theme, see the
|
||||||
|
# documentation.
|
||||||
|
#html_theme_options = {}
|
||||||
|
|
||||||
|
# Add any paths that contain custom themes here, relative to this directory.
|
||||||
|
#html_theme_path = []
|
||||||
|
|
||||||
|
# The name for this set of Sphinx documents. If None, it defaults to
|
||||||
|
# "<project> v<release> documentation".
|
||||||
|
#html_title = None
|
||||||
|
|
||||||
|
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||||
|
#html_short_title = None
|
||||||
|
|
||||||
|
# The name of an image file (relative to this directory) to place at the top
|
||||||
|
# of the sidebar.
|
||||||
|
#html_logo = None
|
||||||
|
|
||||||
|
# The name of an image file (within the static path) to use as favicon of the
|
||||||
|
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||||
|
# pixels large.
|
||||||
|
#html_favicon = None
|
||||||
|
|
||||||
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
|
html_static_path = []
|
||||||
|
|
||||||
|
# Add any extra paths that contain custom files (such as robots.txt or
|
||||||
|
# .htaccess) here, relative to this directory. These files are copied
|
||||||
|
# directly to the root of the documentation.
|
||||||
|
#html_extra_path = []
|
||||||
|
|
||||||
|
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||||
|
# using the given strftime format.
|
||||||
|
#html_last_updated_fmt = '%b %d, %Y'
|
||||||
|
|
||||||
|
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||||
|
# typographically correct entities.
|
||||||
|
#html_use_smartypants = True
|
||||||
|
|
||||||
|
# Custom sidebar templates, maps document names to template names.
|
||||||
|
#html_sidebars = {}
|
||||||
|
|
||||||
|
# Additional templates that should be rendered to pages, maps page names to
|
||||||
|
# template names.
|
||||||
|
#html_additional_pages = {}
|
||||||
|
|
||||||
|
# If false, no module index is generated.
|
||||||
|
#html_domain_indices = True
|
||||||
|
|
||||||
|
# If false, no index is generated.
|
||||||
|
#html_use_index = True
|
||||||
|
|
||||||
|
# If true, the index is split into individual pages for each letter.
|
||||||
|
#html_split_index = False
|
||||||
|
|
||||||
|
# If true, links to the reST sources are added to the pages.
|
||||||
|
#html_show_sourcelink = True
|
||||||
|
|
||||||
|
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||||
|
#html_show_sphinx = True
|
||||||
|
|
||||||
|
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||||
|
#html_show_copyright = True
|
||||||
|
|
||||||
|
# If true, an OpenSearch description file will be output, and all pages will
|
||||||
|
# contain a <link> tag referring to it. The value of this option must be the
|
||||||
|
# base URL from which the finished HTML is served.
|
||||||
|
#html_use_opensearch = ''
|
||||||
|
|
||||||
|
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||||
|
#html_file_suffix = None
|
||||||
|
|
||||||
|
# Output file base name for HTML help builder.
|
||||||
|
htmlhelp_basename = 'poppydoc'
|
||||||
|
|
||||||
|
|
||||||
|
# -- Options for LaTeX output ---------------------------------------------
|
||||||
|
|
||||||
|
latex_elements = {
|
||||||
|
# The paper size ('letterpaper' or 'a4paper').
|
||||||
|
#'papersize': 'letterpaper',
|
||||||
|
|
||||||
|
# The font size ('10pt', '11pt' or '12pt').
|
||||||
|
#'pointsize': '10pt',
|
||||||
|
|
||||||
|
# Additional stuff for the LaTeX preamble.
|
||||||
|
#'preamble': '',
|
||||||
|
}
|
||||||
|
|
||||||
|
# Grouping the document tree into LaTeX files. List of tuples
|
||||||
|
# (source start file, target name, title,
|
||||||
|
# author, documentclass [howto, manual, or own class]).
|
||||||
|
latex_documents = [
|
||||||
|
('index', 'poppy.tex', u'Poppy Documentation',
|
||||||
|
u'OpenStack Foundation', 'manual'),
|
||||||
|
]
|
||||||
|
|
||||||
|
# The name of an image file (relative to this directory) to place at the top of
|
||||||
|
# the title page.
|
||||||
|
#latex_logo = None
|
||||||
|
|
||||||
|
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||||
|
# not chapters.
|
||||||
|
#latex_use_parts = False
|
||||||
|
|
||||||
|
# If true, show page references after internal links.
|
||||||
|
#latex_show_pagerefs = False
|
||||||
|
|
||||||
|
# If true, show URL addresses after external links.
|
||||||
|
#latex_show_urls = False
|
||||||
|
|
||||||
|
# Documents to append as an appendix to all manuals.
|
||||||
|
#latex_appendices = []
|
||||||
|
|
||||||
|
# If false, no module index is generated.
|
||||||
|
#latex_domain_indices = True
|
||||||
|
|
||||||
|
# Example configuration for intersphinx: refer to the Python standard library.
|
||||||
|
intersphinx_mapping = {'python': ('http://docs.python.org/', None)}
|
65
doc/source/index.rst
Normal file
65
doc/source/index.rst
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
..
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
not use this file except in compliance with the License. You may obtain
|
||||||
|
a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
License for the specific language governing permissions and limitations
|
||||||
|
under the License.
|
||||||
|
|
||||||
|
Welcome to Poppy's documentation!
|
||||||
|
=================================
|
||||||
|
|
||||||
|
Poppy is an OpenStack related project to provide a generic and modular vendor-neutral API that wraps provisioning instructions for CDN vendors that support it.
|
||||||
|
|
||||||
|
Poppy, as with all OpenStack projects, is written with the following design
|
||||||
|
guidelines in mind:
|
||||||
|
|
||||||
|
* **Component based architecture**: Quickly add new behaviors
|
||||||
|
* **Highly available**: Scale to very serious workloads
|
||||||
|
* **Fault tolerant**: Isolated processes avoid cascading failures
|
||||||
|
* **Recoverable**: Failures should be easy to diagnose, debug, and rectify
|
||||||
|
* **Open standards**: Be a reference implementation for a community-driven api
|
||||||
|
|
||||||
|
This documentation is generated by the Sphinx toolkit and lives in the source
|
||||||
|
tree. Additional draft and project documentation on Poppy and other components of OpenStack can
|
||||||
|
be found on the `OpenStack wiki`_. Cloud administrators, refer to `docs.openstack.org`_.
|
||||||
|
|
||||||
|
.. _`OpenStack wiki`: http://wiki.openstack.org
|
||||||
|
.. _`docs.openstack.org`: http://docs.openstack.org
|
||||||
|
|
||||||
|
Concepts
|
||||||
|
========
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
|
||||||
|
glossary
|
||||||
|
|
||||||
|
Installing/Configuring Poppy
|
||||||
|
============================
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
|
||||||
|
installing
|
||||||
|
|
||||||
|
Operating Poppy
|
||||||
|
===============
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
|
||||||
|
ha
|
||||||
|
|
||||||
|
Using Poppy
|
||||||
|
===========
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
|
||||||
|
api
|
@ -1,7 +1,7 @@
|
|||||||
Building the Cassandra Docker Image
|
Building the Cassandra Docker Image
|
||||||
--------------------------------------
|
--------------------------------------
|
||||||
|
|
||||||
From the docker/cassandra-cdn folder:
|
From the docker/cassandra folder:
|
||||||
|
|
||||||
$ docker build -t db .
|
$ docker build -t db .
|
||||||
|
|
||||||
@ -30,5 +30,5 @@ Where local ip is the ip address of your running docker container
|
|||||||
Import Schema
|
Import Schema
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
Import the schema file from the cdn/storage/cassandra/schema.cql file.
|
Import the schema file from the poppy/storage/cassandra/schema.cql file.
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
##
|
##
|
||||||
## CDN API
|
## Poppy
|
||||||
##
|
##
|
||||||
##
|
##
|
||||||
|
|
||||||
# The following files should exist in this folder before running Dockerfile
|
# The following files should exist in this folder before running Dockerfile
|
||||||
# - docker_rsa (private key) -> public key should be published to the private git repo
|
# - docker_rsa (private key) -> public key should be published to the private git repo
|
||||||
# - cdn.conf (desired configuration for cdn api)
|
# - poppy.conf (desired configuration for poppy api)
|
||||||
# - logging.conf (desired logging configuration file)
|
# - logging.conf (desired logging configuration file)
|
||||||
|
|
||||||
|
|
||||||
@ -43,28 +43,28 @@ RUN echo "IdentityFile ~/.ssh/id_rsa" >> /etc/ssh/ssh_config
|
|||||||
RUN touch /root/.ssh/known_hosts
|
RUN touch /root/.ssh/known_hosts
|
||||||
|
|
||||||
# Pull project
|
# Pull project
|
||||||
RUN git clone git@github.com:rackerlabs/cdn /home/cdn
|
RUN git clone git@github.com:rackerlabs/cdn /home/poppy
|
||||||
|
|
||||||
# Install Requirements
|
# Install Requirements
|
||||||
RUN sudo pip install -r /home/cdn/requirements/requirements.txt
|
RUN sudo pip install -r /home/poppy/requirements/requirements.txt
|
||||||
|
|
||||||
RUN sudo pip install -e /home/cdn/.
|
RUN sudo pip install -e /home/poppy/.
|
||||||
|
|
||||||
# Set up the configuration files
|
# Set up the configuration files
|
||||||
ADD ./cdn.conf /etc/cdn.conf
|
ADD ./poppy.conf /etc/poppy.conf
|
||||||
ADD ./logging.conf /etc/logging.conf
|
ADD ./logging.conf /etc/logging.conf
|
||||||
ADD ./uwsgi.ini /root/uwsgi.ini
|
ADD ./uwsgi.ini /root/uwsgi.ini
|
||||||
|
|
||||||
# create uwsgi log directory
|
# create uwsgi log directory
|
||||||
RUN mkdir -p /var/log/cdn
|
RUN mkdir -p /var/log/poppy
|
||||||
RUN chmod -R +w /var/log/cdn
|
RUN chmod -R +w /var/log/poppy
|
||||||
|
|
||||||
# create uwsgi pid directory
|
# create uwsgi pid directory
|
||||||
RUN mkdir -p /var/run/cdn
|
RUN mkdir -p /var/run/poppy
|
||||||
RUN chmod -R +w /var/run/cdn
|
RUN chmod -R +w /var/run/poppy
|
||||||
|
|
||||||
#RUN /usr/local/bin/uwsgi --ini /root/uwsgi.ini
|
#RUN /usr/local/bin/uwsgi --ini /root/uwsgi.ini
|
||||||
|
|
||||||
# Start CDN
|
# Start Poppy
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
CMD ["/usr/local/bin/uwsgi", "--ini", "/root/uwsgi.ini"]
|
CMD ["/usr/local/bin/uwsgi", "--ini", "/root/uwsgi.ini"]
|
@ -14,12 +14,12 @@ handlers=devel
|
|||||||
[logger_server]
|
[logger_server]
|
||||||
level=DEBUG
|
level=DEBUG
|
||||||
handlers=devel
|
handlers=devel
|
||||||
qualname=cdn-server
|
qualname=poppy-server
|
||||||
|
|
||||||
[logger_combined]
|
[logger_combined]
|
||||||
level=DEBUG
|
level=DEBUG
|
||||||
handlers=devel
|
handlers=devel
|
||||||
qualname=cdn-combined
|
qualname=poppy-combined
|
||||||
|
|
||||||
[handler_production]
|
[handler_production]
|
||||||
class=handlers.SysLogHandler
|
class=handlers.SysLogHandler
|
||||||
@ -31,7 +31,7 @@ args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER)
|
|||||||
class=FileHandler
|
class=FileHandler
|
||||||
level=DEBUG
|
level=DEBUG
|
||||||
formatter=normal_with_name
|
formatter=normal_with_name
|
||||||
args=('cdn.log', 'w')
|
args=('poppy.log', 'w')
|
||||||
|
|
||||||
[handler_devel]
|
[handler_devel]
|
||||||
class=StreamHandler
|
class=StreamHandler
|
@ -1,6 +1,6 @@
|
|||||||
# By default, this should live in one of:
|
# By default, this should live in one of:
|
||||||
# ~/.cdn/cdn.conf
|
# ~/.poppy/poppy.conf
|
||||||
# /etc/cdn/cdn.conf
|
# /etc/poppy/poppy.conf
|
||||||
|
|
||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
# Show more verbose log output (sets INFO log level output)
|
# Show more verbose log output (sets INFO log level output)
|
||||||
@ -10,7 +10,7 @@
|
|||||||
;debug = False
|
;debug = False
|
||||||
|
|
||||||
# Log to this file
|
# Log to this file
|
||||||
log_file = cdn.log
|
log_file = poppy.log
|
||||||
|
|
||||||
;auth_strategy =
|
;auth_strategy =
|
||||||
|
|
||||||
@ -40,14 +40,14 @@ port = 8888
|
|||||||
|
|
||||||
[drivers:storage:mongodb]
|
[drivers:storage:mongodb]
|
||||||
uri = mongodb://localhost
|
uri = mongodb://localhost
|
||||||
database = cdn
|
database = poppy
|
||||||
|
|
||||||
[drivers:storage:cassandra]
|
[drivers:storage:cassandra]
|
||||||
cluster = "<your-cassandra-server-link-name>"
|
cluster = "<your-cassandra-server-link-name>"
|
||||||
keyspace = cdn
|
keyspace = poppy
|
||||||
|
|
||||||
[drivers:storage:mockdb]
|
[drivers:storage:mockdb]
|
||||||
database = cdn
|
database = poppy
|
||||||
|
|
||||||
[drivers:provider:fastly]
|
[drivers:provider:fastly]
|
||||||
apikey = "<MYAPIKEY>"
|
apikey = "<MYAPIKEY>"
|
@ -1,14 +1,14 @@
|
|||||||
[uwsgi]
|
[uwsgi]
|
||||||
master = true
|
master = true
|
||||||
chdir = /home/cdn/
|
chdir = /home/poppy/
|
||||||
workers = 4
|
workers = 4
|
||||||
http-socket = 0.0.0.0:80
|
http-socket = 0.0.0.0:80
|
||||||
logger = file:/var/log/cdn/cdn.log
|
logger = file:/var/log/poppy/poppy.log
|
||||||
pidfile = /var/run/cdn/cdn.pid
|
pidfile = /var/run/poppy/poppy.pid
|
||||||
die-on-term = true
|
die-on-term = true
|
||||||
enable-threads = true
|
enable-threads = true
|
||||||
buffer-size = 32768
|
buffer-size = 32768
|
||||||
max-requests = 15000
|
max-requests = 15000
|
||||||
no-orphans = true
|
no-orphans = true
|
||||||
vacuum = true
|
vacuum = true
|
||||||
module = cdn.transport.falcon.app:app
|
module = poppy.transport.falcon.app:app
|
@ -14,12 +14,12 @@ handlers=devel
|
|||||||
[logger_server]
|
[logger_server]
|
||||||
level=DEBUG
|
level=DEBUG
|
||||||
handlers=devel
|
handlers=devel
|
||||||
qualname=cdn-server
|
qualname=poppy-server
|
||||||
|
|
||||||
[logger_combined]
|
[logger_combined]
|
||||||
level=DEBUG
|
level=DEBUG
|
||||||
handlers=devel
|
handlers=devel
|
||||||
qualname=cdn-combined
|
qualname=poppy-combined
|
||||||
|
|
||||||
[handler_production]
|
[handler_production]
|
||||||
class=handlers.SysLogHandler
|
class=handlers.SysLogHandler
|
||||||
@ -31,7 +31,7 @@ args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER)
|
|||||||
class=FileHandler
|
class=FileHandler
|
||||||
level=DEBUG
|
level=DEBUG
|
||||||
formatter=normal_with_name
|
formatter=normal_with_name
|
||||||
args=('cdn.log', 'w')
|
args=('poppy.log', 'w')
|
||||||
|
|
||||||
[handler_devel]
|
[handler_devel]
|
||||||
class=StreamHandler
|
class=StreamHandler
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# By default, this should live in one of:
|
# By default, this should live in one of:
|
||||||
# ~/.cdn/cdn.conf
|
# ~/.poppy/poppy.conf
|
||||||
# /etc/cdn/cdn.conf
|
# /etc/poppy/poppy.conf
|
||||||
|
|
||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
# Show more verbose log output (sets INFO log level output)
|
# Show more verbose log output (sets INFO log level output)
|
||||||
@ -10,7 +10,7 @@
|
|||||||
;debug = False
|
;debug = False
|
||||||
|
|
||||||
# Log to this file
|
# Log to this file
|
||||||
log_file = cdn.log
|
log_file = poppy.log
|
||||||
|
|
||||||
;auth_strategy =
|
;auth_strategy =
|
||||||
|
|
||||||
@ -42,14 +42,14 @@ port = 8888
|
|||||||
|
|
||||||
[drivers:storage:mongodb]
|
[drivers:storage:mongodb]
|
||||||
uri = mongodb://localhost
|
uri = mongodb://localhost
|
||||||
database = cdn
|
database = poppy
|
||||||
|
|
||||||
[drivers:storage:cassandra]
|
[drivers:storage:cassandra]
|
||||||
cluster = "localhost"
|
cluster = "localhost"
|
||||||
keyspace = cdn
|
keyspace = poppy
|
||||||
|
|
||||||
[drivers:storage:mockdb]
|
[drivers:storage:mockdb]
|
||||||
database = cdn
|
database = poppy
|
||||||
|
|
||||||
[drivers:provider:fastly]
|
[drivers:provider:fastly]
|
||||||
apikey = "MYAPIKEY"
|
apikey = "MYAPIKEY"
|
@ -1,5 +1,10 @@
|
|||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
base=cdn
|
base=poppy
|
||||||
modules=context
|
module=context
|
||||||
modules=local
|
module=gettextutils
|
||||||
modules=log
|
module=importutils
|
||||||
|
module=jsonutils
|
||||||
|
module=local
|
||||||
|
module=log
|
||||||
|
module=strutils
|
||||||
|
module=timeutils
|
||||||
|
@ -13,11 +13,12 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from cdn.common import decorators
|
|
||||||
from cdn.openstack.common import log
|
|
||||||
from oslo.config import cfg
|
from oslo.config import cfg
|
||||||
from stevedore import driver, extension
|
from stevedore import driver, extension
|
||||||
|
|
||||||
|
from poppy.common import decorators
|
||||||
|
from poppy.openstack.common import log
|
||||||
|
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
@ -47,7 +48,7 @@ class Bootstrap(object):
|
|||||||
self.conf.register_opts(_DRIVER_OPTIONS, group=_DRIVER_GROUP)
|
self.conf.register_opts(_DRIVER_OPTIONS, group=_DRIVER_GROUP)
|
||||||
self.driver_conf = self.conf[_DRIVER_GROUP]
|
self.driver_conf = self.conf[_DRIVER_GROUP]
|
||||||
|
|
||||||
log.setup('cdn')
|
log.setup('poppy')
|
||||||
|
|
||||||
LOG.debug("init bootstrap")
|
LOG.debug("init bootstrap")
|
||||||
|
|
||||||
@ -56,7 +57,7 @@ class Bootstrap(object):
|
|||||||
LOG.debug((u'Loading provider extension(s)'))
|
LOG.debug((u'Loading provider extension(s)'))
|
||||||
|
|
||||||
# create the driver manager to load the appropriate drivers
|
# create the driver manager to load the appropriate drivers
|
||||||
provider_type = 'cdn.provider'
|
provider_type = 'poppy.provider'
|
||||||
args = [self.conf]
|
args = [self.conf]
|
||||||
|
|
||||||
mgr = extension.ExtensionManager(namespace=provider_type,
|
mgr = extension.ExtensionManager(namespace=provider_type,
|
||||||
@ -69,7 +70,7 @@ class Bootstrap(object):
|
|||||||
LOG.debug((u'Loading storage driver'))
|
LOG.debug((u'Loading storage driver'))
|
||||||
|
|
||||||
# create the driver manager to load the appropriate drivers
|
# create the driver manager to load the appropriate drivers
|
||||||
storage_type = 'cdn.storage'
|
storage_type = 'poppy.storage'
|
||||||
storage_name = self.driver_conf.storage
|
storage_name = self.driver_conf.storage
|
||||||
|
|
||||||
args = [self.conf]
|
args = [self.conf]
|
||||||
@ -88,7 +89,7 @@ class Bootstrap(object):
|
|||||||
LOG.debug((u'Loading manager driver'))
|
LOG.debug((u'Loading manager driver'))
|
||||||
|
|
||||||
# create the driver manager to load the appropriate drivers
|
# create the driver manager to load the appropriate drivers
|
||||||
manager_type = 'cdn.manager'
|
manager_type = 'poppy.manager'
|
||||||
manager_name = self.driver_conf.manager
|
manager_name = self.driver_conf.manager
|
||||||
|
|
||||||
args = [self.conf, self.storage, self.provider]
|
args = [self.conf, self.storage, self.provider]
|
||||||
@ -107,7 +108,7 @@ class Bootstrap(object):
|
|||||||
LOG.debug("loading transport")
|
LOG.debug("loading transport")
|
||||||
|
|
||||||
# create the driver manager to load the appropriate drivers
|
# create the driver manager to load the appropriate drivers
|
||||||
transport_type = 'cdn.transport'
|
transport_type = 'poppy.transport'
|
||||||
transport_name = self.driver_conf.transport
|
transport_name = self.driver_conf.transport
|
||||||
|
|
||||||
args = [self.conf, self.manager]
|
args = [self.conf, self.manager]
|
@ -13,10 +13,11 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from cdn import bootstrap
|
|
||||||
from cdn.common import cli
|
|
||||||
from oslo.config import cfg
|
from oslo.config import cfg
|
||||||
|
|
||||||
|
from poppy import bootstrap
|
||||||
|
from poppy.common import cli
|
||||||
|
|
||||||
|
|
||||||
@cli.runnable
|
@cli.runnable
|
||||||
def run():
|
def run():
|
||||||
@ -24,7 +25,7 @@ def run():
|
|||||||
# to pick up common options from openstack.common.log, since
|
# to pick up common options from openstack.common.log, since
|
||||||
# that module uses the global CONF instance exclusively.
|
# that module uses the global CONF instance exclusively.
|
||||||
conf = cfg.CONF
|
conf = cfg.CONF
|
||||||
conf(project='cdn', prog='cdn')
|
conf(project='poppy', prog='poppy')
|
||||||
|
|
||||||
server = bootstrap.Bootstrap(conf)
|
server = bootstrap.Bootstrap(conf)
|
||||||
server.run()
|
server.run()
|
@ -20,8 +20,8 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import termios
|
import termios
|
||||||
|
|
||||||
from cdn.openstack.common.gettextutils import _
|
from poppy.openstack.common.gettextutils import _
|
||||||
from cdn.openstack.common import log as logging
|
from poppy.openstack.common import log as logging
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
@ -72,7 +72,7 @@ def runnable(func):
|
|||||||
_enable_echo(False)
|
_enable_echo(False)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
logging.setup('cdn')
|
logging.setup('poppy')
|
||||||
func()
|
func()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
LOG.info(_(u'Terminating'))
|
LOG.info(_(u'Terminating'))
|
@ -13,9 +13,9 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from cdn.manager.base import driver
|
from poppy.manager.base import driver
|
||||||
from cdn.manager.base import services
|
from poppy.manager.base import services
|
||||||
from cdn.manager.base import v1
|
from poppy.manager.base import v1
|
||||||
|
|
||||||
|
|
||||||
Driver = driver.ManagerDriverBase
|
Driver = driver.ManagerDriverBase
|
@ -16,8 +16,8 @@
|
|||||||
import abc
|
import abc
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from cdn.manager.base import controller
|
from poppy.manager.base import controller
|
||||||
from cdn.manager.base import providers
|
from poppy.manager.base import providers
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
@six.add_metaclass(abc.ABCMeta)
|
@ -16,7 +16,7 @@
|
|||||||
import abc
|
import abc
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from cdn.manager.base import controller
|
from poppy.manager.base import controller
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
@six.add_metaclass(abc.ABCMeta)
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
"""Default Manager Driver"""
|
"""Default Manager Driver"""
|
||||||
|
|
||||||
from cdn.manager.default import driver
|
from poppy.manager.default import driver
|
||||||
|
|
||||||
|
|
||||||
# Hoist classes into package namespace
|
# Hoist classes into package namespace
|
@ -13,7 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from cdn.manager.default import services, v1
|
from poppy.manager.default import services, v1
|
||||||
|
|
||||||
|
|
||||||
Services = services.DefaultServicesController
|
Services = services.DefaultServicesController
|
@ -15,9 +15,9 @@
|
|||||||
|
|
||||||
"""Default manager driver implementation."""
|
"""Default manager driver implementation."""
|
||||||
|
|
||||||
from cdn.common import decorators
|
from poppy.common import decorators
|
||||||
from cdn.manager import base
|
from poppy.manager import base
|
||||||
from cdn.manager.default import controllers
|
from poppy.manager.default import controllers
|
||||||
|
|
||||||
|
|
||||||
class DefaultManagerDriver(base.Driver):
|
class DefaultManagerDriver(base.Driver):
|
@ -13,7 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from cdn.manager import base
|
from poppy.manager import base
|
||||||
|
|
||||||
|
|
||||||
class DefaultServicesController(base.ServicesController):
|
class DefaultServicesController(base.ServicesController):
|
@ -13,11 +13,11 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from cdn.manager import base
|
from poppy.manager import base
|
||||||
|
|
||||||
JSON_HOME = {
|
JSON_HOME = {
|
||||||
"resources": {
|
"resources": {
|
||||||
"rel/cdn": {
|
"rel/poppy": {
|
||||||
"href-template": "services{?marker,limit}",
|
"href-template": "services{?marker,limit}",
|
||||||
"href-vars": {
|
"href-vars": {
|
||||||
"marker": "param/marker",
|
"marker": "param/marker",
|
@ -19,7 +19,7 @@ gettext for openstack-common modules.
|
|||||||
|
|
||||||
Usual usage in an openstack.common module:
|
Usual usage in an openstack.common module:
|
||||||
|
|
||||||
from cdn.openstack.common.gettextutils import _
|
from poppy.openstack.common.gettextutils import _
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
@ -121,7 +121,7 @@ class TranslatorFactory(object):
|
|||||||
# module within each application.
|
# module within each application.
|
||||||
|
|
||||||
# Create the global translation functions.
|
# Create the global translation functions.
|
||||||
_translators = TranslatorFactory('cdn')
|
_translators = TranslatorFactory('poppy')
|
||||||
|
|
||||||
# The primary translation function using the well-known name "_"
|
# The primary translation function using the well-known name "_"
|
||||||
_ = _translators.primary
|
_ = _translators.primary
|
||||||
@ -182,7 +182,7 @@ class Message(six.text_type):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __new__(cls, msgid, msgtext=None, params=None,
|
def __new__(cls, msgid, msgtext=None, params=None,
|
||||||
domain='cdn', *args):
|
domain='poppy', *args):
|
||||||
"""Create a new Message object.
|
"""Create a new Message object.
|
||||||
|
|
||||||
In order for translation to work gettext requires a message ID, this
|
In order for translation to work gettext requires a message ID, this
|
@ -59,7 +59,7 @@ def import_module(import_str):
|
|||||||
|
|
||||||
|
|
||||||
def import_versioned_module(version, submodule=None):
|
def import_versioned_module(version, submodule=None):
|
||||||
module = 'cdn.v%s' % version
|
module = 'poppy.v%s' % version
|
||||||
if submodule:
|
if submodule:
|
||||||
module = '.'.join((module, submodule))
|
module = '.'.join((module, submodule))
|
||||||
return import_module(module)
|
return import_module(module)
|
@ -51,10 +51,10 @@ else:
|
|||||||
import six
|
import six
|
||||||
import six.moves.xmlrpc_client as xmlrpclib
|
import six.moves.xmlrpc_client as xmlrpclib
|
||||||
|
|
||||||
from cdn.openstack.common import gettextutils
|
from poppy.openstack.common import gettextutils
|
||||||
from cdn.openstack.common import importutils
|
from poppy.openstack.common import importutils
|
||||||
from cdn.openstack.common import strutils
|
from poppy.openstack.common import strutils
|
||||||
from cdn.openstack.common import timeutils
|
from poppy.openstack.common import timeutils
|
||||||
|
|
||||||
netaddr = importutils.try_import("netaddr")
|
netaddr = importutils.try_import("netaddr")
|
||||||
|
|
@ -40,13 +40,15 @@ from oslo.config import cfg
|
|||||||
import six
|
import six
|
||||||
from six import moves
|
from six import moves
|
||||||
|
|
||||||
from cdn.openstack.common.gettextutils import _
|
_PY26 = sys.version_info[0:2] == (2, 6)
|
||||||
from cdn.openstack.common import importutils
|
|
||||||
from cdn.openstack.common import jsonutils
|
from poppy.openstack.common.gettextutils import _
|
||||||
from cdn.openstack.common import local
|
from poppy.openstack.common import importutils
|
||||||
|
from poppy.openstack.common import jsonutils
|
||||||
|
from poppy.openstack.common import local
|
||||||
# NOTE(flaper87): Pls, remove when graduating this module
|
# NOTE(flaper87): Pls, remove when graduating this module
|
||||||
# from the incubator.
|
# from the incubator.
|
||||||
from cdn.openstack.common.strutils import mask_password # noqa
|
from poppy.openstack.common.strutils import mask_password # noqa
|
||||||
|
|
||||||
|
|
||||||
_DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
|
_DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
|
||||||
@ -227,6 +229,15 @@ class BaseLoggerAdapter(logging.LoggerAdapter):
|
|||||||
def audit(self, msg, *args, **kwargs):
|
def audit(self, msg, *args, **kwargs):
|
||||||
self.log(logging.AUDIT, msg, *args, **kwargs)
|
self.log(logging.AUDIT, msg, *args, **kwargs)
|
||||||
|
|
||||||
|
def isEnabledFor(self, level):
|
||||||
|
if _PY26:
|
||||||
|
# This method was added in python 2.7 (and it does the exact
|
||||||
|
# same logic, so we need to do the exact same logic so that
|
||||||
|
# python 2.6 has this capability as well).
|
||||||
|
return self.logger.isEnabledFor(level)
|
||||||
|
else:
|
||||||
|
return super(BaseLoggerAdapter, self).isEnabledFor(level)
|
||||||
|
|
||||||
|
|
||||||
class LazyAdapter(BaseLoggerAdapter):
|
class LazyAdapter(BaseLoggerAdapter):
|
||||||
def __init__(self, name='unknown', version='unknown'):
|
def __init__(self, name='unknown', version='unknown'):
|
||||||
@ -502,7 +513,7 @@ def _setup_logging_from_conf(project, version):
|
|||||||
if CONF.publish_errors:
|
if CONF.publish_errors:
|
||||||
try:
|
try:
|
||||||
handler = importutils.import_object(
|
handler = importutils.import_object(
|
||||||
"cdn.openstack.common.log_handler.PublishErrorsHandler",
|
"poppy.openstack.common.log_handler.PublishErrorsHandler",
|
||||||
logging.ERROR)
|
logging.ERROR)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
handler = importutils.import_object(
|
handler = importutils.import_object(
|
@ -24,7 +24,7 @@ import unicodedata
|
|||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from cdn.openstack.common.gettextutils import _
|
from poppy.openstack.common.gettextutils import _
|
||||||
|
|
||||||
|
|
||||||
UNIT_PREFIX_EXPONENT = {
|
UNIT_PREFIX_EXPONENT = {
|
@ -13,8 +13,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from cdn.provider.base import driver
|
from poppy.provider.base import driver
|
||||||
from cdn.provider.base import services
|
from poppy.provider.base import services
|
||||||
|
|
||||||
|
|
||||||
Driver = driver.ProviderDriverBase
|
Driver = driver.ProviderDriverBase
|
@ -16,8 +16,8 @@
|
|||||||
import abc
|
import abc
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from cdn.provider.base import controller
|
from poppy.provider.base import controller
|
||||||
from cdn.provider.base import responder
|
from poppy.provider.base import responder
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
@six.add_metaclass(abc.ABCMeta)
|
@ -1,6 +1,6 @@
|
|||||||
"""Fastly CDN Extension for CDN"""
|
"""Fastly CDN Extension for CDN"""
|
||||||
|
|
||||||
from cdn.provider.fastly import driver
|
from poppy.provider.fastly import driver
|
||||||
|
|
||||||
# Hoist classes into package namespace
|
# Hoist classes into package namespace
|
||||||
Driver = driver.CDNProvider
|
Driver = driver.CDNProvider
|
@ -22,6 +22,6 @@ Field Mappings:
|
|||||||
updated and documented in each controller class.
|
updated and documented in each controller class.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from cdn.provider.fastly import services
|
from poppy.provider.fastly import services
|
||||||
|
|
||||||
ServiceController = services.ServiceController
|
ServiceController = services.ServiceController
|
@ -15,9 +15,9 @@
|
|||||||
|
|
||||||
"""Fastly CDN Provider implementation."""
|
"""Fastly CDN Provider implementation."""
|
||||||
|
|
||||||
from cdn.openstack.common import log as logging
|
from poppy.openstack.common import log as logging
|
||||||
from cdn.provider import base
|
from poppy.provider import base
|
||||||
from cdn.provider.fastly import controllers
|
from poppy.provider.fastly import controllers
|
||||||
|
|
||||||
from oslo.config import cfg
|
from oslo.config import cfg
|
||||||
|
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
import fastly
|
import fastly
|
||||||
|
|
||||||
from cdn.provider import base
|
from poppy.provider import base
|
||||||
|
|
||||||
|
|
||||||
class ServiceController(base.ServiceBase):
|
class ServiceController(base.ServiceBase):
|
@ -1,6 +1,6 @@
|
|||||||
"""CDN Extension for CDN"""
|
"""CDN Extension for CDN"""
|
||||||
|
|
||||||
from cdn.provider.mock import driver
|
from poppy.provider.mock import driver
|
||||||
|
|
||||||
# Hoist classes into package namespace
|
# Hoist classes into package namespace
|
||||||
Driver = driver.CDNProvider
|
Driver = driver.CDNProvider
|
@ -22,6 +22,6 @@ Field Mappings:
|
|||||||
updated and documented in each controller class.
|
updated and documented in each controller class.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from cdn.provider.mock import services
|
from poppy.provider.mock import services
|
||||||
|
|
||||||
ServiceController = services.ServiceController
|
ServiceController = services.ServiceController
|
@ -15,9 +15,9 @@
|
|||||||
|
|
||||||
"""CDN Provider implementation."""
|
"""CDN Provider implementation."""
|
||||||
|
|
||||||
from cdn.openstack.common import log as logging
|
from poppy.openstack.common import log as logging
|
||||||
from cdn.provider import base
|
from poppy.provider import base
|
||||||
from cdn.provider.mock import controllers
|
from poppy.provider.mock import controllers
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
@ -13,7 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from cdn.provider import base
|
from poppy.provider import base
|
||||||
|
|
||||||
|
|
||||||
class ServiceController(base.ServiceBase):
|
class ServiceController(base.ServiceBase):
|
@ -13,8 +13,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from cdn.storage.base import driver
|
from poppy.storage.base import driver
|
||||||
from cdn.storage.base import services
|
from poppy.storage.base import services
|
||||||
|
|
||||||
|
|
||||||
Driver = driver.StorageDriverBase
|
Driver = driver.StorageDriverBase
|
@ -16,7 +16,7 @@
|
|||||||
import abc
|
import abc
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from cdn.storage.base import controller
|
from poppy.storage.base import controller
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
@six.add_metaclass(abc.ABCMeta)
|
@ -1,6 +1,6 @@
|
|||||||
"""MongoDB Storage Driver for CDN"""
|
"""MongoDB Storage Driver for CDN"""
|
||||||
|
|
||||||
from cdn.storage.cassandra import driver
|
from poppy.storage.cassandra import driver
|
||||||
|
|
||||||
# Hoist classes into package namespace
|
# Hoist classes into package namespace
|
||||||
Driver = driver.CassandraStorageDriver
|
Driver = driver.CassandraStorageDriver
|
@ -23,6 +23,6 @@ Field Mappings:
|
|||||||
updated and documented in each controller class.
|
updated and documented in each controller class.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from cdn.storage.cassandra import services
|
from poppy.storage.cassandra import services
|
||||||
|
|
||||||
ServicesController = services.ServicesController
|
ServicesController = services.ServicesController
|
@ -17,10 +17,10 @@
|
|||||||
|
|
||||||
from cassandra.cluster import Cluster
|
from cassandra.cluster import Cluster
|
||||||
|
|
||||||
from cdn.common import decorators
|
from poppy.common import decorators
|
||||||
from cdn.openstack.common import log as logging
|
from poppy.openstack.common import log as logging
|
||||||
from cdn.storage import base
|
from poppy.storage import base
|
||||||
from cdn.storage.cassandra import controllers
|
from poppy.storage.cassandra import controllers
|
||||||
|
|
||||||
from oslo.config import cfg
|
from oslo.config import cfg
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ LOG = logging.getLogger(__name__)
|
|||||||
|
|
||||||
CASSANDRA_OPTIONS = [
|
CASSANDRA_OPTIONS = [
|
||||||
cfg.ListOpt('cluster', help='Cassandra Cluster contact points'),
|
cfg.ListOpt('cluster', help='Cassandra Cluster contact points'),
|
||||||
cfg.StrOpt('keyspace', default='cdn',
|
cfg.StrOpt('keyspace', default='poppy',
|
||||||
help='Keyspace for all queries made in session'),
|
help='Keyspace for all queries made in session'),
|
||||||
]
|
]
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
CREATE KEYSPACE cdn WITH REPLICATION = { 'class' : 'SimpleStrategy' , 'replication_factor' : 1} ;
|
CREATE KEYSPACE poppy WITH REPLICATION = { 'class' : 'SimpleStrategy' , 'replication_factor' : 1} ;
|
||||||
USE cdn;
|
USE poppy;
|
||||||
|
|
||||||
CREATE TABLE services (
|
CREATE TABLE services (
|
||||||
project_id VARCHAR,
|
project_id VARCHAR,
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from cdn.storage import base
|
from poppy.storage import base
|
||||||
|
|
||||||
CQL_GET_ALL_SERVICES = '''
|
CQL_GET_ALL_SERVICES = '''
|
||||||
SELECT project_id,
|
SELECT project_id,
|
@ -1,6 +1,6 @@
|
|||||||
"""Storage Driver for CDN"""
|
"""Storage Driver for CDN"""
|
||||||
|
|
||||||
from cdn.storage.mockdb import driver
|
from poppy.storage.mockdb import driver
|
||||||
|
|
||||||
# Hoist classes into package namespace
|
# Hoist classes into package namespace
|
||||||
Driver = driver.MockDBStorageDriver
|
Driver = driver.MockDBStorageDriver
|
@ -23,6 +23,6 @@ Field Mappings:
|
|||||||
updated and documented in each controller class.
|
updated and documented in each controller class.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from cdn.storage.mockdb import services
|
from poppy.storage.mockdb import services
|
||||||
|
|
||||||
ServicesController = services.ServicesController
|
ServicesController = services.ServicesController
|
@ -15,17 +15,17 @@
|
|||||||
|
|
||||||
"""Storage driver implementation."""
|
"""Storage driver implementation."""
|
||||||
|
|
||||||
from cdn.common import decorators
|
from poppy.common import decorators
|
||||||
from cdn.openstack.common import log as logging
|
from poppy.openstack.common import log as logging
|
||||||
from cdn.storage import base
|
from poppy.storage import base
|
||||||
from cdn.storage.mockdb import controllers
|
from poppy.storage.mockdb import controllers
|
||||||
|
|
||||||
from oslo.config import cfg
|
from oslo.config import cfg
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
MOCKDB_OPTIONS = [
|
MOCKDB_OPTIONS = [
|
||||||
cfg.StrOpt('database', default='cdn',
|
cfg.StrOpt('database', default='poppy',
|
||||||
help='Database for all queries made in session')
|
help='Database for all queries made in session')
|
||||||
]
|
]
|
||||||
|
|
@ -13,7 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from cdn.storage import base
|
from poppy.storage import base
|
||||||
|
|
||||||
|
|
||||||
class ServicesController(base.ServicesController):
|
class ServicesController(base.ServicesController):
|
@ -1,6 +1,6 @@
|
|||||||
"""MongoDB Storage Driver for CDN"""
|
"""MongoDB Storage Driver for CDN"""
|
||||||
|
|
||||||
from cdn.storage.mongodb import driver
|
from poppy.storage.mongodb import driver
|
||||||
|
|
||||||
# Hoist classes into package namespace
|
# Hoist classes into package namespace
|
||||||
Driver = driver.MongoDBStorageDriver
|
Driver = driver.MongoDBStorageDriver
|
@ -22,6 +22,6 @@ Field Mappings:
|
|||||||
updated and documented in each controller class.
|
updated and documented in each controller class.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from cdn.storage.mongodb import services
|
from poppy.storage.mongodb import services
|
||||||
|
|
||||||
ServicesController = services.ServicesController
|
ServicesController = services.ServicesController
|
@ -18,10 +18,10 @@
|
|||||||
import pymongo
|
import pymongo
|
||||||
import pymongo.errors
|
import pymongo.errors
|
||||||
|
|
||||||
from cdn.common import decorators
|
from poppy.common import decorators
|
||||||
from cdn.openstack.common import log as logging
|
from poppy.openstack.common import log as logging
|
||||||
from cdn.storage import base
|
from poppy.storage import base
|
||||||
from cdn.storage.mongodb import controllers
|
from poppy.storage.mongodb import controllers
|
||||||
|
|
||||||
from oslo.config import cfg
|
from oslo.config import cfg
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ MONGODB_OPTIONS = [
|
|||||||
# Database name
|
# Database name
|
||||||
# TODO(kgriffs): Consider local sharding across DBs to mitigate
|
# TODO(kgriffs): Consider local sharding across DBs to mitigate
|
||||||
# per-DB locking latency.
|
# per-DB locking latency.
|
||||||
cfg.StrOpt('database', default='cdn', help='Database name'),
|
cfg.StrOpt('database', default='poppy', help='Database name'),
|
||||||
|
|
||||||
cfg.IntOpt('max_attempts', default=1000,
|
cfg.IntOpt('max_attempts', default=1000,
|
||||||
help=('Maximum number of times to retry a failed operation.'
|
help=('Maximum number of times to retry a failed operation.'
|
@ -14,7 +14,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
# stevedore/example/simple.py
|
# stevedore/example/simple.py
|
||||||
from cdn.storage import base
|
from poppy.storage import base
|
||||||
|
|
||||||
|
|
||||||
class ServicesController(base.ServicesController):
|
class ServicesController(base.ServicesController):
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
"""CDN Transport Drivers"""
|
"""CDN Transport Drivers"""
|
||||||
|
|
||||||
from cdn.transport import base
|
from poppy.transport import base
|
||||||
|
|
||||||
|
|
||||||
# Hoist into package namespace
|
# Hoist into package namespace
|
@ -18,7 +18,7 @@
|
|||||||
This app should be used by external WSGI
|
This app should be used by external WSGI
|
||||||
containers. For example:
|
containers. For example:
|
||||||
|
|
||||||
$ gunicorn cdn.transport.app:app
|
$ gunicorn poppy.transport.app:app
|
||||||
|
|
||||||
NOTE: As for external containers, it is necessary
|
NOTE: As for external containers, it is necessary
|
||||||
to put config files in the standard paths. There's
|
to put config files in the standard paths. There's
|
||||||
@ -28,10 +28,10 @@ to the WSGI app when it is called from other apps.
|
|||||||
|
|
||||||
from oslo.config import cfg
|
from oslo.config import cfg
|
||||||
|
|
||||||
from cdn import bootstrap
|
from poppy import bootstrap
|
||||||
|
|
||||||
|
|
||||||
conf = cfg.CONF
|
conf = cfg.CONF
|
||||||
conf(project='cdn', prog='cdn', args=[])
|
conf(project='poppy', prog='poppy', args=[])
|
||||||
|
|
||||||
app = bootstrap.Bootstrap(conf).transport.app
|
app = bootstrap.Bootstrap(conf).transport.app
|
@ -1,6 +1,6 @@
|
|||||||
"""Falcon Transport Driver"""
|
"""Falcon Transport Driver"""
|
||||||
|
|
||||||
from cdn.transport.falcon import driver
|
from poppy.transport.falcon import driver
|
||||||
|
|
||||||
# Hoist into package namespace
|
# Hoist into package namespace
|
||||||
Driver = driver.TransportDriver
|
Driver = driver.TransportDriver
|
@ -18,7 +18,7 @@
|
|||||||
This app should be used by external WSGI
|
This app should be used by external WSGI
|
||||||
containers. For example:
|
containers. For example:
|
||||||
|
|
||||||
$ gunicorn cdn.transport.falcon.app:app
|
$ gunicorn poppy.transport.falcon.app:app
|
||||||
|
|
||||||
NOTE: As for external containers, it is necessary
|
NOTE: As for external containers, it is necessary
|
||||||
to put config files in the standard paths. There's
|
to put config files in the standard paths. There's
|
||||||
@ -26,10 +26,11 @@ no common way to specify / pass configuration files
|
|||||||
to the WSGI app when it is called from other apps.
|
to the WSGI app when it is called from other apps.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from cdn import bootstrap
|
|
||||||
from oslo.config import cfg
|
from oslo.config import cfg
|
||||||
|
|
||||||
|
from poppy import bootstrap
|
||||||
|
|
||||||
conf = cfg.CONF
|
conf = cfg.CONF
|
||||||
conf(project='cdn', prog='cdn', args=[])
|
conf(project='poppy', prog='poppy', args=[])
|
||||||
|
|
||||||
app = bootstrap.Bootstrap(conf).transport.app
|
app = bootstrap.Bootstrap(conf).transport.app
|
@ -20,9 +20,9 @@ import falcon
|
|||||||
from oslo.config import cfg
|
from oslo.config import cfg
|
||||||
import six
|
import six
|
||||||
|
|
||||||
import cdn.openstack.common.log as logging
|
import poppy.openstack.common.log as logging
|
||||||
from cdn import transport
|
from poppy import transport
|
||||||
from cdn.transport.falcon import (
|
from poppy.transport.falcon import (
|
||||||
v1, services
|
v1, services
|
||||||
)
|
)
|
||||||
|
|
@ -19,7 +19,7 @@ import json
|
|||||||
# NOTE(amitgandhinz): http://tools.ietf.org/html/draft-nottingham-json-home-03
|
# NOTE(amitgandhinz): http://tools.ietf.org/html/draft-nottingham-json-home-03
|
||||||
JSON_HOME = {
|
JSON_HOME = {
|
||||||
"resources": {
|
"resources": {
|
||||||
"rel/cdn": {
|
"rel/poppy": {
|
||||||
"href-template": "services{?marker,limit}",
|
"href-template": "services{?marker,limit}",
|
||||||
"href-vars": {
|
"href-vars": {
|
||||||
"marker": "param/marker",
|
"marker": "param/marker",
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
"""Pecan Transport Driver"""
|
"""Pecan Transport Driver"""
|
||||||
|
|
||||||
from cdn.transport.pecan import driver
|
from poppy.transport.pecan import driver
|
||||||
|
|
||||||
|
|
||||||
# Hoist into package namespace
|
# Hoist into package namespace
|
@ -15,9 +15,9 @@
|
|||||||
|
|
||||||
"""Pecan Controllers"""
|
"""Pecan Controllers"""
|
||||||
|
|
||||||
from cdn.transport.pecan.controllers import root
|
from poppy.transport.pecan.controllers import root
|
||||||
from cdn.transport.pecan.controllers import services
|
from poppy.transport.pecan.controllers import services
|
||||||
from cdn.transport.pecan.controllers import v1
|
from poppy.transport.pecan.controllers import v1
|
||||||
|
|
||||||
|
|
||||||
# Hoist into package namespace
|
# Hoist into package namespace
|
@ -17,7 +17,7 @@ import re
|
|||||||
|
|
||||||
import pecan
|
import pecan
|
||||||
|
|
||||||
from cdn.transport.pecan.controllers import base
|
from poppy.transport.pecan.controllers import base
|
||||||
|
|
||||||
|
|
||||||
class RootController(base.Controller):
|
class RootController(base.Controller):
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user