From db2a05e5b4853f6b042db806180597161642c839 Mon Sep 17 00:00:00 2001 From: Remigiusz Janeczek Date: Thu, 28 Jan 2021 14:01:42 +0100 Subject: Update component-specification documentation Add docs for: - kafka streams - config map volumes Issue-ID: DCAEGEN2-2546 Issue-ID: DCAEGEN2-1179 Signed-off-by: Remigiusz Janeczek Change-Id: Id77d0b3e82b9d82034ecf3d4b16b42a8101a8c50 --- .../component-json-schema.rst | 94 +++++++++++++++++++--- .../component-type-docker.rst | 61 +++++++++++--- .../docker-specification.rst | 48 +++++++++-- 3 files changed, 173 insertions(+), 30 deletions(-) diff --git a/docs/sections/design-components/component-specification/component-json-schema.rst b/docs/sections/design-components/component-specification/component-json-schema.rst index d1d4ef49..a6a1ed43 100644 --- a/docs/sections/design-components/component-specification/component-json-schema.rst +++ b/docs/sections/design-components/component-specification/component-json-schema.rst @@ -54,7 +54,8 @@ The same is provided below for documentation reference. "oneOf": [ { "$ref": "#/definitions/publisher_http" }, { "$ref": "#/definitions/publisher_message_router" }, - { "$ref": "#/definitions/publisher_data_router" } + { "$ref": "#/definitions/publisher_data_router" }, + { "$ref": "#/definitions/publisher_kafka" } ] } }, @@ -65,7 +66,8 @@ The same is provided below for documentation reference. "oneOf": [ { "$ref": "#/definitions/subscriber_http" }, { "$ref": "#/definitions/subscriber_message_router" }, - { "$ref": "#/definitions/subscriber_data_router" } + { "$ref": "#/definitions/subscriber_data_router" }, + { "$ref": "#/definitions/subscriber_kafka" } ] } } @@ -484,6 +486,33 @@ The same is provided below for documentation reference. "type" ] }, + "stream_kafka": { + "type": "object", + "properties": { + "format": { + "$ref": "#/definitions/name" + }, + "version": { + "$ref": "#/definitions/version" + }, + "config_key": { + "type": "string" + }, + "type": { + "description": "Type of stream to be used", + "type": "string", + "enum": [ + "kafka" + ] + } + }, + "required": [ + "format", + "version", + "config_key", + "type" + ] + }, "publisher_http": { "type": "object", "properties": { @@ -542,6 +571,9 @@ The same is provided below for documentation reference. "type" ] }, + "publisher_kafka": { + "$ref": "#/definitions/stream_kafka" + }, "subscriber_http": { "type": "object", "properties": { @@ -605,6 +637,9 @@ The same is provided below for documentation reference. "config_key" ] }, + "subscriber_kafka": { + "$ref": "#/definitions/stream_kafka" + }, "provider" : { "oneOf" : [ {"$ref": "#/definitions/docker-provider"}, @@ -853,17 +888,10 @@ The same is provided below for documentation reference. "type": "array", "items": { "type": "object", - "properties": { - "host":{ - "type":"object", - "path": {"type": "string"} - }, - "container":{ - "type":"object", - "bind": { "type": "string"}, - "mode": { "type": "string"} - } - } + "oneOf": [ + { "$ref": "#/definitions/host_path_volume" }, + { "$ref": "#/definitions/config_map_volume" } + ] } } }, @@ -872,6 +900,46 @@ The same is provided below for documentation reference. ], "additionalProperties": false }, + "host_path_volume": { + "type": "object", + "properties": { + "host": { + "type": "object", + "path": { + "type": "string" + } + }, + "container": { + "type": "object", + "bind": { + "type": "string" + }, + "mode": { + "type": "string" + } + } + } + }, + "config_map_volume": { + "type": "object", + "properties": { + "config_volume": { + "type": "object", + "name": { + "type": "string" + } + }, + "container": { + "type": "object", + "bind": { + "type": "string" + }, + "mode": { + "type": "string" + } + } + } + }, "docker_healthcheck_http": { "properties": { "type": { diff --git a/docs/sections/design-components/component-specification/component-type-docker.rst b/docs/sections/design-components/component-specification/component-type-docker.rst index cf676c48..a685e342 100755 --- a/docs/sections/design-components/component-specification/component-type-docker.rst +++ b/docs/sections/design-components/component-specification/component-type-docker.rst @@ -274,6 +274,8 @@ format of ``dcae.vnf.kpi`` version ``1.0.0``. | | | ``message_router`` | | | | , | | | | ``data_router`` | +| | | , | +| | | ``kafka`` | +-------------+----+--------------------+ .. _message-router: @@ -329,6 +331,27 @@ Example (not tied to the larger example): ... } +.. _kafka: + +Kafka +'''''''''''''' + +Kafka subscribers are clients fetching data directly from kafka. + +``config_key``: + +.. code:: json + + "streams": { + "subscribes": [{ + "format": "dcae.some-format", + "version": "1.0.0", + "config_key": "some_format_handle", + "type": "kafka" + }], + ... + } + Publishes ^^^^^^^^^ @@ -419,6 +442,8 @@ POST requests to streams that support the data format | | | ``message_router`` | | | | , | | | | ``data_router`` | +| | | , | +| | | ``kafka`` | +-------------+----+--------------------+ .. message-router-1: @@ -473,6 +498,27 @@ Example (not tied to the larger example): }] } +.. kafka-1: + +Kafka +'''''''''''''' + +Kafka publishers are clients publishing data directly to kafka. + +``config_key``: + +.. code:: json + + "streams": { + "publishes": [{ + "format": "dcae.some-format", + "version": "1.0.0", + "config_key": "some_format_handle", + "type": "kafka" + }], + ... + } + Quick Reference ^^^^^^^^^^^^^^^ @@ -1543,17 +1589,10 @@ Schema portion: "type": "array", "items": { "type": "object", - "properties": { - "host":{ - "type":"object", - "path": {"type": "string"} - }, - "container":{ - "type":"object", - "bind": { "type": "string"}, - "mode": { "type": "string"} - } - } + "oneOf": [ + { "$ref": "#/definitions/host_path_volume" }, + { "$ref": "#/definitions/config_map_volume" } + ] } } }, diff --git a/docs/sections/design-components/component-specification/docker-specification.rst b/docs/sections/design-components/component-specification/docker-specification.rst index e40af02f..eeac1ef8 100755 --- a/docs/sections/design-components/component-specification/docker-specification.rst +++ b/docs/sections/design-components/component-specification/docker-specification.rst @@ -36,10 +36,10 @@ mapping, volume mapping and policy reconfiguration script details. | | | host port. See example | | | | below. | +--------------------------------+---------+---------------------------+ -| volume | JSON | each array item contains | -| | array | a host and container | -| | | object. See example | -| | | below. | +| volumes | JSON | each array item contains | +| | array | volume definition of eith\| +| | | er: host path or config m\| +| | | ap volume. | +--------------------------------+---------+---------------------------+ | policy | JSON | *Required*. Policy | | | array | reconfiguration script | @@ -171,6 +171,15 @@ Volume Mapping "host": { "path": "/var/run/docker.sock" } + }, + { + "container": { + "bind": "/tmp/mount_path" + "mode": "ro" + }, + "config_volume": { + "name": "config_map_name" + } } ] } @@ -180,7 +189,8 @@ At the top-level: +---------------+-------+-------------------------------------+ | Property Name | Type | Description | +===============+=======+=====================================+ -| volumes | array | Contains container and host objects | +| volumes | array | Contains container with host/config\| +| | | _volume objects | +---------------+-------+-------------------------------------+ The ``container`` object contains: @@ -208,7 +218,15 @@ The ``host`` object contains: | path | string | path to the host volume | +---------------+--------+-------------------------+ -Here’s an example of the minimal JSON that must be provided as an input: +The ``config_volume`` object contains: + ++---------------+--------+-------------------------+ +| Property Name | Type | Description | ++===============+========+=========================+ +| name | string | name of config map | ++---------------+--------+-------------------------+ + +Here is an example of the minimal JSON with host path volume that must be provided as an input: .. code:: json @@ -228,6 +246,24 @@ Here’s an example of the minimal JSON that must be provided as an input: In the example above, the container volume “/tmp/docker.sock” maps to host volume “/var/run/docker.sock”. +Here is an example of the minimal JSON with config map volume that must be provided as an input: + +.. code:: json + + "auxilary": { + "volumes": [ + { + "container": { + "bind": "/tmp/mount_path" + }, + "config_volume": { + "name": "config_map_name" + } + } + ] + } + +In the example above, config map named "config_map_name" is mounted at "/tmp/mount_path". Policy ~~~~~~~ -- cgit 1.2.3-korg