[DCAE] INFO.yaml update
[dcaegen2/platform.git] / adapter / acumos / aoconversion / convert.py
1 # ============LICENSE_START====================================================
2 # org.onap.dcae
3 # =============================================================================
4 # Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
5 # Copyright (c) 2021 highstreet technologies GmbH. All rights reserved.
6 # =============================================================================
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #      http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 # ============LICENSE_END======================================================
19
20 """
21 Module that converts acumos models to dcae artifacts
22 """
23 from aoconversion import docker_gen, dataformat_gen, spec_gen
24
25
26 def gen_dcae_artifacts_for_model(config, model_name, model_version="latest"):
27     """
28     Generate all dcae artifacts given an acumos model
29     """
30     model_repo_path = config.tmpdir
31     docker_uri = docker_gen.build_and_push_docker(config, model_name, model_version)
32     data_formats = dataformat_gen.generate_dcae_data_formats(model_repo_path, model_name)
33     spec = spec_gen.generate_spec(model_repo_path, model_name, data_formats, model_version)
34     return docker_uri, data_formats, spec