Browse Source

Change Smaug to Karbor

There was a decision in the community to change the project name.

Change-Id: I8b3d538b9573ebaa2a873f4696e1f1a500c941a8
changes/24/354024/5
chenying 5 years ago
parent
commit
1c60dac7fa
  1. 4
      .coveragerc
  2. 2
      .gitreview
  3. 2
      .testr.conf
  4. 2
      CONTRIBUTING.rst
  5. 2
      HACKING.rst
  6. 2
      MANIFEST.in
  7. 16
      README.rst
  8. 0
      doc/images/Karbor.png
  9. 0
      doc/images/KarborInPieces.png
  10. 4
      doc/images/available_protectables.svg
  11. 2
      doc/images/class_diagram.svg
  12. 0
      doc/images/karbor-api.png
  13. 2
      doc/source/api/api_examples.md
  14. 14
      doc/source/api/bank.md
  15. 2
      doc/source/api/class_diagram.pu
  16. 6
      doc/source/api/karbor_api.v1.yaml
  17. 2
      doc/source/conf.py
  18. 8
      doc/source/index.rst
  19. 16
      doc/source/installation.rst
  20. 78
      doc/source/readme.rst
  21. 20
      doc/source/specs/api-service.rst
  22. 4
      doc/source/specs/available_protectables.pu
  23. 4
      doc/source/specs/bank-plugin-lease.rst
  24. 4
      doc/source/specs/index.rst
  25. 4
      doc/source/specs/operation-engine/operation_engine_design.rst
  26. 22
      doc/source/specs/pluggable_protection_provider.rst
  27. 2
      doc/source/specs/protection-service/activities-links.svg
  28. 2
      doc/source/specs/protection-service/protect-rpc-call-seq-diagram.pu
  29. 16
      doc/source/specs/protection-service/protection-service.rst
  30. 6
      doc/source/specs/template.rst
  31. 32
      doc/source/usage.rst
  32. 16
      etc/api-paste.ini
  33. 8
      etc/karbor.conf
  34. 6
      etc/providers.d/openstack-infra.conf
  35. 2
      karbor/__init__.py
  36. 0
      karbor/api/__init__.py
  37. 18
      karbor/api/common.py
  38. 0
      karbor/api/middleware/__init__.py
  39. 18
      karbor/api/middleware/auth.py
  40. 0
      karbor/api/openstack/__init__.py
  41. 14
      karbor/api/openstack/wsgi.py
  42. 0
      karbor/api/v1/__init__.py
  43. 42
      karbor/api/v1/plans.py
  44. 24
      karbor/api/v1/protectables.py
  45. 34
      karbor/api/v1/providers.py
  46. 38
      karbor/api/v1/restores.py
  47. 16
      karbor/api/v1/router.py
  48. 32
      karbor/api/v1/scheduled_operations.py
  49. 32
      karbor/api/v1/triggers.py
  50. 2
      karbor/api/versions.py
  51. 0
      karbor/cmd/__init__.py
  52. 20
      karbor/cmd/api.py
  53. 36
      karbor/cmd/manage.py
  54. 18
      karbor/cmd/operationengine.py
  55. 18
      karbor/cmd/protection.py
  56. 0
      karbor/common/__init__.py
  57. 14
      karbor/common/config.py
  58. 0
      karbor/common/constants.py
  59. 36
      karbor/common/karbor_keystone_plugin.py
  60. 6
      karbor/context.py
  61. 4
      karbor/db/__init__.py
  62. 10
      karbor/db/api.py
  63. 2
      karbor/db/base.py
  64. 4
      karbor/db/migration.py
  65. 0
      karbor/db/sqlalchemy/__init__.py
  66. 10
      karbor/db/sqlalchemy/api.py
  67. 0
      karbor/db/sqlalchemy/migrate_repo/README
  68. 0
      karbor/db/sqlalchemy/migrate_repo/__init__.py
  69. 2
      karbor/db/sqlalchemy/migrate_repo/manage.py
  70. 2
      karbor/db/sqlalchemy/migrate_repo/migrate.cfg
  71. 0
      karbor/db/sqlalchemy/migrate_repo/versions/001_karbor_init.py
  72. 0
      karbor/db/sqlalchemy/migrate_repo/versions/__init__.py
  73. 30
      karbor/db/sqlalchemy/models.py
  74. 58
      karbor/exception.py
  75. 2
      karbor/i18n.py
  76. 2
      karbor/loadables.py
  77. 4
      karbor/manager.py
  78. 16
      karbor/objects/__init__.py
  79. 36
      karbor/objects/base.py
  80. 26
      karbor/objects/operation_log.py
  81. 26
      karbor/objects/plan.py
  82. 26
      karbor/objects/restore.py
  83. 26
      karbor/objects/scheduled_operation.py
  84. 24
      karbor/objects/scheduled_operation_log.py
  85. 26
      karbor/objects/scheduled_operation_state.py
  86. 26
      karbor/objects/service.py
  87. 20
      karbor/objects/trigger.py
  88. 6
      karbor/policy.py
  89. 0
      karbor/resource.py
  90. 8
      karbor/rpc.py
  91. 36
      karbor/service.py
  92. 0
      karbor/services/__init__.py
  93. 0
      karbor/services/operationengine/__init__.py
  94. 4
      karbor/services/operationengine/api.py
  95. 0
      karbor/services/operationengine/engine/__init__.py
  96. 0
      karbor/services/operationengine/engine/executors/__init__.py
  97. 0
      karbor/services/operationengine/engine/executors/base.py
  98. 12
      karbor/services/operationengine/engine/executors/scheduled_operation_executor.py
  99. 4
      karbor/services/operationengine/engine/executors/thread_pool_executor.py
  100. 8
      karbor/services/operationengine/engine/trigger_manager.py

4
.coveragerc

