84 Commits

Author SHA1 Message Date
Roman Gorshunov
416df18353 Remove Python 2.x support
Drop support of Python 2.x as it is being deprecated.

Updated documentation, tox config, requirements.txt.

Job templates added:
- openstack-python35-jobs: openstack-tox-py35
- openstack-python3-ussuri-jobs: openstack-tox-py36, openstack-tox-py37

Job added:
- openstack-tox-pep8

Job templates removed:
- openstack-python-jobs: openstack-tox-pep8, openstack-tox-py27

Jobs removed:
- deckhand-tox-py27-postgresql

Change-Id: I7783ba841258a913f5ecd9d6f1130d378345ab5a
2019-10-08 12:41:12 +00:00
Rajeshwari Dharwadkar
971c901c4d Update base image from leap15.0 to leap15.1
Changes made in opensuse_15 dockerfile to support opensuse leap15.1

Change-Id: Ifc959e9e8aa5da4ed6703ef8157f1c5beedc8ecd
2019-07-11 17:21:43 -07:00
Arun Kant
8eb74b0509 Adding opensuse image build for deckhand
Adding DISTRO parameter for makefile to invoke distribution specific
Dockerfile and build image accordingly.

Updated logic for existing jobs to have distro specific logic
for building and publishing images.

Added multiple distro specific document in operator section.

Change-Id: I415ab28b06ea17b21e76d28ccb3e284041c8072d
2019-05-30 17:22:57 +00:00
Zuul
49ad9f3884 Merge "docs: Add use cases for each of the mutation operations" 2019-02-22 23:20:28 +00:00
Roman Gorshunov
c81a88b963 Embed UML generated diagrams into docs, fix docs build
Remove manual generation of UML diagrams; they will be built by Sphinx
itself.

Require to install PlantUML and Graphviz via bindep in
openstack-tox-docs job; ReadTheDocs service already has both PlantUML
and Graphviz installed for documentation builds.

Change-Id: I21ab124a80e7768bc9edd891b975b4e0f8a6e50d
Story: 2004747
2019-02-14 13:55:44 +01:00
Dustin Specker
815306ddf8 docs(substitution): mention that all occurrences are replaced
Before it was unclear if all occurrences of a pattern were replaced
in a given target.

Change-Id: Ie02a54fef98a912b36b66891be8fed346ba5d9e0
2018-11-30 13:39:22 -06:00
Felipe Monteiro
82ceafa7bc docs: Add use cases for each of the mutation operations
This patch set adds use cases for each of the mutation
operations used by Deckhand:

* substitution
* layering
* replacement

To help document authors decide which operations they should use.

Change-Id: I8bc470c7ddc2f3c0aa9d4372a2323fa84632e369
2018-11-06 09:37:35 -05:00
Zuul
947810ada5 Merge "docs: Add config documentation to operator's section" 2018-11-05 18:05:49 +00:00
Rick Bartra
60e82b7bd6 Validate additional 'metadata.replacement' scenarios
This patch set adds additional documentation and unit tests
to validate further replacement scenarios.

In particular this commit adds an additional document check that
looks for documents exisitng in different layers that contain the
same name and same schema without any of them having `replacement: true`

Change-Id: I7c033d32a6755f36e609789a748cbc6d4af06bc2
2018-10-30 10:23:14 -04:00
Felipe Monteiro
b34156ae7b docs: Add config documentation to operator's section
This PS adds configuration documentation that includes
a literalinclude of the config file as well as some
information on each of the cache config options as
these are important on performance.

Change-Id: I3b06012b8843b7bfbd46307f81397172a41d3675
2018-10-29 18:21:38 +00:00
Zuul
27aeeb8fea Merge "docs: Add documentation on data redaction" 2018-10-29 17:26:37 +00:00
Felipe Monteiro
9d91a072cd docs: Use sphinx-apidoc library for autodoc compatibility
This package is used for generation autodoc documentation
automatically which can be linked to by Deckhand
documentation from other places. This is to make autodoc
generation work in RTD.

More info: https://pypi.org/project/sphinxcontrib-apidoc/

Change-Id: I43aac82728e5935a5a2626f2fd29d7a7188d19f9
2018-10-27 22:52:39 +01:00
Felipe Monteiro
018162f1ef rtd: Fix warnings in RTD causing autodoc to fail
This patch set fixes warnings [0] in RTD which are causing autodoc
to fail to build, resulting in missing documentation as in
here: https://airship-deckhand.readthedocs.io/en/latest/operators/exceptions.html

Example warnings:

WARNING: autodoc: failed to import module 'deckhand.policy'; the following exception was raised:
No module named 'falcon'

[0] https://readthedocs.org/api/v2/build/8001684.txt

Change-Id: I872b90e03a8f9e3de3fd717ed340b53f095f01a5
2018-10-27 15:21:54 +00:00
Zuul
1d4cc81dfa Merge "docs: Elaborate on document layering in documentation" 2018-10-24 14:03:35 +00:00
Zuul
b4cd48cde0 Merge "trivial: Add missing alembic upgrade head to manual install" 2018-10-24 02:27:40 +00:00
Felipe Monteiro
0d5189e226 trivial: Add missing alembic upgrade head to manual install
This patch set adds `./entrypoint.sh alembic upgrade head` command
to manual install section in Getting Started guide, without which
Deckhand server cannot start correctly.

Change-Id: Id486cc98b8fd93271a8571364adfb9fb30bf4bcc
2018-10-23 22:09:22 -04:00
Felipe Monteiro
f711a83ee7 docs: Add documentation on data redaction
This patch set adds documentation related to data redaction in
order to capture the purpose behind it and how it adds an
added layer of security to Deckhand.

Change-Id: Icb28970684a9026fda200273a14d9ba421f627d7
2018-10-20 14:48:19 -04:00
Aaron Sheffield
349e5600df Redacts Raw Documents
- If a document has a storage policy of encrypted
 - Redacts (sha256) the data section.
 - Redacts (sha256) the substition paths.
- Uses the same /documents endpoint, adds a new query parameter
  ?cleartext-secrets=true to show the non-redacted values.

Change-Id: I42808901b97c667a1148c00fbb7717a0847c9981
2018-10-19 23:56:12 -05:00
Felipe Monteiro
38c1d7a1a3 fix: Pin down Deckhand package requirements
This patch set pins down package requirements for the following
reasons:

* Inconsistencies between ranges and direct pins
* Deckhand isn't gated against requirements repo so changes to
  some packages isn't actively tested
* Other Airship components use pins, so Deckhand might break them
  when package requirements go out of sync between components
* Deckhand as of yet has no stable release so Airship relies on
  master for stability so it is better to ensure stability over
  anything else

Change-Id: I20ef4be3e01cd267771098d33447ccb61aee20b4
2018-10-18 02:36:35 +01:00
Felipe Monteiro
1ac9abb555 docs: Elaborate on document layering in documentation
This patchset elaborates on document layering in the documentation
to provide much greater clarity into what layering is and its
associated concepts, including: layer, layer order, layering policy,
layering definition, document abstraction, parent selection,
layering actions, etc.

Change-Id: I584e67b7984fa4035cef481a116ae3b8a3eb2906
2018-10-10 19:06:38 +00:00
Felipe Monteiro
a8660a7e53 docs: Reorganize documentation structure
This patch set reorganizes Deckhand's documentation structure
for better organization into 3 distinct categories:

* developer's guide
* operator's guide
* user's guide

This means that the RTD navigation menu on the left-hand side
will have fewer links (see list above) making navigation much
easier. This is similar to how Armada organizes its documentation
too.

This patch set also updates README section with a better
overview and trims some fat from it (remove testing
documentation as it doesn't really belong there -- there
is a dedicated page for that already).

Finally, this patch set changes the exceptions page to
render as a basic list of autoexception classes because
the current tabularized view is not rendering correctly
on RTD [0].

[0] https://airship-deckhand.readthedocs.io/en/latest/exceptions.html
Change-Id: I162383bf8e3bbd5004603c979ac7b0d760a210c4
2018-09-26 20:29:02 -04:00
Roman Gorshunov
d41e5a44ca Fix: various documentation and URL fixes
1) UCP -> Airship
2) readthedocs.org -> readthedocs.io (there is redirect)
3) http -> https
4) attcomdev -> airshipit (repo on quay.io)
5) att-comdev -> openstack/airship-* (repo on github/openstack git)
6) many URLs have been verified and adjusted to be current
7) no need for 'en/latest/' path in URL of the RTD
8) added more info to some setup.cfg and setup.py files
9) ucp-integration docs are now in airship-in-a-bottle
10) various other minor fixes

Change-Id: I12b2fa8fbec37a483a0ad50382e08f51ed97533a
2018-09-25 11:44:57 +02:00
Zuul
7dddbd56d4 Merge "substitution: Recursive pattern replacement" 2018-09-19 21:38:08 +00:00
pallav
9345035522 Adding api for revisions deep diffing
GET /revisions/{{revision_id}}/deepdiff/{{comparison_revision_id}}

 - Added deepdiff api for generating diff between
   two rendered documents.
 - Deep diffing for data and metadata
 - Refactor diff functions
 - Client update
 - Added unit testcases
 - Added funtional testcases
 - Doc update

Change-Id: Ib60fa60a3b33e9125a1595a999272ca595721b38
2018-09-17 17:01:34 +05:30
Felipe Monteiro
c9d71a6509 substitution: Recursive pattern replacement
Patterns may now be replaced recursively. This can be
achieved by using specifying a ``pattern`` value and
``recurse`` (with a required ``depth`` argument).

Example:

    substitutions:
      - dest:
          path: .
          pattern: REGEX
          recurse:
            depth: -1
        src:
          schema: deckhand/Passphrase/v1
          name: example-password
          path: .

NOTE:

  Recursive selection of patterns will only consider
  matching patterns. Non-matching patterns will be ignored.
  Thus, even if recursion can "pass over" non-matching patterns,
  they will be silently ignored.

This is useful for reducing the number of substitution
stanzas that are required for the purposes of performing
all the string pattern replacements that are required.
Best practice is to limit the scope of the recursion
as much as possible: e.g. avoid passing in "$" as the
``jsonpath``, but rather a JSON path that lives closer
to the nested strings in question.

Included in this patch set:

* recursive implementation for pattern replacement
* unit tests for most scenarios and edge cases
* docstring updates
* documentation updates
* schema updates for validation

Change-Id: I85048349097ed696667fae80f1180808d264bbcf
2018-09-12 09:24:46 -06:00
Felipe Monteiro
5325b46412 trivial: Update deprecated Airship links in docs
This updates att-comdev to openstack/airship-* namespace as well
as old RTD links to new ones.

Change-Id: Ic7d7fae2ac2f64e4b59eb4f350d26784d2d1ac40
2018-08-30 15:32:18 +00:00
melissaml
7290c91889 Remove the duplicated word
Change-Id: Ifdd74e418c7387e39fd0d8e667e86ccf2ed889fe
2018-08-22 10:57:02 +08:00
Zuul
64975c820a Merge "doc(typo): Correct spelling" 2018-08-08 22:05:17 +00:00
Zuul
9b6eb81c82 Merge "docs: Update document types documentation" 2018-08-06 16:15:09 +00:00
Tin Lam
02e7fc5793 doc(typo): Correct spelling
Trivial fix. Correct a minor spelling error in doc.

Change-Id: Ie111acdf7dbbf884cc12acf9136d324ad332a823
Signed-off-by: Tin Lam <tin@irrational.io>
2018-08-04 21:17:28 -05:00
Felipe Monteiro
f1e47e80c1 docs: Update document types documentation
This patch set updates document types documentation
which includes expounding on control documents, layering policy
documents, and dataschema documents.

Change-Id: Id31fcb6b68ca30fdf681dec8348c2fc4237cd48d
2018-07-31 21:27:28 +00:00
Zuul
9077e27589 Merge "Rename some instances of ucp to airship" 2018-07-24 16:27:33 +00:00
Felipe Monteiro
c95ec45307 Rename some instances of ucp to airship
This renames some instances of ucp to airship in the documentation
and makes some trivial documentation fixes.

Change-Id: I9a4a81d15bfc13b4fe089b7d65f0df43eeade9fb
2018-07-23 20:56:00 +01:00
Zuul
109b78df59 Merge "Simplify schema validation" 2018-07-10 13:42:57 +00:00
Felipe Monteiro
039f9830da Move retrieval of encrypted documents to Deckhand controller
This patchset moves retrieval of encrypted documents to the
Deckhand controller so that components like Pegleg and
Promenade can consume the Deckhand engine offline without
running into Barbican errors.

