Component Node Type

Component

Component is a basic type which allows embedding a blueprint as a component of another blueprint, thus allowing re-use of micro-services and simplify the creation and readability of blueprints.

The Components mentioned in a blueprint will be deployed as part of the blueprint install workflow as a separate deployment linked to the main blueprint in which they were mentioned. Relationships and dependencies can be defined for components similar to other nodes.

Modeling

This basic type is the basis for modeling “cloud-native” architectures with Cloudify, which opens a range of basic “building blocks”:

Workflows

In a deployment of multi-service application which utilizes Component in it’s architecture, there might be a need to extend the lifecycle management of the application deployment by cascading down the workflows executions. This will start the execution from the root deployment to every Component in the architecture (also if it is a multi-Component and multi-layer architecture), and will traverse the deployments “tree” from the root deployment (application’s deployment) according to inherit execution and architecture dependencies from the blueprint.

All custom workflows, including the builtin ones, are not cascading by default. Notice that cascading custom workflows requires it’s definition in every Component in the application, which also allows custom behaviour in every Component so different layers/parts of the application can act uniformly or independently.

Example for defining cascading custom workflow:

workflows:
  custom_workflow:
    mapping: <workflow implementation>
    is_cascading: true (default: false)

Parameters

Workflow parameters are passed down to the components as a workflow_parameters entry of the operation context. This means that in case a root deployment, which contained a subsystem component was uninstalled like:

cfy uninstall root --parameters ignore_failure=true

then both root and subsystem deployments would be uninstalled with ignore_failure=true option.

Limitations

Currently the following limitation exists, the output of the cascading workflow on the Components does not propagate to the result of the workflow execution in the root deployment. So if the cascading workflow fails in a Component “down” the deployments “tree” the execution in the root deployment will still show statues of success. This limitation does not apply for install and uninstall workflows, so if there is a failure for some Component the workflow status will show the correct status.

Scaling

The Component node type is can be scaled like a regular node.

When scaling a Component it’s deployment name could be specified with the following:

  component:
    type: cloudify.nodes.ServiceComponent
    properties:
      resource_config:
        blueprint:
          external_resource: true
          id: uploaded_blueprint

This example will create two deployment with the following ‘component-1’ and ‘component-2’:

node_templates:
  component_node:
    type: cloudify.nodes.ServiceComponent
    properties:
      resource_config:
        blueprint:
          external_resource: true
          id: component_blueprint
        deployment:
          id: component
          auto_inc_suffix: true
    capabilities:
        scalable:
            properties:
                default_instances: 2

Support in topology widget

Topology View Example

Lifecycle - install and uninstall

In install workflow the following lifecycle flow will be executed for a node of type Component (or derives from it):

In uninstall workflow the following lifecycle flow will be executed for a node of type Component (or derives from it):

Node type:

cloudify.nodes.Component

Derived From: cloudify.nodes.Root

Properties:

cloudify.nodes.ServiceComponent

Derived From: cloudify.nodes.Component

Internal implantation details:

Workflow inputs

Runtime properties

These are the used runtime properties for the internal implementation on each node of type Component (or of a type that is derived from it):

Examples

  component:
    type: cloudify.nodes.ServiceComponent
    properties:
      client:
        host: 127.0.0.1
        username: admin
        password: admin
        tenant: default_tenant
      resource_config:
        blueprint:
          external_resource: true
          id: uploaded_blueprint
        deployment:
          id: component_deployment
          auto_inc_suffix: true