dockerpass: '@/run/pass/dpass'
http_proxy: {{ .Values.http_proxy }}
https_proxy: {{ .Values.https_proxy }}
-no_proxy: {{ .Values.http_proxy }}
+no_proxy: {{ .Values.no_proxy }}
{{ $firstPort := index .Values.service.ports 0 -}}
port: {{ $firstPort.port }}
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
-## [1.0.6] - 6/04/2021
+## [1.0.7] - 2021/12/01
+ * Customize DCAE adapter to support the v3 component spec (DCAEGEN2-2877)
+## [1.0.6] - 2021/06/04
* Adapt DCAE adapter to work with Acumos Demeter's metadata structure change
-## [1.0.5] - 5/05/2021
+## [1.0.5] - 2021/05/05
* Enhance adapter to also work behind proxy.
-## [1.0.4] - 1/07/2021
+## [1.0.4] - 2021/01/07
* Select metadata.json with additional name search in case of multiple json artifacts (Fix for DCAEGEN2-2578)
-## [1.0.3] - 7/28/2020
+## [1.0.3] - 2020/07/28
* Fetch json schemas during image build
-## [1.0.2] - 3/26/2020
+## [1.0.2] - 2020/03/26
* Run as non-root
-## [1.0.1] - 3/20/2020
+## [1.0.1] - 2020/03/20
* Adjust URL paths for consistency with DCAE GEN design tool
-## [1.0.0] - 11/13/2019
+## [1.0.0] - 2019/11/13
* Onboard models from Acumos - initial version
# org.onap.dcae
# =============================================================================
# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2021 highstreet technologies GmbH. All rights reserved.
# =============================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
npm install -g protobuf-jsonschema && \
mkdir schemas && \
wget -O schemas/schema.json 'https://json-schema.org/draft-04/schema#' && \
- wget -O schemas/compspec.json https://git.onap.org/dcaegen2/platform/plain/mod/component-json-schemas/component-specification/dcae-cli-v2/component-spec-schema.json && \
+ wget -O schemas/compspec.json https://git.onap.org/dcaegen2/platform/plain/mod/component-json-schemas/component-specification/dcae-cli-v3/component-spec-schema.json && \
wget -O schemas/dataformat.json https://git.onap.org/dcaegen2/platform/plain/mod/component-json-schemas/data-format/dcae-cli-v1/data-format-schema.json && \
cd /tmp/build/ && \
python setup.py install && \
# org.onap.dcae
# =============================================================================
# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2021 highstreet technologies GmbH. All rights reserved.
# =============================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
model_repo_path = config.tmpdir
docker_uri = docker_gen.build_and_push_docker(config, model_name, model_version)
data_formats = dataformat_gen.generate_dcae_data_formats(model_repo_path, model_name)
- spec = spec_gen.generate_spec(model_repo_path, model_name, data_formats, docker_uri)
+ spec = spec_gen.generate_spec(model_repo_path, model_name, data_formats, model_version)
return docker_uri, data_formats, spec
# org.onap.dcae
# =============================================================================
# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
-# =============================================================================
# Copyright (c) 2021 highstreet technologies GmbH. All rights reserved.
# =============================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
ENV no_proxy={no_proxy}
ENV NO_PROXY={no_proxy}
RUN pip install -r /app/requirements.txt && \
- pip install acumos_dcae_model_runner
+ pip install acumos_dcae_model_runner && \
+ pip install pyyaml
ENV DCAEPORT=10000
EXPOSE $DCAEPORT
# org.onap.dcae
# =============================================================================
# Copyright (c) 2019-2020 AT&T Intellectual Property. All rights reserved.
-# =============================================================================
# Copyright (c) 2021 highstreet technologies GmbH. All rights reserved.
# =============================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
Generates DCAE component specs
"""
-
import json
from jsonschema import validate
from aoconversion import utils
return df["self"]["version"]
-def _generate_spec(model_name, meta, dcae_cs_schema, data_formats, docker_uri):
+def _generate_spec(model_name, meta, dcae_cs_schema, data_formats, model_version):
"""
Function that generates the component spec from the model metadata and docker info
Broken out to be unit-testable.
"""
-
+ docker_uri = "{}:{}".format(model_name, model_version)
spec = {
"self": {
"version": "1.0.0", # hopefully we get this from somewhere and not hardcode this
"services": {"calls": [], "provides": []},
"streams": {"subscribes": [], "publishes": []},
"parameters": [],
- "auxilary": {"healthcheck": {"type": "http", "endpoint": "/healthcheck"}},
+ "auxilary": {"helm": {"service": {"type": "ClusterIP",
+ "name": model_name,
+ "has_internal_only_ports": "true",
+ "ports": [{"name": "http", "port": 8443, "plain_port": 8080,
+ "port_protocol": "http"}]}},
+ "healthcheck": {"type": "HTTP", "interval": "15s", "timeout": "1s", "port": 8080,
+ "endpoint": "/healthcheck"}},
"artifacts": [{"type": "docker image", "uri": docker_uri}],
}
# each model method gets a subscruber and a publisher, using the methood name
pstype = "message_router"
for method in meta["methods"]:
-
df_in_name = utils.validate_format(meta, method, "input")
subscriber = {
"config_key": "{0}_subscriber".format(method),
"type": pstype,
}
+ publisher = {
+ "config_key": "{0}_publisher".format(method),
+ "format": df_out_name,
+ "version": _get_format_version(df_out_name, data_formats),
+ "type": pstype,
+ }
+ parameter_subscriber = {
+ "name": "streams_subscribes",
+ "value": "{{\"{0}_subscriber\":{{\"dmaap_info\":{{\"topic_url\":\"http://message-router:3904/events/unauthenticated.{1}_In\"}},\"type\":\"message_router\"}}}}".format(
+ method, model_name),
+
+ "description": "standard http port collector will open for listening;",
+ "sourced_at_deployment": False,
+ "policy_editable": False,
+ "designer_editable": False
+ }
+ paramter_publisher = {
+ "name": "streams_publishes",
+ "value": "{{\"{0}_publisher\":{{\"dmaap_info\":{{\"topic_url\":\"http://message-router:3904/events/unauthenticated.{1}_Out\"}},\"type\":\"message_router\"}}}}".format(
+ method, model_name),
+ "description": "standard http port collector will open for listening;",
+ "sourced_at_deployment": False,
+ "policy_editable": False,
+ "designer_editable": False
+ }
spec["streams"]["publishes"].append(publisher)
+ spec["parameters"].append(parameter_subscriber)
+ spec["parameters"].append(paramter_publisher)
# Validate that we have a valid spec
validate(instance=spec, schema=dcae_cs_schema)
-
return spec
-def generate_spec(model_repo_path, model_name, data_formats, docker_uri):
+def generate_spec(model_repo_path, model_name, data_formats, model_version):
"""
Generate and write the component spec to disk
Returns the spec
"""
spec = _generate_spec(
- model_name, utils.get_metadata(model_repo_path, model_name), utils.component_schema.get(), data_formats, docker_uri
+ model_name, utils.get_metadata(model_repo_path, model_name), utils.component_schema.get(), data_formats,
+ model_version
)
fname = "{0}_dcae_component_specification.json".format(model_name)
with open("{0}/{1}".format(model_repo_path, fname), "w") as f:
org.onap.dcae
================================================================================
Copyright (c) 2019-2020 AT&T Intellectual Property. All rights reserved.
-================================================================================
Copyright (c) 2021 highstreet technologies GmbH. All rights reserved.
=============================================================================
Licensed under the Apache License, Version 2.0 (the "License");
<modelVersion>4.0.0</modelVersion>
<groupId>org.onap.dcaegen2.platform.adapter</groupId>
<artifactId>dcaegen2-platform-adapter-acumos</artifactId>
- <version>1.0.6-SNAPSHOT</version>
+ <version>1.0.7</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonar.sources>.</sonar.sources>
# org.onap.dcae
# =============================================================================
# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
-# =============================================================================
# Copyright (c) 2021 highstreet technologies GmbH. All rights reserved.
# =============================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
setup(
name="aoconversion",
- version="1.0.6-SNAPSHOT",
+ version="1.0.7",
packages=find_packages(exclude=["tests.*", "tests"]),
author="Tommy Carpenter, Andrew Gauld",
author_email="tommy@research.att.com, agauld@att.com",
# org.onap.dcae
# =============================================================================
# Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2021 highstreet technologies GmbH. All rights reserved.
# =============================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
def mock_schemas(monkeypatch):
cwd = os.getcwd()
schemadir = cwd[:cwd.find('/adapter/acumos')] + '/mod/component-json-schemas'
- monkeypatch.setattr(aoconversion.utils.component_schema, 'path', schemadir + '/component-specification/dcae-cli-v2/component-spec-schema.json')
+ monkeypatch.setattr(aoconversion.utils.component_schema, 'path', schemadir + '/component-specification/dcae-cli-v3/component-spec-schema.json')
monkeypatch.setattr(aoconversion.utils.dataformat_schema, 'path', schemadir + '/data-format/dcae-cli-v1/data-format-schema.json')
monkeypatch.setattr(aoconversion.utils.schema_schema, 'ret', requests.get('https://json-schema.org/draft-04/schema#').json())
dockerregistry: 'dockerregistry'
dockeruser: 'dockeruser'
dockerpass: 'dockerpass'
-port: '90'
\ No newline at end of file
+port: '90'
-{"self": {"name": "ArgsList", "version": "1.0.0"}, "dataformatversion": "1.0.1", "jsonschema": {"title": "ArgsList", "type": "object", "properties": {"args": {"type": "array", "items": {"$ref": "#/definitions/Args"}}}, "$schema": "http://json-schema.org/draft-04/schema#", "definitions": {"Args": {"title": "Args", "type": "object", "properties": {"x": {"type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991}, "y": {"type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991}}}}}}
\ No newline at end of file
+{"self": {"name": "ArgsList", "version": "1.0.0"}, "dataformatversion": "1.0.1", "jsonschema": {"title": "ArgsList", "type": "object", "properties": {"args": {"type": "array", "items": {"$ref": "#/definitions/Args"}}}, "$schema": "http://json-schema.org/draft-04/schema#", "definitions": {"Args": {"title": "Args", "type": "object", "properties": {"x": {"type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991}, "y": {"type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991}}}}}}
-{"self": {"name": "SumOut", "version": "1.0.0"}, "dataformatversion": "1.0.1", "jsonschema": {"title": "SumOut", "type": "object", "properties": {"value": {"type": "array", "items": {"type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991}}}, "$schema": "http://json-schema.org/draft-04/schema#", "definitions": {}}}
\ No newline at end of file
+{"self": {"name": "SumOut", "version": "1.0.0"}, "dataformatversion": "1.0.1", "jsonschema": {"title": "SumOut", "type": "object", "properties": {"value": {"type": "array", "items": {"type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991}}}, "$schema": "http://json-schema.org/draft-04/schema#", "definitions": {}}}
-{"schema": "acumos.schema.model:0.4.0", "runtime": {"name": "python", "encoding": "protobuf", "version": "3.6.8", "dependencies": {"pip": {"indexes": [], "requirements": [{"name": "dill", "version": "0.3.0"}, {"name": "acumos", "version": "0.8.0"}]}, "conda": {"channels": [], "requirements": []}}}, "name": "example-model", "methods": {"sum": {"input": "ArgsList", "output": "SumOut", "description": ""}}}
\ No newline at end of file
+{"schema": "acumos.schema.model:0.4.0", "runtime": {"name": "python", "encoding": "protobuf", "version": "3.6.8", "dependencies": {"pip": {"indexes": [], "requirements": [{"name": "dill", "version": "0.3.0"}, {"name": "acumos", "version": "0.8.0"}]}, "conda": {"channels": [], "requirements": []}}}, "name": "example-model", "methods": {"sum": {"input": "ArgsList", "output": "SumOut", "description": ""}}}
--- /dev/null
+dill==0.3.0
+acumos==0.8.0
# org.onap.dcae
# =============================================================================
# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
-# =============================================================================
# Copyright (c) 2021 highstreet technologies GmbH. All rights reserved.
# =============================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
ENV no_proxy=
ENV NO_PROXY=
RUN pip install -r /app/requirements.txt && \
- pip install acumos_dcae_model_runner
+ pip install acumos_dcae_model_runner && \
+ pip install pyyaml
ENV DCAEPORT=10000
EXPOSE $DCAEPORT
# org.onap.dcae
# =============================================================================
# Copyright (c) 2019-2020 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2021 highstreet technologies GmbH. All rights reserved.
# =============================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Test generating data formats from the protobuf
"""
test_proto_path = get_fixture_path("models/example-model/model.proto")
- data_formats = dataformat_gen._generate_dcae_data_formats(test_proto_path, TEST_META, utils.dataformat_schema.get(), utils.schema_schema.get())
+ data_formats = dataformat_gen._generate_dcae_data_formats(test_proto_path, TEST_META, utils.dataformat_schema.get(),
+ utils.schema_schema.get())
assert spec_gen._generate_spec(
- "example-model", TEST_META, utils.component_schema.get(), data_formats, "nexus01.fake.com:18443/example-model:latest"
+ "example-model", TEST_META, utils.component_schema.get(), data_formats,
+ "latest"
) == {
- "self": {
- "version": "1.0.0",
- "name": "example-model",
- "description": "Automatically generated from Acumos model",
- "component_type": "docker",
- },
- "services": {"calls": [], "provides": []},
- "streams": {
- "subscribes": [
- {"config_key": "add_subscriber", "format": "NumbersIn", "version": "1.0.0", "type": "message_router"}
- ],
- "publishes": [
- {"config_key": "add_publisher", "format": "NumberOut", "version": "1.0.0", "type": "message_router"}
- ],
- },
- "parameters": [],
- "auxilary": {"healthcheck": {"type": "http", "endpoint": "/healthcheck"}},
- "artifacts": [{"type": "docker image", "uri": "nexus01.fake.com:18443/example-model:latest"}],
- }
+ "self": {
+ "version": "1.0.0",
+ "name": "example-model",
+ "description": "Automatically generated from Acumos model",
+ "component_type": "docker",
+ },
+ "services": {"calls": [], "provides": []},
+ "streams": {
+ "subscribes": [
+ {"config_key": "add_subscriber", "format": "NumbersIn", "version": "1.0.0",
+ "type": "message_router"}
+ ],
+ "publishes": [
+ {"config_key": "add_publisher", "format": "NumberOut", "version": "1.0.0",
+ "type": "message_router"}
+ ],
+ },
+ "parameters": [
+ {
+ "name": "streams_subscribes",
+ "value": "{\"add_subscriber\":{\"dmaap_info\":{\"topic_url\":\"http://message-router:3904/events/unauthenticated.example-model_In\"},\"type\":\"message_router\"}}",
+ "description": "standard http port collector will open for listening;",
+ "sourced_at_deployment": False,
+ "policy_editable": False,
+ "designer_editable": False
+ },
+ {
+ "name": "streams_publishes",
+ "value": "{\"add_publisher\":{\"dmaap_info\":{\"topic_url\":\"http://message-router:3904/events/unauthenticated.example-model_Out\"},\"type\":\"message_router\"}}",
+ "description": "standard http port collector will open for listening;",
+ "sourced_at_deployment": False,
+ "policy_editable": False,
+ "designer_editable": False
+ }
+ ],
+ "auxilary": {
+ "helm": {
+ "service": {
+ "type": "ClusterIP",
+ "name": "example-model",
+ "has_internal_only_ports": "true",
+ "ports": [{
+ "name": "http",
+ "port": 8443,
+ "plain_port": 8080,
+ "port_protocol": "http"
+ }
+ ]
+ }
+ },
+ "healthcheck": {"type": "HTTP", "interval": "15s", "timeout": "1s", "port": 8080,
+ "endpoint": "/healthcheck"}},
+ "artifacts": [{"type": "docker image", "uri": "example-model:latest"}],
+ }
# org.onap.dcae
# =============================================================================
# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2021 highstreet technologies GmbH. All rights reserved.
# =============================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ============LICENSE_END======================================================
[tox]
-envlist = py37,flake8
+envlist = py39,flake8
[testenv]
whitelist_externals =
pytest --verbose --junitxml xunit-results.xml --cov aoconversion --cov-report xml --cov-report html --cov-report term
[testenv:flake8]
-basepython = python3.7
+basepython = python3.9
skip_install = true
deps = flake8
commands = flake8 setup.py aoconversion tests