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

Sync cloudnet tosca 2021 09 22 10 42 38 #37

Merged
merged 122 commits into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
6db93d6
Merge pull request #5 from Orange-OpenSource/master
philippemerle Mar 3, 2021
1f8ac3a
Activated tosca_2_0 syntax checking
philippemerle Mar 8, 2021
3715cb7
Corrected TOSCA 2.0 grammar, i.e. how extending #/definitions/common_…
philippemerle Mar 14, 2021
f7e1811
Improved to support TOSCA 2.0 grammar, don't load tosca_simple_yaml_1…
philippemerle Mar 14, 2021
0a2e070
double quote current directory to deal with spaces in the path
philippemerle Mar 16, 2021
202790e
added a new yaml parsing error case
philippemerle Mar 17, 2021
03745b9
corrected https://github.com/Orange-OpenSource/Cloudnet-TOSCA-toolbox…
philippemerle Mar 18, 2021
a24f045
corrected https://github.com/Orange-OpenSource/Cloudnet-TOSCA-toolbox…
philippemerle Mar 18, 2021
b4c8e37
resolved https://github.com/Orange-OpenSource/Cloudnet-TOSCA-toolbox/…
philippemerle Mar 18, 2021
77ec156
improved import management and deal with short notation for capabilit…
philippemerle Mar 28, 2021
2231032
generated policies in UML2 component diagrams
philippemerle Mar 28, 2021
8e48bdc
commented generation of operation inputs
philippemerle Mar 28, 2021
d79d5aa
generate Neutron::Subnet only for ipv4 and ipv6 layer protocols
philippemerle Mar 31, 2021
988a4b0
Generated configurable Alloy invariants
philippemerle Mar 31, 2021
f11c460
Optimized the requirements relation
philippemerle Mar 31, 2021
c7be55d
Added two topology_template functions to retrieve the owning topology…
philippemerle Mar 31, 2021
de077b9
improved detection of required properties/inputs which are unassigned
philippemerle Apr 3, 2021
db1e9f7
changed some warnings into information messages as these warnings are…
philippemerle Apr 5, 2021
e0c0b88
computed the scope of attributes of the substitution_mappings node type
philippemerle Apr 5, 2021
5c88435
the bug seems to be corrected
philippemerle Apr 5, 2021
69b784a
Initial commits of the generation of workflow diagrams
philippemerle Apr 28, 2021
8df01ed
Colored regression messages
philippemerle May 3, 2021
1e600bd
Put networks at the bottom of deployment diagrams and normalize state…
philippemerle May 4, 2021
fb8d352
Corrected both issues https://gitlab.inria.fr/cloudnet/common/-/issue…
philippemerle May 4, 2021
60504a2
Corrected issue https://gitlab.inria.fr/cloudnet/common/-/issues/5
philippemerle May 4, 2021
40393c0
improved scalar unit parsing
philippemerle May 5, 2021
46bc852
substitution property mapping does not required to be set
philippemerle May 5, 2021
f105117
Added check_property_mapping
philippemerle May 5, 2021
dc871c0
Tagged warnings as they are now checked by run.sh
philippemerle May 5, 2021
e26ba3d
Corrected a recently introduced bug
philippemerle May 5, 2021
1e92884
Improved the type checker: more accurated messages and avoid an excep…
philippemerle May 5, 2021
c5b8426
Corrected to work on MacOS
philippemerle May 5, 2021
e7ab642
Checked constraints of list entries and map keys/entries, related to …
philippemerle May 5, 2021
3bd0d2c
Minor improvements
philippemerle May 12, 2021
ff85fe5
displayed unmapped substitution mapping requirements
philippemerle May 12, 2021
cc5c239
Used the full path instead of just the file name as name of generated…
philippemerle May 12, 2021
e0f3c11
New features and various improvements:
philippemerle May 12, 2021
7406ee0
added a configuration parameter to generate long full filenames
philippemerle May 15, 2021
794d55a
Generated a sequence diagram for each policy trigger and generated po…
philippemerle May 16, 2021
7dea2d9
improved generated sequence diagrams
philippemerle May 16, 2021
1a78c18
Added the '_' prefix to name starting with a digit
philippemerle Jun 3, 2021
2154a4e
Normalized node of capability mappings
philippemerle Jun 3, 2021
21da2ca
Improvements
philippemerle Jun 3, 2021
eb51b7a
Checked that a property mapping is a 1-string array
philippemerle Jun 20, 2021
a1625f2
Preliminary implementation for checking node template directive keyna…
philippemerle Aug 31, 2021
ffa15b3
Added a configurable service template catalog
philippemerle Sep 1, 2021
a27fbbf
Added support for get_input with a list parameter
philippemerle Sep 2, 2021
e691d72
Dealw with map based import definition
philippemerle Sep 2, 2021
47c40f9
Improved the support of property mapping, i.e. support of both mappin…
philippemerle Sep 3, 2021
d980b8f
fixed a typo
philippemerle Sep 6, 2021
8be3935
added outputs
philippemerle Sep 6, 2021
183b20d
Improved type checking of requirement definitions: Avoid unexpected w…
philippemerle Sep 10, 2021
0612ea8
Uncommented code previously commented
philippemerle Sep 12, 2021
a188ddc
Generated the feature capability of a node template when this capabil…
philippemerle Sep 14, 2021
7457a31
Checked that the directory of network diagrams exists
philippemerle Sep 14, 2021
e6f6724
Don't exit when there are typing errors, then diagrams are generated
philippemerle Sep 14, 2021
1c61fee
Added the missed boolean.valid_values predicate
philippemerle Sep 15, 2021
d0d6891
Removed declaration of Alloy signatures for TOSCA normative types, on…
philippemerle Sep 15, 2021
f9a337a
Added support for colorated UML2 component and deployment diagrams
philippemerle Sep 15, 2021
8f4bc00
Minor correction for generated component diagrams
philippemerle Sep 15, 2021
c618bb6
Clean up Alloy specification for TOSCA
philippemerle Sep 16, 2021
89a1219
Added the missed max_length predicate
philippemerle Sep 21, 2021
7c2786e
Added a missed predicate max_length for Map signature and seq
philippemerle Sep 22, 2021
2761fa7
Straight Manual Merge remote-tracking branch 'upstream/master' to Syn…
JLCoulin Sep 22, 2021
36f4d86
Unecessary file removed
JLCoulin Sep 22, 2021
3152919
Black python linter applied
JLCoulin Sep 22, 2021
7ff6ede
Used the right API to access interface operations
philippemerle Sep 25, 2021
69f8526
A try to deal with operation in StrCoord type
JLCoulin Sep 28, 2021
f352b12
get alloy.py from PM Fork and include the 2 calls to diagnostic
JLCoulin Sep 29, 2021
0c0b586
Comment added
JLCoulin Sep 29, 2021
7355920
minor change (message added for log diagnostic formatting) and typo c…
JLCoulin Sep 29, 2021
6629a36
Minor updates
JLCoulin Oct 5, 2021
f8cda14
Attempt to get line and column numbers on errors.
JLCoulin Oct 5, 2021
1864f75
Optimation of generated Alloy code: replace << one R implies P >> by …
philippemerle Oct 14, 2021
18247a8
Cosmetic correction in generated PlantUML code
philippemerle Oct 14, 2021
4845d98
Checked useless assignment and checked unexpected requirement mapping…
philippemerle Oct 14, 2021
bb8ece1
Changed made to deal with new Coord types defined in yaml_line_number…
JLCoulin Oct 14, 2021
edd5bdc
Changes to deal with DictCoord type in capabilities
JLCoulin Oct 14, 2021
ef0f8df
typo
JLCoulin Oct 14, 2021
70265e3
Temporary commit to review questions
JLCoulin Oct 21, 2021
f760339
Try to define get function for DictCoord and DictCoord types
JLCoulin Oct 21, 2021
ac7beb0
Convert all type(value) with isinstance(value)
JLCoulin Oct 25, 2021
e5686a6
Portion of code corrected
JLCoulin Oct 25, 2021
a0021c8
bug fixes
philippemerle Nov 17, 2021
61cf47e
Quoted network name
philippemerle Nov 17, 2021
76beb00
Fixed TOSCA 1.0 normative types
philippemerle Nov 17, 2021
fef7416
Make forwarding node types configurable, remove the reference to ETSI…
philippemerle Nov 19, 2021
99d5a9f
Removed LF at the first line
philippemerle Nov 19, 2021
38591b4
Moved to the latest PlantUML version
philippemerle Nov 19, 2021
0adb887
Added support to configure icons associated to node and artifact types
philippemerle Nov 19, 2021
e5f04f9
Removed a duplicate key
philippemerle Nov 20, 2021
de3ad5b
Fixed two issues
philippemerle Nov 20, 2021
b9ed836
Moved from jsonschema.Draft4Validator to jsonschema.Draft7Validator
philippemerle Nov 20, 2021
4218e67
Fixed the generation of property maps in deployment diagrams
philippemerle Nov 21, 2021
63434ea
Added to the operation implementation to UML class diagrams
philippemerle Nov 21, 2021
b03ed5d
capability in requirement definition is required in TOSCA specifications
philippemerle Nov 21, 2021
cc99d00
schedule is not a keyname in TOSCA 2.0
philippemerle Nov 21, 2021
889c6b4
timestamp is not supported by JSON schema
philippemerle Nov 21, 2021
c8596c7
Fix the grammar for trigger condition according to discussions betwee…
philippemerle Nov 21, 2021
110c30b
Fix the grammar for inputs, parameter_definition shall be used instea…
philippemerle Nov 21, 2021
dd6bd8e
Improved how to deal with configurable filename-format
philippemerle Nov 21, 2021
844b57c
Fixed regression tests as capability in requirement definition is req…
philippemerle Nov 21, 2021
3a36032
Improvments of the type checker: added a lot of checks to avoid excep…
philippemerle Nov 21, 2021
5b086d0
Configured the next declarative workflows generator
philippemerle Nov 21, 2021
6357e52
Added the new declarative workflows generator
philippemerle Nov 21, 2021
ff3ee75
Excluded generated deployment workflows for the syntax checking
philippemerle Nov 21, 2021
db1f479
Set a different color to fork and join bars in workflow diagrams, thi…
philippemerle Nov 21, 2021
2e9eea0
Added check_unmapped_definitions to recover the message about interfa…
JLCoulin Nov 22, 2021
e4e05e7
List type unsupported error recovered.
JLCoulin Nov 23, 2021
107b0be
upgraded logging level to info
JLCoulin Nov 23, 2021
0844e5d
Merge remote-tracking branch 'upstream/master' into Sync-Cloudnet-TOS…
JLCoulin Nov 24, 2021
dba70fc
Merge bugs fixed
JLCoulin Nov 24, 2021
756dacd
Fixed code thanks to Jean-Luc report
philippemerle Nov 24, 2021
0705ff8
Used the new get_artifact_type_by_filename method
philippemerle Nov 24, 2021
53b764e
Bug fix for uml2 diagram generation
JLCoulin Nov 24, 2021
c90d3c4
Use of the new get_artifact_type_by_filename method
JLCoulin Nov 24, 2021
ffd7bda
Differences in alloy files generation in tosca-k8s examples corrected.
JLCoulin Dec 2, 2021
f7efbab
Merge remote-tracking branch 'upstream/master' into Sync-Cloudnet-TOS…
JLCoulin Dec 2, 2021
f841b3d
Get types.yaml for tosca 1.0 from P. Merle repo
JLCoulin Dec 2, 2021
e245bdb
Comment out the wrinting of generated workflows
JLCoulin Dec 6, 2021
607bb40
New attempt to merge uml2_diagrams.py
JLCoulin Dec 7, 2021
6191502
Correction to get uml2 diagrams generated correctly in tosca-k8s example
JLCoulin Dec 9, 2021
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
113 changes: 49 additions & 64 deletions bin/Alloy/models/cloudnet/TOSCA.als
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Software Name : Cloudnet TOSCA toolbox
* Version: 1.0
* SPDX-FileCopyrightText: Copyright (c) 2020 Orange
* SPDX-FileCopyrightText: Copyright (c) 2020-21 Orange
* SPDX-License-Identifier: Apache-2.0
*
* This software is distributed under the Apache License 2.0
Expand Down Expand Up @@ -143,6 +143,11 @@ pred scalar_unit_time.greater_than[sut: one scalar_unit_time]
* TOSCA scalar predicates.
*******************************************************************************/

pred boolean.valid_values[values: set boolean]
{
this in values
}

pred valid_values[variable: one String, values: set String]
{
variable in values
Expand All @@ -158,13 +163,6 @@ pred integer.valid_values[values: set integer]
this in values
}

/*
pred valid_values[variable: one String, value1: one Int, value2: one Int]
{
// TODO: variable in values
}
*/

pred in_range[variable: one range, value1: one Int, value2: one Int]
{
// NOTE: Always true because not supported currently.
Expand All @@ -182,45 +180,46 @@ pred float.greater_or_equal[value: one float]

pred integer.greater_or_equal[value: one Int]
{
one this implies this >= value
this >= value
}

pred integer.greater_than[value: one Int]
{
one this implies this > value
this > value
}

pred integer.less_or_equal[value: one Int]
{
one this implies this <= value
this <= value
}

pred integer.in_range[lower: one integer, upper: one integer]
{
one this implies {
lower <= this
this <= upper
}
lower <= this
this <= upper
}

pred min_length[variable: one String, value: one Int]
{
// NOTE: Always true because not supported currently.
}

/*
pred min_length[variable: set String -> univ, value: one Int]
pred max_length[variable: one String, value: one Int]
{
#variable >= value
// NOTE: Always true because not supported currently.
}
*/

//fk added following an error in SOL001 2.8.1 NSD_types: 'constraints: min_length' has been applied to a list in tosca.policies.nfv.NsMonitoring
pred min_length[variable: seq univ, value: one Int]
{
#variable >= value
}

pred max_length[variable: seq univ, value: one Int]
{
#variable <= value
}

pred boolean.equal[value: one boolean]
{
this = value
Expand All @@ -231,6 +230,11 @@ pred string.equal[value: one String]
this = value
}

pred equal[variable: seq univ, value: seq univ]
{
variable = value
}

/*******************************************************************************
* TOSCA range predicates.
*******************************************************************************/
Expand Down Expand Up @@ -308,27 +312,19 @@ fun ToscaComponent.interface[name: one String] : one Interface
* TOSCA requirements and capabilities are named LG roles.
*******************************************************************************/

//TODO: remove following useless signature
abstract sig ToscaRole extends LG/Role {
_name_: one String,
} {
}

//TODO: remove following useless predicate
pred ToscaRole.no_name[]
{
this._name_= "(anonymous)"
}

//TODO: remove following useless predicate
pred ToscaRole.name[n: one String]
{
this._name_ in n
// NOTE: Could be also
// some this implies this.name = n
// but this produces more SAT vars and clauses.
}

fun role[roles: set ToscaRole, role_name: one String] : set ToscaRole
{
{ r : roles { r._name_ = role_name } }
}

/*******************************************************************************
Expand Down Expand Up @@ -395,14 +391,13 @@ sig TopologyTemplate extends LG/LocationGraph
distinct_names[outputs]

// if one substitution_mapping then it is distinct of nodes.
one substitution_mapping implies substitution_mapping not in nodes
some substitution_mapping implies substitution_mapping not in nodes

//
// Mapping TOSCA to Location Graphs.
//
// nodes, relationships, groups and policies are locations of this location graph.
// TBR locations = nodes + relationships + groups + policies + nodes.requirements.relationship
locations = nodes + relationships + groups + policies + (String.(nodes.requirements)).relationship
locations = nodes + relationships + groups + policies + nodes.requirements.relationship
// NOTE: substitution_mapping is not a location of this location graph but
// will be part of the location graphs where it will be substituted.
}
Expand Down Expand Up @@ -436,12 +431,12 @@ pred TopologyTemplate.with_inputs[args: String -> lone any]
{
all input : this.inputs {
let arg_value=args[input._name_] {
one arg_value
some arg_value
implies
input.set_value[arg_value]
else
let default_value=input.default {
one default_value
some default_value
implies
input.set_value[default_value]
else
Expand Down Expand Up @@ -545,8 +540,7 @@ pred TopologyTemplate.apply_substitution[]

abstract sig Node extends ToscaComponent {
node_type_name: lone String, // NOTE: Used by the substitution algorithm.
// TBR: requirements : set Requirement,
requirements : String -> Requirement,
requirements : set Requirement,
capabilities : set Capability,
artifacts : set Artifact,
} {
Expand All @@ -557,8 +551,7 @@ abstract sig Node extends ToscaComponent {
// Mapping TOSCA to Location Graphs.
//
// Requirements are required roles of this location.
// TBR: required = requirements
required = String.requirements
required = requirements
//
// Capabilities are provided roles of this location.
provided = capabilities
Expand All @@ -570,27 +563,15 @@ pred Node.capability[capability: one Capability]
capability in this.capabilities
}

fun Node.capability[name: one String] : set Capability
{
role[this.capabilities, name]
}

/** A requirement is owned by this node. */
// TBR: pred Node.requirement[requirement: one Requirement]
//TODO: remove the name parameter as useless
pred Node.requirement[name: String, requirement: one Requirement]
{
// TBR: requirement in this.requirements
(name -> requirement) in this.requirements
}

fun Node.requirement[name: one String] : set Requirement
{
// TBR: role[this.requirements, name]
this.requirements[name]
requirement in this.requirements
}

/** An artefact is owned by this node. */
pred Node.artifact[artifact: one Artifact]
pred Node.artifact[artifact: one Artifact]
{
artifact in this.artifacts
}
Expand All @@ -600,35 +581,33 @@ fun Node.artifact[name: one String] : one Artifact
get_value[this.artifacts, name]
}

/** Get the topology template owning this node */
fun Node.topology_template[] : one TopologyTemplate
{
~nodes[this]
}

/*******************************************************************************
* TOSCA Requirement.
*******************************************************************************/

// TODO: to remove as perhaps not required
// abstract // TBR: abstract is not necessary
sig Requirement extends ToscaRole {
relationship: lone Relationship
} {
//
// TOSCA constraints.
//
// The source of the relationship is this requirement.
one relationship implies relationship.source = this
some relationship implies relationship.source = this

// The name of requirement is stored by the node owning this reference.
no_name[]
}

/* Return the node owning a given requirement. */
fun Requirement.node[] : set Node {
// TBR: ~(Node<:requirements)[this]
~(Node<:select13[requirements])[this]
}

// Copied from ternary.als
/** returns the first and last columns of a ternary relation */
fun select13 [r: univ->univ->univ] : ((r.univ).univ) -> (univ.(univ.r)) {
{x: (r.univ).univ, z: univ.(univ.r) | some (x.r).z}
~(Node<:requirements)[this]
}

/** The capability targetted by this requirement is of given capability types. */
Expand Down Expand Up @@ -762,6 +741,12 @@ pred Policy.targets[nodesAndGroups: set Node + Group]
this.targets = nodesAndGroups
}

/** Get the topology template owning this policy */
fun Policy.topology_template[] : one TopologyTemplate
{
~policies[this]
}

/*******************************************************************************
* TOSCA Interface.
*******************************************************************************/
Expand Down
7 changes: 6 additions & 1 deletion bin/Alloy/models/cloudnet/map.als
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
*
* Software Name : Cloudnet TOSCA toolbox
* Software Name : Cloudnet TOSCA toolbox
* Version: 1.0
* SPDX-FileCopyrightText: Copyright (c) 2020 Orange
* SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -53,6 +53,11 @@ pred Map.min_length[length : one Int]
// #this.entries >= length
}

pred Map.max_length[length : one Int]
{
// ISSUE: Currently not implemented :-(
}

pred Map.entry_schema_type[type: set VALUE]
{
// ISSUE: Currently commented as generating CNF takes too time :-(
Expand Down
Loading