diff --git a/tests/FaaS Thumbnail Generator/FaaS Thumbnail Generator.docx b/tests/FaaS Thumbnail Generator/FaaS Thumbnail Generator.docx index ee0401ab3043de21ff31514e69e087b54d101012..568d755b820d5f9c24ade3faa31979471f88ac53 100644 Binary files a/tests/FaaS Thumbnail Generator/FaaS Thumbnail Generator.docx and b/tests/FaaS Thumbnail Generator/FaaS Thumbnail Generator.docx differ diff --git a/tests/FaaS Thumbnail Generator/faas_thumbnail_generator.doml b/tests/FaaS Thumbnail Generator/faas_thumbnail_generator.doml index 843a511ad52156a17ff604099e6a449f834838f0..ab041960aeb45de6053d38c89b3e355a30792c2e 100644 --- a/tests/FaaS Thumbnail Generator/faas_thumbnail_generator.doml +++ b/tests/FaaS Thumbnail Generator/faas_thumbnail_generator.doml @@ -1,131 +1,133 @@ -doml faas_thumbnail_generator - -application ImageResizeApp { - software_component image_resize { - source s1 { - entry "python/image_resize.py" - backend "python" +doml faas_thumbnail_generator { + version "3.1" + + application ImageResizeApp { + software_component image_resize { + source s1 { + entry "python/image_resize.py" + backend "python" + } + provides { + handle_image + } + consumes { + storage_interface + bucket_in + bucket_out + } } - provides { - handle_image + saas st { + provides { + storage_interface + bucket_in + bucket_out + } } - consumes { - storage_interface, - bucket_in, - bucket_out + software_component notification { + consumes { + handle_image + bucket_in + } } - } - saas st { - provides { - storage_interface, - bucket_in, - bucket_out + software_component web { + source s2 { + entry "django/web_app.py" + backend "django" + } + consumes { + storage_interface + bucket_out + } } } - software_component notification { - consumes { - handle_image, - bucket_in + + infrastructure infra { + net net1 { + protocol "TCP/IP" } - } - software_component web { - source s2 { - entry "django/web_app.py" - backend "django" + vm_image v_img { + generates { v } + image "v.iso" } - consumes { - storage_interface, - bucket_out + container c { + host v { + cont_config { + cont_port 80 + vm_port 8080 + iface i1 + } + } } - } -} - -infrastructure infra { - net net1 { - cidr "16.0.0.0/24" - protocol "TCP/IP" - } - vm_image v_img { - generates v - image "v.iso" - } - container c { - host v { - container_port 80 - vm_port 8080 - iface i1 + cont_image c_img { + generates { c } + image "docker.hub.io/thumbnail_generator/tgen:1.0" } - } - cont_image c_img { - generates c - image "docker.hub.io/thumbnail_generator/tgen:1.0" - } - key_pair ssh_key { - user "username" - keyfile "ssh key" - } - faas f { - // properties ... - // cost ... - } - storage s { - label "disk0" - size_gb 40 - } - autoscale_group g1 { - vm v { - size "micro" - iface i1 { - address "16.0.0.1" - belongs_to net1 - } - credentials ssh_key - loc { - region "00EU" + key_pair ssh_key { + user "username" + key "ssh key" + } + faas f { + // properties ... + // cost ... + } + storage s { + label "disk0" + size_gb 40 + } + autoscale_group g1 { + vm v { + size "micro" + iface i1 { + address "16.0.0.1" + belongs_to net1 + } + credentials ssh_key + loc { + region "00EU" + } } } + security_group sg { + // rules... + ifaces { i1 } + } } - security_group sg { - // rules... - ifaces i1 + + deployment config1 { + image_resize => f + web => c + st => s } -} - -deployment config1 { - image_resize => f, - web => c, - st => s -} - -active deployment config1 - -concretizations { - concrete_infrastructure con_infra { - provider aws { - autoscale_group concrete_g1 { - maps g1 - } - faas concrete_f { - maps f - } - storage concrete_s { - maps s - } - net concrete_net { - properties { - name = "piacere_net" + + active deployment config1 + + concretizations { + concrete_infrastructure con_infra { + provider aws { + autoscale_group concrete_g1 { + maps g1 + } + faas concrete_f { + maps f + } + storage concrete_s { + maps s + } + net concrete_net { + resource_name "piacere_net" + cidr "16.0.0.0/24" + maps net1 + } + vm_image concrete_v_img { + preexisting true + maps v_img + } + cont_image concrete_c_img { + preexisting true + maps c_img } - maps net1 - } - vm_image concrete_v_img { - preexisting true - maps v_img - } - cont_image concrete_c_img { - preexisting true - maps c_img } } + active con_infra } - active con_infra } \ No newline at end of file diff --git a/tests/NginX Web Application/NginX Web Application.docx b/tests/NginX Web Application/NginX Web Application.docx index bf3fdcb6a6a4bbc49eb7badfd666f27c37a784a9..54154a2b3bbb91b254c94870684394ca0f4fca65 100644 Binary files a/tests/NginX Web Application/NginX Web Application.docx and b/tests/NginX Web Application/NginX Web Application.docx differ diff --git a/tests/NginX Web Application/nginx_web_application.doml b/tests/NginX Web Application/nginx_web_application.doml index 457bd5d7d4f661f928ae0038ed0c0c2a8c99e5fd..57ed9317c97be588679303a77de635adf493a5df 100644 --- a/tests/NginX Web Application/nginx_web_application.doml +++ b/tests/NginX Web Application/nginx_web_application.doml @@ -8,337 +8,353 @@ * Moreover, we want the availability and performance of the infrastructure to be maximized and OpenStack to be used as a cloud provider for the infrastructure. * */ -doml doml_example1 - -/* - * We first have to define our application components in the Application Layer. - */ -application app_example1 { - - /* - * A mysql DBMS: it provides a SQL interface to handle data. - */ - dbms mysql { - - provides { - sql_interface - } - - } +doml doml_example1 { + version "3.1" - /* - * An nginx web server to run the web application. - * As stated in the description above, it consumes the database interface. + /* + * We first have to define our application components in the Application Layer. */ - software_component nginx { - - consumes { - sql_interface - } - - } - -} - -/* - * We can then describe the abstract infrastructure in the Infrastructure Layer. - */ -infrastructure infra_example1 { + application app_example1 { - /* - * We want to use a VM to host the nginx web server. - * We want the VM to have the configuration we specify through the attributes. - */ - vm nginx_vm { - - arch "x86-64" - - os "Ubuntu-22.04.2-LTS" - - mem_mb 1024.0 - - sto "16" - - cpu_count 1 - - size "small" - - loc { - - region "00EU" - - } - /* - * We want to define a network interface belonging to the subnet we're defining for this VM. - * We decide to name such subnet "nginx_subnet". - */ - iface nginx_iface { + * A mysql DBMS: it provides a SQL interface to handle data. + */ + dbms mysql { - belongs_to nginx_subnet - } + provides { + sql_interface + } + + } /* - * We also want to specify credentials to access the VM. - * For security reasons, it's always a good practice to have separate credentials for each VM instance. - * We decide to name credentials to access this VM "nginx_vm_credentials". + * An nginx web server to run the web application. + * As stated in the description above, it consumes the database interface. */ - credentials nginx_vm_credentials - } - - - /* - * We want to use a VM to host the mysql DBMS. - * Analogously to what we have done above for the nginx_vm, we can specify the VM configuration through attributes. - */ - vm mysql_vm { - - arch "x86-64" - - os "Ubuntu-22.04.2-LTS" - - mem_mb 1024.0 - - sto "16" - - cpu_count 1 - - size "small" - - loc { + software_component nginx { - region "00EU" - - } - - /* - * We want to do the same as above. - * We decide to name the subnet "mysql_subnet". - */ - iface mysql_iface { + consumes { + sql_interface + } - belongs_to mysql_subnet } - // As done above, we proceed to set credentials to access the VM. - credentials mysql_vm_credentials - } /* - * We now want to configure the network. - * As stated above, we need to define two interconnected subnets. - * Moreover, we need to define an Internet gateway since we want the network to have access to Internet. + * We can then describe the abstract infrastructure in the Infrastructure Layer. */ - net common_network { + infrastructure infra_example1 { /* - * Definition of the first subnet, the one associated to the nginx_vm. + * We want to use a VM to host the nginx web server. + * We want the VM to have the configuration we specify through the attributes. */ - subnet nginx_subnet { + vm nginx_vm { - connections { - mysql_subnet - } + arch "x86-64" - cidr "10.0.144.0/25" - } - - // This definition is analogous to what is shown above. - subnet mysql_subnet { + os "Ubuntu-22.04.2-LTS" + + mem_mb 1024.0 + + sto 16.0 + + cpu_count 1 + + size "small" + + loc { + + region "00EU" - connections { - nginx_subnet } - cidr "10.0.144.128/25" + /* + * We want to define a network interface belonging to the subnet we're defining for this VM. + * We decide to name such a subnet "nginx_subnet". + */ + iface nginx_iface { + + belongs_to nginx_subnet + } + + /* + * We also want to specify credentials to access the VM. + * For security reasons, it's always a good practice to have separate credentials for each VM instance. + * We decide to name credentials to access this VM "nginx_vm_credentials". + */ + credentials nginx_vm_credentials } - protocol "TCP/IP" - cidr "10.0.144.0/24" - - gateway igw1 { + /* + * We want to use a VM to host the mysql DBMS. + * Analogously to what we have done above for the nginx_vm, we can specify the VM configuration through attributes. + */ + vm mysql_vm { + + arch "x86-64" + + os "Ubuntu-22.04.2-LTS" + + mem_mb 1024.0 - address "10.0.144.22" + sto 16.0 + + cpu_count 1 + + size "small" + + loc { + + region "00EU" + + } + + /* + * We want to do the same as above. + * We decide to name the subnet "mysql_subnet". + */ + iface mysql_iface { + + belongs_to mysql_subnet + } + + // As done above, we proceed to set credentials to access the VM. + credentials mysql_vm_credentials } - } - - /* - * As specified above, we want to define credentials to guarantee access to VMs. - * These credentials are used for the nginx_vm. - * We're here specifying the key through the keyfile attribute instead of using it for specifying the keyfile path. - */ - key_pair nginx_vm_credentials { - - user "nginx_user" - - keyfile "AAAAB3NzaC1yc2EAAAADAQABAAABAQC63ZvocMhX1LsdUlhzqLNSsh/Wotk/EMfDfa9pBHC52NXv05uENTjd/LBj8PS5JXEr7rKG9Zpj2Kj/PA7Gu0X1BZMwAiNR2dKjw9K0HO6Ozj3elCA7WjjotiQcO+OLWefE1PUW8/BJjtjFD/qf6wJd8CwInH8cjpkccQQfA55IXXegQMm5qv2a/S2XBvMMzv1dzsCy5UPO7tiOz4RBfi56JK8o2mDR327yY7+goA0HQz5tSN1X98+vxLpTPD5qINEFfVk1yNmf/ls3C7EBZQFJ6tsHgl070ymdBLHccmDMEYktzBnc/IhNWMq7K4IxwgFfQ7YSzAAqMr1n04+3oUeB" - - algorithm "RSA" - - bits 4096 - } - - // This definition is analogous to what we have shown above. - key_pair mysql_vm_credentials { - - user "mysql_user" - - keyfile "AAAAB3NzaC1yc2EAAAADAQABAAABAQCBiNSYpUJ9bCNhmFdEmCqF0WCW0f47SDN3T43nF5rDI06Ixuedk9+TlAUZudistB/RTlq0AaQmaZjBdQFkDvLiKnmEAB16eITQ/lz+eODcK5540E3Qd5jlq9DOy3s8eVaL8zg1zwaSktIJ/Y/jGyiy/MM1uobj/JNGNE++llYwh6/SjynGADo9bNcboJifLoU51lrJbyO6w7SJyeP28X46Dd6ob/GQwPAEZjhW+0U+K/JeDfIA1wYH6fC15K1pte9n57gd4RK+yRn7r45c0dP5M4gzZsZrXXaWRI/Dgbha08zSlKEzFdT7QcExMu+W6jGPZiHUSUAZJBxfRORHZ8iP" - - algorithm "RSA" - - bits 4096 - } - - /* - * We also want to secure access to our common network. - * In order to do so, we describe the rules for such network through the definition of a security group. - * - * Here are shown some of the most commonly used rules. - */ - security_group sec_group { - - egress icmp { + /* + * We now want to configure the network. + * As stated above, we need to define two interconnected subnets. + * Moreover, we need to define an Internet gateway since we want the network to have access to Internet. + */ + net common_network { + + protocol "TCP/IP" - protocol "ICMP" + /* + * Definition of the first subnet, the one associated to the nginx_vm. + */ + subnet nginx_subnet { + + connections { + mysql_subnet + } + + } - from_port -1 + // This definition is analogous to what is shown above. + subnet mysql_subnet { + + connections { + nginx_subnet + } + + } - to_port -1 + gateway igw1 { + + address "10.0.144.22" + + } - cidr ["0.0.0.0/0"] } - ingress ssh { + /* + * As specified above, we want to define credentials to guarantee access to VMs. + * These credentials are used for the nginx_vm. + */ + key_pair nginx_vm_credentials { - protocol "TCP" + user "nginx_user" - from_port 22 - - to_port 22 + key "AAAAB3NzaC1yc2EAAAADAQABAAABAQC63ZvocMhX1LsdUlhzqLNSsh/Wotk/EMfDfa9pBHC52NXv05uENTjd/LBj8PS5JXEr7rKG9Zpj2Kj/PA7Gu0X1BZMwAiNR2dKjw9K0HO6Ozj3elCA7WjjotiQcO+OLWefE1PUW8/BJjtjFD/qf6wJd8CwInH8cjpkccQQfA55IXXegQMm5qv2a/S2XBvMMzv1dzsCy5UPO7tiOz4RBfi56JK8o2mDR327yY7+goA0HQz5tSN1X98+vxLpTPD5qINEFfVk1yNmf/ls3C7EBZQFJ6tsHgl070ymdBLHccmDMEYktzBnc/IhNWMq7K4IxwgFfQ7YSzAAqMr1n04+3oUeB" + + algorithm "RSA" - cidr ["0.0.0.0/0"] + bits 4096 } - ingress http { + // This definition is analogous to what we have shown above. + key_pair mysql_vm_credentials { - protocol "TCP" + user "mysql_user" - from_port 80 + key "AAAAB3NzaC1yc2EAAAADAQABAAABAQCBiNSYpUJ9bCNhmFdEmCqF0WCW0f47SDN3T43nF5rDI06Ixuedk9+TlAUZudistB/RTlq0AaQmaZjBdQFkDvLiKnmEAB16eITQ/lz+eODcK5540E3Qd5jlq9DOy3s8eVaL8zg1zwaSktIJ/Y/jGyiy/MM1uobj/JNGNE++llYwh6/SjynGADo9bNcboJifLoU51lrJbyO6w7SJyeP28X46Dd6ob/GQwPAEZjhW+0U+K/JeDfIA1wYH6fC15K1pte9n57gd4RK+yRn7r45c0dP5M4gzZsZrXXaWRI/Dgbha08zSlKEzFdT7QcExMu+W6jGPZiHUSUAZJBxfRORHZ8iP" - to_port 80 + algorithm "RSA" - cidr ["0.0.0.0/0"] + bits 4096 } - ingress https { + /* + * We also want to secure access to our common network. + * In order to do so, we describe the rules for such network through the definition of a security group. + * + * Here are shown some of the most commonly used rules. + */ + security_group sec_group { + + egress icmp { + + protocol "ICMP" + + from_port -1 + + to_port -1 + + cidrs ["0.0.0.0/0"] + } - protocol "TCP" + ingress ssh { + + protocol "TCP" + + from_port 22 - from_port 443 + to_port 22 + + cidrs ["0.0.0.0/0"] + } + + ingress http { + + protocol "TCP" + + from_port 80 + + to_port 80 + + cidrs ["0.0.0.0/0"] + } + + ingress https { + + protocol "TCP" + + from_port 443 + + to_port 443 + + cidrs ["0.0.0.0/0"] + } - to_port 443 + // We want to specify that these rules apply to both the interfaces we defined for our VMs. + ifaces { + nginx_iface + mysql_iface + } - cidr ["0.0.0.0/0"] } - // We want to specify that these rules apply to both the interfaces we defined for our VMs. - ifaces nginx_iface, mysql_iface - } -} - -/* - * Now we have defined our abstract infrastructure and we're ready to deploy our application. - * Let's define the configuration for deployment. - */ -deployment config_example1 { - mysql => mysql_vm, - nginx => nginx_vm -} - -// We specify the active deployment configuration. We only have one, but this step is always necessary. -active deployment config_example1 - -/* - * We then need to define the concrete infrastructure in the Concrete Layer. - */ -concretizations { - - concrete_infrastructure concrete_example1 { - - /* - * As stated in the description, we want to use Openstack as a provider for our infrastructure. - * Any further information regarding the provider itself can be specified through properties. - * Here we have to describe the concrete components corresponding to the abstract ones defined in the Infrastructure Layer. - */ - provider openstack { - - /* - * We have three elements in the abstract infrastructure definition that need a concrete counterpart: - * - The two VMs for mysql DBMS and nginx web server - * - The common network - */ - - vm concrete_nginx_vm { - - maps nginx_vm - - } - - vm concrete_mysql_vm { - - maps mysql_vm - - } - - - net concrete_common_network { - - maps common_network - } - - } - - } - - // We specify the active concretization. - // Analogously to the deployment configurations, we only have one, but this step is always necessary. - active concrete_example1 - - } - - /* - * For this simple application, there is no need to define any functional requirement, so the corresponding - * section is not present in this example. - * - * However, we can specify some optimization objectives and non functional requirements. - * - * Even though we can express any kind of objective in DOML, the three widely used optimization - * targets are cost, availability and performance, which is also what PIACERE mainly focuses on. - * Since we haven't included any cost in the example, we're keeping as objectives the - * maximization of both performance and availability. - * - * As stated in the description of the example, both VMs should be located in the "00EU" region. - * In order to specify this constraint, we define a non-functional requirement. - * Moreover, we want to specify that we want to deploy two VMs as elements. - */ - - optimization opt{ + /* + * Now we have defined our abstract infrastructure and we're ready to deploy our application. + * Let's define the configuration for deployment. + */ + deployment config_example1 { + mysql => mysql_vm + nginx => nginx_vm + } + + // We specify the active deployment configuration. We only have one, but this step is always necessary. + active deployment config_example1 + + /* + * We then need to define the concrete infrastructure in the Concrete Layer. + */ + concretizations { + + concrete_infrastructure concrete_example1 { + + /* + * As stated in the description, we want to use Openstack as a provider for our infrastructure. + * Any further information regarding the provider itself can be specified through properties. + * Here we have to describe the concrete components corresponding to the abstract ones defined in the Infrastructure Layer. + */ + provider openstack { + + /* + * We have three elements in the abstract infrastructure definition that need a concrete counterpart: + * - The two VMs for mysql DBMS and nginx web server + * - The common network and its subnets + */ + + vm concrete_nginx_vm { + + maps nginx_vm + + } + + vm concrete_mysql_vm { + + maps mysql_vm + + } + + + net concrete_common_network { + + cidr "10.0.144.0/24" + + subnet concrete_nginx_subnet { + + cidr "10.0.144.0/25" + + maps nginx_subnet + } + + subnet concrete_mysql_subnet { + + cidr "10.0.144.128/25" + + maps mysql_subnet + } + + maps common_network + } + + } + + } + + // We specify the active concretization. + // Analogously to the deployment configurations, we only have one, but this step is always necessary. + active concrete_example1 + + } + + /* + * For this simple application, there is no need to define any functional requirement, so the corresponding + * section is not present in this example. + * + * However, we can specify some optimization objectives and non functional requirements. + * + * Even though we can express any kind of objective in DOML, the three widely used optimization + * targets are cost, availability and performance, which is also what PIACERE mainly focuses on. + * Since we haven't included any cost in the example, we're keeping as objectives the + * maximization of both performance and availability. + * + * As stated in the description of the example, both VMs should be located in the "00EU" region. + * In order to specify this constraint, we define a non-functional requirement. + * Moreover, we want to specify that we want to deploy two VMs as elements. + */ + + optimization opt{ + + objectives { + "availability" => max + "performance" => max + } + nonfunctional_requirements { + Req1 "Region" values "00EU" => "region" + Req2 "Provider" values "openstack" => "provider" + Req3 "elements" => "VM VM" + } - objectives { - "availability" => max - "performance" => max - } - nonfunctional_requirements { - Req1 "Region" values "00EU" => "region" - Req2 "Provider" values "openstack" => "provider" - Req3 "elements" => "VM, VM" - } - + } } \ No newline at end of file diff --git a/tests/Simplified Ericsson Case/Simplified Ericsson Case.docx b/tests/Simplified Ericsson Case/Simplified Ericsson Case.docx index 1b5437a56d26206b62aa75a00552a52266b8853e..f6f188e6a1573cb15164435e03e2406f62c9f48c 100644 Binary files a/tests/Simplified Ericsson Case/Simplified Ericsson Case.docx and b/tests/Simplified Ericsson Case/Simplified Ericsson Case.docx differ diff --git a/tests/Simplified Ericsson Case/simplified_ericsson_case.doml b/tests/Simplified Ericsson Case/simplified_ericsson_case.doml index 13a335df464efe06b1240ded8904388b10b5c7ce..e01428d295851ef7e7ce96a62e277433038b0aa9 100644 --- a/tests/Simplified Ericsson Case/simplified_ericsson_case.doml +++ b/tests/Simplified Ericsson Case/simplified_ericsson_case.doml @@ -1,236 +1,260 @@ -doml uc3_openstack -application app { - software_component iwg { - provides { net_info } - } - software_component osint { - provides { osint_info } - consumes { net_info, get_twitter, ewcf_rest_interface } - } - software_component ewcf { - provides { ewcf_rest_interface } - consumes { get_firebase } - } - saas external_twitter { - provides { get_twitter @ "https://twitter_api/get" } - } - saas external_firebase { - provides { get_firebase @ "https://firebase_api/get" } - } -} -infrastructure infra { - // VMs region -// This VM as a network interface belonging to the OAM network, -// one belonging to Net1 to communicate with the osint VM -// and one belonging to Net2 to access the 5G network - vm igw_vm { - os "Ubuntu-Focal-20.04-Daily-2022-04-19" - size "small" - iface igw_vm_oam { - belongs_to subnet_oam_igw - } - iface igw_vm_net1 { - belongs_to subnet_net1_igw - } - iface igw_vm_net2 { - belongs_to subnet_net2_igw - } - credentials ssh_key - } -// This VM has a network interface belonging to the OAM network, -// one belonging to Net1 to communicate with the other VMs -// and one belonging to Net3 to the access the Internet - vm osint_vm { - os "Ubuntu-Focal-20.04-Daily-2022-04-19" - size "small" - iface osint_vm_oam { - belongs_to subnet_oam_osint - } - iface osint_vm_net1 { - belongs_to subnet_net1_osint - } - iface osint_vm_net3 { - belongs_to subnet_net3_osint - } - credentials ssh_key - } -// This VM has a network interface belonging to the OAM network, -// one belonging to Net1 to communicate with the osint VM -// and one belonging to Net3 to access the Internet - vm ewcf_vm { - os "Ubuntu-Focal-20.04-Daily-2022-04-19" - size "small" - iface ewcf_vm_oam { - belongs_to subnet_oam_ewcf - } - iface ewcf_vm_net1 { - belongs_to subnet_net1_ewcf - } - iface ewcf_vm_net3 { - belongs_to subnet_net3_ewcf - } - credentials ssh_key - } - // Operation and management network, to which all the VMs are connected - net oam { - protocol "TCP/IP" - cidr "16.0.0.0/24" - subnet subnet_oam_igw { - protocol "TCP/IP" - cidr "16.0.1.0/26" +doml uc3_openstack { + version "3.1" + application app { + software_component iwg { + provides { net_info } } - subnet subnet_oam_osint { - protocol "TCP/IP" - cidr "16.0.1.64/26" + software_component osint { + provides { osint_info } + consumes { net_info get_twitter ewcf_rest_interface } } - subnet subnet_oam_ewcf { - protocol "TCP/IP" - cidr "16.0.1.128/26" + software_component ewcf { + provides { ewcf_rest_interface } + consumes { get_firebase } + } + saas external_twitter { + provides { get_twitter @ "https://twitter_api/get" } + } + saas external_firebase { + provides { get_firebase @ "https://firebase_api/get" } } } - - // This is an internal network and therefore has no Internet gateway - net net1 { - protocol "TCP/IP" - cidr "16.0.1.0/24" - // Subnets definition - subnet subnet_net1_igw { - connections { - subnet_net1_osint + infrastructure infra { + // VMs region + // This VM as a network interface belonging to the OAM network, + // one belonging to Net1 to communicate with the osint VM + // and one belonging to Net2 to access the 5G network + vm igw_vm { + os "Ubuntu-Focal-20.04-Daily-2022-04-19" + size "small" + iface igw_vm_oam { + belongs_to subnet_oam_igw } - protocol "TCP/IP" - cidr "16.0.1.0/25" + iface igw_vm_net1 { + belongs_to subnet_net1_igw + } + iface igw_vm_net2 { + belongs_to subnet_net2_igw + } + credentials ssh_key } - subnet subnet_net1_osint { - connections { - subnet_net1_igw - subnet_net1_ewcf + // This VM has a network interface belonging to the OAM network, + // one belonging to Net1 to communicate with the other VMs + // and one belonging to Net3 to the access the Internet + vm osint_vm { + os "Ubuntu-Focal-20.04-Daily-2022-04-19" + size "small" + iface osint_vm_oam { + belongs_to subnet_oam_osint } - protocol "TCP/IP" - cidr "16.0.1.64/26" + iface osint_vm_net1 { + belongs_to subnet_net1_osint + } + iface osint_vm_net3 { + belongs_to subnet_net3_osint + } + credentials ssh_key } - subnet subnet_net1_ewcf { - connections { - subnet_net1_osint + // This VM has a network interface belonging to the OAM network, + // one belonging to Net1 to communicate with the osint VM + // and one belonging to Net3 to access the Internet + vm ewcf_vm { + os "Ubuntu-Focal-20.04-Daily-2022-04-19" + size "small" + iface ewcf_vm_oam { + belongs_to subnet_oam_ewcf } - protocol "TCP/IP" - cidr "16.0.1.128/26" + iface ewcf_vm_net1 { + belongs_to subnet_net1_ewcf + } + iface ewcf_vm_net3 { + belongs_to subnet_net3_ewcf + } + credentials ssh_key } - } - // Network connecting igw to 5G - net net2 { - protocol "TCP/IP" - cidr "16.0.2.0/24" - subnet subnet_net2_igw { + // Operation and management network, to which all the VMs are connected + net oam { protocol "TCP/IP" - cidr "16.0.2.0/25" + subnet subnet_oam_igw { } + subnet subnet_oam_osint { } + subnet subnet_oam_ewcf { } } - gateway net2_igw { - address "16.0.2.22" + + // This is an internal network and therefore has no Internet gateway + net net1 { + protocol "TCP/IP" + // Subnets definition + subnet subnet_net1_igw { + connections { + subnet_net1_osint + } + } + subnet subnet_net1_osint { + connections { + subnet_net1_igw + subnet_net1_ewcf + } + } + subnet subnet_net1_ewcf { + connections { + subnet_net1_osint + } + } } - } - // Network connecting osint and ewcf to Internet - net net3 { - protocol "TCP/IP" - cidr "16.0.3.0/24" - subnet subnet_net3_osint { + // Network connecting igw to 5G + net net2 { protocol "TCP/IP" - cidr "16.0.3.0/25" + subnet subnet_net2_igw { } + gateway net2_igw { + address "16.0.2.22" + } } - subnet subnet_net3_ewcf { + // Network connecting osint and ewcf to Internet + net net3 { protocol "TCP/IP" - cidr "16.0.3.128/25" + subnet subnet_net3_osint { } + subnet subnet_net3_ewcf { } + gateway net3_igw { + address "16.0.3.22" + } } - gateway net3_igw { - address "16.0.3.22" + // Credentials region + // These credentials are used to access the VMs + key_pair ssh_key { + user "ubuntu" + // key to be inserted here + key "KEYVALUE" + algorithm "RSA" + bits 4096 } - } - // Credentials region - // These credentials are used to access the VMs - key_pair ssh_key { - user "ubuntu" -// key to be inserted here -keyfile "…" - algorithm "RSA" - bits 4096 - } - // Security region -// This security group is composed of standard security rules -// and is associated with all the interfaces - security_group sg { - egress icmp { - protocol "ICMP" - from_port -1 - to_port -1 - cidr ["0.0.0.0/0"] - } - ingress http { - protocol "TCP" - from_port 80 - to_port 80 - cidr ["0.0.0.0/0"] - } - ingress https { - protocol "TCP" - from_port 443 - to_port 443 - cidr ["0.0.0.0/0"] - } - ingress ssh { - protocol "TCP" - from_port 22 - to_port 22 - cidr ["0.0.0.0/0"] - } - ifaces igw_vm_oam, igw_vm_net1, igw_vm_net2, osint_vm_oam, osint_vm_net1, osint_vm_net3, ewcf_vm_oam, ewcf_vm_net1, ewcf_vm_net3 - } -} -deployment config1 { - osint -> osint_vm, - iwg -> igw_vm, - ewcf -> ewcf_vm -} -active deployment config1 -concretizations { - concrete_infrastructure con_infra { - provider openstack { - // Concrete computing nodes region - vm concrete_osint_vm { - maps osint_vm - } - vm concrete_igw_vm { - maps igw_vm - } - vm concrete_ewcf_vm { - maps ewcf_vm + // Security region + // This security group is composed of standard security rules + // and is associated with all the interfaces + security_group sg { + egress icmp { + protocol "ICMP" + from_port -1 + to_port -1 + cidrs ["0.0.0.0/0"] } - // Concrete networks region - net concrete_oam { - maps oam + ingress http { + protocol "TCP" + from_port 80 + to_port 80 + cidrs ["0.0.0.0/0"] } - net concrete_net1 { - maps net1 + ingress https { + protocol "TCP" + from_port 443 + to_port 443 + cidrs ["0.0.0.0/0"] } - net concrete_net2 { - maps net2 + ingress ssh { + protocol "TCP" + from_port 22 + to_port 22 + cidrs ["0.0.0.0/0"] } - net concrete_net3 { - maps net3 + ifaces { + igw_vm_oam + igw_vm_net1 + igw_vm_net2 + osint_vm_oam + osint_vm_net1 + osint_vm_net3 + ewcf_vm_oam + ewcf_vm_net1 + ewcf_vm_net3 } } } - active con_infra -} -optimization opt { - objectives { - "cost" => min - "performance" => max - "availability" => max + deployment config1 { + osint => osint_vm + iwg => igw_vm + ewcf => ewcf_vm } - nonfunctional_requirements { - req1 "Cost <= 300" max 300.0 => "cost" - req2 "Performance >= 7%" min 7.0 => "performance" - req3 "Provider" values "openstack" => "provider" - req4 "elements" => "VM, VM, VM" + active deployment config1 + concretizations { + concrete_infrastructure con_infra { + provider openstack { + // Concrete computing nodes region + vm concrete_osint_vm { + maps osint_vm + } + vm concrete_igw_vm { + maps igw_vm + } + vm concrete_ewcf_vm { + maps ewcf_vm + } + // Concrete networks region + net concrete_oam { + cidr "16.0.0.0/24" + subnet concrete_subnet_oam_igw { + cidr "16.0.1.0/26" + maps subnet_oam_igw + } + subnet concrete_subnet_oam_osint { + cidr "16.0.1.64/26" + maps subnet_oam_osint + } + subnet concrete_subnet_oam_ewcf { + cidr "16.0.1.128/26" + maps subnet_oam_ewcf + } + maps oam + } + net concrete_net1 { + cidr "16.0.1.0/24" + subnet concrete_subnet_net1_igw { + cidr "16.0.1.0/25" + maps subnet_net1_igw + } + subnet concrete_subnet_net1_osint { + cidr "16.0.1.64/26" + maps subnet_net1_osint + } + subnet subnet_net1_ewcf { + cidr "16.0.1.128/26" + maps subnet_net1_ewcf + } + maps net1 + } + net concrete_net2 { + cidr "16.0.2.0/24" + subnet concrete_subnet_net2_igw { + cidr "16.0.2.0/25" + maps subnet_net2_igw + } + maps net2 + } + net concrete_net3 { + cidr "16.0.3.0/24" + subnet concrete_subnet_net3_osint { + cidr "16.0.3.0/25" + maps subnet_net3_osint + } + subnet concrete_subnet_net3_ewcf { + cidr "16.0.3.128/25" + maps subnet_net3_ewcf + } + maps net3 + } + } + } + active con_infra + } + optimization opt { + objectives { + "cost" => min + "performance" => max + "availability" => max + } + nonfunctional_requirements { + req1 "Cost <= 300" max 300.0 => "cost" + req2 "Performance >= 7%" min 7.0 => "performance" + req3 "Provider" values "openstack" => "provider" + req4 "elements" => "VM VM VM" + } } } \ No newline at end of file diff --git a/tests/WordPress Application/WordPress example.docx b/tests/WordPress Application/WordPress example.docx index b0ac558ce4e71c592ba20d76b60e91a6737f89aa..ee1845a3cca1657030ee1a30baefcb705c85f751 100644 Binary files a/tests/WordPress Application/WordPress example.docx and b/tests/WordPress Application/WordPress example.docx differ diff --git a/tests/WordPress Application/wordpress_application.doml b/tests/WordPress Application/wordpress_application.doml index 474f3b15e396c016df31722e6829f6cd381d08b9..2e1d71f123a88c2872bbcf6cd100d5a29dc386d4 100644 --- a/tests/WordPress Application/wordpress_application.doml +++ b/tests/WordPress Application/wordpress_application.doml @@ -1,174 +1,185 @@ -doml wordpress - -application app { - dbms postgres { - properties { - identifier = "education" - name = "wp_db" - } - provides { - SQL_interface - } - } +doml wordpress { + version "3.1" - software_component wordPressServer { - consumes { - SQL_interface + application app { + dbms postgres { + properties { + identifier = "education" + db_name = "wp_db" + } + provides { + SQL_interface + } } - } -} - -infrastructure infra { - net net1 { - cidr "10.0.1.0/24" - protocol "TCP/IP" - subnet subnet1 { - cidr "10.0.1.0/24" + + software_component wordPressServer { + consumes { + SQL_interface + } } } - vm dbms_vm { - os "ubuntu" - size "micro" - iface dbms_iface { - belongs_to subnet1 - address "10.0.1.2" + infrastructure infra { + net net1 { + protocol "TCP/IP" + subnet subnet1 { } } - credentials ssh_key - } - - autoscale_group ag { - vm wp_vm { + + vm dbms_vm { os "ubuntu" size "micro" - cpu_count 2 - mem_mb 1024.0 - iface i1 { + iface dbms_iface { belongs_to subnet1 - address "10.0.1.1" + address "10.0.1.2" } credentials ssh_key } - // count = 2 - min 2 max 2 - } - - vm_image vm_img { - generates wp_vm - } - - key_pair ssh_key { - user "user" - keyfile "ssh key..." - } - - container container1 { - properties { - WP_DB_HOST = "dbms_vm" - WP_DB_USER = "username" - WP_DB_PASSWORD = "password" - WP_DB_NAME = "database.name" - } - host wp_vm { - container_port 80 - vm_port 8080 - iface i1 + + autoscale_group ag { + vm wp_vm { + os "ubuntu" + size "micro" + cpu_count 2 + mem_mb 1024.0 + iface i1 { + belongs_to subnet1 + address "10.0.1.1" + } + credentials ssh_key + } + // count = 2 + min 2 max 2 } - } - - cont_image container_image { - generates container1 - image "docker.hub.io/wordpress/wordpress:5.8.0" - } - - security_group sg { - egress icmp { - from_port -1 - to_port -1 - protocol "ICMP" - cidr ["0.0.0.0/0"] + + vm_image vm_img { + generates { wp_vm } } - ingress http { - from_port 80 - to_port 80 - protocol "TCP" - cidr ["0.0.0.0/0"] + + key_pair ssh_key { + user "user" + key "ssh key..." } - ingress https { - from_port 443 - to_port 443 - protocol "TCP" - cidr ["0.0.0.0/0"] + + container container1 { + properties { + WP_DB_HOST = "dbms_vm" + WP_DB_USER = "username" + WP_DB_PASSWORD = "password" + WP_DB_NAME = "database.name" + } + host wp_vm { + cont_config { + cont_port 80 + vm_port 8080 + iface i1 + } + } } - ingress ssh { - from_port 22 - to_port 22 - protocol "TCP" - cidr ["0.0.0.0/0"] + + cont_image container_image { + generates { container1 } + image "docker.hub.io/wordpress/wordpress:5.8.0" } - ifaces i1, dbms_iface - } -} - -deployment config1 { - wordPressServer => container1, - postgres => dbms_vm -} - -concretizations { - concrete_infrastructure con_infra1 { - provider aws { - vm_image concrete_vm_img { - preexisting true - image_name "ami-012e16cfb2f9e8b0a" - maps vm_img + + security_group sg { + egress icmp { + from_port -1 + to_port -1 + protocol "ICMP" + cidrs ["0.0.0.0/0"] } - - autoscale_group concrete_ag { - maps ag + ingress http { + from_port 80 + to_port 80 + protocol "TCP" + cidrs ["0.0.0.0/0"] } - - vm concrete_dbms_vm { - maps dbms_vm + ingress https { + from_port 443 + to_port 443 + protocol "TCP" + cidrs ["0.0.0.0/0"] } - - net concrete_net { - maps net1 - } - - cont_image concrete_wp_image { - preexisting true - maps container_image + ingress ssh { + from_port 22 + to_port 22 + protocol "TCP" + cidrs ["0.0.0.0/0"] } + ifaces { i1 dbms_iface } } } - concrete_infrastructure con_infra2 { - provider aws { - vm_image concrete_vm_img { - preexisting true - image_name "mantic-20230508" - maps vm_img - } - - autoscale_group concrete_ag { - maps ag - } - - vm concrete_dbms_vm { - maps dbms_vm - } - - net concrete_net { - maps net1 + deployment config1 { + wordPressServer => container1 + postgres => dbms_vm + } + + concretizations { + concrete_infrastructure con_infra1 { + provider aws { + vm_image concrete_vm_img { + preexisting true + image_name "ami-012e16cfb2f9e8b0a" + maps vm_img + } + + autoscale_group concrete_ag { + maps ag + } + + vm concrete_dbms_vm { + maps dbms_vm + } + + net concrete_net { + cidr "10.0.1.0/24" + subnet concrete_subnet1 { + cidr "10.0.1.0/24" + maps subnet1 + } + maps net1 + } + + cont_image concrete_wp_image { + preexisting true + maps container_image + } } - - cont_image concrete_wp_image { - preexisting true - maps container_image + } + + concrete_infrastructure con_infra2 { + provider aws { + vm_image concrete_vm_img { + preexisting true + image_name "mantic-20230508" + maps vm_img + } + + autoscale_group concrete_ag { + maps ag + } + + vm concrete_dbms_vm { + maps dbms_vm + } + + net concrete_net { + cidr "10.0.1.0/24" + subnet concrete_subnet1 { + cidr "10.0.1.0/24" + maps subnet1 + } + maps net1 + } + + cont_image concrete_wp_image { + preexisting true + maps container_image + } } } + + active con_infra1 } - - active con_infra1 } \ No newline at end of file diff --git a/tests/WordPress Application/wordpress_application_saas_alternative.doml b/tests/WordPress Application/wordpress_application_saas_alternative.doml index 95fb4ad696a00295cd52d15754bcd777aa87bebb..cf68f43253ca053e91e02bf4642078026f28a881 100644 --- a/tests/WordPress Application/wordpress_application_saas_alternative.doml +++ b/tests/WordPress Application/wordpress_application_saas_alternative.doml @@ -1,154 +1,191 @@ -doml wordpress - -application app { - saas_dbms postgres { - properties { - identifier = "education" +doml wordpress { + version "3.1" + application app { + saas_dbms postgres { + // This is the identifier in the Terraform code + name "education" + engine "postgres" + engine_version "15.4" + provides { + SQL_interface + } } - provides { - SQL_interface + + software_component wordPressServer { + consumes { + SQL_interface + } } } - software_component wordPressServer { - consumes { - SQL_interface - } - } -} - -infrastructure infra { - net net1 { - cidr "10.0.1.0/24" - protocol "TCP/IP" - subnet subnet1 { - cidr "10.0.1.0/24" + infrastructure infra { + net net1 { + protocol "TCP/IP" + subnet subnet1 { } } - } - - autoscale_group ag { - vm wp_vm { - os "ubuntu" - size "micro" - cpu_count 2 - mem_mb 1024.0 - iface i1 { - belongs_to subnet1 - address "10.0.1.1" + + exec_env dbms_exec_env { + size 20.0 + max_size 100.0 + loc { + region "eu-west-1" + zone "a" + } + network subnet1 + security { + sg } - credentials ssh_key - } - // count = 2 - min 2 max 2 - } - - vm_image vm_img { - generates wp_vm - } - - key_pair ssh_key { - user "user" - keyfile "ssh key..." - } - - container container1 { - properties { - WP_DB_HOST = "dbms_vm" - WP_DB_USER = "username" - WP_DB_PASSWORD = "password" - WP_DB_NAME = "database.name" } - host wp_vm { - container_port 80 - vm_port 8080 - iface i1 + + autoscale_group ag { + vm wp_vm { + os "ubuntu" + size "micro" + cpu_count 2 + mem_mb 1024.0 + iface i1 { + belongs_to subnet1 + address "10.0.1.1" + } + credentials ssh_key + } + // count = 2 + min 2 max 2 } - } - - cont_image container_image { - generates container1 - image "docker.hub.io/wordpress/wordpress:5.8.0" - } - - security_group sg { - egress icmp { - from_port -1 - to_port -1 - protocol "ICMP" - cidr ["0.0.0.0/0"] + + vm_image vm_img { + generates { wp_vm } } - ingress http { - from_port 80 - to_port 80 - protocol "TCP" - cidr ["0.0.0.0/0"] + + key_pair ssh_key { + user "user" + key "ssh key..." } - ingress https { - from_port 443 - to_port 443 - protocol "TCP" - cidr ["0.0.0.0/0"] + + container container1 { + properties { + WP_DB_HOST = "dbms_vm" + WP_DB_USER = "username" + WP_DB_PASSWORD = "password" + WP_DB_NAME = "database.name" + } + host wp_vm { + cont_config { + cont_port 80 + vm_port 8080 + iface i1 + } + } } - ingress ssh { - from_port 22 - to_port 22 - protocol "TCP" - cidr ["0.0.0.0/0"] + + cont_image container_image { + generates { container1 } + image "docker.hub.io/wordpress/wordpress:5.8.0" } - ifaces i1 - } -} - -deployment config1 { - wordPressServer => container1 -} - -concretizations { - concrete_infrastructure con_infra1 { - provider aws { - vm_image concrete_vm_img { - preexisting true - image_name "ami-012e16cfb2f9e8b0a" - maps vm_img + + security_group sg { + egress icmp { + from_port -1 + to_port -1 + protocol "ICMP" + cidrs ["0.0.0.0/0"] } - - autoscale_group concrete_ag { - maps ag + ingress http { + from_port 80 + to_port 80 + protocol "TCP" + cidrs ["0.0.0.0/0"] } - - net concrete_net { - maps net1 + ingress https { + from_port 443 + to_port 443 + protocol "TCP" + cidrs ["0.0.0.0/0"] } - - cont_image concrete_wp_image { - preexisting true - maps container_image + ingress ssh { + from_port 22 + to_port 22 + protocol "TCP" + cidrs ["0.0.0.0/0"] } + ifaces { i1 } } } - concrete_infrastructure con_infra2 { - provider aws { - vm_image concrete_vm_img { - preexisting true - image_name "mantic-20230508" - maps vm_img - } - - autoscale_group concrete_ag { - maps ag - } - - net concrete_net { - maps net1 + deployment config1 { + wordPressServer => container1 + postgres => dbms_exec_env + } + + concretizations { + concrete_infrastructure con_infra1 { + provider aws { + vm_image concrete_vm_img { + preexisting true + image_name "ami-012e16cfb2f9e8b0a" + maps vm_img + } + + autoscale_group concrete_ag { + maps ag + } + + exec_env concrete_dbms_exec_env { + instance_type "db.t3.small" + storage_type "gp2" + maps dbms_exec_env + } + + net concrete_net { + cidr "10.0.1.0/24" + subnet concrete_subnet1 { + cidr "10.0.1.0/24" + maps subnet1 + } + maps net1 + } + + cont_image concrete_wp_image { + preexisting true + maps container_image + } } - - cont_image concrete_wp_image { - preexisting true - maps container_image + } + + concrete_infrastructure con_infra2 { + provider aws { + vm_image concrete_vm_img { + preexisting true + image_name "mantic-20230508" + maps vm_img + } + + autoscale_group concrete_ag { + maps ag + } + + exec_env concrete_dbms_exec_env { + instance_type "db.t3.small" + storage_type "gp2" + maps dbms_exec_env + } + + net concrete_net { + cidr "10.0.1.0/24" + subnet concrete_subnet1 { + cidr "10.0.1.0/24" + maps subnet1 + } + maps net1 + } + + cont_image concrete_wp_image { + preexisting true + maps container_image + } } } + + active con_infra1 } - - active con_infra1 } \ No newline at end of file diff --git a/tests/domlTests/.project b/tests/domlTests/.project deleted file mode 100644 index 96bcdb7a1076c114a39e5046f8f7d8a1b7c96daa..0000000000000000000000000000000000000000 --- a/tests/domlTests/.project +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>domlTests</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.xtext.ui.shared.xtextBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.xtext.ui.shared.xtextNature</nature> - </natures> -</projectDescription> diff --git a/tests/domlTests/DOML 3.0 demo tests/DOML_v3.0_demo.doml b/tests/domlTests/DOML 3.0 demo tests/DOML_v3.0_demo.doml deleted file mode 100644 index 9c24184a343a5b5f65adfc0af711ba73ccf5c722..0000000000000000000000000000000000000000 --- a/tests/domlTests/DOML 3.0 demo tests/DOML_v3.0_demo.doml +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Here we show a simple example of a DOML Model to let user better understand the syntax and the structure of DOML v2.1. - * - * In the following example, we want to describe a financial web application, which accesses a database. - * - * Both mysql DBMS and an nginx web server run on VMs provisioned by the Openstack provider. - * - * Such VMs are connected to a common network which also guarantees access to Internet, - * and each of them has an associated subnet. The two subnets are connected to each other. - * - * Both VMs should be located in "00EU" region. - */ -doml doml_example1 - -/* - * We first have to define our application components in the Application Layer. - */ -application app_example1 { - - /* - * A mysql DBMS: it provides a SQL interface to handle data. - */ - dbms mysql { - - provides { - sql_interface - } - - } - - /* - * An nginx web server to run the web application. - * As stated in the description above, it consumes the database interface. - */ - software_component nginx { - - consumes { - sql_interface - } - - } - -} - -/* - * We then can describe the abstract infrastructure in the Infrastructure Layer. - */ -infrastructure infra_example1 { - - /* - * We want to use a VM to host the nginx web server. - * We want the VM to have the configuration we specify through the attributes. - */ - vm nginx_vm { - - arch "x86-64" - - os "Ubuntu-22.04.2-LTS" - - mem_mb 1024.0 - - sto "16GB" - - cpu_count 1 - - size "small" - - loc { - - region "00EU" - - } - - /* - * We want to define a network interface belonging to the subnet we're defining for this VM. - * We decide to name such subnet "nginx_subnet". - */ - iface nginx_iface { - - belongs_to nginx_subnet - } - - /* - * We also want to specify credentials to access the VM. - * For security reasons, it's always a good practice to have separate credentials for each VM instance. - * We decide to name credentials to access this VM "nginx_vm_credentials". - */ - credentials nginx_vm_credentials - } - - - /* - * We want to use a VM to host the mysql DBMS. - * Analogously to what we have done above for the nginx_vm, we can specify the VM configuration through attributes. - */ - vm mysql_vm { - - arch "x86-64" - - os "Ubuntu-22.04.2-LTS" - - mem_mb 1024.0 - - sto "16GB" - - cpu_count 1 - - size "small" - - loc { - - region "00EU" - - } - - /* - * We want to do the same as above. - * We decide to name the subnet "mysql_subnet". - */ - iface mysql_iface { - - belongs_to mysql_subnet - } - - // As done above, we proceed to set credentials to access the VM. - credentials mysql_vm_credentials - - } - - /* - * We now want to configure the network. - * As stated above, we need to define two interconnected subnets. - * Moreover, we need to define an Internet gateway since we want the network to have access to Internet. - */ - net common_network { - - /* - * Definition of the first subnet, the one associated to the nginx_vm. - */ - subnet nginx_subnet { - - connections { - mysql_subnet - } - - protocol "TCP/IP" - - cidr "10.0.144.0/25" - } - - // This definition is analogous to what is shown above. - subnet mysql_subnet { - - connections { - nginx_subnet - } - - protocol "TCP/IP" - - cidr "10.0.144.128/25" - } - - protocol "TCP/IP" - - cidr "10.0.144.0/24" - - gateway igw1 { - - address "10.0.144.22" - - } - - } - - /* - * As specified above, we want to define credentials to guarantee access to VMs. - * These credentials are used for the nginx_vm. - * We're here specifying the key through the keyfile attribute instead of using it for specifying the keyfile path. - */ - key_pair nginx_vm_credentials { - - user "nginx_user" - - keyfile "AAAAB3NzaC1yc2EAAAADAQABAAABAQC63ZvocMhX1LsdUlhzqLNSsh/Wotk/EMfDfa9pBHC52NXv05uENTjd/LBj8PS5JXEr7rKG9Zpj2Kj/PA7Gu0X1BZMwAiNR2dKjw9K0HO6Ozj3elCA7WjjotiQcO+OLWefE1PUW8/BJjtjFD/qf6wJd8CwInH8cjpkccQQfA55IXXegQMm5qv2a/S2XBvMMzv1dzsCy5UPO7tiOz4RBfi56JK8o2mDR327yY7+goA0HQz5tSN1X98+vxLpTPD5qINEFfVk1yNmf/ls3C7EBZQFJ6tsHgl070ymdBLHccmDMEYktzBnc/IhNWMq7K4IxwgFfQ7YSzAAqMr1n04+3oUeB" - - algorithm "RSA" - - bits 4096 - } - - // This definition is analogous to what we have shown above. - key_pair mysql_vm_credentials { - - user "mysql_user" - - keyfile "AAAAB3NzaC1yc2EAAAADAQABAAABAQCBiNSYpUJ9bCNhmFdEmCqF0WCW0f47SDN3T43nF5rDI06Ixuedk9+TlAUZudistB/RTlq0AaQmaZjBdQFkDvLiKnmEAB16eITQ/lz+eODcK5540E3Qd5jlq9DOy3s8eVaL8zg1zwaSktIJ/Y/jGyiy/MM1uobj/JNGNE++llYwh6/SjynGADo9bNcboJifLoU51lrJbyO6w7SJyeP28X46Dd6ob/GQwPAEZjhW+0U+K/JeDfIA1wYH6fC15K1pte9n57gd4RK+yRn7r45c0dP5M4gzZsZrXXaWRI/Dgbha08zSlKEzFdT7QcExMu+W6jGPZiHUSUAZJBxfRORHZ8iP" - - algorithm "RSA" - - bits 4096 - } - - /* - * We also want to secure access to our common network. - * In order to do so, we describe the rules for such network through the definition of a security group. - * - * Here are shown some of the most commonly used rules. - */ - security_group sec_group { - - egress icmp { - - protocol "ICMP" - - from_port -1 - - to_port -1 - - cidr ["0.0.0.0/0"] - } - - ingress ssh { - - protocol "TCP" - - from_port 22 - - to_port 22 - - cidr ["0.0.0.0/0"] - } - - ingress http { - - protocol "TCP" - - from_port 80 - - to_port 80 - - cidr ["0.0.0.0/0"] - } - - ingress https { - - protocol "TCP" - - from_port 443 - - to_port 443 - - cidr ["0.0.0.0/0"] - } - - // We want to specify that these rules apply to both the interfaces we defined for our VMs. - ifaces nginx_iface, mysql_iface - - } - -} - -/* - * Now we have defined our abstract infrastructure and we're ready to deploy our application. - * Let's define the configuration for deployment. - */ -deployment config_example1 { - mysql => mysql_vm, - nginx => nginx_vm -} - -// We specify the active deployment configuration. We only have one, but this step is always necessary. -active deployment config_example1 - -/* - * We then need to define the concrete infrastructure in the Concrete Layer. - */ -concretizations { - - concrete_infrastructure concrete_example1 { - - /* - * As stated in the description, we want to use Openstack as a provider for our infrastructure. - * Any further information regarding the provider itself can be specified through properties. - * Here we have to describe the concrete components corresponding to the abstract ones defined in the Infrastructure Layer. - */ - provider openstack { - - /* - * We have three elements in the abstract infrastructure definition that need a concrete counterpart: - * - The two VMs for mysql DBMS and nginx web server - * - The common network - */ - - vm concrete_nginx_vm { - - maps nginx_vm - - } - - vm concrete_mysql_vm { - - maps mysql_vm - - } - - - net concrete_common_network { - - maps common_network - } - - } - - } - - // We specify the active concretization. - // Analogously to the deployment configurations, we only have one, but this step is always necessary. - active concrete_example1 - - } - - /* - * For this simple application, there is no need to define any functional requirement, so the corresponding - * section is not present in this example. - * - * However, we can specify some optimization objectives and non functional requirements. - * - * Even though we can express any kind of objective in DOML, the three widely used optimization - * targets are cost, availability and performance, which is also what PIACERE mainly focuses on. - * Since we haven't included any cost in the example, we're keeping as objectives the - * maximization of both performance and availability. - * - * As stated in the description of the example, both VMs should be located in the "00EU" region. - * In order to specify this constraint, we define a non-functional requirement. - * Moreover, we want to specify that we want to deploy two VMs as elements. - */ - - optimization opt{ - - objectives { - "availability" => max - "performance" => max - } - nonfunctional_requirements { - Req1 "Region" values "00EU" => "region" - Req2 "Provider" values "openstack" => "provider" - Req3 "elements" => "VM, VM" - } - -} \ No newline at end of file diff --git a/tests/domlTests/DOML 3.0 demo tests/SIMPA_demo.doml b/tests/domlTests/DOML 3.0 demo tests/SIMPA_demo.doml deleted file mode 100644 index 0f4a611fa4788f47c70bd73f9d6f22a775e0d359..0000000000000000000000000000000000000000 --- a/tests/domlTests/DOML 3.0 demo tests/SIMPA_demo.doml +++ /dev/null @@ -1,147 +0,0 @@ -doml nio3_test_exec_env - -application app { - - software_component nio3 { - properties {} - } -} - -infrastructure infra { - - net net1 { - cidr "/24" - protocol "tcp/ip" - gateway g1 { - address "10.83.18.65" - } - } - - key_pair ssh_key { - algorithm "RSA" - bits 4096 - } - - vm_image img { - generates vm1, vm2 - } - - vm vm1 { - os "centos7_64Guest" - cpu_count 2 - mem_mb 1024.0 - iface i1 { - address "10.83.18.92" - belongs_to net1 - } - credentials ssh_key - } - - vm vm2 { - os "centos7_64Guest" - cpu_count 2 - mem_mb 1024.0 - iface i1 { - address "10.83.18.88" - belongs_to net1 - } - credentials ssh_key - } - - storage disk0 { - label "disk0" - size_gb 100 - } -} - -deployment conf { - nio3 => vm1, nio3 => vm2 -} - -active deployment conf - -concretizations { - concrete_infrastructure con_infra { - provider vsphere { - properties { - username = "vc_username" - password = "vc_password" - vsphere_server = "psvc10000002.cd.sigov.si" - allow_unverified_ssl = true - } - - generic_resource dc { - preexisting true - type 'vsphere_datacenter' - gname 'PIACDC' - } - - generic_resource cl { - preexisting true - refs_to dc - type 'vsphere_compute_cluster' - gname 'PIACC' - } - - generic_resource pool { - preexisting true - refs_to dc - type 'vsphere_resource_pool' - gname 'Piacere' - } - - vm_image template { - properties { - vsphere_virtual_machine_name = "c7tmp" - } - preexisting true - refs_to dc - maps img - } - - storage datastore { - properties { - vsphere_datastore_name = 'NFSShare01' - } - preexisting true - refs_to dc - maps disk0 - } - - net network { - properties { - vsphere_network_name = "Nested-ESXi" - } - preexisting true - refs_to dc - maps net1 - } - - vm con_vm1 { - properties { - host_name = "simpa-test00-piacere" - domain = "tri.lan" - guest_id = "centos7_64Guest" - disk = "disk0" - disk_size = 100 - - } - refs_to pool, datastore, template - maps vm1 - } - - vm con_vm2 { - properties { - host_name = "simpa-test00-piacere" - domain = "tri.lan" - guest_id = "centos7_64Guest" - disk = "disk1" - disk_size = 100 - } - refs_to pool, datastore, template - maps vm2 - } - } - } - active con_infra -} diff --git a/tests/domlTests/DOML 3.0 demo tests/UC3_Simplified_demo.doml b/tests/domlTests/DOML 3.0 demo tests/UC3_Simplified_demo.doml deleted file mode 100644 index 5a715a0c353e750b561ad5cd82e014abe7a22410..0000000000000000000000000000000000000000 --- a/tests/domlTests/DOML 3.0 demo tests/UC3_Simplified_demo.doml +++ /dev/null @@ -1,294 +0,0 @@ -doml uc3_openstack - -application app { - - // need to define all sw components of the project this is a placeholder - // need to understand what is really needed in this spec - // need to specify all provides/consumes - - software_component iwg { - provides { net_info } - } - software_component osint { - provides { osint_info } - consumes { net_info, get_twitter, ewcf_rest_interface } - } - software_component ewcf { - provides { ewcf_rest_interface } - consumes { get_firebase } - } - saas external_twitter { - provides { get_twitter @ "https://twitter_api/get" } - } - saas external_firebase { - provides { get_firebase @ "https://firebase_api/get" } - } - -} - -infrastructure infra { - // Giuseppe - tutti devono collegarsi a oam - // Giuseppe - igw deve avere reti oam la net1 verso osint e net2 verso network 5G - - // VMs region - vm igw_vm { - os "Ubuntu-Focal-20.04-Daily-2022-04-19" - size "small" - - iface igw_vm_oam { - belongs_to subnet_oam_igw - } - - iface igw_vm_net1 { - belongs_to subnet_net1_igw - } - - iface igw_vm_net2 { - belongs_to subnet_net2_igw - } - - credentials ssh_key - } - - // Giuseppe - osint deve avere reti oam la net1 verso igw e net3 verso network internet - vm osint_vm { - os "Ubuntu-Focal-20.04-Daily-2022-04-19" - size "small" - - iface osint_vm_oam { - belongs_to subnet_oam_osint - } - - iface osint_vm_net1 { - belongs_to subnet_net1_osint - } - - iface osint_vm_net3 { - belongs_to subnet_net3_osint - } - - credentials ssh_key - } - - // Giuseppe - ewcf deve avere reti oam la net1 verso osint e net3 verso network internet - vm ewcf_vm { - os "Ubuntu-Focal-20.04-Daily-2022-04-19" - size "small" - - iface ewcf_vm_oam { - belongs_to subnet_oam_ewcf - } - - iface ewcf_vm_net1 { - belongs_to subnet_net1_ewcf - } - - iface ewcf_vm_net3 { - belongs_to subnet_net3_ewcf - } - - credentials ssh_key - } - - // Network region - - // Internal Network - net oam { - protocol "TCP/IP" - cidr "16.0.0.0/24" - - subnet subnet_oam_igw { - protocol "TCP/IP" - cidr "16.0.1.0/26" - } - - subnet subnet_oam_osint { - protocol "TCP/IP" - cidr "16.0.1.64/26" - } - - subnet subnet_oam_ewcf { - protocol "TCP/IP" - cidr "16.0.1.128/26" - } - } - - // Internal network - net net1 { - protocol "TCP/IP" - cidr "16.0.1.0/24" - - // Subnets definition - subnet subnet_net1_igw { - connections { - subnet_net1_osint - } - protocol "TCP/IP" - cidr "16.0.1.0/25" - } - - subnet subnet_net1_osint { - connections { - subnet_net1_igw, - subnet_net1_ewcf - } - protocol "TCP/IP" - cidr "16.0.1.64/26" - } - - subnet subnet_net1_ewcf { - connections { - subnet_net1_osint - } - protocol "TCP/IP" - cidr "16.0.1.128/26" - } - } - - // Network connecting igw to 5G - net net2 { - protocol "TCP/IP" - cidr "16.0.2.0/24" - - subnet subnet_net2_igw { - protocol "TCP/IP" - cidr "16.0.2.0/25" - } - - gateway net2_igw { - // TODO: Define address - address "16.0.2.22" - } - - } - - // Network connecting osint and ewcf to Internet - net net3 { - protocol "TCP/IP" - cidr "16.0.3.0/24" - - subnet subnet_net3_osint { - protocol "TCP/IP" - cidr "16.0.3.0/25" - } - - subnet subnet_net3_ewcf { - protocol "TCP/IP" - cidr "16.0.3.128/25" - } - - gateway net3_igw { - // TODO: Define address - address "16.0.3.22" - } - } - - // credentials region - key_pair ssh_key { - user "ubuntu" - keyfile "AAAAB3NzaC1yc2EAAAADAQABAAABAQC63ZvocMhX1LsdUlhzqLNSsh/Wotk/EMfDfa9pBHC52NXv05uENTjd/LBj8PS5JXEr7rKG9Zpj2Kj/PA7Gu0X1BZMwAiNR2dKjw9K0HO6Ozj3elCA7WjjotiQcO+OLWefE1PUW8/BJjtjFD/qf6wJd8CwInH8cjpkccQQfA55IXXegQMm5qv2a/S2XBvMMzv1dzsCy5UPO7tiOz4RBfi56JK8o2mDR327yY7+goA0HQz5tSN1X98+vxLpTPD5qINEFfVk1yNmf/ls3C7EBZQFJ6tsHgl070ymdBLHccmDMEYktzBnc/IhNWMq7K4IxwgFfQ7YSzAAqMr1n04+3oUeB" - algorithm "RSA" - bits 4096 - } - - // Security region - - // security group is left as originally defined needs to be updated - security_group sg { - egress icmp { - protocol "ICMP" - from_port -1 - to_port -1 - cidr ["0.0.0.0/0"] - } - ingress http { - protocol "TCP" - from_port 80 - to_port 80 - cidr ["0.0.0.0/0"] - } - ingress https { - protocol "TCP" - from_port 443 - to_port 443 - cidr ["0.0.0.0/0"] - } - ingress ssh { - protocol "TCP" - from_port 22 - to_port 22 - cidr ["0.0.0.0/0"] - } - - ifaces igw_vm_oam, igw_vm_net1, igw_vm_net2, osint_vm_oam, osint_vm_net1, osint_vm_net3, ewcf_vm_oam, ewcf_vm_net1, ewcf_vm_net3 - } -} - -deployment config1 { - osint => osint_vm, - iwg => igw_vm, - ewcf => ewcf_vm -} - -active deployment config1 - -concretizations { - concrete_infrastructure con_infra { - - provider openstack { - - // Concrete computing nodes region - - vm concrete_osint_vm { - maps osint_vm - } - - vm concrete_igw_vm { - maps igw_vm - } - - vm concrete_ewcf_vm { - maps ewcf_vm - } - - // Concrete Network region - net concrete_oam { - maps oam - } - - net concrete_net1 { - maps net1 - } - - net concrete_net2 { - maps net2 - } - - net concrete_net3 { - maps net3 - } - - } - } - active con_infra -} - -// It's currently not possible to provide "storage" for openstack provider (IOP) -// req4 "elements" => "VM, storage"; -// Required performance was too much (70%), modified after talking with Eneko - -optimization opt { - - objectives { - "cost" => min - "performance" => max - "availability" => max - } - nonfunctional_requirements { - req1 "Cost <= 300" max 300.0 => "cost" - req2 "Performance >= 7%" min 7.0 => "performance" - req3 "Provider" values "openstack" => "provider" - req4 "elements" => "VM, VM, VM" - } - -} \ No newline at end of file diff --git a/tests/domlTests/DOML_v2.2_Example.doml b/tests/domlTests/DOML_v2.2_Example.doml deleted file mode 100644 index 29a2608926b80a2ebf9412091556ffa80fd8b06f..0000000000000000000000000000000000000000 --- a/tests/domlTests/DOML_v2.2_Example.doml +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Here we show a simple example of a DOML Model to let user better understand the syntax and the structure of DOML v2.1. - * - * In the following example, we want to describe a financial web application, which accesses a database. - * - * Both mysql DBMS and an nginx web server run on VMs provisioned by the Openstack provider. - * - * Such VMs are connected to a common network which also guarantees access to Internet, - * and each of them has an associated subnet. The two subnets are connected to each other. - * - * Both VMs should be located in "00EU" region. - */ -doml doml_example1 - -/* - * We first have to define our application components in the Application Layer. - */ -application app_example1 { - - /* - * A mysql DBMS: it provides a SQL interface to handle data. - */ - dbms mysql { - - provides { - sql_interface - } - - } - - /* - * An nginx web server to run the web application. - * As stated in the description above, it consumes the database interface. - */ - software_component nginx { - - consumes { - sql_interface - } - - } - -} - -/* - * We then can describe the abstract infrastructure in the Infrastructure Layer. - */ -infrastructure infra_example1 { - - /* - * We want to use a VM to host the nginx web server. - * We want the VM to have the configuration we specify through the attributes. - */ - vm nginx_vm { - - arch "x86-64" - - os "Ubuntu-22.04.2-LTS" - - mem_mb 1024.0 - - sto "16GB" - - cpu_count 1 - - size "small" - - loc { - - region "00EU" - - } - - /* - * We want to define a network interface belonging to the subnet we're defining for this VM. - * We decide to name such subnet "nginx_subnet". - */ - iface nginx_iface { - - belongs_to nginx_subnet - } - - /* - * We also want to specify credentials to access the VM. - * For security reasons, it's always a good practice to have separate credentials for each VM instance. - * We decide to name credentials to access this VM "nginx_vm_credentials". - */ - credentials nginx_vm_credentials - } - - - /* - * We want to use a VM to host the mysql DBMS. - * Analogously to what we have done above for the nginx_vm, we can specify the VM configuration through attributes. - */ - vm mysql_vm { - - arch "x86-64" - - os "Ubuntu-22.04.2-LTS" - - mem_mb 1024.0 - - sto "16GB" - - cpu_count 1 - - size "small" - - loc { - - region "00EU" - - } - - /* - * We want to do the same as above. - * We decide to name the subnet "mysql_subnet". - */ - iface mysql_iface { - - belongs_to mysql_subnet - } - - // As done above, we proceed to set credentials to access the VM. - credentials mysql_vm_credentials - - } - - /* - * We now want to configure the network. - * As stated above, we need to define two interconnected subnets. - * Moreover, we need to define an Internet gateway since we want the network to have access to Internet. - */ - net common_network { - - /* - * Definition of the first subnet, the one associated to the nginx_vm. - */ - subnet nginx_subnet { - - connections { - mysql_subnet - } - - protocol "TCP/IP" - - cidr "10.0.144.0/25" - } - - // This definition is analogous to what is shown above. - subnet mysql_subnet { - - connections { - nginx_subnet - } - - protocol "TCP/IP" - - cidr "10.0.144.128/25" - } - - protocol "TCP/IP" - - cidr "10.0.144.0/24" - - gateway igw1 { - - address "10.0.144.22" - - } - - } - - /* - * As specified above, we want to define credentials to guarantee access to VMs. - * These credentials are used for the nginx_vm. - * We're here specifying the key through the keyfile attribute instead of using it for specifying the keyfile path. - */ - key_pair nginx_vm_credentials { - - user "nginx_user" - - keyfile "AAAAB3NzaC1yc2EAAAADAQABAAABAQC63ZvocMhX1LsdUlhzqLNSsh/Wotk/EMfDfa9pBHC52NXv05uENTjd/LBj8PS5JXEr7rKG9Zpj2Kj/PA7Gu0X1BZMwAiNR2dKjw9K0HO6Ozj3elCA7WjjotiQcO+OLWefE1PUW8/BJjtjFD/qf6wJd8CwInH8cjpkccQQfA55IXXegQMm5qv2a/S2XBvMMzv1dzsCy5UPO7tiOz4RBfi56JK8o2mDR327yY7+goA0HQz5tSN1X98+vxLpTPD5qINEFfVk1yNmf/ls3C7EBZQFJ6tsHgl070ymdBLHccmDMEYktzBnc/IhNWMq7K4IxwgFfQ7YSzAAqMr1n04+3oUeB" - - algorithm "RSA" - - bits 4096 - } - - // This definition is analogous to what we have shown above. - key_pair mysql_vm_credentials { - - user "mysql_user" - - keyfile "AAAAB3NzaC1yc2EAAAADAQABAAABAQCBiNSYpUJ9bCNhmFdEmCqF0WCW0f47SDN3T43nF5rDI06Ixuedk9+TlAUZudistB/RTlq0AaQmaZjBdQFkDvLiKnmEAB16eITQ/lz+eODcK5540E3Qd5jlq9DOy3s8eVaL8zg1zwaSktIJ/Y/jGyiy/MM1uobj/JNGNE++llYwh6/SjynGADo9bNcboJifLoU51lrJbyO6w7SJyeP28X46Dd6ob/GQwPAEZjhW+0U+K/JeDfIA1wYH6fC15K1pte9n57gd4RK+yRn7r45c0dP5M4gzZsZrXXaWRI/Dgbha08zSlKEzFdT7QcExMu+W6jGPZiHUSUAZJBxfRORHZ8iP" - - algorithm "RSA" - - bits 4096 - } - - /* - * We also want to secure access to our common network. - * In order to do so, we describe the rules for such network through the definition of a security group. - * - * Here are shown some of the most commonly used rules. - */ - security_group sec_group { - - egress icmp { - - protocol "ICMP" - - from_port -1 - - to_port -1 - - cidrs ["0.0.0.0/0"] - } - - ingress ssh { - - protocol "TCP" - - from_port 22 - - to_port 22 - - cidrs ["0.0.0.0/0"] - } - - ingress http { - - protocol "TCP" - - from_port 80 - - to_port 80 - - cidrs ["0.0.0.0/0"] - } - - ingress https { - - protocol "TCP" - - from_port 443 - - to_port 443 - - cidrs ["0.0.0.0/0"] - } - - // We want to specify that these rules apply to both the interfaces we defined for our VMs. - ifaces [ nginx_iface mysql_iface ] - - } - -} - -/* - * Now we have defined our abstract infrastructure and we're ready to deploy our application. - * Let's define the configuration for deployment. - */ -deployment config_example1 { - mysql => mysql_vm - nginx => nginx_vm -} - -// We specify the active deployment configuration. We only have one, but this step is always necessary. -active deployment config_example1 - -/* - * We then need to define the concrete infrastructure in the Concrete Layer. - */ -concretizations { - - concrete_infrastructure concrete_example1 { - - /* - * As stated in the description, we want to use Openstack as a provider for our infrastructure. - * Any further information regarding the provider itself can be specified through properties. - * Here we have to describe the concrete components corresponding to the abstract ones defined in the Infrastructure Layer. - */ - provider openstack { - - /* - * We have three elements in the abstract infrastructure definition that need a concrete counterpart: - * - The two VMs for mysql DBMS and nginx web server - * - The common network - */ - - vm concrete_nginx_vm { - - maps nginx_vm - - } - - vm concrete_mysql_vm { - - maps mysql_vm - - } - - - net concrete_common_network { - - maps common_network - } - - } - - } - - // We specify the active concretization. - // Analogously to the deployment configurations, we only have one, but this step is always necessary. - active concrete_example1 - - } - - /* - * For this simple application, there is no need to define any functional requirement, so the corresponding - * section is not present in this example. - * - * However, we can specify some optimization objectives and non functional requirements. - * - * Even though we can express any kind of objective in DOML, the three widely used optimization - * targets are cost, availability and performance, which is also what PIACERE mainly focuses on. - * Since we haven't included any cost in the example, we're keeping as objectives the - * maximization of both performance and availability. - * - * As stated in the description of the example, both VMs should be located in the "00EU" region. - * In order to specify this constraint, we define a non-functional requirement. - * Moreover, we want to specify that we want to deploy two VMs as elements. - */ - - optimization opt{ - - objectives { - "availability" => max - "performance" => max - } - nonfunctional_requirements { - Req1 "Region" values "00EU" => "region" - Req2 "Provider" values "OPENSTACK" => "provider" - Req3 "elements" => "VM, VM" - } - -} \ No newline at end of file diff --git a/tests/domlTests/DOML_v2.2_Example.domlx b/tests/domlTests/DOML_v2.2_Example.domlx deleted file mode 100644 index 9a90f917298afc691d1717cad743a8f84238e848..0000000000000000000000000000000000000000 --- a/tests/domlTests/DOML_v2.2_Example.domlx +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<commons:DOMLModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:app="http://www.piacere-project.eu/doml/application" xmlns:commons="http://www.piacere-project.eu/doml/commons" xmlns:infra="http://www.piacere-project.eu/doml/infrastructure" xmlns:optimization="http://www.piacere-project.eu/doml/optimization" name="doml_example1" activeConfiguration="//@configurations.0" activeInfrastructure="//@concretizations.0"> - <application name="app_example1"> - <components xsi:type="app:DBMS" name="mysql"> - <exposedInterfaces name="sql_interface"/> - </components> - <components xsi:type="app:SoftwareComponent" name="nginx" consumedInterfaces="//@application/@components.0/@exposedInterfaces.0"/> - </application> - <infrastructure name="infra_example1"> - <nodes xsi:type="infra:VirtualMachine" name="nginx_vm" architecture="x86-64" os="Ubuntu-22.04.2-LTS" memory_mb="1024.0" storage="16GB" cpu_count="1" credentials="//@infrastructure/@credentials.0" sizeDescription="small"> - <ifaces name="nginx_iface" belongsTo="//@infrastructure/@networks.0/@subnets.0" associated="//@infrastructure/@securityGroups.0"/> - <location region="00EU"/> - </nodes> - <nodes xsi:type="infra:VirtualMachine" name="mysql_vm" architecture="x86-64" os="Ubuntu-22.04.2-LTS" memory_mb="1024.0" storage="16GB" cpu_count="1" credentials="//@infrastructure/@credentials.1" sizeDescription="small"> - <ifaces name="mysql_iface" belongsTo="//@infrastructure/@networks.0/@subnets.1" associated="//@infrastructure/@securityGroups.0"/> - <location region="00EU"/> - </nodes> - <credentials xsi:type="commons:KeyPair" name="nginx_vm_credentials" user="nginx_user" keyfile="AAAAB3NzaC1yc2EAAAADAQABAAABAQC63ZvocMhX1LsdUlhzqLNSsh/Wotk/EMfDfa9pBHC52NXv05uENTjd/LBj8PS5JXEr7rKG9Zpj2Kj/PA7Gu0X1BZMwAiNR2dKjw9K0HO6Ozj3elCA7WjjotiQcO+OLWefE1PUW8/BJjtjFD/qf6wJd8CwInH8cjpkccQQfA55IXXegQMm5qv2a/S2XBvMMzv1dzsCy5UPO7tiOz4RBfi56JK8o2mDR327yY7+goA0HQz5tSN1X98+vxLpTPD5qINEFfVk1yNmf/ls3C7EBZQFJ6tsHgl070ymdBLHccmDMEYktzBnc/IhNWMq7K4IxwgFfQ7YSzAAqMr1n04+3oUeB" algorithm="RSA" bits="4096"/> - <credentials xsi:type="commons:KeyPair" name="mysql_vm_credentials" user="mysql_user" keyfile="AAAAB3NzaC1yc2EAAAADAQABAAABAQCBiNSYpUJ9bCNhmFdEmCqF0WCW0f47SDN3T43nF5rDI06Ixuedk9+TlAUZudistB/RTlq0AaQmaZjBdQFkDvLiKnmEAB16eITQ/lz+eODcK5540E3Qd5jlq9DOy3s8eVaL8zg1zwaSktIJ/Y/jGyiy/MM1uobj/JNGNE++llYwh6/SjynGADo9bNcboJifLoU51lrJbyO6w7SJyeP28X46Dd6ob/GQwPAEZjhW+0U+K/JeDfIA1wYH6fC15K1pte9n57gd4RK+yRn7r45c0dP5M4gzZsZrXXaWRI/Dgbha08zSlKEzFdT7QcExMu+W6jGPZiHUSUAZJBxfRORHZ8iP" algorithm="RSA" bits="4096"/> - <securityGroups name="sec_group" ifaces="//@infrastructure/@nodes.0/@ifaces.0 //@infrastructure/@nodes.1/@ifaces.0"> - <rules name="icmp" protocol="ICMP" fromPort="-1" toPort="-1"> - <cidr>0.0.0.0/0</cidr> - </rules> - <rules name="ssh" kind="INGRESS" protocol="TCP" fromPort="22" toPort="22"> - <cidr>0.0.0.0/0</cidr> - </rules> - <rules name="http" kind="INGRESS" protocol="TCP" fromPort="80" toPort="80"> - <cidr>0.0.0.0/0</cidr> - </rules> - <rules name="https" kind="INGRESS" protocol="TCP" fromPort="443" toPort="443"> - <cidr>0.0.0.0/0</cidr> - </rules> - </securityGroups> - <networks name="common_network" protocol="TCP/IP" addressRange="10.0.144.0/24"> - <gateways name="igw1" address="10.0.144.22"/> - <subnets name="nginx_subnet" protocol="TCP/IP" addressRange="10.0.144.0/25" connectedIfaces="//@infrastructure/@nodes.0/@ifaces.0" connectedTo="//@infrastructure/@networks.0/@subnets.1"/> - <subnets name="mysql_subnet" protocol="TCP/IP" addressRange="10.0.144.128/25" connectedIfaces="//@infrastructure/@nodes.1/@ifaces.0" connectedTo="//@infrastructure/@networks.0/@subnets.0"/> - </networks> - </infrastructure> - <concretizations name="concrete_example1"> - <providers name="openstack"> - <vms name="concrete_nginx_vm" maps="//@infrastructure/@nodes.0"/> - <vms name="concrete_mysql_vm" maps="//@infrastructure/@nodes.1"/> - <networks name="concrete_common_network" maps="//@infrastructure/@networks.0"/> - </providers> - </concretizations> - <optimization name="opt"> - <objectives xsi:type="optimization:MeasurableObjective" kind="max" property="availability"/> - <objectives xsi:type="optimization:MeasurableObjective" kind="max" property="performance"/> - <nonfunctionalRequirements xsi:type="commons:EnumeratedRequirement" name="Req1" description="Region" property="region"> - <values>00EU</values> - </nonfunctionalRequirements> - <nonfunctionalRequirements xsi:type="commons:EnumeratedRequirement" name="Req2" description="Provider" property="provider"> - <values>OPENSTACK</values> - </nonfunctionalRequirements> - <nonfunctionalRequirements name="Req3" description="elements" property="VM, VM"/> - </optimization> - <configurations name="config_example1"> - <deployments component="//@application/@components.0" node="//@infrastructure/@nodes.1"/> - <deployments component="//@application/@components.1" node="//@infrastructure/@nodes.0"/> - </configurations> -</commons:DOMLModel> diff --git a/tests/domlTests/DOML_v2.2_Example_gen_20230527061008.domlx b/tests/domlTests/DOML_v2.2_Example_gen_20230527061008.domlx deleted file mode 100644 index 9a90f917298afc691d1717cad743a8f84238e848..0000000000000000000000000000000000000000 --- a/tests/domlTests/DOML_v2.2_Example_gen_20230527061008.domlx +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<commons:DOMLModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:app="http://www.piacere-project.eu/doml/application" xmlns:commons="http://www.piacere-project.eu/doml/commons" xmlns:infra="http://www.piacere-project.eu/doml/infrastructure" xmlns:optimization="http://www.piacere-project.eu/doml/optimization" name="doml_example1" activeConfiguration="//@configurations.0" activeInfrastructure="//@concretizations.0"> - <application name="app_example1"> - <components xsi:type="app:DBMS" name="mysql"> - <exposedInterfaces name="sql_interface"/> - </components> - <components xsi:type="app:SoftwareComponent" name="nginx" consumedInterfaces="//@application/@components.0/@exposedInterfaces.0"/> - </application> - <infrastructure name="infra_example1"> - <nodes xsi:type="infra:VirtualMachine" name="nginx_vm" architecture="x86-64" os="Ubuntu-22.04.2-LTS" memory_mb="1024.0" storage="16GB" cpu_count="1" credentials="//@infrastructure/@credentials.0" sizeDescription="small"> - <ifaces name="nginx_iface" belongsTo="//@infrastructure/@networks.0/@subnets.0" associated="//@infrastructure/@securityGroups.0"/> - <location region="00EU"/> - </nodes> - <nodes xsi:type="infra:VirtualMachine" name="mysql_vm" architecture="x86-64" os="Ubuntu-22.04.2-LTS" memory_mb="1024.0" storage="16GB" cpu_count="1" credentials="//@infrastructure/@credentials.1" sizeDescription="small"> - <ifaces name="mysql_iface" belongsTo="//@infrastructure/@networks.0/@subnets.1" associated="//@infrastructure/@securityGroups.0"/> - <location region="00EU"/> - </nodes> - <credentials xsi:type="commons:KeyPair" name="nginx_vm_credentials" user="nginx_user" keyfile="AAAAB3NzaC1yc2EAAAADAQABAAABAQC63ZvocMhX1LsdUlhzqLNSsh/Wotk/EMfDfa9pBHC52NXv05uENTjd/LBj8PS5JXEr7rKG9Zpj2Kj/PA7Gu0X1BZMwAiNR2dKjw9K0HO6Ozj3elCA7WjjotiQcO+OLWefE1PUW8/BJjtjFD/qf6wJd8CwInH8cjpkccQQfA55IXXegQMm5qv2a/S2XBvMMzv1dzsCy5UPO7tiOz4RBfi56JK8o2mDR327yY7+goA0HQz5tSN1X98+vxLpTPD5qINEFfVk1yNmf/ls3C7EBZQFJ6tsHgl070ymdBLHccmDMEYktzBnc/IhNWMq7K4IxwgFfQ7YSzAAqMr1n04+3oUeB" algorithm="RSA" bits="4096"/> - <credentials xsi:type="commons:KeyPair" name="mysql_vm_credentials" user="mysql_user" keyfile="AAAAB3NzaC1yc2EAAAADAQABAAABAQCBiNSYpUJ9bCNhmFdEmCqF0WCW0f47SDN3T43nF5rDI06Ixuedk9+TlAUZudistB/RTlq0AaQmaZjBdQFkDvLiKnmEAB16eITQ/lz+eODcK5540E3Qd5jlq9DOy3s8eVaL8zg1zwaSktIJ/Y/jGyiy/MM1uobj/JNGNE++llYwh6/SjynGADo9bNcboJifLoU51lrJbyO6w7SJyeP28X46Dd6ob/GQwPAEZjhW+0U+K/JeDfIA1wYH6fC15K1pte9n57gd4RK+yRn7r45c0dP5M4gzZsZrXXaWRI/Dgbha08zSlKEzFdT7QcExMu+W6jGPZiHUSUAZJBxfRORHZ8iP" algorithm="RSA" bits="4096"/> - <securityGroups name="sec_group" ifaces="//@infrastructure/@nodes.0/@ifaces.0 //@infrastructure/@nodes.1/@ifaces.0"> - <rules name="icmp" protocol="ICMP" fromPort="-1" toPort="-1"> - <cidr>0.0.0.0/0</cidr> - </rules> - <rules name="ssh" kind="INGRESS" protocol="TCP" fromPort="22" toPort="22"> - <cidr>0.0.0.0/0</cidr> - </rules> - <rules name="http" kind="INGRESS" protocol="TCP" fromPort="80" toPort="80"> - <cidr>0.0.0.0/0</cidr> - </rules> - <rules name="https" kind="INGRESS" protocol="TCP" fromPort="443" toPort="443"> - <cidr>0.0.0.0/0</cidr> - </rules> - </securityGroups> - <networks name="common_network" protocol="TCP/IP" addressRange="10.0.144.0/24"> - <gateways name="igw1" address="10.0.144.22"/> - <subnets name="nginx_subnet" protocol="TCP/IP" addressRange="10.0.144.0/25" connectedIfaces="//@infrastructure/@nodes.0/@ifaces.0" connectedTo="//@infrastructure/@networks.0/@subnets.1"/> - <subnets name="mysql_subnet" protocol="TCP/IP" addressRange="10.0.144.128/25" connectedIfaces="//@infrastructure/@nodes.1/@ifaces.0" connectedTo="//@infrastructure/@networks.0/@subnets.0"/> - </networks> - </infrastructure> - <concretizations name="concrete_example1"> - <providers name="openstack"> - <vms name="concrete_nginx_vm" maps="//@infrastructure/@nodes.0"/> - <vms name="concrete_mysql_vm" maps="//@infrastructure/@nodes.1"/> - <networks name="concrete_common_network" maps="//@infrastructure/@networks.0"/> - </providers> - </concretizations> - <optimization name="opt"> - <objectives xsi:type="optimization:MeasurableObjective" kind="max" property="availability"/> - <objectives xsi:type="optimization:MeasurableObjective" kind="max" property="performance"/> - <nonfunctionalRequirements xsi:type="commons:EnumeratedRequirement" name="Req1" description="Region" property="region"> - <values>00EU</values> - </nonfunctionalRequirements> - <nonfunctionalRequirements xsi:type="commons:EnumeratedRequirement" name="Req2" description="Provider" property="provider"> - <values>OPENSTACK</values> - </nonfunctionalRequirements> - <nonfunctionalRequirements name="Req3" description="elements" property="VM, VM"/> - </optimization> - <configurations name="config_example1"> - <deployments component="//@application/@components.0" node="//@infrastructure/@nodes.1"/> - <deployments component="//@application/@components.1" node="//@infrastructure/@nodes.0"/> - </configurations> -</commons:DOMLModel> diff --git a/tests/domlTests/DOML_v2.2_Example_gen_20230527061019.doml b/tests/domlTests/DOML_v2.2_Example_gen_20230527061019.doml deleted file mode 100644 index 56d0933b14d123313761bcf4ec175b499322ace4..0000000000000000000000000000000000000000 --- a/tests/domlTests/DOML_v2.2_Example_gen_20230527061019.doml +++ /dev/null @@ -1,46 +0,0 @@ -doml doml_example1 -application app_example1 { - dbms mysql { provides { sql_interface } } software_component nginx { consumes { sql_interface } } -} -infrastructure infra_example1 { - vm nginx_vm { - arch "x86-64" - os "Ubuntu-22.04.2-LTS" - mem_mb 1024.0 - sto "16GB" - cpu_count 1 - size "small" loc { region "00EU" } iface nginx_iface { belongs_to nginx_subnet security sec_group } - credentials nginx_vm_credentials - } - vm mysql_vm { - arch "x86-64" - os "Ubuntu-22.04.2-LTS" - mem_mb 1024.0 - sto "16GB" - cpu_count 1 - size "small" loc { region "00EU" } iface mysql_iface { belongs_to mysql_subnet security sec_group } - credentials mysql_vm_credentials - } - net common_network { subnet nginx_subnet { connections { mysql_subnet } protocol "TCP/IP" cidr "10.0.144.0/25" ifaces [ nginx_iface ] } subnet mysql_subnet { connections { nginx_subnet } protocol "TCP/IP" cidr "10.0.144.128/25" ifaces [ mysql_iface ] } protocol "TCP/IP" cidr "10.0.144.0/24" - gateway igw1 { - address "10.0.144.22" - } - } key_pair nginx_vm_credentials { user "nginx_user" keyfile "AAAAB3NzaC1yc2EAAAADAQABAAABAQC63ZvocMhX1LsdUlhzqLNSsh/Wotk/EMfDfa9pBHC52NXv05uENTjd/LBj8PS5JXEr7rKG9Zpj2Kj/PA7Gu0X1BZMwAiNR2dKjw9K0HO6Ozj3elCA7WjjotiQcO+OLWefE1PUW8/BJjtjFD/qf6wJd8CwInH8cjpkccQQfA55IXXegQMm5qv2a/S2XBvMMzv1dzsCy5UPO7tiOz4RBfi56JK8o2mDR327yY7+goA0HQz5tSN1X98+vxLpTPD5qINEFfVk1yNmf/ls3C7EBZQFJ6tsHgl070ymdBLHccmDMEYktzBnc/IhNWMq7K4IxwgFfQ7YSzAAqMr1n04+3oUeB" algorithm "RSA" bits 4096 } key_pair mysql_vm_credentials { user "mysql_user" keyfile "AAAAB3NzaC1yc2EAAAADAQABAAABAQCBiNSYpUJ9bCNhmFdEmCqF0WCW0f47SDN3T43nF5rDI06Ixuedk9+TlAUZudistB/RTlq0AaQmaZjBdQFkDvLiKnmEAB16eITQ/lz+eODcK5540E3Qd5jlq9DOy3s8eVaL8zg1zwaSktIJ/Y/jGyiy/MM1uobj/JNGNE++llYwh6/SjynGADo9bNcboJifLoU51lrJbyO6w7SJyeP28X46Dd6ob/GQwPAEZjhW+0U+K/JeDfIA1wYH6fC15K1pte9n57gd4RK+yRn7r45c0dP5M4gzZsZrXXaWRI/Dgbha08zSlKEzFdT7QcExMu+W6jGPZiHUSUAZJBxfRORHZ8iP" algorithm "RSA" bits 4096 } security_group sec_group { egress icmp { protocol "ICMP" from_port -1 to_port -1 cidrs [ "0.0.0.0/0" ] } ingress ssh { protocol "TCP" from_port 22 to_port 22 cidrs [ "0.0.0.0/0" ] } ingress http { protocol "TCP" from_port 80 to_port 80 cidrs [ "0.0.0.0/0" ] } ingress https { protocol "TCP" from_port 443 to_port 443 cidrs [ "0.0.0.0/0" ] } ifaces [ nginx_iface mysql_iface ] } -} -deployment config_example1 { mysql => mysql_vm nginx => nginx_vm } active deployment config_example1 concretizations { - concrete_infrastructure concrete_example1 { - provider openstack { - vm concrete_nginx_vm { - maps nginx_vm - } - vm concrete_mysql_vm { - maps mysql_vm - } - net concrete_common_network { - maps common_network - } - } - } - active concrete_example1 -} -optimization opt { objectives { "availability" => max "performance" => max } nonfunctional_requirements { Req1 "Region" values "00EU" => "region" Req2 "Provider" values "OPENSTACK" => "provider" Req3 "elements" => "VM, VM" } } \ No newline at end of file diff --git a/tests/domlTests/UC3_Simplified.doml b/tests/domlTests/UC3_Simplified.doml deleted file mode 100644 index 93e3e5b0fce02f66bed954c8bb73132d8c779544..0000000000000000000000000000000000000000 --- a/tests/domlTests/UC3_Simplified.doml +++ /dev/null @@ -1,294 +0,0 @@ -doml uc3_openstack - -application app { - - // need to define all sw components of the project this is a placeholder - // need to understand what is really needed in this spec - // need to specify all provides/consumes - - software_component iwg { - provides { net_info } - } - software_component osint { - provides { osint_info } - consumes { net_info, get_twitter, ewcf_rest_interface } - } - software_component ewcf { - provides { ewcf_rest_interface } - consumes { get_firebase } - } - saas external_twitter { - provides { get_twitter @ "https://twitter_api/get" } - } - saas external_firebase { - provides { get_firebase @ "https://firebase_api/get" } - } - -} - -infrastructure infra { - // Giuseppe - tutti devono collegarsi a oam - // Giuseppe - igw deve avere reti oam la net1 verso osint e net2 verso network 5G - - // VMs region - vm igw_vm { - os "Ubuntu-Focal-20.04-Daily-2022-04-19" - size "small" - - iface igw_vm_oam { - belongs_to subnet_oam_igw - } - - iface igw_vm_net1 { - belongs_to subnet_net1_igw - } - - iface igw_vm_net2 { - belongs_to subnet_net2_igw - } - - credentials ssh_key - } - - // Giuseppe - osint deve avere reti oam la net1 verso igw e net3 verso network internet - vm osint_vm { - os "Ubuntu-Focal-20.04-Daily-2022-04-19" - size "small" - - iface osint_vm_oam { - belongs_to subnet_oam_osint - } - - iface osint_vm_net1 { - belongs_to subnet_net1_osint - } - - iface osint_vm_net3 { - belongs_to subnet_net3_osint - } - - credentials ssh_key - } - - // Giuseppe - ewcf deve avere reti oam la net1 verso osint e net3 verso network internet - vm ewcf_vm { - os "Ubuntu-Focal-20.04-Daily-2022-04-19" - size "small" - - iface ewcf_vm_oam { - belongs_to subnet_oam_ewcf - } - - iface ewcf_vm_net1 { - belongs_to subnet_net1_ewcf - } - - iface ewcf_vm_net3 { - belongs_to subnet_net3_ewcf - } - - credentials ssh_key - } - - // Network region - - // Internal Network - net oam { - protocol "TCP/IP" - cidr "16.0.0.0/24" - - subnet subnet_oam_igw { - protocol "TCP/IP" - cidr "16.0.1.0/26" - } - - subnet subnet_oam_osint { - protocol "TCP/IP" - cidr "16.0.1.64/26" - } - - subnet subnet_oam_ewcf { - protocol "TCP/IP" - cidr "16.0.1.128/26" - } - } - - // Internal network - net net1 { - protocol "TCP/IP" - cidr "16.0.1.0/24" - - // Subnets definition - subnet subnet_net1_igw { - connections { - subnet_net1_osint - } - protocol "TCP/IP" - cidr "16.0.1.0/25" - } - - subnet subnet_net1_osint { - connections { - subnet_net1_igw - subnet_net1_ewcf - } - protocol "TCP/IP" - cidr "16.0.1.64/26" - } - - subnet subnet_net1_ewcf { - connections { - subnet_net1_osint - } - protocol "TCP/IP" - cidr "16.0.1.128/26" - } - } - - // Network connecting igw to 5G - net net2 { - protocol "TCP/IP" - cidr "16.0.2.0/24" - - subnet subnet_net2_igw { - protocol "TCP/IP" - cidr "16.0.2.0/25" - } - - gateway net2_igw { - // TODO: Define address - address "16.0.2.22" - } - - } - - // Network connecting osint and ewcf to Internet - net net3 { - protocol "TCP/IP" - cidr "16.0.3.0/24" - - subnet subnet_net3_osint { - protocol "TCP/IP" - cidr "16.0.3.0/25" - } - - subnet subnet_net3_ewcf { - protocol "TCP/IP" - cidr "16.0.3.128/25" - } - - gateway net3_igw { - // TODO: Define address - address "16.0.3.22" - } - } - - // credentials region - key_pair ssh_key { - user "ubuntu" - keyfile "AAAAB3NzaC1yc2EAAAADAQABAAABAQC63ZvocMhX1LsdUlhzqLNSsh/Wotk/EMfDfa9pBHC52NXv05uENTjd/LBj8PS5JXEr7rKG9Zpj2Kj/PA7Gu0X1BZMwAiNR2dKjw9K0HO6Ozj3elCA7WjjotiQcO+OLWefE1PUW8/BJjtjFD/qf6wJd8CwInH8cjpkccQQfA55IXXegQMm5qv2a/S2XBvMMzv1dzsCy5UPO7tiOz4RBfi56JK8o2mDR327yY7+goA0HQz5tSN1X98+vxLpTPD5qINEFfVk1yNmf/ls3C7EBZQFJ6tsHgl070ymdBLHccmDMEYktzBnc/IhNWMq7K4IxwgFfQ7YSzAAqMr1n04+3oUeB" - algorithm "RSA" - bits 4096 - } - - // Security region - - // security group is left as originally defined needs to be updated - security_group sg { - egress icmp { - protocol "ICMP" - from_port -1 - to_port -1 - cidr ["0.0.0.0/0"] - } - ingress http { - protocol "TCP" - from_port 80 - to_port 80 - cidr ["0.0.0.0/0"] - } - ingress https { - protocol "TCP" - from_port 443 - to_port 443 - cidr ["0.0.0.0/0"] - } - ingress ssh { - protocol "TCP" - from_port 22 - to_port 22 - cidr ["0.0.0.0/0"] - } - - ifaces igw_vm_oam, igw_vm_net1, igw_vm_net2, osint_vm_oam, osint_vm_net1, osint_vm_net3, ewcf_vm_oam, ewcf_vm_net1, ewcf_vm_net3 - } -} - -deployment config1 { - osint -> osint_vm, - iwg -> igw_vm, - ewcf -> ewcf_vm -} - -active deployment config1 - -concretizations { - concrete_infrastructure con_infra { - - provider openstack { - - // Concrete computing nodes region - - vm concrete_osint_vm { - maps osint_vm - } - - vm concrete_igw_vm { - maps igw_vm - } - - vm concrete_ewcf_vm { - maps ewcf_vm - } - - // Concrete Network region - net concrete_oam { - maps oam - } - - net concrete_net1 { - maps net1 - } - - net concrete_net2 { - maps net2 - } - - net concrete_net3 { - maps net3 - } - - } - } - active con_infra -} - -// It's currently not possible to provide "storage" for OPEN provider (IOP) -// req4 "elements" => "VM, storage"; -// Required performance was too much (70%), modified after talking with Eneko - -optimization opt { - - objectives { - "cost" => min - "performance" => max - "availability" => max - } - nonfunctional_requirements { - req1 "Cost <= 300" max 300.0 => "cost"; - req2 "Performance >= 7%" min 7.0 => "performance"; - req3 "Provider" values "OPEN" => "provider"; - req4 "elements" => "VM, VM, VM"; - } - -} \ No newline at end of file diff --git a/tests/domlTests/faas.doml b/tests/domlTests/faas.doml deleted file mode 100644 index 9345cc7d776cafd80d1a0af2553202e6f8ea112d..0000000000000000000000000000000000000000 --- a/tests/domlTests/faas.doml +++ /dev/null @@ -1,177 +0,0 @@ -doml faas_app - -application ImageResizeApp { - - software_component image_resize { - provides { - handle_image - } - consumes { - storage_interface, - bucket_in, - bucket_out - } - properties { - source_code = "path/lambda/function/image_resize.py"; - } - } - - saas s1 { - provides { - storage_interface - bucket_in - } - } - - saas s2 { - provides { - storage_interface - bucket_out - } - } - - software_component notification { - consumes { - handle_image, - bucket_in - } - } - - software_component web { - consumes { - storage_interface, - bucket_out - } - properties { - source_code = "path/web_app"; - } - } -} - -infrastructure infra { - vm vm1 { - iface i1 { - address "10.0.0.1" - belongs_to vpc - security sg - } - credentials ssh_key - loc { - region "eu-central-1" - } - } - - vm_image v_img { - generates vm1 - image "ami-xxxxxxxxxxxxxxxxx" - } - - container c { - host vm1 - } - - cont_image c_img { - generates c - image "web-app:0.1.0" - } - - faas f { } - - sto st1 { } - - sto st2 { } - - net vpc { - cidr "/24" - protocol "tcp/ip" - subnet vpc_subnet { - cidr "/24" - protocol "tcp/ip" - } - } - - security_group sg { - egress icmp { - from_port -1 - to_port -1 - protocol "icmp" - cidr ["0.0.0.0/0"] - } - ingress http { - from_port 80 - to_port 80 - protocol "tcp" - cidr ["0.0.0.0/0"] - } - ingress https { - from_port 443 - to_port 443 - protocol "tcp" - cidr ["0.0.0.0/0"] - } - ingress ssh { - from_port 22 - to_port 22 - protocol "tcp" - cidr ["0.0.0.0/0"] - } - ifaces i1 - } - - key_pair ssh_key { - user "ec2-user" - keyfile "/tmp/ssh_key_file" - algorithm "RSA" - bits 4096 - } -} - -deployment config1 { - image_resize -> f, - web -> c, - s1 -> st1, - s2 -> st2 -} - -active deployment config1 - -concretizations { - concrete_infrastructure con_infra { - provider aws { - vm concrete_vm { - properties { - instance_type = "t2.micro"; - ssh_key_name = "demo-key"; - ec2_role_name = "demo-ec2-role"; - } - maps vm1 - } - faas concrete_f { - properties { - lambda_role_name = "DemoLambdaRole"; - lambda_runtime = "python3.8"; - lambda_handler = "image_resize.lambda_handler"; - lambda_timeout = 5; - lambda_memory = 128; - } - maps f - } - storage s3_bucket_in { - properties { - bucket_name = "bucket_in"; - } - maps st1 - } - storage s3_bucket_out { - properties { - bucket_name = "bucket_out"; - } - maps st2 - } - net concrete_net { - maps vpc - } - } - } - active con_infra -} \ No newline at end of file diff --git a/tests/domlTests/faas.domlx b/tests/domlTests/faas.domlx deleted file mode 100644 index dc83d7135253786f5e7d1fbb9180c0ab1da9e2ca..0000000000000000000000000000000000000000 --- a/tests/domlTests/faas.domlx +++ /dev/null @@ -1,82 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<commons:DOMLModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:app="http://www.piacere-project.eu/doml/application" xmlns:commons="http://www.piacere-project.eu/doml/commons" xmlns:infra="http://www.piacere-project.eu/doml/infrastructure" name="faas_app" activeConfiguration="//@configurations.0" activeInfrastructure="//@concretizations.0"> - <application name="ImageResizeApp"> - <components xsi:type="app:SoftwareComponent" name="image_resize" consumedInterfaces="//@application/@components.1/@exposedInterfaces.0 //@application/@components.1/@exposedInterfaces.1 //@application/@components.2/@exposedInterfaces.1"> - <annotations xsi:type="commons:SProperty" key="source_code" value="path/lambda/function/image_resize.py"/> - <exposedInterfaces name="handle_image"/> - </components> - <components xsi:type="app:SaaS" name="s1"> - <exposedInterfaces name="storage_interface"/> - <exposedInterfaces name="bucket_in"/> - </components> - <components xsi:type="app:SaaS" name="s2"> - <exposedInterfaces name="storage_interface"/> - <exposedInterfaces name="bucket_out"/> - </components> - <components xsi:type="app:SoftwareComponent" name="notification" consumedInterfaces="//@application/@components.0/@exposedInterfaces.0 //@application/@components.1/@exposedInterfaces.1"/> - <components xsi:type="app:SoftwareComponent" name="web" consumedInterfaces="//@application/@components.1/@exposedInterfaces.0 //@application/@components.2/@exposedInterfaces.1"> - <annotations xsi:type="commons:SProperty" key="source_code" value="path/web_app"/> - </components> - </application> - <infrastructure name="infra"> - <nodes xsi:type="infra:VirtualMachine" name="vm1" credentials="//@infrastructure/@credentials.0" generatedFrom="//@infrastructure/@generators.0"> - <ifaces name="i1" endPoint="10.0.0.1" belongsTo="//@infrastructure/@networks.0" associated="//@infrastructure/@securityGroups.0"/> - <location region="eu-central-1"/> - </nodes> - <nodes xsi:type="infra:Container" name="c" generatedFrom="//@infrastructure/@generators.1"> - <configs host="//@infrastructure/@nodes.0"/> - </nodes> - <generators xsi:type="infra:VMImage" name="v_img" uri="ami-xxxxxxxxxxxxxxxxx" kind="IMAGE" generatedVMs="//@infrastructure/@nodes.0"/> - <generators xsi:type="infra:ContainerImage" name="c_img" uri="web-app:0.1.0" kind="IMAGE" generatedContainers="//@infrastructure/@nodes.1"/> - <storages name="st1"/> - <storages name="st2"/> - <faas name="f"/> - <credentials xsi:type="commons:KeyPair" name="ssh_key" user="ec2-user" keyfile="/tmp/ssh_key_file" algorithm="RSA" bits="4096"/> - <securityGroups name="sg" ifaces="//@infrastructure/@nodes.0/@ifaces.0"> - <rules name="icmp" protocol="icmp" fromPort="-1" toPort="-1"> - <cidr>0.0.0.0/0</cidr> - </rules> - <rules name="http" kind="INGRESS" protocol="tcp" fromPort="80" toPort="80"> - <cidr>0.0.0.0/0</cidr> - </rules> - <rules name="https" kind="INGRESS" protocol="tcp" fromPort="443" toPort="443"> - <cidr>0.0.0.0/0</cidr> - </rules> - <rules name="ssh" kind="INGRESS" protocol="tcp" fromPort="22" toPort="22"> - <cidr>0.0.0.0/0</cidr> - </rules> - </securityGroups> - <networks name="vpc" protocol="tcp/ip" addressRange="/24" connectedIfaces="//@infrastructure/@nodes.0/@ifaces.0"> - <subnets name="vpc_subnet" protocol="tcp/ip" addressRange="/24"/> - </networks> - </infrastructure> - <concretizations name="con_infra"> - <providers name="aws"> - <vms name="concrete_vm" maps="//@infrastructure/@nodes.0"> - <annotations xsi:type="commons:SProperty" key="instance_type" value="t2.micro"/> - <annotations xsi:type="commons:SProperty" key="ssh_key_name" value="demo-key"/> - <annotations xsi:type="commons:SProperty" key="ec2_role_name" value="demo-ec2-role"/> - </vms> - <networks name="concrete_net" maps="//@infrastructure/@networks.0"/> - <storages name="s3_bucket_in" maps="//@infrastructure/@storages.0"> - <annotations xsi:type="commons:SProperty" key="bucket_name" value="bucket_in"/> - </storages> - <storages name="s3_bucket_out" maps="//@infrastructure/@storages.1"> - <annotations xsi:type="commons:SProperty" key="bucket_name" value="bucket_out"/> - </storages> - <faas name="concrete_f" maps="//@infrastructure/@faas.0"> - <annotations xsi:type="commons:SProperty" key="lambda_role_name" value="DemoLambdaRole"/> - <annotations xsi:type="commons:SProperty" key="lambda_runtime" value="python3.8"/> - <annotations xsi:type="commons:SProperty" key="lambda_handler" value="image_resize.lambda_handler"/> - <annotations xsi:type="commons:IProperty" key="lambda_timeout" value="5"/> - <annotations xsi:type="commons:IProperty" key="lambda_memory" value="128"/> - </faas> - </providers> - </concretizations> - <configurations name="config1"> - <deployments component="//@application/@components.0" node="//@infrastructure/@faas.0"/> - <deployments component="//@application/@components.4" node="//@infrastructure/@nodes.1"/> - <deployments component="//@application/@components.1" node="//@infrastructure/@storages.0"/> - <deployments component="//@application/@components.2" node="//@infrastructure/@storages.1"/> - </configurations> -</commons:DOMLModel> diff --git a/tests/domlTests/iot_simple_app.doml b/tests/domlTests/iot_simple_app.doml deleted file mode 100644 index 4dca09ac6ec52afa070731e6942535354b8eb5b4..0000000000000000000000000000000000000000 --- a/tests/domlTests/iot_simple_app.doml +++ /dev/null @@ -1,52 +0,0 @@ -doml iot_simple_app - -application iot_simple_app { - dbms oracle { - provides { sql_interface } - } - - software_component web_server { - provides { sensor_info } - consumes { sql_interface, get_weather } - } - - software_component iot_provider { - consumes { sensor_info } - } - - saas external_meteo { - provides { get_weather @ "https://api.mymeteo.com/get" } - } -} - -infrastructure infra { - vm vm1 {} - vm vm2 {} - node iot_device1 {} - node iot_device2 {} -} - -deployment config1 { - oracle -> vm1, - web_server -> vm2, - iot_provider -> iot_device1, - iot_provider -> iot_device2 -} - -active deployment config1 - -concretizations { - concrete_infrastructure con_infra1 { - provider aws { - vm concrete_vm1 { - properties { instance_type = "t2.micro"; } - maps vm1 - } - vm concrete_vm2 { - properties {} - maps vm2 - } - } - } - active con_infra1 -} \ No newline at end of file diff --git a/tests/domlTests/iot_simple_app.domlx b/tests/domlTests/iot_simple_app.domlx deleted file mode 100644 index d750eee5e1487c0b0097e48b3a92453dc3da95d2..0000000000000000000000000000000000000000 --- a/tests/domlTests/iot_simple_app.domlx +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<commons:DOMLModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:app="http://www.piacere-project.eu/doml/application" xmlns:commons="http://www.piacere-project.eu/doml/commons" xmlns:infra="http://www.piacere-project.eu/doml/infrastructure" name="iot_simple_app" activeConfiguration="//@configurations.0" activeInfrastructure="//@concretizations.0"> - <application name="iot_simple_app"> - <components xsi:type="app:DBMS" name="oracle"> - <exposedInterfaces name="sql_interface"/> - </components> - <components xsi:type="app:SoftwareComponent" name="web_server" consumedInterfaces="//@application/@components.0/@exposedInterfaces.0 //@application/@components.3/@exposedInterfaces.0"> - <exposedInterfaces name="sensor_info"/> - </components> - <components xsi:type="app:SoftwareComponent" name="iot_provider" consumedInterfaces="//@application/@components.1/@exposedInterfaces.0"/> - <components xsi:type="app:SaaS" name="external_meteo"> - <exposedInterfaces name="get_weather" endPoint="https://api.mymeteo.com/get"/> - </components> - </application> - <infrastructure name="infra"> - <nodes xsi:type="infra:VirtualMachine" name="vm1"/> - <nodes xsi:type="infra:VirtualMachine" name="vm2"/> - <nodes xsi:type="infra:PhysicalComputingNode" name="iot_device1"/> - <nodes xsi:type="infra:PhysicalComputingNode" name="iot_device2"/> - </infrastructure> - <concretizations name="con_infra1"> - <providers name="aws"> - <vms name="concrete_vm1" maps="//@infrastructure/@nodes.0"> - <annotations xsi:type="commons:SProperty" key="instance_type" value="t2.micro"/> - </vms> - <vms name="concrete_vm2" maps="//@infrastructure/@nodes.1"/> - </providers> - </concretizations> - <configurations name="config1"> - <deployments component="//@application/@components.0" node="//@infrastructure/@nodes.0"/> - <deployments component="//@application/@components.1" node="//@infrastructure/@nodes.1"/> - <deployments component="//@application/@components.2" node="//@infrastructure/@nodes.2"/> - <deployments component="//@application/@components.2" node="//@infrastructure/@nodes.3"/> - </configurations> -</commons:DOMLModel> diff --git a/tests/domlTests/nginx-aws-ec2.doml b/tests/domlTests/nginx-aws-ec2.doml deleted file mode 100644 index 8b1f7635abe55981f613ee869c490d364fd236a0..0000000000000000000000000000000000000000 --- a/tests/domlTests/nginx-aws-ec2.doml +++ /dev/null @@ -1,121 +0,0 @@ -doml nginx_aws_ec2 - -application app { - - software_component nginx { - properties { - source_code="/usr/share/nginx/html/index.html"; - } - } -} - -infrastructure infra { - - vm_image vm_img { - generates vm1 - image "ami-xxxxxxxxxxxxxxxxx" - } - - net vpc { - cidr "/24" - protocol "tcp/ip" - subnet vpc_subnet { - cidr "/24" - protocol "tcp/ip" - } - } - - security_group sg { - egress icmp { - from_port -1 - to_port -1 - protocol "icmp" - cidr ["0.0.0.0/0"] - } - ingress http { - from_port 80 - to_port 80 - protocol "tcp" - cidr ["0.0.0.0/0"] - } - ingress https { - from_port 443 - to_port 443 - protocol "tcp" - cidr ["0.0.0.0/0"] - } - ingress ssh { - from_port 22 - to_port 22 - protocol "tcp" - cidr ["0.0.0.0/0"] - } - ifaces i1 - } - - key_pair ssh_key { - user "ec2-user" - keyfile "/tmp/ssh_key_file" - algorithm "RSA" - bits 4096 - } - - autoscale_group ag { - vm vm1 { - iface i1 { - address "10.0.0.1" - belongs_to vpc - security sg - } - credentials ssh_key - loc { - region "eu-central-1" - } - } - } -} - -deployment conf { - nginx -> vm1 -} - -active deployment conf - -concretizations { - concrete_infrastructure con_infra { - provider aws { - vm ec2_vm { - properties { - vm_name = "nginx-host"; - instance_type = "t2.micro"; - ssh_key_name = "demo-key"; - ec2_role_name = "demo-ec2-role"; - } - maps vm1 - } - - vm_image concrete_vm_image { - maps vm_img - } - - net concrete_net { - properties { - vm_name = "nginx-host"; - } - maps vpc - } - } - } - active con_infra -} - -optimization opt { - objectives { - "cost" => min - "availability" => max - } - nonfunctional_requirements { - req1 "Cost <= 70.0" max 70.0 => "cost"; - req2 "Availability >= 66.5%" min 66.5 => "availability"; - } -} diff --git a/tests/domlTests/nginx-aws-ec2.domlx b/tests/domlTests/nginx-aws-ec2.domlx deleted file mode 100644 index 14660f0286d3bb24560cccada553c121e06cd4e9..0000000000000000000000000000000000000000 --- a/tests/domlTests/nginx-aws-ec2.domlx +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<commons:DOMLModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:app="http://www.piacere-project.eu/doml/application" xmlns:commons="http://www.piacere-project.eu/doml/commons" xmlns:infra="http://www.piacere-project.eu/doml/infrastructure" xmlns:optimization="http://www.piacere-project.eu/doml/optimization" name="nginx_aws_ec2" activeConfiguration="//@configurations.0" activeInfrastructure="//@concretizations.0"> - <application name="app"> - <components xsi:type="app:SoftwareComponent" name="nginx"> - <annotations xsi:type="commons:SProperty" key="source_code" value="/usr/share/nginx/html/index.html"/> - </components> - </application> - <infrastructure name="infra"> - <generators xsi:type="infra:VMImage" name="vm_img" uri="ami-xxxxxxxxxxxxxxxxx" kind="IMAGE" generatedVMs="//@infrastructure/@groups.0/@machineDefinition"/> - <credentials xsi:type="commons:KeyPair" name="ssh_key" user="ec2-user" keyfile="/tmp/ssh_key_file" algorithm="RSA" bits="4096"/> - <groups xsi:type="infra:AutoScalingGroup" name="ag"> - <machineDefinition name="vm1" credentials="//@infrastructure/@credentials.0" generatedFrom="//@infrastructure/@generators.0"> - <ifaces name="i1" endPoint="10.0.0.1" belongsTo="//@infrastructure/@networks.0" associated="//@infrastructure/@securityGroups.0"/> - <location region="eu-central-1"/> - </machineDefinition> - </groups> - <securityGroups name="sg" ifaces="//@infrastructure/@groups.0/@machineDefinition/@ifaces.0"> - <rules name="icmp" protocol="icmp" fromPort="-1" toPort="-1"> - <cidr>0.0.0.0/0</cidr> - </rules> - <rules name="http" kind="INGRESS" protocol="tcp" fromPort="80" toPort="80"> - <cidr>0.0.0.0/0</cidr> - </rules> - <rules name="https" kind="INGRESS" protocol="tcp" fromPort="443" toPort="443"> - <cidr>0.0.0.0/0</cidr> - </rules> - <rules name="ssh" kind="INGRESS" protocol="tcp" fromPort="22" toPort="22"> - <cidr>0.0.0.0/0</cidr> - </rules> - </securityGroups> - <networks name="vpc" protocol="tcp/ip" addressRange="/24" connectedIfaces="//@infrastructure/@groups.0/@machineDefinition/@ifaces.0"> - <subnets name="vpc_subnet" protocol="tcp/ip" addressRange="/24"/> - </networks> - </infrastructure> - <concretizations name="con_infra"> - <providers name="aws"> - <vms name="ec2_vm" maps="//@infrastructure/@groups.0/@machineDefinition"> - <annotations xsi:type="commons:SProperty" key="vm_name" value="nginx-host"/> - <annotations xsi:type="commons:SProperty" key="instance_type" value="t2.micro"/> - <annotations xsi:type="commons:SProperty" key="ssh_key_name" value="demo-key"/> - <annotations xsi:type="commons:SProperty" key="ec2_role_name" value="demo-ec2-role"/> - </vms> - <vmImages name="concrete_vm_image" maps="//@infrastructure/@generators.0"/> - <networks name="concrete_net" maps="//@infrastructure/@networks.0"> - <annotations xsi:type="commons:SProperty" key="vm_name" value="nginx-host"/> - </networks> - </providers> - </concretizations> - <optimization name="opt"> - <objectives xsi:type="optimization:MeasurableObjective" kind="min" property="cost"/> - <objectives xsi:type="optimization:MeasurableObjective" kind="max" property="availability"/> - <nonfunctionalRequirements xsi:type="commons:RangedRequirement" name="req1" description="Cost <= 70.0" property="cost" max="70.0"/> - <nonfunctionalRequirements xsi:type="commons:RangedRequirement" name="req2" description="Availability >= 66.5%" property="availability" min="66.5"/> - </optimization> - <configurations name="conf"> - <deployments component="//@application/@components.0" node="//@infrastructure/@groups.0/@machineDefinition"/> - </configurations> -</commons:DOMLModel> diff --git a/tests/domlTests/nginx_func_req.doml b/tests/domlTests/nginx_func_req.doml deleted file mode 100644 index f810a6be84417f7a40da07b084b08c4e5f50db8a..0000000000000000000000000000000000000000 --- a/tests/domlTests/nginx_func_req.doml +++ /dev/null @@ -1,149 +0,0 @@ -doml nginx_func_req - -application app { - - software_component nginx { - properties { - source_code="/usr/share/nginx/html/index.html"; - } - } -} - -infrastructure infra { - - vm_image vm_img { - generates vm1 - image "ami-xxxxxxxxxxxxxxxxx" - } - - net vpc { - cidr "/24" - protocol "tcp/ip" - subnet vpc_subnet { - cidr "/24" - protocol "tcp/ip" - } - } - - security_group sg { - egress icmp { - from_port -1 - to_port -1 - protocol "icmp" - cidr ["0.0.0.0/0"] - } - ingress http { - from_port 80 - to_port 80 - protocol "tcp" - cidr ["0.0.0.0/0"] - } - ingress https { - from_port 443 - to_port 443 - protocol "tcp" - cidr ["0.0.0.0/0"] - } - ingress ssh { - from_port 22 - to_port 22 - protocol "tcp" - cidr ["0.0.0.0/0"] - } - ifaces i1 - } - - key_pair ssh_key { - user "ec2-user" - keyfile "/tmp/ssh_key_file" - algorithm "RSA" - bits 4096 - } - - autoscale_group ag { - vm vm1 { - iface i1 { - address "10.0.0.1" - belongs_to vpc - security sg - } - credentials ssh_key - loc { - region "eu-central-1" - } - } - } -} - -deployment conf { - nginx -> vm1 -} - -active deployment conf - -concretizations { - concrete_infrastructure con_infra { - provider aws { - vm ec2_vm { - properties { - vm_name = "nginx-host"; - instance_type = "t2.micro"; - ssh_key_name = "demo-key"; - ec2_role_name = "demo-ec2-role"; - } - maps vm1 - } - - vm_image concrete_vm_image { - maps vm_img - } - - net concrete_net { - properties { - vm_name = "nginx-host"; - } - maps vpc - } - } - } - active con_infra -} - -optimization opt { - objectives { - "cost" => min - "availability" => max - } - nonfunctional_requirements { - req1 "Cost <= 70.0" max 70.0 => "cost"; - req2 "Availability >= 66.5%" min 66.5 => "availability"; - } -} - -functional_requirements { - req_ext ``` - > "example requirement to test" - # Expr to parse - not ( - vm is class infrastructure.VirtualMachine - and - vm is not class infrastructure.Storage - or - vm is not class infrastructure.Storage - implies - vm is class infrastructure.Storage - ) - iff - not exists iface, apple ( - forall orange ( - vm has association infrastructure.ComputingNode->ifaces iface - or - vm has association infrastructure.ComputingNode->ifaces iface - ) - and - vm has attribute infrastructure.ComputingNode->os Os1 - ) - --- - "Virtual Machine {vm} has no iface" - ```; -} diff --git a/tests/domlTests/nginx_func_req.domlx b/tests/domlTests/nginx_func_req.domlx deleted file mode 100644 index 06e934aef363c4f9ebb82bf224ccaec8a4829967..0000000000000000000000000000000000000000 --- a/tests/domlTests/nginx_func_req.domlx +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<commons:DOMLModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:app="http://www.piacere-project.eu/doml/application" xmlns:commons="http://www.piacere-project.eu/doml/commons" xmlns:infra="http://www.piacere-project.eu/doml/infrastructure" xmlns:optimization="http://www.piacere-project.eu/doml/optimization" name="nginx_func_req" activeConfiguration="//@configurations.0" activeInfrastructure="//@concretizations.0"> - <application name="app"> - <components xsi:type="app:SoftwareComponent" name="nginx"> - <annotations xsi:type="commons:SProperty" key="source_code" value="/usr/share/nginx/html/index.html"/> - </components> - </application> - <infrastructure name="infra"> - <generators xsi:type="infra:VMImage" name="vm_img" uri="ami-xxxxxxxxxxxxxxxxx" kind="IMAGE" generatedVMs="//@infrastructure/@groups.0/@machineDefinition"/> - <credentials xsi:type="commons:KeyPair" name="ssh_key" user="ec2-user" keyfile="/tmp/ssh_key_file" algorithm="RSA" bits="4096"/> - <groups xsi:type="infra:AutoScalingGroup" name="ag"> - <machineDefinition name="vm1" credentials="//@infrastructure/@credentials.0" generatedFrom="//@infrastructure/@generators.0"> - <ifaces name="i1" endPoint="10.0.0.1" belongsTo="//@infrastructure/@networks.0" associated="//@infrastructure/@securityGroups.0"/> - <location region="eu-central-1"/> - </machineDefinition> - </groups> - <securityGroups name="sg" ifaces="//@infrastructure/@groups.0/@machineDefinition/@ifaces.0"> - <rules name="icmp" protocol="icmp" fromPort="-1" toPort="-1"> - <cidr>0.0.0.0/0</cidr> - </rules> - <rules name="http" kind="INGRESS" protocol="tcp" fromPort="80" toPort="80"> - <cidr>0.0.0.0/0</cidr> - </rules> - <rules name="https" kind="INGRESS" protocol="tcp" fromPort="443" toPort="443"> - <cidr>0.0.0.0/0</cidr> - </rules> - <rules name="ssh" kind="INGRESS" protocol="tcp" fromPort="22" toPort="22"> - <cidr>0.0.0.0/0</cidr> - </rules> - </securityGroups> - <networks name="vpc" protocol="tcp/ip" addressRange="/24" connectedIfaces="//@infrastructure/@groups.0/@machineDefinition/@ifaces.0"> - <subnets name="vpc_subnet" protocol="tcp/ip" addressRange="/24"/> - </networks> - </infrastructure> - <concretizations name="con_infra"> - <providers name="aws"> - <vms name="ec2_vm" maps="//@infrastructure/@groups.0/@machineDefinition"> - <annotations xsi:type="commons:SProperty" key="vm_name" value="nginx-host"/> - <annotations xsi:type="commons:SProperty" key="instance_type" value="t2.micro"/> - <annotations xsi:type="commons:SProperty" key="ssh_key_name" value="demo-key"/> - <annotations xsi:type="commons:SProperty" key="ec2_role_name" value="demo-ec2-role"/> - </vms> - <vmImages name="concrete_vm_image" maps="//@infrastructure/@generators.0"/> - <networks name="concrete_net" maps="//@infrastructure/@networks.0"> - <annotations xsi:type="commons:SProperty" key="vm_name" value="nginx-host"/> - </networks> - </providers> - </concretizations> - <optimization name="opt"> - <objectives xsi:type="optimization:MeasurableObjective" kind="min" property="cost"/> - <objectives xsi:type="optimization:MeasurableObjective" kind="max" property="availability"/> - <nonfunctionalRequirements xsi:type="commons:RangedRequirement" name="req1" description="Cost <= 70.0" property="cost" max="70.0"/> - <nonfunctionalRequirements xsi:type="commons:RangedRequirement" name="req2" description="Availability >= 66.5%" property="availability" min="66.5"/> - </optimization> - <configurations name="conf"> - <deployments component="//@application/@components.0" node="//@infrastructure/@groups.0/@machineDefinition"/> - </configurations> - <functionalRequirements name="req_ext" description="```
 > "example requirement to test"
 # Expr to parse
 not ( 
 vm is class infrastructure.VirtualMachine
 and
 vm is not class infrastructure.Storage
 or
 vm is not class infrastructure.Storage
 implies
 vm is class infrastructure.Storage
 )
 iff
 not exists iface, apple (
 forall orange (
 vm has association infrastructure.ComputingNode->ifaces iface
 or
 vm has association infrastructure.ComputingNode->ifaces iface
 )
 and
 vm has attribute infrastructure.ComputingNode->os Os1
 )
 ---
 "Virtual Machine {vm} has no iface"
	```"/> -</commons:DOMLModel> diff --git a/tutorial/DOML_3.1_Tutorial - NginX Example.doml b/tutorial/DOML_3.1_Tutorial - NginX Example.doml deleted file mode 100644 index 57ed9317c97be588679303a77de635adf493a5df..0000000000000000000000000000000000000000 --- a/tutorial/DOML_3.1_Tutorial - NginX Example.doml +++ /dev/null @@ -1,360 +0,0 @@ -/* - * Here we show a simple example of a DOML Model to let user better understand the syntax and the structure of DOML v3.0. - * - * In the following example, we want to describe a web application, which accesses a database. - * Such an application consists of an NginX web server and a MySQL DBMS, which both run on virtual machines provided by the OpenStack cloud provider. - * Such virtual machines, which should be both located in Europe ("00EU" region), are connected to a common network, which also guarantees access to Internet, and each of them has an associated subnet. - * Finally, these two subnets are connected to each other. - * Moreover, we want the availability and performance of the infrastructure to be maximized and OpenStack to be used as a cloud provider for the infrastructure. - * - */ -doml doml_example1 { - version "3.1" - - /* - * We first have to define our application components in the Application Layer. - */ - application app_example1 { - - /* - * A mysql DBMS: it provides a SQL interface to handle data. - */ - dbms mysql { - - provides { - sql_interface - } - - } - - /* - * An nginx web server to run the web application. - * As stated in the description above, it consumes the database interface. - */ - software_component nginx { - - consumes { - sql_interface - } - - } - - } - - /* - * We can then describe the abstract infrastructure in the Infrastructure Layer. - */ - infrastructure infra_example1 { - - /* - * We want to use a VM to host the nginx web server. - * We want the VM to have the configuration we specify through the attributes. - */ - vm nginx_vm { - - arch "x86-64" - - os "Ubuntu-22.04.2-LTS" - - mem_mb 1024.0 - - sto 16.0 - - cpu_count 1 - - size "small" - - loc { - - region "00EU" - - } - - /* - * We want to define a network interface belonging to the subnet we're defining for this VM. - * We decide to name such a subnet "nginx_subnet". - */ - iface nginx_iface { - - belongs_to nginx_subnet - } - - /* - * We also want to specify credentials to access the VM. - * For security reasons, it's always a good practice to have separate credentials for each VM instance. - * We decide to name credentials to access this VM "nginx_vm_credentials". - */ - credentials nginx_vm_credentials - } - - - /* - * We want to use a VM to host the mysql DBMS. - * Analogously to what we have done above for the nginx_vm, we can specify the VM configuration through attributes. - */ - vm mysql_vm { - - arch "x86-64" - - os "Ubuntu-22.04.2-LTS" - - mem_mb 1024.0 - - sto 16.0 - - cpu_count 1 - - size "small" - - loc { - - region "00EU" - - } - - /* - * We want to do the same as above. - * We decide to name the subnet "mysql_subnet". - */ - iface mysql_iface { - - belongs_to mysql_subnet - } - - // As done above, we proceed to set credentials to access the VM. - credentials mysql_vm_credentials - - } - - /* - * We now want to configure the network. - * As stated above, we need to define two interconnected subnets. - * Moreover, we need to define an Internet gateway since we want the network to have access to Internet. - */ - net common_network { - - protocol "TCP/IP" - - /* - * Definition of the first subnet, the one associated to the nginx_vm. - */ - subnet nginx_subnet { - - connections { - mysql_subnet - } - - } - - // This definition is analogous to what is shown above. - subnet mysql_subnet { - - connections { - nginx_subnet - } - - } - - gateway igw1 { - - address "10.0.144.22" - - } - - } - - /* - * As specified above, we want to define credentials to guarantee access to VMs. - * These credentials are used for the nginx_vm. - */ - key_pair nginx_vm_credentials { - - user "nginx_user" - - key "AAAAB3NzaC1yc2EAAAADAQABAAABAQC63ZvocMhX1LsdUlhzqLNSsh/Wotk/EMfDfa9pBHC52NXv05uENTjd/LBj8PS5JXEr7rKG9Zpj2Kj/PA7Gu0X1BZMwAiNR2dKjw9K0HO6Ozj3elCA7WjjotiQcO+OLWefE1PUW8/BJjtjFD/qf6wJd8CwInH8cjpkccQQfA55IXXegQMm5qv2a/S2XBvMMzv1dzsCy5UPO7tiOz4RBfi56JK8o2mDR327yY7+goA0HQz5tSN1X98+vxLpTPD5qINEFfVk1yNmf/ls3C7EBZQFJ6tsHgl070ymdBLHccmDMEYktzBnc/IhNWMq7K4IxwgFfQ7YSzAAqMr1n04+3oUeB" - - algorithm "RSA" - - bits 4096 - } - - // This definition is analogous to what we have shown above. - key_pair mysql_vm_credentials { - - user "mysql_user" - - key "AAAAB3NzaC1yc2EAAAADAQABAAABAQCBiNSYpUJ9bCNhmFdEmCqF0WCW0f47SDN3T43nF5rDI06Ixuedk9+TlAUZudistB/RTlq0AaQmaZjBdQFkDvLiKnmEAB16eITQ/lz+eODcK5540E3Qd5jlq9DOy3s8eVaL8zg1zwaSktIJ/Y/jGyiy/MM1uobj/JNGNE++llYwh6/SjynGADo9bNcboJifLoU51lrJbyO6w7SJyeP28X46Dd6ob/GQwPAEZjhW+0U+K/JeDfIA1wYH6fC15K1pte9n57gd4RK+yRn7r45c0dP5M4gzZsZrXXaWRI/Dgbha08zSlKEzFdT7QcExMu+W6jGPZiHUSUAZJBxfRORHZ8iP" - - algorithm "RSA" - - bits 4096 - } - - /* - * We also want to secure access to our common network. - * In order to do so, we describe the rules for such network through the definition of a security group. - * - * Here are shown some of the most commonly used rules. - */ - security_group sec_group { - - egress icmp { - - protocol "ICMP" - - from_port -1 - - to_port -1 - - cidrs ["0.0.0.0/0"] - } - - ingress ssh { - - protocol "TCP" - - from_port 22 - - to_port 22 - - cidrs ["0.0.0.0/0"] - } - - ingress http { - - protocol "TCP" - - from_port 80 - - to_port 80 - - cidrs ["0.0.0.0/0"] - } - - ingress https { - - protocol "TCP" - - from_port 443 - - to_port 443 - - cidrs ["0.0.0.0/0"] - } - - // We want to specify that these rules apply to both the interfaces we defined for our VMs. - ifaces { - nginx_iface - mysql_iface - } - - } - - } - - /* - * Now we have defined our abstract infrastructure and we're ready to deploy our application. - * Let's define the configuration for deployment. - */ - deployment config_example1 { - mysql => mysql_vm - nginx => nginx_vm - } - - // We specify the active deployment configuration. We only have one, but this step is always necessary. - active deployment config_example1 - - /* - * We then need to define the concrete infrastructure in the Concrete Layer. - */ - concretizations { - - concrete_infrastructure concrete_example1 { - - /* - * As stated in the description, we want to use Openstack as a provider for our infrastructure. - * Any further information regarding the provider itself can be specified through properties. - * Here we have to describe the concrete components corresponding to the abstract ones defined in the Infrastructure Layer. - */ - provider openstack { - - /* - * We have three elements in the abstract infrastructure definition that need a concrete counterpart: - * - The two VMs for mysql DBMS and nginx web server - * - The common network and its subnets - */ - - vm concrete_nginx_vm { - - maps nginx_vm - - } - - vm concrete_mysql_vm { - - maps mysql_vm - - } - - - net concrete_common_network { - - cidr "10.0.144.0/24" - - subnet concrete_nginx_subnet { - - cidr "10.0.144.0/25" - - maps nginx_subnet - } - - subnet concrete_mysql_subnet { - - cidr "10.0.144.128/25" - - maps mysql_subnet - } - - maps common_network - } - - } - - } - - // We specify the active concretization. - // Analogously to the deployment configurations, we only have one, but this step is always necessary. - active concrete_example1 - - } - - /* - * For this simple application, there is no need to define any functional requirement, so the corresponding - * section is not present in this example. - * - * However, we can specify some optimization objectives and non functional requirements. - * - * Even though we can express any kind of objective in DOML, the three widely used optimization - * targets are cost, availability and performance, which is also what PIACERE mainly focuses on. - * Since we haven't included any cost in the example, we're keeping as objectives the - * maximization of both performance and availability. - * - * As stated in the description of the example, both VMs should be located in the "00EU" region. - * In order to specify this constraint, we define a non-functional requirement. - * Moreover, we want to specify that we want to deploy two VMs as elements. - */ - - optimization opt{ - - objectives { - "availability" => max - "performance" => max - } - nonfunctional_requirements { - Req1 "Region" values "00EU" => "region" - Req2 "Provider" values "openstack" => "provider" - Req3 "elements" => "VM VM" - } - - } -} \ No newline at end of file