Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added diagrams generated with Cloudnet TOSCA toolbox #50

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,6 @@ cython_debug/

# default opera storage folder
.opera/

# PlantUML diagram generation
?
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions diagrams/toolbox/additional_artifact_types.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
######################################################################
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rename this folder to .cloudnet-tosca-toolbox for being clearer. It's important that this directory name starts with the dot (.) to keep it hidden. This is needed because xOpera examples are already separated into folders and we cannot have a folder for generating diagrams on the same level.

#
# None standardized TOSCA types.
#
# Copyright (c) 2021 Inria
#
######################################################################

tosca_definitions_version: tosca_simple_yaml_1_3

artifact_types:
tosca.artifacts.Implementation.Ansible:
derived_from: tosca.artifacts.Implementation
description: Artifact for the interpreted Ansible language
mime_type: application/x-ansible
file_ext: [ yaml ]

tosca.artifacts.File.Text:
derived_from: tosca.artifacts.File
description: Artifact for TEXT files
file_ext: [ txt ]

tosca.artifacts.File.Json:
derived_from: tosca.artifacts.File
description: Artifact for JSON files
file_ext: [ json ]
39 changes: 39 additions & 0 deletions diagrams/toolbox/generate-diagrams.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#! /bin/sh
######################################################################
#
# Run the Cloudnet TOSCA toolbox.
#
# Copyright (c) 2021 Inria
#
######################################################################

# Check that the CLOUDNET_BINDIR environment variable is set correctly.
if [ ! -f ${CLOUDNET_BINDIR}/cloudnet_rc.sh ]
then
echo "The CLOUDNET_BINDIR environment variable is not set correctly!"
exit 1
fi
Comment on lines +10 to +15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script can be executed if the user has already installed Cloudnet TOSCA toolbox, right? It would be nice to have also the installation part here in this script.


# Load cloudnet commands.
. ${CLOUDNET_BINDIR}/cloudnet_rc.sh

# Copy the toolbox configuration.
cp diagrams/toolbox/tosca2cloudnet.yaml .

# Compile all xopera-examples service template files.
translate $(grep 'tosca_definitions_version: ' -l -r .)

# Remove useless generated files.
rm diagrams/*-workflow-diagram.plantuml

# Generate UML2 diagrams.
generate_uml2_diagrams diagrams/*.plantuml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also rather see that each diagram would be separated the folder that contains the corresponding example.


# Remove useless generated files.
rm -rf diagrams/Alloy/ \
diagrams/DeclarativeWorkflows/ \
diagrams/ToscaDiagrams/ \
diagrams/NetworkDiagrams/ \
diagrams/*.plantuml \
diagrams/*.svg \
tosca2cloudnet.yaml
71 changes: 71 additions & 0 deletions diagrams/toolbox/tosca2cloudnet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
######################################################################
#
# Configuration for Cloudnet TOSCA toolbox.
#
# Copyright (c) 2021 Inria
#
######################################################################

# Configuration of the type checker.
TypeSystem:
tosca_normative_types:
tosca_simple_yaml_1_3:
- file:/cloudnet/tosca/profiles/tosca_simple_yaml_1_3/types.yaml
- file:diagrams/toolbox/additional_artifact_types.yaml

# Configuration of all generators.
Generator:
filename-format: fullname # keep full filenames

# Configuration of the Alloy generator.
Alloy:
# Target directory where Alloy files are generated.
target-directory: diagrams/Alloy

# Configuration of the declarative workflow generator.
DeclarativeWorkflows:
# Target directory where declarative workflows are generated.
target-directory: diagrams/DeclarativeWorkflows

# Configuration of the network diagram generator.
nwdiag:
# Target directory where network diagrams are generated.
target-directory: diagrams/NetworkDiagrams

# Configuration of the TOSCA diagram generator.
tosca_diagrams:
# Target directory where network diagrams are generated.
target-directory: diagrams/ToscaDiagrams

# Configuration of the UML2 diagram generator.
UML2:
# Target directory where UML2 diagrams are generated.
target-directory: diagrams

# Logging configuration.
logging:
loggers:
cloudnet.tosca.configuration:
level: WARNING
cloudnet.tosca.importers:
level: WARNING
cloudnet.tosca.processors:
level: WARNING
cloudnet.tosca.syntax:
level: WARNING
cloudnet.tosca.type_system:
level: WARNING
cloudnet.tosca.declarative_workflows:
level: WARNING
cloudnet.tosca.alloy:
level: WARNING
cloudnet.tosca.network_diagrams:
level: WARNING
cloudnet.tosca.tosca_diagrams:
level: WARNING
cloudnet.tosca.uml2_diagrams:
level: WARNING
cloudnet.tosca.hot:
level: WARNING
root:
level: WARNING
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<map id="tosca-intrinsic-functions-service-uml2-class-diagram_map" name="tosca-intrinsic-functions-service-uml2-class-diagram_map">
<area shape="rect" id="id1" href="'a'," title="&#39;a&#39;," alt="" coords="565,179,717,192"/>
</map>
Comment on lines +1 to +3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, why is this file different than the others?