@ -1,7 +1,7 @@
[run]
branch = True
source = smaug
omit = smaug/tests/*,smaug/openstack/*
source = karbor
omit = karbor/tests/*,karbor/openstack/*
[report]
ignore_errors = True

2
.gitreview

@ -1,4 +1,4 @@
[gerrit]
host=review.openstack.org
port=29418
project=openstack/smaug.git
project=openstack/karbor.git

2
.testr.conf

@ -2,6 +2,6 @@
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./smaug/tests/unit} $LISTOPT $IDOPTION
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./karbor/tests/unit} $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

2
CONTRIBUTING.rst

@ -14,4 +14,4 @@ Pull requests submitted through GitHub will be ignored.
Bugs should be filed on Launchpad, not GitHub:
https://bugs.launchpad.net/smaug
https://bugs.launchpad.net/karbor

2
HACKING.rst

@ -1,4 +1,4 @@
smaug Style Commandments
karbor Style Commandments
===============================================
Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/

2
MANIFEST.in

@ -1,6 +1,6 @@
include AUTHORS
include ChangeLog
recursive-include smaug *.cfg
recursive-include karbor *.cfg
exclude .gitignore
exclude .gitreview

16
README.rst

@ -1,11 +1,11 @@
=====
Smaug
Karbor
=====
Application Data Protection as a Service for OpenStack
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/Smaug.png
:alt: Smaug
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/Karbor.png
:alt: Karbor
:width: 300
:height: 525
:align: center
@ -45,12 +45,12 @@ Links
*****
* Free software: Apache license
* Documentation: http://docs.openstack.org/developer/smaug
* Source: http://git.openstack.org/cgit/openstack/smaug
* Bugs: http://bugs.launchpad.net/smaug
* Documentation: http://docs.openstack.org/developer/karbor
* Source: http://git.openstack.org/cgit/openstack/karbor
* Bugs: http://bugs.launchpad.net/karbor
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/SmaugInPieces.png
:alt: Smaug
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/KarborInPieces.png
:alt: Karbor
:width: 200
:height: 525
:align: center

0
doc/images/Smaug.png → doc/images/Karbor.png

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

0
doc/images/SmaugInPieces.png → doc/images/KarborInPieces.png

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

4
doc/images/available_protectables.svg

@ -9,10 +9,10 @@
</filter>
</defs>
<g>
<text fill="#000000" font-family="sans-serif" font-size="18" lengthAdjust="spacingAndGlyphs" textLength="175" x="223" y="16.708">Smaug Protectables</text>
<text fill="#000000" font-family="sans-serif" font-size="18" lengthAdjust="spacingAndGlyphs" textLength="175" x="223" y="16.708">Karbor Protectables</text>
<polygon fill="#DDDDDD" points="43.5,28.9531,43.5,104.1406,576.5,104.1406,576.5,28.9531,43.5,28.9531" style="stroke: #000000; stroke-width: 1.0;" />
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="474" x="49.5" y="46.9482">This file contains the dependecy between protectables in the default</text>
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="514" x="49.5" y="63.2451">distribution of Smaug. The arrows, similar to inheritance point to the parent</text>
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="514" x="49.5" y="63.2451">distribution of Karbor. The arrows, similar to inheritance point to the parent</text>
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="521" x="49.5" y="79.542">since Protectables define what types they depend on so this reflects who is</text>
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="216" x="49.5" y="95.8389">responsible for the connection.</text>
<rect fill="#FEFECE" filter="url(#f1)" height="39.9688" style="stroke: #A80036; stroke-width: 1.5;" width="120" x="6" y="321.1406" />

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

2
doc/images/class_diagram.svg

@ -9,7 +9,7 @@
</filter>
</defs>
<g>
<text fill="#000000" font-family="sans-serif" font-size="18" lengthAdjust="spacingAndGlyphs" textLength="172" x="526.5" y="16.708">"Smaug API model"</text>
<text fill="#000000" font-family="sans-serif" font-size="18" lengthAdjust="spacingAndGlyphs" textLength="172" x="526.5" y="16.708">"Karbor API model"</text>
<rect fill="#FEFECE" filter="url(#f1)" height="86.4141" style="stroke: #A80036; stroke-width: 1.5;" width="136" x="1071" y="519.9531" />
<ellipse cx="1099.95" cy="535.9531" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;" />
<path d="M1102.9188,541.5938 Q1102.3406,541.8906 1101.7,542.0391 Q1101.0594,542.1875 1100.3563,542.1875 Q1097.8563,542.1875 1096.5359,540.5391 Q1095.2156,538.8906 1095.2156,535.7656 Q1095.2156,532.6406 1096.5359,530.9844 Q1097.8563,529.3281 1100.3563,529.3281 Q1101.0594,529.3281 1101.7078,529.4844 Q1102.3563,529.6406 1102.9188,529.9375 L1102.9188,532.6563 Q1102.2938,532.0781 1101.7,531.8047 Q1101.1063,531.5313 1100.4813,531.5313 Q1099.1375,531.5313 1098.45,532.6016 Q1097.7625,533.6719 1097.7625,535.7656 Q1097.7625,537.8594 1098.45,538.9297 Q1099.1375,540 1100.4813,540 Q1101.1063,540 1101.7,539.7266 Q1102.2938,539.4531 1102.9188,538.875 L1102.9188,541.5938 Z "

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

0
doc/images/smaug-api.png → doc/images/karbor-api.png

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 147 KiB

2
doc/source/api/api_examples.md

@ -1,4 +1,4 @@
# Smaug API #
# Karbor API #
----------

14
doc/source/api/bank.md

@ -2,17 +2,17 @@
*** :exclamation: This is still a work in progress ***
This document will describe the layout and algorithms used by Smaug using the
This document will describe the layout and algorithms used by Karbor using the
default bank implementation. Providers can use their own algorithms to manage
metdata but there might be issues when using default plugins.
## Abstract
Since Smaug want's to be able to store metadata in many locations (swift, mongodb, etc.)
Since Karbor want's to be able to store metadata in many locations (swift, mongodb, etc.)
we defined a simplified object store interface that we believe most backends will be able
to support without much work.
But the simplified interface doesn't describe how Smaug will do it's higher
But the simplified interface doesn't describe how Karbor will do it's higher
level operations and how the higher level logic will be laid out in the object
store. This is why we need higher level logic defined explicitly so that later
we could use higher level bank functions knowing they are correct, safe and atomic.
@ -80,7 +80,7 @@ Create new Checkpoint with id <CHECKPOINT-ID>;
* buffer:
```json
{
"smaug_version": "1.0.0",
"karbor_version": "1.0.0",
"status": "in_progress",
"plugins": {}
}
@ -92,7 +92,7 @@ Create new Checkpoint with id <CHECKPOINT-ID>;
* buffer:
```json
{
"smaug_version": "1.0.0",
"karbor_version": "1.0.0",
"status": "creating_indices",
"plugins": {}
}
@ -120,7 +120,7 @@ Create new Checkpoint with id <CHECKPOINT-ID>;
* buffer:
```json
{
"smaug_version": "1.0.0",
"karbor_version": "1.0.0",
"status": "deleting",
"plugins": {}
}
@ -131,7 +131,7 @@ or returned by the provider.
## GC
When deleting a checkpoint the checkpoint is only marked as deleted. On of the
Smaug server will have to run a GC collection run and make sure all the actual
Karbor server will have to run a GC collection run and make sure all the actual
data is free. This is done to unify all the cleanup to one flow and make sure
the deletion has been propagated to all sites before actually deleting the data.

2
doc/source/api/class_diagram.pu

@ -1,6 +1,6 @@
@startuml
title "Smaug API model"
title "Karbor API model"
class Protectable {
name: string

6
doc/source/api/smaug_api.v1.yaml → doc/source/api/karbor_api.v1.yaml

@ -1,9 +1,9 @@
swagger: '2.0'
info:
title: Smaug API
title: Karbor API
description: Protect all you hold dear
version: 0.99.0
host: api.smaug.nowhere.com
host: api.karbor.nowhere.com
schemes:
- https
basePath: /v1
@ -729,7 +729,7 @@ paths:
get:
summary: Operation log entry point.
description: |
Get the information about operation instances in smaug.
Get the information about operation instances in karbor.
Whenever an operation is run a log instance is created.
The user never creates operation logs.
This should not include the 'entires' property for the operation log.

2
doc/source/conf.py

@ -38,7 +38,7 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'smaug'
project = u'karbor'
copyright = u'2013, OpenStack Foundation'
# If true, '()' will be appended to :func: etc. cross-reference text.

8
doc/source/index.rst

@ -1,10 +1,10 @@
==================================
Smaug: Application Data Protection
Karbor: Application Data Protection
==================================
Introduction
============
Smaug is an OpenStack project that provides a pluggable framework for
Karbor is an OpenStack project that provides a pluggable framework for
protecting and restoring Data and Metadata that comprises an OpenStack-deployed
application - Application Data Protection as a Service.
@ -15,7 +15,7 @@ Application against loss/damage (e.g. backup, replication) by providing a
standard framework of APIs and services that allows vendors to provide plugins
through a unified interface
Using Smaug
Using Karbor
===========
.. toctree::
:maxdepth: 1
@ -26,7 +26,7 @@ Using Smaug
contributing
releasenotes
Smaug Specs
Karbor Specs
===========
.. toctree::
:maxdepth: 1

16
doc/source/installation.rst

@ -4,18 +4,18 @@ Installation
Single-node Devstack Installation
=================================
In order to install Smaug using Devstack on a single node, add the following to
In order to install Karbor using Devstack on a single node, add the following to
your local.conf, under [[local|localrc]]:
.. code-block:: none
enable_plugin smaug http://git.openstack.org/openstack/smaug master
enable_plugin smaug-dashboard http://git.openstack.org/openstack/smaug-dashboard master
enable_service smaug-api
enable_service smaug-operationengine
enable_service smaug-protection
# Smaug Dashboard depends on Horizon
enable_service smaug-dashboard
enable_plugin karbor http://git.openstack.org/openstack/karbor master
enable_plugin karbor-dashboard http://git.openstack.org/openstack/karbor-dashboard master
enable_service karbor-api
enable_service karbor-operationengine
enable_service karbor-protection
# Karbor Dashboard depends on Horizon
enable_service karbor-dashboard
Depenencies
===========

78
doc/source/readme.rst

@ -5,15 +5,15 @@ Introduction
.. contents:: :depth: 2
What is Smaug?
What is Karbor?
==============
Smaug is an OpenStack project that provides a pluggable framework for
Karbor is an OpenStack project that provides a pluggable framework for
protecting and restoring Data and Metadata that comprises an OpenStack-deployed
application - Application Data Protection as a Service.
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/Smaug.png
:alt: Smaug
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/Karbor.png
:alt: Karbor
:align: center
:height: 150px
@ -33,7 +33,7 @@ Typical Use Case: 3-Tier Cloud App
3-Tier Cloud App Web/App/DB
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/3-tirApp.png
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/3-tirApp.png
:alt: 3-Tier Cloud App
:width: 600
:align: center
@ -42,13 +42,13 @@ In order to provide full Protection for this typical use case, we would have to
protect many resources, which have some dependency between them. The following
diagram demonstrates how this dependency looks, in the form of a tree:
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/resource_tree_architecture.png
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/resource_tree_architecture.png
:alt: Resource Tree
:width: 600
:align: center
These resources can be divided into groups, each of which will be handled by a
different plugin in Smaug:
different plugin in Karbor:
- Volume
- VM
@ -62,7 +62,7 @@ Main Concepts
Protection Providers
-----------------------
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/
protection_provider.png
:width: 600
@ -77,7 +77,7 @@ each protection provider exposes what options it provides for each protectable.
This allows the UI to dynamically adapt to each provider and show the user what
options are available, what they mean and what values are supported.
This allows us to extend the providers without updates to Smaug and allow
This allows us to extend the providers without updates to Karbor and allow
provider implementation to easily add specialize options.
Example
@ -112,12 +112,12 @@ provider.
There are two main aspect to protection plan. The first is the continuous
aspect. When a plans is started it becomes enabled and continues protection
processes are started and monitored (eg. replication). As long as the plan is
active Smaug will try and make sure the continuous aspects are active and valid.
active Karbor will try and make sure the continuous aspects are active and valid.
The other aspect is point in time protection or, as we call them in Smaug,
The other aspect is point in time protection or, as we call them in Karbor,
checkpoints. Checkpoints are saved in the protection provider paired with the
plan and, as stated, represent a restorable point in time for the plan. When a
checkpoint is created Smaug will store in the protection provider all the
checkpoint is created Karbor will store in the protection provider all the
information required to successfully restore the project covered by the plan
to how it was at that specific point in time.
@ -139,16 +139,16 @@ complex retention plan to automate the creation and deletion of checkpoints.
Protectables
------------
Protectabes are any class or type of entity that can be protected by Smaug.
Since setups might have different entities they would like to protect Smaug
Protectabes are any class or type of entity that can be protected by Karbor.
Since setups might have different entities they would like to protect Karbor
doesn't bind the API to specific entity types. The admin can even add new
protectables during set up as long as the protection provider can handle those
entities. This flexibility means that Smaug is agnostic to the relationship
entities. This flexibility means that Karbor is agnostic to the relationship
between the resources being backed up.
High Level Architecture
=======================
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/
high_level_architecture.png
:alt: Solution Overview
:width: 600
@ -157,15 +157,15 @@ High Level Architecture
The system is built from independent services and a scalable *Workflow
engine* that ties them together:
Smaug API Service
Karbor API Service
=================
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/
smaug-api.png
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/
karbor-api.png
:width: 600
These top-level north-bound APIs expose Application Data Protection services to
the Smaug user.
the Karbor user.
The purpose of the services is to maximize flexibility and accommodate for
(hopefully) any kind of protection for any type of resource, whether it is a
@ -177,21 +177,21 @@ a hardware device, an external database, etc.).
Resource (Protectable) API
---------------------------
Enables the Smaug user to access information about which resource types are
protectable (i.e. can be protected by Smaug). In addition, enables the user to
Enables the Karbor user to access information about which resource types are
protectable (i.e. can be protected by Karbor). In addition, enables the user to
get additional information on each resource type, such as a list of actual
instances and their dependencies.
Provider API
---------------
Enables the Smaug user to list available providers and get parameters and
Enables the Karbor user to list available providers and get parameters and
result schema super-set for all plugins of a specific Provider.
Plan API
--------
This API enables the Smaug user to access the protection Plan registry and do
This API enables the Karbor user to access the protection Plan registry and do
the following operations:
- Plan CRUD.
@ -201,7 +201,7 @@ the following operations:
Automatic Operation API
--------------------------
This API enables the Smaug user to manage protection Operations:
This API enables the Karbor user to manage protection Operations:
- Create a checkpoint for a given Protection Plan.
- Delete unneeded checkpoints from the provider.
@ -210,7 +210,7 @@ This API enables the Smaug user to manage protection Operations:
Checkpoint API
---------------
This API enables the Smaug user to access and manage the checkpoints stored in
This API enables the Karbor user to access and manage the checkpoints stored in
the protection provider:
- List all checkpoints given a Bank ID.
@ -221,11 +221,11 @@ the protection provider:
Restore API
---------------
This API enables the Smaug user restore a checkpoint on to a restore target:
This API enables the Karbor user restore a checkpoint on to a restore target:
- Create restored system from a checkpoint.
Smaug Schedule Service
Karbor Schedule Service
======================
This subsystem is responsible for scheduling and orchestrating the execution of
@ -256,7 +256,7 @@ triggers to begin the execution of the Plan Orchestration.
It can be done based on a Timer or an Event Collector - Open to implementation.
In the first version of Smaug reference implementation, it will only provide
In the first version of Karbor reference implementation, it will only provide
time-based triggering.
Scheduled Operation
@ -265,7 +265,7 @@ Scheduled Operation
The sub-component of the Schedule Service is responsible for holding the
mapping between a Trigger and Operation(s).
Smaug Protection Service
Karbor Protection Service
========================
This subsystem is responsible for handling the following tasks:
@ -282,20 +282,20 @@ flow of the plan across all protection providers.
Communication and Meetings
==========================
- Smaug Launchpad Link: \ https://launchpad.net/smaug
- Smaug Code Review: \ https://review.openstack.org/#/q/smaug+status:open,n,z
- Smaug Code Repository: \ https://github.com/openstack/smaug
- Smaug daily IRC Channel: #openstack-smaug
- Smaug weekly IRC Meeting on **even** Tuesday at 1500 UTC
- Karbor Launchpad Link: \ https://launchpad.net/karbor
- Karbor Code Review: \ https://review.openstack.org/#/q/karbor+status:open,n,z
- Karbor Code Repository: \ https://github.com/openstack/karbor
- Karbor daily IRC Channel: #openstack-karbor
- Karbor weekly IRC Meeting on **even** Tuesday at 1500 UTC
and on **odd** Tuesday at 0900 UTC in
#openstack-meeting at freenode: \
https://wiki.openstack.org/wiki/Meetings/smaug
- Smaug Trello Board: \ https://trello.com/b/Sudr4fKT/smaug
https://wiki.openstack.org/wiki/Meetings/karbor
- Karbor Trello Board: \ https://trello.com/b/Sudr4fKT/karbor
Additional references
=====================
- `OpenStack Tokyo Summit 2015 talk <http://www.slideshare.net/gampel/openstack-tokyo-talk-application-data-protection-service>`_
- `OpenStack Austin Summit 2016 talk <https://www.youtube.com/watch?v=_tVYuW_YMB8>`_
- `Smaug overview slide <https://docs.google.com/presentation/d/1JYO1VIlTkGTF6lvKEMcsHkaST3mYFxuarpcNTJ3HBhk/edit?usp=sharing>`_
- `Smaug overview blog <http://blog.gampel.net/2015/12/smaug-application-data-protection-for.html>`_
- `Karbor overview slide <https://docs.google.com/presentation/d/1JYO1VIlTkGTF6lvKEMcsHkaST3mYFxuarpcNTJ3HBhk/edit?usp=sharing>`_
- `Karbor overview blog <http://blog.gampel.net/2015/12/karbor-application-data-protection-for.html>`_

20
doc/source/specs/api-service.rst

@ -10,7 +10,7 @@ API Service
https://review.openstack.org/#/c/266338/
The APIs expose Application Data Protection services to the Smaug user.
The APIs expose Application Data Protection services to the Karbor user.
The purpose of the services is to maximize flexibility and accommodate
for (hopefully) any kind of protection for any type of resource, whether
@ -27,35 +27,35 @@ WSGI Resources Controller
The WSGI Controller handles incoming web requests that are dispatched
from the WSGI application APIRouter.
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/api-service-class-diagram.png
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/api-service-class-diagram.png
From the module class graph, api service basically have following
resources Controller:
Provider Controller
---------------------------
Enables the Smaug user to list available providers and get parameters and
Enables the Karbor user to list available providers and get parameters and
result schema super-set for all plugins of a specific Provider.
Checkpoint Controller
---------------------------
Enables the Smaug user to access and manage the checkpoints stored
Enables the Karbor user to access and manage the checkpoints stored
in the protection provider.
Protectable Controller
---------------------------
Enables the Smaug user to access information about which resource types
are protectable (i.e. can be protected by Smaug).
Enables the Karbor user to access information about which resource types
are protectable (i.e. can be protected by Karbor).
In addition, enables the user to get additional information on each
resource type, such as a list of actual instances and their dependencies.
Plan Controller
---------------------------
This API enables the Smaug user to access the protection Plan registry
This API enables the Karbor user to access the protection Plan registry
and do the following operations:
- Plan CRUD.
- List Plans.
@ -65,7 +65,7 @@ and do the following operations:
Scheduled Operation Controller
--------------------------
This API enables the Smaug user to manage Scheduled Operations:
This API enables the Karbor user to manage Scheduled Operations:
- Operation CRUD.
- List Operations.
@ -73,7 +73,7 @@ This API enables the Smaug user to manage Scheduled Operations:
Trigger Controller
--------------------------
This API enables the Smaug user to manage Triggers:
This API enables the Karbor user to manage Triggers:
A trigger only can be deleted when it isn't used in any of the
scheduled operation.
- Trigger CRUD.
@ -83,7 +83,7 @@ scheduled operation.
Restore Controller
---------------------------
This API enables the Smaug user restore a checkpoint on to a restore target:
This API enables the Karbor user restore a checkpoint on to a restore target:
- Create restored system from a checkpoint.

4
doc/source/specs/available_protectables.pu

@ -1,12 +1,12 @@
@startuml
title Smaug Protectables
title Karbor Protectables
hide circle
legend top
This file contains the dependency between protectables in the default
distribution of Smaug. The arrows, similar to inheritance point to the parent
distribution of Karbor. The arrows, similar to inheritance point to the parent
since Protectables define what types they depend on so this reflects who is
responsible for the connection.
endlegend

4
doc/source/specs/bank-plugin-lease.rst

@ -7,7 +7,7 @@
=================
Bank Plugin Basic
=================
Bank Plugin is a component of smaug (an openstack project working as a service for data protection),
Bank Plugin is a component of karbor (an openstack project working as a service for data protection),
which is responsible for execute CRUD actions in Bank.
The bank is a backend (such as swift) which is used to store the metadata/data of protection plan.
@ -19,7 +19,7 @@ leases
Smuag will create a checkpoint when protecting a protection plan. This checkpoint is maintained with
status, which is a enum type: protecting, available, restoring, deleted, etc.
The status is used for smaug API layer to control access to one checkpoint from users.
The status is used for karbor API layer to control access to one checkpoint from users.
With the 'protecting' status, there're two cases which we can't tell the difference:

4
doc/source/specs/index.rst

@ -1,8 +1,8 @@
Smaug Specs
Karbor Specs
===========
This section contains detailed specification documents for
different features inside Smaug.
different features inside Karbor.
Contents:

4
doc/source/specs/operation-engine/operation_engine_design.rst

@ -8,9 +8,9 @@
Operation Engine
================
https://blueprints.launchpad.net/smaug/+spec/operation-engine-design
https://blueprints.launchpad.net/karbor/+spec/operation-engine-design
Operation Engine is one of components in Smaug, which is responsible for
Operation Engine is one of components in Karbor, which is responsible for
triggering the operations to execute when the time is up or event happens.
Problem description

22
doc/source/specs/pluggable_protection_provider.rst

@ -22,7 +22,7 @@
Pluggable Protection Provider
==========================================
https://blueprints.launchpad.net/smaug/+spec/protection-plugin-is-design
https://blueprints.launchpad.net/karbor/+spec/protection-plugin-is-design
Protection Provider
===================
@ -63,7 +63,7 @@ Protection Provider Configuration
Protection Providers are loaded from configuration files, placed in the
directory specified by the ``provider_config_dir`` configuration option (by
default: ``/etc/smaug/providers.d``). Each provider configuration file must
default: ``/etc/karbor/providers.d``). Each provider configuration file must
bear the ``.conf`` suffix and contain a ``[provider]`` section. This section
specifies the following configuration:
@ -85,11 +85,11 @@ For example::
name = Foo
id = 2e0c8826-81d6-44f5-bbe5-8f46a98c5845
description = Example Protection Provider
bank = smaug.protections.smaug-swift-bank-plugin
plugin = smaug.protections.smaug-volume-protection-plugin
plugin = smaug.protections.smaug-image-protection-plugin
plugin = smaug.protections.smaug-server-protection-plugin
plugin = smaug.protections.smaug-project-protection-plugin
bank = karbor.protections.karbor-swift-bank-plugin
plugin = karbor.protections.karbor-volume-protection-plugin
plugin = karbor.protections.karbor-image-protection-plugin
plugin = karbor.protections.karbor-server-protection-plugin
plugin = karbor.protections.karbor-project-protection-plugin
[swift_client]
bank_swift_auth_url = http://10.0.0.10:5000
@ -166,7 +166,7 @@ Notes:
else:
yield
.. figure:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/protection-service/activities-links.png
.. figure:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/protection-service/activities-links.png
:alt: Activities Links
:align: center
@ -186,11 +186,11 @@ This scheme decouples the tree structure from the task execution. A plugin that
handles multiple resources or that aggregates multiple resources to one task can
use this mechanism to only return tasks when appropriate for it's scheme.
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/pluggable_protection_provider.svg
:alt: Smaug
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/pluggable_protection_provider.svg
:alt: Karbor
:align: center
References
==========
1. `Class Diagram Source <http://raw.githubusercontent.com/openstack/smaug/master/doc/images/specs/pluggable_protection_provider.pu>`_
1. `Class Diagram Source <http://raw.githubusercontent.com/openstack/karbor/master/doc/images/specs/pluggable_protection_provider.pu>`_
2. `Dependency graph building algorithm <https://docs.google.com/document/d/1Mkd9RgUVdiRL6iei8Nqzzx4xteKIcd-yjMLEkV4Jc9s/edit#>`_

2
doc/source/specs/protection-service/activities-links.svg

@ -16,7 +16,7 @@
width="630"
height="400"
style="fill:none;stroke:none;stroke-linecap:square;stroke-miterlimit:10"
inkscape:export-filename="/home/yuvalbr/src/smaug/doc/images/protection-service/activities-links.png"
inkscape:export-filename="/home/yuvalbr/src/karbor/doc/images/protection-service/activities-links.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<metadata

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

2
doc/source/specs/protection-service/protect-rpc-call-seq-diagram.pu

@ -2,7 +2,7 @@
title create_checkpoint - API RPC call Sequence Diagram
Smaug_API_Service ->> ProtectionManager :create_checkpoint(backup_plan, protect)
Karbor_API_Service ->> ProtectionManager :create_checkpoint(backup_plan, protect)
ProtectionManager -> WorkflowEngine:built task flow
ProtectionManager -> WorkflowEngine: execute task flow
WorkflowEngine -> CreateCheckpointTask:execute()

16
doc/source/specs/protection-service/protection-service.rst

@ -8,13 +8,13 @@
Protection Service Basics
====================================
https://bugs.launchpad.net/smaug/+bug/1529199
https://bugs.launchpad.net/karbor/+bug/1529199
Protection Service is a component of smaug (an openstack project working as a
Protection Service is a component of karbor (an openstack project working as a
service for data protection), which is responsible to execute
protect/restore/other actions on operations (triggered plans).
Architecturally, it acts as a RPC server role for smaug API service to actually
Architecturally, it acts as a RPC server role for karbor API service to actually
execute the actions on triggered operations.
It's also the role who actually cooperates with protection plugins provided by
@ -29,7 +29,7 @@ the graph task flow.
RPC interfaces
================================================
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/protection-service/protection-architecture.png
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/protection-service/protection-architecture.png
From the module graph, protection service basically provide following RPC
calls:
@ -56,7 +56,7 @@ Checkpoint RPC:
Main Concept
============
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/protection-service/class-diagram.png
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/protection-service/class-diagram.png
Protection Manager
@ -80,7 +80,7 @@ CheckpointCollection
--------------------
Entity to manage checkpoints, which provides CRUD interfaces to handle
checkpoint. As checkpoint is a smaug internal entity, one checkpoint operation
checkpoint. As checkpoint is a karbor internal entity, one checkpoint operation
is actually composed by combination of several BankPlugin atomic operations.
Take create_checkpoint as example, it will first acquire write lease (there
@ -96,9 +96,9 @@ call to Protection Service.
Let's take action protect as the example and analyze the sequence together with
the class graph:
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/protection-service/protect-rpc-call-seq-diagram.png
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/protection-service/protect-rpc-call-seq-diagram.png
1. Smaug **Operation Engine**
1. Karbor **Operation Engine**
------------------------------
who is responsible for triggering operation according to time schedule or
events, will call RPC call of Protection Service:

6
doc/source/specs/template.rst

@ -10,7 +10,7 @@ Example Spec - The title of your RFE
Include the URL of your launchpad RFE:
https://bugs.launchpad.net/smaug/+bug/example-id
https://bugs.launchpad.net/karbor/+bug/example-id
Introduction paragraph -- why are we doing this feature? A single paragraph of
prose that **deployers, and developers, and operators** can understand.
@ -44,7 +44,7 @@ design at the same time as use cases, if desired. Note that by high-level,
we mean the "view from orbit" rough cut at how things will happen.
This section should 'scope' the effort from a feature standpoint: how is the
'Smaug end-to-end system' going to look like after this change? What Smaug
'Karbor end-to-end system' going to look like after this change? What Karbor
areas do you intend to touch and how do you intend to work on them?
@ -143,7 +143,7 @@ but we're mostly trying to understand the timeline for implementation.
Dependencies
============
* Include specific references to specs and/or blueprints in Smaug, or in other
* Include specific references to specs and/or blueprints in Karbor, or in other
projects, that this one either depends on or is related to.
* If this requires functionality of another project that is not currently used

32
doc/source/usage.rst

@ -1,12 +1,12 @@
=============
Usage Example
=============
Resources in OpenStack (server, volume, image, network, etc) can be protected by Smaug.
Resources in OpenStack (server, volume, image, network, etc) can be protected by Karbor.
This example will show protecting volume.
#. Before starting the smaug-protection service, the admin needs to configure a
Provider in /etc/smaug/providers.d/openstack-infra.conf. The Swift plugin is
#. Before starting the karbor-protection service, the admin needs to configure a
Provider in /etc/karbor/providers.d/openstack-infra.conf. The Swift plugin is
the default bank plugin. The admin also needs to configure the basic Swift
client account configuration::
@ -15,8 +15,8 @@ This example will show protecting volume.
name = OS Infra Provider
description = This provider uses OpenStack's own services (swift, cinder) as storage
id = cf56bd3e-97a7-4078-b6d5-f36246333fd9
plugin=smaug-volume-protection-plugin
bank=smaug-swift-bank-plugin
plugin=karbor-volume-protection-plugin
bank=karbor-swift-bank-plugin
[swift_client]
swift_auth_url=http://10.229.47.230:5000/v2.0/
@ -27,7 +27,7 @@ This example will show protecting volume.
#. To use cinder or smaug client, we should provide Keystone authentication
#. To use cinder or karbor client, we should provide Keystone authentication
variables::
export OS_USERNAME=admin
@ -37,7 +37,7 @@ This example will show protecting volume.
#. Show the provider information::
smaug provider-show cf56bd3e-97a7-4078-b6d5-f36246333fd9
karbor provider-show cf56bd3e-97a7-4078-b6d5-f36246333fd9
+----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property | Value |
+----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@ -61,7 +61,7 @@ This example will show protecting volume.
#. List the protectable resources::
smaug protectable-list
karbor protectable-list
+-----------------------+
| Protectable type |
+-----------------------+
@ -70,7 +70,7 @@ This example will show protecting volume.
| OS::Nova::Server |
+-----------------------+
smaug protectable-list-instances OS::Cinder::Volume
karbor protectable-list-instances OS::Cinder::Volume
+--------------------------------------+--------------------+---------------------+
| Id | Type | Dependent resources |
+--------------------------------------+--------------------+---------------------+
@ -81,7 +81,7 @@ This example will show protecting volume.
#. Create a protection plan with a provider and resources::
smaug plan-create 'OS volumes protection plan.' 'cf56bd3e-97a7-4078-b6d5-f36246333fd9' 'd107b234-e16d-4e1e-800d-86523c693e5c'='OS::Cinder::Volume'='volume2','c468688b-dcb1-4bdf-b26b-62e989ac940e'='OS::Cinder::Volume'='volume1'
karbor plan-create 'OS volumes protection plan.' 'cf56bd3e-97a7-4078-b6d5-f36246333fd9' 'd107b234-e16d-4e1e-800d-86523c693e5c'='OS::Cinder::Volume'='volume2','c468688b-dcb1-4bdf-b26b-62e989ac940e'='OS::Cinder::Volume'='volume1'
+-------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property | Value |
+-------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@ -95,7 +95,7 @@ This example will show protecting volume.
#. Execute a protect operation manually with a plan::
smaug checkpoint-create cf56bd3e-97a7-4078-b6d5-f36246333fd9 b5969bb9-c571-4538-b827-3746d11aa7a2
karbor checkpoint-create cf56bd3e-97a7-4078-b6d5-f36246333fd9 b5969bb9-c571-4538-b827-3746d11aa7a2
+-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property | Value |
@ -115,18 +115,18 @@ This example will show protecting volume.
| 58811e5a-d65f-4d1e-8e3d-2e7f1b688c32 | c468688b-dcb1-4bdf-b26b-62e989ac940e | available | test_protect | 1 | 22 | volumebackups |
| de4bbdab-315b-40f3-b89a-25a23c387e04 | d107b234-e16d-4e1e-800d-86523c693e5c | available | test_protect | 1 | 22 | volumebackups |
+--------------------------------------+--------------------------------------+-----------+--------------+------+--------------+---------------+
smaug checkpoint-show cf56bd3e-97a7-4078-b6d5-f36246333fd9 503e12db-a815-4101-b526-6b687ba60080
karbor checkpoint-show cf56bd3e-97a7-4078-b6d5-f36246333fd9 503e12db-a815-4101-b526-6b687ba60080
#. Execute a protect operation automatically with a scheduler::
smaug trigger-create 'My Trigger' 'time' "pattern"="0 20 * * 2":"format"="crontab"
smaug scheduledoperation-create 'Protect with My Trigger' 'protect' <trigger_id> "plan_id"="b5969bb9-c571-4538-b827-3746d11aa7a2":"provider_id"="cf56bd3e-97a7-4078-b6d5-f36246333fd9"
karbor trigger-create 'My Trigger' 'time' "pattern"="0 20 * * 2":"format"="crontab"
karbor scheduledoperation-create 'Protect with My Trigger' 'protect' <trigger_id> "plan_id"="b5969bb9-c571-4538-b827-3746d11aa7a2":"provider_id"="cf56bd3e-97a7-4078-b6d5-f36246333fd9"
#. Execute a restore operation manually with a checkpoint id::
smaug --debug restore-create cf56bd3e-97a7-4078-b6d5-f36246333fd9 2c14b9d6-529b-4308-bb17-7334eb351fd7 'http://10.229.47.230:35357/v2.0/' --parameters 'username'='admin' 'password'='123456'
karbor --debug restore-create cf56bd3e-97a7-4078-b6d5-f36246333fd9 2c14b9d6-529b-4308-bb17-7334eb351fd7 'http://10.229.47.230:35357/v2.0/' --parameters 'username'='admin' 'password'='123456'
+----------------+-------------------------------------------------+
| Property | Value |
+----------------+-------------------------------------------------+
@ -159,7 +159,7 @@ This example will show protecting volume.
| de4bbdab-315b-40f3-b89a-25a23c387e04 | d107b234-e16d-4e1e-800d-86523c693e5c | available | test_protect | 1 | 22 | volumebackups |
+--------------------------------------+--------------------------------------+-----------+--------------+------+--------------+---------------+
smaug checkpoint-delete cf56bd3e-97a7-4078-b6d5-f36246333fd9 2c14b9d6-529b-4308-bb17-7334eb351fd7
karbor checkpoint-delete cf56bd3e-97a7-4078-b6d5-f36246333fd9 2c14b9d6-529b-4308-bb17-7334eb351fd7
cinder backup-list
+----+-----------+--------+------+------+--------------+-----------+

16
etc/api-paste.ini

@ -2,13 +2,13 @@
# OpenStack #
#############
[composite:osapi_smaug]
[composite:osapi_karbor]
use = egg:Paste#urlmap
/: apiversions
/v1: openstack_smaug_api_v1
/v1: openstack_karbor_api_v1
[composite:openstack_smaug_api_v1]
use = call:smaug.api.middleware.auth:pipeline_factory
[composite:openstack_karbor_api_v1]
use = call:karbor.api.middleware.auth:pipeline_factory
noauth = request_id catch_errors noauth apiv1
keystone = request_id catch_errors authtoken keystonecontext apiv1
@ -19,16 +19,16 @@ paste.filter_factory = oslo_middleware:RequestId.factory
paste.filter_factory = oslo_middleware:CatchErrors.factory
[filter:noauth]
paste.filter_factory = smaug.api.middleware.auth:NoAuthMiddleware.factory
paste.filter_factory = karbor.api.middleware.auth:NoAuthMiddleware.factory
[filter:keystonecontext]
paste.filter_factory = smaug.api.middleware.auth:SmaugKeystoneContext.factory
paste.filter_factory = karbor.api.middleware.auth:KarborKeystoneContext.factory
[filter:authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
[app:apiversions]
paste.app_factory = smaug.api.versions:Versions.factory
paste.app_factory = karbor.api.versions:Versions.factory
[app:apiv1]
paste.app_factory = smaug.api.v1.router:APIRouter.factory
paste.app_factory = karbor.api.v1.router:APIRouter.factory

8
etc/smaug.conf → etc/karbor.conf

@ -1,17 +1,17 @@
[keystone_authtoken]
#signing_dir = /var/cache/smaug
#signing_dir = /var/cache/karbor
#cafile = /opt/stack/data/ca-bundle.pem
#auth_uri = http://192.168.1.102:5000
#project_domain_id = default
#project_name = service
#user_domain_id = default
#password = nomoresecrete
#username = smaug
#username = karbor
#auth_url = http://http://192.168.1.102:35357
#auth_plugin = password
[DEFAULT]
#api_paste_config = /etc/smaug/api-paste.ini
#api_paste_config = /etc/karbor/api-paste.ini
#logging_context_format_string = %(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [%(request_id)s %(user_id)s %(project_id)s%(color)s] %(instance)s%(color)s%(message)s
#logging_debug_format_suffix = from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d
#logging_default_format_string = %(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [-%(color)s] %(instance)s%(color)s%(message)s
@ -23,7 +23,7 @@
#rpc_backend = rabbit
#[database]
#connection = mysql+pymysql://root:stackdb@127.0.0.1/smaug?charset=utf8
#connection = mysql+pymysql://root:stackdb@127.0.0.1/karbor?charset=utf8
#[oslo_messaging_rabbit]
#rabbit_userid = stackrabbit

6
etc/providers.d/openstack-infra.conf

@ -3,9 +3,9 @@ name = OS Infra Provider
description = This provider uses OpenStack's own services (swift, cinder) as storage
id = cf56bd3e-97a7-4078-b6d5-f36246333fd9
plugin=smaug-volume-protection-plugin
plugin=smaug-image-protection-plugin
bank=smaug-swift-bank-plugin
plugin=karbor-volume-protection-plugin
plugin=karbor-image-protection-plugin
bank=karbor-swift-bank-plugin
[swift_client]
swift_auth_url=http://127.0.0.1:5000/v2.0/

2
smaug/__init__.py → karbor/__init__.py

@ -16,4 +16,4 @@ import pbr.version
__version__ = pbr.version.VersionInfo(
'smaug').version_string()
'karbor').version_string()

0
smaug/api/__init__.py → karbor/api/__init__.py

18
smaug/api/common.py → karbor/api/common.py

@ -19,7 +19,7 @@ from oslo_log import log as logging
from six.moves import urllib
import webob
from smaug.i18n import _
from karbor.i18n import _
api_common_opts = [
@ -159,7 +159,7 @@ def get_sort_params(params, default_key='created_at', default_dir='desc'):
function.
:param params: webob.multidict of request parameters (from
smaug.api.openstack.wsgi.Request.params)
karbor.api.openstack.wsgi.Request.params)
:param default_key: default sort key value, added to the list if no
sort keys are supplied
:param default_dir: default sort dir value, added to the list if the
@ -204,11 +204,11 @@ def get_request_url(request):
def remove_version_from_href(href):
"""Removes the first api version from the href.
Given: 'http://www.smaug.com/v1.1/123'
Returns: 'http://www.smaug.com/123'
Given: 'http://www.karbor.com/v1.1/123'
Returns: 'http://www.karbor.com/123'
Given: 'http://www.smaug.com/v1.1'
Returns: 'http://www.smaug.com'
Given: 'http://www.karbor.com/v1.1'
Returns: 'http://www.karbor.com'
"""
parsed_url = urllib.parse.urlsplit(href)
@ -249,7 +249,7 @@ class ViewBuilder(object):
prefix = self._update_link_prefix(get_request_url(request),
CONF.osapi_plan_base_URL)
url = os.path.join(prefix,
request.environ["smaug.context"].project_id,
request.environ["karbor.context"].project_id,
collection_name)
return "%s?%s" % (url, urllib.parse.urlencode(params))
@ -258,7 +258,7 @@ class ViewBuilder(object):
prefix = self._update_link_prefix(get_request_url(request),
CONF.osapi_plan_base_URL)
return os.path.join(prefix,
request.environ["smaug.context"].project_id,
request.environ["karbor.context"].project_id,
self._collection_name,
str(identifier))
@ -268,7 +268,7 @@ class ViewBuilder(object):
base_url = self._update_link_prefix(base_url,
CONF.osapi_plan_base_URL)
return os.path.join(base_url,
request.environ["smaug.context"].project_id,
request.environ["karbor.context"].project_id,
self._collection_name,
str(identifier))

0
smaug/api/middleware/__init__.py → karbor/api/middleware/__init__.py

18
smaug/api/middleware/auth.py → karbor/api/middleware/auth.py

@ -27,10 +27,10 @@ from oslo_serialization import jsonutils
import webob.dec
import webob.exc
from smaug.api.openstack import wsgi
from smaug import context
from smaug.i18n import _
from smaug.wsgi import common as base_wsgi
from karbor.api.openstack import wsgi
from karbor import context
from karbor.i18n import _
from karbor.wsgi import common as base_wsgi
use_forwarded_for_opt = cfg.BoolOpt(
@ -58,7 +58,7 @@ def pipeline_factory(loader, global_conf, **local_conf):
class InjectContext(base_wsgi.Middleware):
"""Add a 'smaug.context' to WSGI environ."""
"""Add a 'karbor.context' to WSGI environ."""
def __init__(self, context, *args, **kwargs):
self.context = context
@ -66,11 +66,11 @@ class InjectContext(base_wsgi.Middleware):
@webob.dec.wsgify(RequestClass=base_wsgi.Request)
def __call__(self, req):
req.environ['smaug.context'] = self.context
req.environ['karbor.context'] = self.context
return self.application
class SmaugKeystoneContext(base_wsgi.Middleware):
class KarborKeystoneContext(base_wsgi.Middleware):
"""Make a request context from keystone headers."""
@webob.dec.wsgify(RequestClass=base_wsgi.Request)
@ -125,7 +125,7 @@ class SmaugKeystoneContext(base_wsgi.Middleware):
request_id=req_id,
auth_token_info=auth_token_info)
environ['smaug.context'] = ctx
environ['karbor.context'] = ctx
return self.application
@ -159,5 +159,5 @@ class NoAuthMiddleware(base_wsgi.Middleware):
is_admin=True,
remote_address=remote_address)
req.environ['smaug.context'] = ctx
req.environ['karbor.context'] = ctx
return self.application

0
smaug/api/openstack/__init__.py → karbor/api/openstack/__init__.py

14
smaug/api/openstack/wsgi.py → karbor/api/openstack/wsgi.py

@ -20,11 +20,11 @@ from oslo_utils import excutils
import six
import webob
from smaug import exception
from smaug import i18n
from smaug.i18n import _, _LE, _LI
from smaug import utils
from smaug.wsgi import common as wsgi
from karbor import exception
from karbor import i18n
from karbor.i18n import _, _LE, _LI
from karbor import utils
from karbor.wsgi import common as wsgi
LOG = logging.getLogger(__name__)
@ -620,7 +620,7 @@ class Resource(wsgi.Application):
action_args.update(contents)
project_id = action_args.pop("project_id", None)
context = request.environ.get('smaug.context')
context = request.environ.get('karbor.context')
if (context and project_id and (project_id != context.project_id)):
msg = _("Malformed request url")
return Fault(webob.exc.HTTPBadRequest(explanation=msg))
@ -962,7 +962,7 @@ class Fault(webob.exc.HTTPException):
def _set_request_id_header(req, headers):
context = req.environ.get('smaug.context')
context = req.environ.get('karbor.context')
if context:
headers['x-compute-request-id'] = context.request_id

0
smaug/api/v1/__init__.py → karbor/api/v1/__init__.py

42
smaug/api/v1/plans.py → karbor/api/v1/plans.py

@ -18,17 +18,17 @@ from oslo_utils import uuidutils
from webob import exc
import smaug
from smaug.api import common
from smaug.api.openstack import wsgi
from smaug import exception
from smaug.i18n import _, _LI
from smaug import objects
from smaug.objects import base as objects_base
import smaug.policy
from smaug.services.operationengine import api as operationengine_api
from smaug import utils
import karbor
from karbor.api import common
from karbor.api.openstack import wsgi
from karbor import exception
from karbor.i18n import _, _LI
from karbor import objects
from karbor.objects import base as objects_base
import karbor.policy
from karbor.services.operationengine import api as operationengine_api
from karbor import utils
import six
@ -50,7 +50,7 @@ def check_policy(context, action, target_obj=None):
'user_id': context.user_id,
}
if isinstance(target_obj, objects_base.SmaugObject):
if isinstance(target_obj, objects_base.KarborObject):
# Turn object into dict so target.update can work
target.update(
target_obj.obj_to_primitive() or {})
@ -58,7 +58,7 @@ def check_policy(context, action, target_obj=None):
target.update(target_obj or {})
_action = 'plan:%s' % action
smaug.policy.enforce(context, _action, target)
karbor.policy.enforce(context, _action, target)
class PlanViewBuilder(common.ViewBuilder):
@ -126,7 +126,7 @@ class PlansController(wsgi.Controller):
def show(self, req, id):
"""Return data about the given plan."""
context = req.environ['smaug.context']
context = req.environ['karbor.context']
LOG.info(_LI("Show plan with id: %s"), id, context=context)
@ -145,7 +145,7 @@ class PlansController(wsgi.Controller):
def delete(self, req, id):
"""Delete a plan."""
context = req.environ['smaug.context']
context = req.environ['karbor.context']
LOG.info(_LI("Delete plan with id: %s"), id, context=context)
@ -161,7 +161,7 @@ class PlansController(wsgi.Controller):
def index(self, req):
"""Returns a list of plans, transformed through view builder."""
context = req.environ['smaug.context']
context = req.environ['karbor.context']
LOG.info(_LI("Show plan list"), context=context)
@ -236,7 +236,7 @@ class PlansController(wsgi.Controller):
raise exc.HTTPUnprocessableEntity()
LOG.debug('Create plan request body: %s', body)
context = req.environ['smaug.context']
context = req.environ['karbor.context']
check_policy(context, 'create')
plan = body['plan']
LOG.debug('Create plan request plan: %s', plan)
@ -278,7 +278,7 @@ class PlansController(wsgi.Controller):
def update(self, req, id, body):
"""Update a plan."""
context = req.environ['smaug.context']
context = req.environ['karbor.context']
if not body:
msg = _("Missing request body")
@ -333,7 +333,7 @@ class PlansController(wsgi.Controller):
try:
check_policy(context, 'get', plan)
except exception.PolicyNotAuthorized:
# raise PlanNotFound instead to make sure smaug behaves
# raise PlanNotFound instead to make sure karbor behaves
# as it used to
raise exception.PlanNotFound(plan_id=plan_id)
LOG.info(_LI("Plan info retrieved successfully."), resource=plan)
@ -347,13 +347,13 @@ class PlansController(wsgi.Controller):
raise exception.InvalidPlan(reason=msg)
# TODO(chenying) replication scene: need call rpc API when
# the status of the plan is changed.
if isinstance(plan, objects_base.SmaugObject):
if isinstance(plan, objects_base.KarborObject):
plan.update(fields)
plan.save()
LOG.info(_LI("Plan updated successfully."), resource=plan)
else:
msg = _("The parameter plan must be a object of "
"SmaugObject class.")
"KarborObject class.")
raise exception.InvalidInput(reason=msg)
def validate_plan_resources(self, plan):

24
smaug/api/v1/protectables.py → karbor/api/v1/protectables.py

@ -17,14 +17,14 @@ from oslo_log import log as logging