Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ICG - Infrastucture as Code Generator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PIACERE
public
The Platform
ICG - Infrastucture as Code Generator
Commits
59677413
Commit
59677413
authored
3 years ago
by
debora.benedetto@hpe.com
Browse files
Options
Downloads
Patches
Plain Diff
Add docs for Orchestrator main functions using reStructuredText standard
parent
5b13ab4a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
controller/Orchestrator.py
+29
-0
29 additions, 0 deletions
controller/Orchestrator.py
with
29 additions
and
0 deletions
controller/Orchestrator.py
+
29
−
0
View file @
59677413
...
...
@@ -80,6 +80,7 @@ def create_temp_model_file(model_xml):
logging
.
info
(
f
"
Successfully saved model in temp file at
{
temp_model_file_path
}
"
)
return
temp_model_file_path
def
create_intermediate_representation
(
model_path
,
is_multiecore_metamodel
,
metamodel_directory
):
logging
.
info
(
"
Calling ICG Parser for creating intermediate representation
"
)
intermediate_representation
=
ModelParser
.
parse_model
(
model_path
=
model_path
,
...
...
@@ -101,21 +102,49 @@ def compress_iac_folder(template_generated_folder):
compress_folder_info
=
CompressFolder
(
file_path
=
compress_file_folder_path
,
filename
=
compress_file_name
)
return
compress_folder_info
def
create_iac_from_intermediate_representation
(
intermediate_representation
):
logging
.
info
(
"
Creating iac files
"
)
template_generated_folder
=
create_infrastructure_files
(
intermediate_representation
)
return
template_generated_folder
def
create_iac_from_doml
(
model
,
is_multiecore_metamodel
,
metamodel_directory
):
"""
Create IaC files storing the model domlx in a temp file and then parsing it
:param model: the model xml file
:type model: xml
:param is_multiecore_metamodel: true if the metamodel is composed by multiecore files, false is it is a single ecore file
:type is_multiecore_metamodel: bool
:param metamodel_directory: the path of the metamodel directory
:type metamodel_directory: str
:returns: path to the zip folder containing the IaC files
:type: str
"""
logging
.
info
(
"
Creating iac files: parse and plugins will be called
"
)
model_path
=
create_temp_model_file
(
model_xml
=
model
)
## TODO: same as create_iac_from_doml_path a part from the model storage in xml
intermediate_representation
=
create_intermediate_representation
(
model_path
,
is_multiecore_metamodel
,
metamodel_directory
)
template_generated_folder
=
create_iac_from_intermediate_representation
(
intermediate_representation
)
compress_folder_info
=
compress_iac_folder
(
template_generated_folder
)
return
compress_folder_info
def
create_iac_from_doml_path
(
model_path
,
is_multiecore_metamodel
,
metamodel_directory
):
"""
Create IaC files from existing file model domlx
:param model_path: the model xml file location
:type model_path: str
:param is_multiecore_metamodel: true if the metamodel is composed by multiecore files, false is it is a single ecore file
:type is_multiecore_metamodel: bool
:param metamodel_directory: the path of the metamodel directory
:type metamodel_directory: str
:returns: path to the zip folder containing the IaC files
:type: str
"""
intermediate_representation
=
create_intermediate_representation
(
model_path
,
is_multiecore_metamodel
,
metamodel_directory
)
template_generated_folder
=
create_iac_from_intermediate_representation
(
intermediate_representation
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment