Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
b8dc2f77
Commit
b8dc2f77
authored
Jan 26, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added alias from vmtype
parent
43d96849
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
87 additions
and
95 deletions
+87
-95
application_example_updated.yaml
TOSCA/application_example_updated.yaml
+14
-35
CloudStormDCMetaInfo.java
.../uva/sne/drip/model/cloud/storm/CloudStormDCMetaInfo.java
+13
-13
CloudsStormVM.java
...java/nl/uva/sne/drip/model/cloud/storm/CloudsStormVM.java
+2
-0
DBInfo.java
...c/main/java/nl/uva/sne/drip/model/cloud/storm/DBInfo.java
+6
-6
workspace.xml
drip-planner/.idea/workspace.xml
+13
-16
pom.xml
drip-provisioner/pom.xml
+10
-0
CloudStormDAO.java
.../main/java/nl/uva/sne/drip/provisioner/CloudStormDAO.java
+3
-4
CloudStormService.java
...n/java/nl/uva/sne/drip/provisioner/CloudStormService.java
+26
-21
No files found.
TOSCA/application_example_updated.yaml
View file @
b8dc2f77
...
@@ -17,44 +17,23 @@ description: >
...
@@ -17,44 +17,23 @@ description: >
topology_template
:
topology_template
:
node_templates
:
node_templates
:
wordpress
:
mongo
:
type
:
tosca.nodes.ARTICONF.Container.Application.Docker
requirements
:
-
service
:
node
:
mysql
relationship
:
type
:
tosca.relationships.ConnectsTo
type
:
tosca.relationships.DependsOn
artifacts
:
image
:
file
:
wordpress:latest
type
:
tosca.artifacts.Deployment.Image.Container.Docker
repository
:
docker_hub
properties
:
ports
:
-
"
8000:80"
environment
:
WORDPRESS_DB_HOST
:
mysql:3306
WORDPRESS_DB_USER
:
wordpress
WORDPRESS_DB_PASSWORD
:
wordpress
WORDPRESS_DB_NAME
:
wordpress
mysql
:
type
:
tosca.nodes.ARTICONF.Container.Application.Docker
type
:
tosca.nodes.ARTICONF.Container.Application.Docker
properties
:
properties
:
ports
:
ports
:
-
"
3306:3306
"
-
"
27017:27017
"
volumes
:
volumes
:
-
db_data:/var/lib/m
ysql
-
db_data:/var/lib/m
ongo
environment
:
environment
:
MYSQL_ROOT_PASSWORD
:
somewordpress
MONGO_INITDB_ROOT_USERNAME
:
rootUser
MYSQL_DATABASE
:
wordpress
MONGO_INITDB_ROOT_PASSWORD
:
rootPassword
MYSQL_USER
:
wordpress
MONGO_INITDB_DATABASE
:
databaseName
MYSQL_PASSWORD
:
wordpress
MONGO_USERNAME
:
databaseUser
MONGO_PASSWORD:password
artifacts
:
artifacts
:
image
:
image
:
type
:
tosca.artifacts.Deployment.Image.Container.Docker
type
:
tosca.artifacts.Deployment.Image.Container.Docker
file
:
mysql:5.7
file
:
lakshminp/mongo:4.2.1
repository
:
docker_hub
repository
:
docker_hub
...
@@ -77,13 +56,13 @@ topology_template:
...
@@ -77,13 +56,13 @@ topology_template:
policies
:
policies
:
-
scalability
:
-
scalability
:
type
:
tosca.policies.ARTICONF.Performance.CPU
type
:
tosca.policies.ARTICONF.Performance.CPU
targets
:
[
wordpress
]
targets
:
[
mongo
]
properties
:
properties
:
constraint_name
:
cpu_load
constraint_name
:
cpu_load
max_value
:
90
max_value
:
90
-
faultTolerance
:
-
faultTolerance
:
type
:
tosca.policies.ARTICONF.FaultTolerance
type
:
tosca.policies.ARTICONF.FaultTolerance
targets
:
[
m
ysql
]
targets
:
[
m
ongo
]
properties
:
properties
:
level
:
1
level
:
1
...
...
drip-commons/src/main/java/nl/uva/sne/drip/model/cloud/storm/DCMetaInfo.java
→
drip-commons/src/main/java/nl/uva/sne/drip/model/cloud/storm/
CloudStorm
DCMetaInfo.java
View file @
b8dc2f77
...
@@ -11,12 +11,12 @@ import org.springframework.validation.annotation.Validated;
...
@@ -11,12 +11,12 @@ import org.springframework.validation.annotation.Validated;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
/**
/**
* DCMetaInfo
*
CloudStorm
DCMetaInfo
*/
*/
@Validated
@Validated
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.SpringCodegen"
,
date
=
"2020-01-12T18:26:54.530Z"
)
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.SpringCodegen"
,
date
=
"2020-01-12T18:26:54.530Z"
)
public
class
DCMetaInfo
{
public
class
CloudStorm
DCMetaInfo
{
@JsonProperty
(
"domain"
)
@JsonProperty
(
"domain"
)
private
String
domain
=
null
;
private
String
domain
=
null
;
...
@@ -44,7 +44,7 @@ public class DCMetaInfo {
...
@@ -44,7 +44,7 @@ public class DCMetaInfo {
@Valid
@Valid
private
Map
<
String
,
Object
>
extraInfo
=
null
;
private
Map
<
String
,
Object
>
extraInfo
=
null
;
public
DCMetaInfo
domain
(
String
domain
)
{
public
CloudStorm
DCMetaInfo
domain
(
String
domain
)
{
this
.
domain
=
domain
;
this
.
domain
=
domain
;
return
this
;
return
this
;
}
}
...
@@ -65,7 +65,7 @@ public class DCMetaInfo {
...
@@ -65,7 +65,7 @@ public class DCMetaInfo {
this
.
domain
=
domain
;
this
.
domain
=
domain
;
}
}
public
DCMetaInfo
endpoint
(
String
endpoint
)
{
public
CloudStorm
DCMetaInfo
endpoint
(
String
endpoint
)
{
this
.
endpoint
=
endpoint
;
this
.
endpoint
=
endpoint
;
return
this
;
return
this
;
}
}
...
@@ -86,7 +86,7 @@ public class DCMetaInfo {
...
@@ -86,7 +86,7 @@ public class DCMetaInfo {
this
.
endpoint
=
endpoint
;
this
.
endpoint
=
endpoint
;
}
}
public
DCMetaInfo
country
(
String
country
)
{
public
CloudStorm
DCMetaInfo
country
(
String
country
)
{
this
.
country
=
country
;
this
.
country
=
country
;
return
this
;
return
this
;
}
}
...
@@ -107,7 +107,7 @@ public class DCMetaInfo {
...
@@ -107,7 +107,7 @@ public class DCMetaInfo {
this
.
country
=
country
;
this
.
country
=
country
;
}
}
public
DCMetaInfo
longitude
(
String
longitude
)
{
public
CloudStorm
DCMetaInfo
longitude
(
String
longitude
)
{
this
.
longitude
=
longitude
;
this
.
longitude
=
longitude
;
return
this
;
return
this
;
}
}
...
@@ -128,7 +128,7 @@ public class DCMetaInfo {
...
@@ -128,7 +128,7 @@ public class DCMetaInfo {
this
.
longitude
=
longitude
;
this
.
longitude
=
longitude
;
}
}
public
DCMetaInfo
latitude
(
String
latitude
)
{
public
CloudStorm
DCMetaInfo
latitude
(
String
latitude
)
{
this
.
latitude
=
latitude
;
this
.
latitude
=
latitude
;
return
this
;
return
this
;
}
}
...
@@ -149,7 +149,7 @@ public class DCMetaInfo {
...
@@ -149,7 +149,7 @@ public class DCMetaInfo {
this
.
latitude
=
latitude
;
this
.
latitude
=
latitude
;
}
}
public
DCMetaInfo
availability
(
String
availability
)
{
public
CloudStorm
DCMetaInfo
availability
(
String
availability
)
{
this
.
availability
=
availability
;
this
.
availability
=
availability
;
return
this
;
return
this
;
}
}
...
@@ -170,12 +170,12 @@ public class DCMetaInfo {
...
@@ -170,12 +170,12 @@ public class DCMetaInfo {
this
.
availability
=
availability
;
this
.
availability
=
availability
;
}
}
public
DCMetaInfo
vmMetaInfo
(
List
<
CloudsStormVM
>
vmMetaInfo
)
{
public
CloudStorm
DCMetaInfo
vmMetaInfo
(
List
<
CloudsStormVM
>
vmMetaInfo
)
{
this
.
vmMetaInfo
=
vmMetaInfo
;
this
.
vmMetaInfo
=
vmMetaInfo
;
return
this
;
return
this
;
}
}
public
DCMetaInfo
addVmMetaInfoItem
(
CloudsStormVM
vmMetaInfoItem
)
{
public
CloudStorm
DCMetaInfo
addVmMetaInfoItem
(
CloudsStormVM
vmMetaInfoItem
)
{
if
(
this
.
vmMetaInfo
==
null
)
{
if
(
this
.
vmMetaInfo
==
null
)
{
this
.
vmMetaInfo
=
new
ArrayList
<
CloudsStormVM
>();
this
.
vmMetaInfo
=
new
ArrayList
<
CloudsStormVM
>();
}
}
...
@@ -201,12 +201,12 @@ public class DCMetaInfo {
...
@@ -201,12 +201,12 @@ public class DCMetaInfo {
this
.
vmMetaInfo
=
vmMetaInfo
;
this
.
vmMetaInfo
=
vmMetaInfo
;
}
}
public
DCMetaInfo
extraInfo
(
Map
<
String
,
Object
>
extraInfo
)
{
public
CloudStorm
DCMetaInfo
extraInfo
(
Map
<
String
,
Object
>
extraInfo
)
{
this
.
extraInfo
=
extraInfo
;
this
.
extraInfo
=
extraInfo
;
return
this
;
return
this
;
}
}
public
DCMetaInfo
putExtraInfoItem
(
String
key
,
Object
extraInfoItem
)
{
public
CloudStorm
DCMetaInfo
putExtraInfoItem
(
String
key
,
Object
extraInfoItem
)
{
if
(
this
.
extraInfo
==
null
)
{
if
(
this
.
extraInfo
==
null
)
{
this
.
extraInfo
=
new
HashMap
<
String
,
Object
>();
this
.
extraInfo
=
new
HashMap
<
String
,
Object
>();
}
}
...
@@ -238,7 +238,7 @@ public class DCMetaInfo {
...
@@ -238,7 +238,7 @@ public class DCMetaInfo {
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
return
false
;
return
false
;
}
}
DCMetaInfo
dcMetaInfo
=
(
DCMetaInfo
)
o
;
CloudStormDCMetaInfo
dcMetaInfo
=
(
CloudStorm
DCMetaInfo
)
o
;
return
Objects
.
equals
(
this
.
domain
,
dcMetaInfo
.
domain
)
return
Objects
.
equals
(
this
.
domain
,
dcMetaInfo
.
domain
)
&&
Objects
.
equals
(
this
.
endpoint
,
dcMetaInfo
.
endpoint
)
&&
Objects
.
equals
(
this
.
endpoint
,
dcMetaInfo
.
endpoint
)
&&
Objects
.
equals
(
this
.
country
,
dcMetaInfo
.
country
)
&&
Objects
.
equals
(
this
.
country
,
dcMetaInfo
.
country
)
...
...
drip-commons/src/main/java/nl/uva/sne/drip/model/cloud/storm/CloudsStormVM.java
View file @
b8dc2f77
...
@@ -134,6 +134,7 @@ public class CloudsStormVM {
...
@@ -134,6 +134,7 @@ public class CloudsStormVM {
@JsonProperty
(
"nodeType"
)
@JsonProperty
(
"nodeType"
)
private
String
nodeType
=
null
;
private
String
nodeType
=
null
;
@JsonProperty
(
"VEngineClass"
)
@JsonProperty
(
"VEngineClass"
)
private
String
VEngineClass
=
null
;
private
String
VEngineClass
=
null
;
...
@@ -152,6 +153,7 @@ public class CloudsStormVM {
...
@@ -152,6 +153,7 @@ public class CloudsStormVM {
private
Map
<
String
,
Object
>
extraInfo
=
null
;
private
Map
<
String
,
Object
>
extraInfo
=
null
;
@JsonProperty
(
"CPU"
)
@JsonProperty
(
"CPU"
)
@JsonAlias
({
"cpu"
})
private
String
CPU
=
null
;
private
String
CPU
=
null
;
@JsonProperty
(
"MEM"
)
@JsonProperty
(
"MEM"
)
...
...
drip-commons/src/main/java/nl/uva/sne/drip/model/cloud/storm/DBInfo.java
View file @
b8dc2f77
...
@@ -21,7 +21,7 @@ public class DBInfo {
...
@@ -21,7 +21,7 @@ public class DBInfo {
@JsonProperty
(
"DCMetaInfo"
)
@JsonProperty
(
"DCMetaInfo"
)
@Valid
@Valid
private
List
<
DCMetaInfo
>
dcMetaInfo
=
null
;
private
List
<
CloudStorm
DCMetaInfo
>
dcMetaInfo
=
null
;
public
DBInfo
globalEntry
(
String
globalEntry
)
{
public
DBInfo
globalEntry
(
String
globalEntry
)
{
this
.
globalEntry
=
globalEntry
;
this
.
globalEntry
=
globalEntry
;
...
@@ -44,14 +44,14 @@ public class DBInfo {
...
@@ -44,14 +44,14 @@ public class DBInfo {
this
.
globalEntry
=
globalEntry
;
this
.
globalEntry
=
globalEntry
;
}
}
public
DBInfo
dcMetaInfo
(
List
<
DCMetaInfo
>
dcMetaInfo
)
{
public
DBInfo
dcMetaInfo
(
List
<
CloudStorm
DCMetaInfo
>
dcMetaInfo
)
{
this
.
dcMetaInfo
=
dcMetaInfo
;
this
.
dcMetaInfo
=
dcMetaInfo
;
return
this
;
return
this
;
}
}
public
DBInfo
addDcMetaInfoItem
(
DCMetaInfo
dcMetaInfoItem
)
{
public
DBInfo
addDcMetaInfoItem
(
CloudStorm
DCMetaInfo
dcMetaInfoItem
)
{
if
(
this
.
dcMetaInfo
==
null
)
{
if
(
this
.
dcMetaInfo
==
null
)
{
this
.
dcMetaInfo
=
new
ArrayList
<
DCMetaInfo
>();
this
.
dcMetaInfo
=
new
ArrayList
<
CloudStorm
DCMetaInfo
>();
}
}
this
.
dcMetaInfo
.
add
(
dcMetaInfoItem
);
this
.
dcMetaInfo
.
add
(
dcMetaInfoItem
);
return
this
;
return
this
;
...
@@ -67,11 +67,11 @@ public class DBInfo {
...
@@ -67,11 +67,11 @@ public class DBInfo {
@Valid
@Valid
public
List
<
DCMetaInfo
>
getDcMetaInfo
()
{
public
List
<
CloudStorm
DCMetaInfo
>
getDcMetaInfo
()
{
return
dcMetaInfo
;
return
dcMetaInfo
;
}
}
public
void
setDcMetaInfo
(
List
<
DCMetaInfo
>
dcMetaInfo
)
{
public
void
setDcMetaInfo
(
List
<
CloudStorm
DCMetaInfo
>
dcMetaInfo
)
{
this
.
dcMetaInfo
=
dcMetaInfo
;
this
.
dcMetaInfo
=
dcMetaInfo
;
}
}
...
...
drip-planner/.idea/workspace.xml
View file @
b8dc2f77
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"e478ccae-5352-4e8e-9efb-3f5cda44e877"
name=
"Default Changelist"
comment=
""
>
<list
default=
"true"
id=
"e478ccae-5352-4e8e-9efb-3f5cda44e877"
name=
"Default Changelist"
comment=
""
/>
<change
beforePath=
"$PROJECT_DIR$/../TOSCA/types/interfaces.yml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../TOSCA/types/interfaces.yml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-manager/src/main/java/nl/uva/sne/drip/api/DeployerApiController.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-manager/src/main/java/nl/uva/sne/drip/api/DeployerApiController.java"
afterDir=
"false"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
...
@@ -270,25 +267,25 @@
...
@@ -270,25 +267,25 @@
</state>
</state>
<state
x=
"792"
y=
"334"
width=
"827"
height=
"663"
key=
"FileChooserDialogImpl/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1578326180157"
/>
<state
x=
"792"
y=
"334"
width=
"827"
height=
"663"
key=
"FileChooserDialogImpl/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1578326180157"
/>
<state
x=
"1043"
y=
"437"
width=
"530"
height=
"598"
key=
"FileChooserDialogImpl/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1575907769017"
/>
<state
x=
"1043"
y=
"437"
width=
"530"
height=
"598"
key=
"FileChooserDialogImpl/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1575907769017"
/>
<state
width=
"
2437"
height=
"407"
key=
"GridCell.Tab.0.bottom"
timestamp=
"1579103246563
"
>
<state
width=
"
1825"
height=
"454"
key=
"GridCell.Tab.0.bottom"
timestamp=
"1579191653154
"
>
<screen
x=
"67"
y=
"34"
width=
"
2493"
height=
"140
6"
/>
<screen
x=
"67"
y=
"34"
width=
"
1853"
height=
"104
6"
/>
</state>
</state>
<state
width=
"1825"
height=
"
263"
key=
"GridCell.Tab.0.bottom/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1578584059031
"
/>
<state
width=
"1825"
height=
"
454"
key=
"GridCell.Tab.0.bottom/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1579191653154
"
/>
<state
width=
"2437"
height=
"407"
key=
"GridCell.Tab.0.bottom/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1579103246563"
/>
<state
width=
"2437"
height=
"407"
key=
"GridCell.Tab.0.bottom/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1579103246563"
/>
<state
width=
"
2437"
height=
"407"
key=
"GridCell.Tab.0.center"
timestamp=
"1579103246562
"
>
<state
width=
"
1825"
height=
"454"
key=
"GridCell.Tab.0.center"
timestamp=
"1579191653153
"
>
<screen
x=
"67"
y=
"34"
width=
"
2493"
height=
"140
6"
/>
<screen
x=
"67"
y=
"34"
width=
"
1853"
height=
"104
6"
/>
</state>
</state>
<state
width=
"1825"
height=
"
263"
key=
"GridCell.Tab.0.center/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1578584059030
"
/>
<state
width=
"1825"
height=
"
454"
key=
"GridCell.Tab.0.center/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1579191653153
"
/>
<state
width=
"2437"
height=
"407"
key=
"GridCell.Tab.0.center/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1579103246562"
/>
<state
width=
"2437"
height=
"407"
key=
"GridCell.Tab.0.center/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1579103246562"
/>
<state
width=
"
2437"
height=
"407"
key=
"GridCell.Tab.0.left"
timestamp=
"1579103246561
"
>
<state
width=
"
1825"
height=
"454"
key=
"GridCell.Tab.0.left"
timestamp=
"1579191653152
"
>
<screen
x=
"67"
y=
"34"
width=
"
2493"
height=
"140
6"
/>
<screen
x=
"67"
y=
"34"
width=
"
1853"
height=
"104
6"
/>
</state>
</state>
<state
width=
"1825"
height=
"
263"
key=
"GridCell.Tab.0.left/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1578584059030
"
/>
<state
width=
"1825"
height=
"
454"
key=
"GridCell.Tab.0.left/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1579191653152
"
/>
<state
width=
"2437"
height=
"407"
key=
"GridCell.Tab.0.left/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1579103246561"
/>
<state
width=
"2437"
height=
"407"
key=
"GridCell.Tab.0.left/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1579103246561"
/>
<state
width=
"
2437"
height=
"407"
key=
"GridCell.Tab.0.right"
timestamp=
"1579103246562
"
>
<state
width=
"
1825"
height=
"454"
key=
"GridCell.Tab.0.right"
timestamp=
"1579191653154
"
>
<screen
x=
"67"
y=
"34"
width=
"
2493"
height=
"140
6"
/>
<screen
x=
"67"
y=
"34"
width=
"
1853"
height=
"104
6"
/>
</state>
</state>
<state
width=
"1825"
height=
"
263"
key=
"GridCell.Tab.0.right/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1578584059030
"
/>
<state
width=
"1825"
height=
"
454"
key=
"GridCell.Tab.0.right/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1579191653154
"
/>
<state
width=
"2437"
height=
"407"
key=
"GridCell.Tab.0.right/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1579103246562"
/>
<state
width=
"2437"
height=
"407"
key=
"GridCell.Tab.0.right/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1579103246562"
/>
<state
width=
"2437"
height=
"407"
key=
"GridCell.Tab.1.bottom"
timestamp=
"1579103246564"
>
<state
width=
"2437"
height=
"407"
key=
"GridCell.Tab.1.bottom"
timestamp=
"1579103246564"
>
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
...
...
drip-provisioner/pom.xml
View file @
b8dc2f77
...
@@ -65,8 +65,18 @@
...
@@ -65,8 +65,18 @@
<artifactId>
CloudsStorm
</artifactId>
<artifactId>
CloudsStorm
</artifactId>
<version>
b.1.1
</version>
<version>
b.1.1
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-math3
</artifactId>
<version>
3.6.1
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
<plugins>
<plugins>
<plugin>
<plugin>
...
...
drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/CloudStormDAO.java
View file @
b8dc2f77
...
@@ -18,7 +18,6 @@ import nl.uva.sne.drip.model.cloud.storm.CloudDB;
...
@@ -18,7 +18,6 @@ import nl.uva.sne.drip.model.cloud.storm.CloudDB;
import
nl.uva.sne.drip.model.cloud.storm.CloudsStormVM
;
import
nl.uva.sne.drip.model.cloud.storm.CloudsStormVM
;
import
nl.uva.sne.drip.model.cloud.storm.DB
;
import
nl.uva.sne.drip.model.cloud.storm.DB
;
import
nl.uva.sne.drip.model.cloud.storm.DBInfo
;
import
nl.uva.sne.drip.model.cloud.storm.DBInfo
;
import
nl.uva.sne.drip.model.cloud.storm.DCMetaInfo
;
/**
/**
*
*
...
@@ -51,9 +50,9 @@ class CloudStormDAO {
...
@@ -51,9 +50,9 @@ class CloudStormDAO {
if
(
targetCloudDB
!=
null
)
{
if
(
targetCloudDB
!=
null
)
{
List
<
CloudsStormVM
>
vMMetaInfos
=
new
ArrayList
<>();
List
<
CloudsStormVM
>
vMMetaInfos
=
new
ArrayList
<>();
DBInfo
dbInfo
=
objectMapper
.
readValue
(
new
File
(
cloudStormDBPath
+
File
.
separator
+
targetCloudDB
.
getDbInfoFile
()),
DBInfo
.
class
);
DBInfo
dbInfo
=
objectMapper
.
readValue
(
new
File
(
cloudStormDBPath
+
File
.
separator
+
targetCloudDB
.
getDbInfoFile
()),
nl
.
uva
.
sne
.
drip
.
model
.
cloud
.
storm
.
DBInfo
.
class
);
List
<
DCMetaInfo
>
metaInfos
=
dbInfo
.
getDcMetaInfo
();
List
<
nl
.
uva
.
sne
.
drip
.
model
.
cloud
.
storm
.
CloudStorm
DCMetaInfo
>
metaInfos
=
dbInfo
.
getDcMetaInfo
();
for
(
DCMetaInfo
metaInfo
:
metaInfos
)
{
for
(
nl
.
uva
.
sne
.
drip
.
model
.
cloud
.
storm
.
CloudStorm
DCMetaInfo
metaInfo
:
metaInfos
)
{
vMMetaInfos
.
addAll
(
metaInfo
.
getVmMetaInfo
());
vMMetaInfos
.
addAll
(
metaInfo
.
getVmMetaInfo
());
}
}
return
vMMetaInfos
;
return
vMMetaInfos
;
...
...
drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/CloudStormService.java
View file @
b8dc2f77
...
@@ -49,6 +49,7 @@ import nl.uva.sne.drip.model.tosca.ToscaTemplate;
...
@@ -49,6 +49,7 @@ import nl.uva.sne.drip.model.tosca.ToscaTemplate;
import
nl.uva.sne.drip.sure.tosca.client.ApiException
;
import
nl.uva.sne.drip.sure.tosca.client.ApiException
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.math3.ml.distance.EuclideanDistance
;
/**
/**
*
*
...
@@ -181,14 +182,9 @@ class CloudStormService {
...
@@ -181,14 +182,9 @@ class CloudStormService {
List
<
NodeTemplateMap
>
vmTemplatesMap
=
helper
.
getTemplateVMsForVMTopology
(
nodeTemplateMap
);
List
<
NodeTemplateMap
>
vmTemplatesMap
=
helper
.
getTemplateVMsForVMTopology
(
nodeTemplateMap
);
int
j
=
0
;
int
j
=
0
;
for
(
NodeTemplateMap
vmMap
:
vmTemplatesMap
)
{
for
(
NodeTemplateMap
vmMap
:
vmTemplatesMap
)
{
CloudsStormVM
cloudsStormVM
=
new
CloudsStormVM
();
CloudsStormVM
cloudStromVM
=
getBestMatchingCloudStormVM
(
vmMap
,
provider
);
String
vmType
=
getVMType
(
vmMap
,
provider
);
cloudStromVM
.
setName
(
"vm"
+
j
);
cloudsStormVM
.
setNodeType
(
vmType
);
vms
.
add
(
cloudStromVM
);
cloudsStormVM
.
setName
(
"vm"
+
j
);
String
os
=
helper
.
getVMNOS
(
vmMap
);
// cloudsStormVM.setOS(os);
cloudsStormVM
.
setOstype
(
os
);
vms
.
add
(
cloudsStormVM
);
j
++;
j
++;
}
}
cloudsStormVMs
.
setVms
(
vms
);
cloudsStormVMs
.
setVms
(
vms
);
...
@@ -202,21 +198,27 @@ class CloudStormService {
...
@@ -202,21 +198,27 @@ class CloudStormService {
return
cloudsStormMap
;
return
cloudsStormMap
;
}
}
private
String
getVMType
(
NodeTemplateMap
vmMap
,
String
provider
)
throws
IOException
,
Exception
{
private
CloudsStormVM
getBestMatchingCloudStormVM
(
NodeTemplateMap
vmMap
,
String
provider
)
throws
IOException
,
Exception
{
Double
numOfCores
=
helper
.
getVMNumOfCores
(
vmMap
);
Double
numOfCores
=
helper
.
getVMNumOfCores
(
vmMap
);
Double
memSize
=
helper
.
getVMNMemSize
(
vmMap
);
Double
memSize
=
helper
.
getVMNMemSize
(
vmMap
);
String
os
=
helper
.
getVMNOS
(
vmMap
);
String
os
=
helper
.
getVMNOS
(
vmMap
);
double
[]
requestedVector
=
convert2ArrayofDoubles
(
numOfCores
,
memSize
);
double
min
=
Double
.
MAX_VALUE
;
CloudsStormVM
bestMatchingVM
=
null
;
List
<
CloudsStormVM
>
vmInfos
=
cloudStormDAO
.
findVmMetaInfoByProvider
(
CloudProviderEnum
.
fromValue
(
provider
));
List
<
CloudsStormVM
>
vmInfos
=
cloudStormDAO
.
findVmMetaInfoByProvider
(
CloudProviderEnum
.
fromValue
(
provider
));
for
(
CloudsStormVM
vmInfo
:
vmInfos
)
{
for
(
CloudsStormVM
vmInfo
:
vmInfos
)
{
Logger
.
getLogger
(
CloudStormService
.
class
.
getName
()).
log
(
Level
.
FINE
,
"vmInfo: {0}"
,
vmInfo
);
Logger
.
getLogger
(
CloudStormService
.
class
.
getName
()).
log
(
Level
.
FINE
,
"numOfCores:{0} memSize: {1} os: {2}"
,
new
Object
[]{
numOfCores
,
memSize
,
os
});
if
(
os
.
toLowerCase
().
equals
(
vmInfo
.
getOstype
().
toLowerCase
()))
{
if
(
Objects
.
equals
(
numOfCores
,
Double
.
valueOf
(
vmInfo
.
getCPU
()))
double
[]
aveliableVector
=
convert2ArrayofDoubles
(
Double
.
valueOf
(
vmInfo
.
getCPU
()),
Double
.
valueOf
(
vmInfo
.
getMEM
()));
&&
Objects
.
equals
(
memSize
,
Double
.
valueOf
(
vmInfo
.
getMEM
()))
&&
os
.
toLowerCase
().
equals
(
vmInfo
.
getOstype
().
toLowerCase
()))
{
EuclideanDistance
dist
=
new
EuclideanDistance
();
return
vmInfo
.
getVmType
();
double
res
=
dist
.
compute
(
requestedVector
,
aveliableVector
);
if
(
res
<
min
)
{
min
=
res
;
bestMatchingVM
=
vmInfo
;
}
}
}
}
return
null
;
}
return
bestMatchingVM
;
}
}
private
void
writeCloudStormCredentialsFiles
(
String
credentialsTempInputDirPath
)
throws
ApiException
,
Exception
{
private
void
writeCloudStormCredentialsFiles
(
String
credentialsTempInputDirPath
)
throws
ApiException
,
Exception
{
...
@@ -244,17 +246,15 @@ class CloudStormService {
...
@@ -244,17 +246,15 @@ class CloudStormService {
CredentialInfo
cloudStormCredentialInfo
=
new
CredentialInfo
();
CredentialInfo
cloudStormCredentialInfo
=
new
CredentialInfo
();
switch
(
toscaCredentials
.
getCloudProviderName
().
toLowerCase
())
{
switch
(
toscaCredentials
.
getCloudProviderName
().
toLowerCase
())
{
case
"exogeni"
:
case
"exogeni"
:
String
base64Keystore
=
toscaCredentials
.
getKeys
().
get
(
"keystore"
);
String
base64Keystore
=
toscaCredentials
.
getKeys
().
get
(
"keystore"
);
Converter
.
decodeBase64BToFile
(
base64Keystore
,
tmpPath
+
File
.
separator
+
"user.jks"
);
Converter
.
decodeBase64BToFile
(
base64Keystore
,
tmpPath
+
File
.
separator
+
"user.jks"
);
cloudStormCredentialInfo
.
setUserKeyName
(
"user.jks"
);
cloudStormCredentialInfo
.
setUserKeyName
(
"user.jks"
);
cloudStormCredentialInfo
.
setKeyAlias
(
toscaCredentials
.
getUser
());
cloudStormCredentialInfo
.
setKeyAlias
(
toscaCredentials
.
getUser
());
cloudStormCredentialInfo
.
setKeyPassword
(
toscaCredentials
.
getToken
());
cloudStormCredentialInfo
.
setKeyPassword
(
toscaCredentials
.
getToken
());
return
cloudStormCredentialInfo
;
return
cloudStormCredentialInfo
;
case
"ec2"
:
case
"ec2"
:
// cloudStormCredentialInfo.setAccessKey(toscaCredentials.get);
cloudStormCredentialInfo
.
setSecretKey
(
toscaCredentials
.
getToken
());
cloudStormCredentialInfo
.
setAccessKey
(
toscaCredentials
.
getKeys
().
get
(
"aws_access_key_id"
));
return
cloudStormCredentialInfo
;
return
cloudStormCredentialInfo
;
}
}
...
@@ -366,4 +366,9 @@ class CloudStormService {
...
@@ -366,4 +366,9 @@ class CloudStormService {
return
toscaTemplate
;
return
toscaTemplate
;
}
}
private
double
[]
convert2ArrayofDoubles
(
Double
numOfCores
,
Double
memSize
)
{
double
[]
vector
=
new
double
[]{
numOfCores
,
memSize
};
return
vector
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment