shipyard/src/bin/shipyard_airflow
Andrey Volkov 4164518502 Ensure pod logs are fetched in case of exception in any operator
This patch tries to cover some edge cases could happen during Shipyard
Airflow operator execution. All operators at the moment make
interactions with other services i.e. k8s pods. In a case of exceptions
during execution of the operator, logs will be fetched from the
appropriate pod and if the operator has "fetch_failure_details" method
(see DrydockBaseOperator) it will be called as well.

What exception could happen during an operator execution?
Besides explicitly defined in code like
DrydockClientUseFailureException, other exception e.g. KeyError or
similar may be raised. It's not clear who is a culprit in that client
side (Shipyard) or server side (Drydock, Armada, Deckhand,
Promenade). So this patch applies defensive mode and gets logs from
pods and gets additional details for any exceptional situations.

For doing that do_execute method is wrapped with try..except
in UcpBaseOperator.execute. While fetching logs from a pod
and fetching failure details it makes appropriate logging by itself
and finally reraises the original exception.

Change-Id: If1501e9a24b05edb6eb32c7b1b2d27f24f3ee063
2018-09-19 09:17:13 -07:00
..
alembic Add Apache 2.0 LICENSE file 2018-05-14 13:46:28 +00:00
etc/shipyard Add documentation for safer redeploy_server 2018-09-10 15:27:48 -05:00
generator Refactor shipyard to UCP target layout 2018-04-24 16:47:13 -05:00
shipyard_airflow Ensure pod logs are fetched in case of exception in any operator 2018-09-19 09:17:13 -07:00
tests Ensure pod logs are fetched in case of exception in any operator 2018-09-19 09:17:13 -07:00
.coveragerc Set ULID of action on DAG request 2018-08-10 10:23:30 -05:00
README.md Refactor shipyard to UCP target layout 2018-04-24 16:47:13 -05:00
alembic.ini Refactor shipyard to UCP target layout 2018-04-24 16:47:13 -05:00
entrypoint.sh Refactor shipyard to UCP target layout 2018-04-24 16:47:13 -05:00
requirements.txt Add cryptography to shipyard 2018-07-27 15:00:11 -05:00
setup.py Refactor shipyard to UCP target layout 2018-04-24 16:47:13 -05:00
test-requirements.txt Consolidate pep8/bandit zuul gating 2018-08-21 20:53:24 +00:00
tox.ini Consolidate pep8/bandit zuul gating 2018-08-21 20:53:24 +00:00

README.md

Shipyard

Shipyard is the directed acyclic graph controller for Kubernetes and OpenStack control plane life cycle management, and a component of the Undercloud Platform (UCP).

Shipyard provides the entrypoint for the following aspects of the control plane established by the UCP:

Designs and Secrets
Site designs, including the configuration of bare metal host nodes, network design, operating systems, Kubernetes nodes, Armada manifests, Helm charts, and any other descriptors that define the build out of a group of servers enter the UCP via Shipyard. Secrets, such as passwords and certificates use the same mechanism.
The designs and secrets are stored in UCP's Deckhand, providing for version history and secure storage among other document-based conveniences.
Actions
Interaction with the site's control plane is done via invocation of actions in Shipyard. Each action is backed by a workflow implemented as a directed acyclic graph (DAG) that runs using Apache Airflow. Shipyard provides a mechanism to monitor and control the execution of the workflow.

Find more documentation for Shipyard on Read the Docs

Integration Points:

OpenStack Identity (Keystone) provides authentication and support for role based authorization
Apache Airflow provides the framework and automation of workflows provided by Shipyard
PostgreSQL is used to persist information to correlate workflows with users and history of workflow commands
Deckhand supplies storage and management of site designs and secrets
Drydock is orchestrated by Shipyard to perform bare metal node provisioning
Promenade is indirectly orchestrated by Shipyard to configure and join Kubernetes nodes
Armada is orchestrated by Shipyard to deploy and test Kubernetes workloads

Getting Started:

Shipyard @ Gerrithub
Helm chart

See also:

Undercloud Platform (UCP)