Components can pass in `encryption_sources` to Deckhand's
rendering module which Deckhand will now use instead to resolve
secret references.

`encryption_sources` is a dictionary that maps the reference
contained in the destination document's data section to the
actual unecrypted data. If encrypting data with Barbican, the
reference will be a Barbican secret reference.

Change-Id: I1a457d3bd37101d73a28882845c2ce74ac09fdf4
2018-07-08 23:16:26 +00:00
Scott Hussey
e40f3e443f Simplify schema validation
- Treat internal Deckhand schemas equivalent to other
  service schemas
- Remove validating sections other than `data` outside of
  base schema
- Create schemas for metadata sections metadata/Control/v1 and
  metadata/Document/v1
- Use a single validator and let that validator check for document
  structure (validate against the base schema and metadata)
  and for post-validation also validate against service schemas

Change-Id: I5f9b9a3cfa1692a69b5982a6424edd65bdfed0ef
2018-07-03 02:07:33 +00:00
Zuul
59182380e3 Merge "docs: Add developer overview documentation" 2018-06-29 18:00:27 +00:00
Felipe Monteiro
6c45569ecd docs: Add developer overview documentation
This patchset adds developer overview documentation for providing
a high-level introduction to Deckhand, including its architecture,
modules, test utilities, Helm utilities, and other errata. This
work is based off this Drydock patchset:

  https://review.openstack.org/#/c/571298/

Change-Id: Ic3382d4e04edf02a65184651d272fe9cd1db56a4
2018-06-20 15:00:46 -04:00
Felipe Monteiro
d1b7ce154c docs: Expand on definition of document uniqueness
This patchset expands on document uniquness in Deckhand which is
a bit involved.

At the **database** level, documents are uniquely identified by
the combination of:

#. ``metadata.name``
#. ``schema``
#. ``metadata.layeringDefinition.layer``

This means that raw revision documents -- which are persisted
in Deckhand's database -- require that the combination of all
3 parameters be unique.

However, **post-rendered documents** are only uniquely
identified by the combination of:

#. ``metadata.name``
#. ``schema``

Because collisions with respect to the the third parameter --
``metadata.layeringDefinition.layer`` -- can only occur with
replacement. But after document rendering, the replacement-parent
documents are never returned.

Change-Id: I841caa83bef46bf5e155136fbcd7444b672d06f8
2018-06-20 18:56:54 +00:00
Zuul
9ae805f988 Merge "[docs] Add documentation on document encryption" 2018-06-19 13:05:59 +00:00
Felipe Monteiro
84ab5c5096 [test] Add integration test scenario for encrypting generic type
This PS adds an integration test scenario for validating that
encrypting a generic document type and using it as a substitution
source during document rendering works.

Deckhand will now submit all generic documents to be encrypted
to Barbican with a 'secret_type' of 'passphrase'. No encoding
is provided Deckhand-side (i.e. base64) because encoding is
deprecated in Barbican since it lead to strange behavior;
Barbican will figure out what to encode the payload as
automatically. For more information, see [0] and [1].

In addition, this PS handles 2 edge cases around secret
payloads that are rejected by Barbican if not handled
correctly by Deckhand: empty payloads and non-string
type payloads [2]. For the first case Deckhand forcibly
changes the document to cleartext because there is no
point in encrypting a document with an empty payload.
For the second case Deckhand sets overrides any
previously set secret_type to 'opaque' and encodes
the payload to base64 -- when it goes to render
the secret it decodes the payload also using base64.

Integration tests have been added to handle both edge
cases described above.

[0] https://bugs.launchpad.net/python-barbicanclient/+bug/1419166
[1] 49505b9aec/barbicanclient/v1/secrets.py (L252)
[2] 49505b9aec/barbicanclient/v1/secrets.py (L297)

Change-Id: I1964aa84ad07b6f310b39974f078b84a1dc84983
2018-06-16 15:11:20 -04:00
Felipe Monteiro
fb6220f1b5 [docs] Add documentation on document encryption
This patchset adds documentation on document encryption. It also
adds appropriate references to other sections of the documentation
where linking to document encryption is apropos. Finally, this
patchset adds further information and structure around the document
rendering process in general, in order to underscore the pieces
of documentation that undergird the general concept of document
rendering: substitution, layering and replacement.

Change-Id: I566cac4a3374556a0e62e0e1962e153029f7ec05
2018-06-11 10:28:32 -04:00
Felipe Monteiro
fa0e26938b Add docs-on-readthedocs to .zuul.yaml templates
This patchset adds docs-on-readthedocs openstack-infra template
to Deckhand's .zuul.yaml templates and makes some documentation
changes to test the template.

.. https://github.com/openstack-infra/zuul-jobs/blob/master/playbooks/python/readthedocs.yaml

Change-Id: I000fc1e3be9dd4cf333fa28d7739747eb9003adc
2018-06-06 03:29:08 +00:00
Felipe Monteiro
cda4f9e431 Rename docs to doc to align with OpenStack standard
This patchset updates docs to doc to align with OpenStack
standard. Follow-up patchset will be needed to publish
documentation to OpenStack [0].

[0] https://docs.openstack.org/doc-contrib-guide/project-guides.html

Change-Id: Ia191ac1cc4536af1232aedd4bb491f3829651730
2018-06-05 13:19:24 -04:00
Felipe Monteiro
d27814cb1e Trivial: Rename doc to docs to align with UCP standard
Change-Id: I79e1544bfee8701cc49fe50509d69d53495e2ffa
2018-03-15 15:03:29 +00:00
Felipe Monteiro
d82d0cfaf7 ValidationPolicy integration with Validations API
This PS integrates ValidationPolicy logic with the
Deckhand Validations API.

Support for multiple ValidationPolicy documents is
included.

If a ValidationPolicy is found, then the validations
contained therein are used to determine whether
a revision is successful or not. For example,
if a VP contains 'promenade-schema-validation' then
DH will return success if the externally registered
validation result for that validation is success.
However, if the result was never registered in DH
then the returned result is 'failure'.

In addition, if "extra" validations are registered
(that is validations not present in any VP) then
they are effectively ignored. An error message is
added with enough details to indicate why the validation
is ignored.

This PS adds unit tests to verify the correct behavior
for the above scenarios.

Functional tests and documentation changes will be added
in a follow up once design is ironed out.

Change-Id: I44c657974589ea3563e0a23ad667894329048b46
2018-03-12 12:41:06 -04:00
Felipe Monteiro
4e796ed30a Remove microversions from document versions
This PS removes microversions from document versions because
no services use microversions and microversioning for documents
isn't supported in Deckhand.

Change-Id: I3635d15513a2c7b8154ec6be4d0b8577e7d4ce3d
2018-02-27 12:37:43 -05:00
Felipe Monteiro
e0fc59e89b Deckhand schemas as YAML files
Use YAML formatting for built-in Deckhand schemas
used for validations to align with other UCP services.

The second most important intention behind this PS
is to allow pre_validate flag to cascade correctly
between the layering and document_validation modules.

If pre_validate is true, then:
  * the base_schema validates ALL documents
  * ALL built-in schemas validate the appropriate
    document given a schema match
  * NO externally registered DataSchema documents
    are used for validation

Else (if pre_validate is false):
  * the base_schema validates ALL documents
  * ALL built-in schemas validate the appropriate
    document given a schema match
  * ALL externally registered DataSchema documents
    are used for validation given a schema match

A more minor change is setting pre_validate flags in
all modules to True for consistency. The idea is to
facilitate the way other projects that import Deckhand
in directly interface with Deckhand.

Change-Id: I859f61989ec15bede1c104b86625d116064f056d
2018-02-27 11:16:30 -05:00
Felipe Monteiro
eeff5c7d24 Docs: Touch up getting started documentation
This is to fix up a slight rendering issue with getting
started documentation related to double code block syntax.

Change-Id: I4b6777f77d148113e5a798aeb3daa520d05c1f0e
2018-02-23 23:13:38 +00:00
Felipe Monteiro
3c8a65a813 Docs: Update README and create Getting Started docs
Update the README by moving a lot of the manual installation into
Getting Started docs and simplify some of the documentation because
Deckhand can be re-run using sqlite (for dev purposes, for example).

Change-Id: I5742dc75b95e2af67a18b419d04e769c10a1e43e
2018-02-21 15:26:22 -05:00