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: >
topology_template
:
node_templates
:
wordpress
:
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
:
mongo
:
type
:
tosca.nodes.ARTICONF.Container.Application.Docker
properties
:
ports
:
-
"
3306:3306
"
-
"
27017:27017
"
volumes
:
-
db_data:/var/lib/m
ysql
-
db_data:/var/lib/m
ongo
environment
:
MYSQL_ROOT_PASSWORD
:
somewordpress
MYSQL_DATABASE
:
wordpress
MYSQL_USER
:
wordpress
MYSQL_PASSWORD
:
wordpress
MONGO_INITDB_ROOT_USERNAME
:
rootUser
MONGO_INITDB_ROOT_PASSWORD
:
rootPassword
MONGO_INITDB_DATABASE
:
databaseName
MONGO_USERNAME
:
databaseUser
MONGO_PASSWORD:password
artifacts
:
image
:
type
:
tosca.artifacts.Deployment.Image.Container.Docker
file
:
mysql:5.7
file
:
lakshminp/mongo:4.2.1
repository
:
docker_hub
...
...
@@ -77,13 +56,13 @@ topology_template:
policies
:
-
scalability
:
type
:
tosca.policies.ARTICONF.Performance.CPU
targets
:
[
wordpress
]
targets
:
[
mongo
]
properties
:
constraint_name
:
cpu_load
max_value
:
90
-
faultTolerance
:
type
:
tosca.policies.ARTICONF.FaultTolerance
targets
:
[
m
ysql
]
targets
:
[
m
ongo
]
properties
:
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;
import
javax.validation.Valid
;
/**
* DCMetaInfo
*
CloudStorm
DCMetaInfo
*/
@Validated
@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"
)
private
String
domain
=
null
;
...
...
@@ -44,7 +44,7 @@ public class DCMetaInfo {
@Valid
private
Map
<
String
,
Object
>
extraInfo
=
null
;
public
DCMetaInfo
domain
(
String
domain
)
{
public
CloudStorm
DCMetaInfo
domain
(
String
domain
)
{
this
.
domain
=
domain
;
return
this
;
}
...
...
@@ -65,7 +65,7 @@ public class DCMetaInfo {
this
.
domain
=
domain
;
}
public
DCMetaInfo
endpoint
(
String
endpoint
)
{
public
CloudStorm
DCMetaInfo
endpoint
(
String
endpoint
)
{
this
.
endpoint
=
endpoint
;
return
this
;
}
...
...
@@ -86,7 +86,7 @@ public class DCMetaInfo {
this
.
endpoint
=
endpoint
;
}
public
DCMetaInfo
country
(
String
country
)
{
public
CloudStorm
DCMetaInfo
country
(
String
country
)
{
this
.
country
=
country
;
return
this
;
}
...
...
@@ -107,7 +107,7 @@ public class DCMetaInfo {
this
.
country
=
country
;
}
public
DCMetaInfo
longitude
(
String
longitude
)
{
public
CloudStorm
DCMetaInfo
longitude
(
String
longitude
)
{
this
.
longitude
=
longitude
;
return
this
;
}
...
...
@@ -128,7 +128,7 @@ public class DCMetaInfo {
this
.
longitude
=
longitude
;
}
public
DCMetaInfo
latitude
(
String
latitude
)
{
public
CloudStorm
DCMetaInfo
latitude
(
String
latitude
)
{
this
.
latitude
=
latitude
;
return
this
;
}
...
...
@@ -149,7 +149,7 @@ public class DCMetaInfo {
this
.
latitude
=
latitude
;
}
public
DCMetaInfo
availability
(
String
availability
)
{
public
CloudStorm
DCMetaInfo
availability
(
String
availability
)
{
this
.
availability
=
availability
;
return
this
;
}
...
...
@@ -170,12 +170,12 @@ public class DCMetaInfo {
this
.
availability
=
availability
;
}
public
DCMetaInfo
vmMetaInfo
(
List
<
CloudsStormVM
>
vmMetaInfo
)
{
public
CloudStorm
DCMetaInfo
vmMetaInfo
(
List
<
CloudsStormVM
>
vmMetaInfo
)
{
this
.
vmMetaInfo
=
vmMetaInfo
;
return
this
;
}
public
DCMetaInfo
addVmMetaInfoItem
(
CloudsStormVM
vmMetaInfoItem
)
{
public
CloudStorm
DCMetaInfo
addVmMetaInfoItem
(
CloudsStormVM
vmMetaInfoItem
)
{
if
(
this
.
vmMetaInfo
==
null
)
{
this
.
vmMetaInfo
=
new
ArrayList
<
CloudsStormVM
>();
}
...
...
@@ -201,12 +201,12 @@ public class DCMetaInfo {
this
.
vmMetaInfo
=
vmMetaInfo
;
}
public
DCMetaInfo
extraInfo
(
Map
<
String
,
Object
>
extraInfo
)
{
public
CloudStorm
DCMetaInfo
extraInfo
(
Map
<
String
,
Object
>
extraInfo
)
{
this
.
extraInfo
=
extraInfo
;
return
this
;
}
public
DCMetaInfo
putExtraInfoItem
(
String
key
,
Object
extraInfoItem
)
{
public
CloudStorm
DCMetaInfo
putExtraInfoItem
(
String
key
,
Object
extraInfoItem
)
{
if
(
this
.
extraInfo
==
null
)
{
this
.
extraInfo
=
new
HashMap
<
String
,
Object
>();
}
...
...
@@ -238,7 +238,7 @@ public class DCMetaInfo {
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
return
false
;
}
DCMetaInfo
dcMetaInfo
=
(
DCMetaInfo
)
o
;
CloudStormDCMetaInfo
dcMetaInfo
=
(
CloudStorm
DCMetaInfo
)
o
;
return
Objects
.
equals
(
this
.
domain
,
dcMetaInfo
.
domain
)
&&
Objects
.
equals
(
this
.
endpoint
,
dcMetaInfo
.
endpoint
)
&&
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 {
@JsonProperty
(
"nodeType"
)
private
String
nodeType
=
null
;
@JsonProperty
(
"VEngineClass"
)
private
String
VEngineClass
=
null
;
...
...
@@ -152,6 +153,7 @@ public class CloudsStormVM {
private
Map
<
String
,
Object
>
extraInfo
=
null
;
@JsonProperty
(
"CPU"
)
@JsonAlias
({
"cpu"
})
private
String
CPU
=
null
;
@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 {
@JsonProperty
(
"DCMetaInfo"
)
@Valid
private
List
<
DCMetaInfo
>
dcMetaInfo
=
null
;
private
List
<
CloudStorm
DCMetaInfo
>
dcMetaInfo
=
null
;
public
DBInfo
globalEntry
(
String
globalEntry
)
{
this
.
globalEntry
=
globalEntry
;
...
...
@@ -44,14 +44,14 @@ public class DBInfo {
this
.
globalEntry
=
globalEntry
;
}
public
DBInfo
dcMetaInfo
(
List
<
DCMetaInfo
>
dcMetaInfo
)
{
public
DBInfo
dcMetaInfo
(
List
<
CloudStorm
DCMetaInfo
>
dcMetaInfo
)
{
this
.
dcMetaInfo
=
dcMetaInfo
;
return
this
;
}
public
DBInfo
addDcMetaInfoItem
(
DCMetaInfo
dcMetaInfoItem
)
{
public
DBInfo
addDcMetaInfoItem
(
CloudStorm
DCMetaInfo
dcMetaInfoItem
)
{
if
(
this
.
dcMetaInfo
==
null
)
{
this
.
dcMetaInfo
=
new
ArrayList
<
DCMetaInfo
>();
this
.
dcMetaInfo
=
new
ArrayList
<
CloudStorm
DCMetaInfo
>();
}
this
.
dcMetaInfo
.
add
(
dcMetaInfoItem
);
return
this
;
...
...
@@ -67,11 +67,11 @@ public class DBInfo {
@Valid
public
List
<
DCMetaInfo
>
getDcMetaInfo
()
{
public
List
<
CloudStorm
DCMetaInfo
>
getDcMetaInfo
()
{
return
dcMetaInfo
;
}
public
void
setDcMetaInfo
(
List
<
DCMetaInfo
>
dcMetaInfo
)
{
public
void
setDcMetaInfo
(
List
<
CloudStorm
DCMetaInfo
>
dcMetaInfo
)
{
this
.
dcMetaInfo
=
dcMetaInfo
;
}
...
...
drip-planner/.idea/workspace.xml
View file @
b8dc2f77
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<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>
<list
default=
"true"
id=
"e478ccae-5352-4e8e-9efb-3f5cda44e877"
name=
"Default Changelist"
comment=
""
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
...
...
@@ -270,25 +267,25 @@
</state>
<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
width=
"
2437"
height=
"407"
key=
"GridCell.Tab.0.bottom"
timestamp=
"1579103246563
"
>
<screen
x=
"67"
y=
"34"
width=
"
2493"
height=
"140
6"
/>
<state
width=
"
1825"
height=
"454"
key=
"GridCell.Tab.0.bottom"
timestamp=
"1579191653154
"
>
<screen
x=
"67"
y=
"34"
width=
"
1853"
height=
"104
6"
/>
</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.center"
timestamp=
"1579103246562
"
>
<screen
x=
"67"
y=
"34"
width=
"
2493"
height=
"140
6"
/>
<state
width=
"
1825"
height=
"454"
key=
"GridCell.Tab.0.center"
timestamp=
"1579191653153
"
>
<screen
x=
"67"
y=
"34"
width=
"
1853"
height=
"104
6"
/>
</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.left"
timestamp=
"1579103246561
"
>
<screen
x=
"67"
y=
"34"
width=
"
2493"
height=
"140
6"
/>
<state
width=
"
1825"
height=
"454"
key=
"GridCell.Tab.0.left"
timestamp=
"1579191653152
"
>
<screen
x=
"67"
y=
"34"
width=
"
1853"
height=
"104
6"
/>
</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.right"
timestamp=
"1579103246562
"
>
<screen
x=
"67"
y=
"34"
width=
"
2493"
height=
"140
6"
/>
<state
width=
"
1825"
height=
"454"
key=
"GridCell.Tab.0.right"
timestamp=
"1579191653154
"
>
<screen
x=
"67"
y=
"34"
width=
"
1853"
height=
"104
6"
/>
</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.1.bottom"
timestamp=
"1579103246564"
>
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
...
...
drip-provisioner/pom.xml
View file @
b8dc2f77
...
...
@@ -65,8 +65,18 @@
<artifactId>
CloudsStorm
</artifactId>
<version>
b.1.1
</version>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-math3
</artifactId>
<version>
3.6.1
</version>
</dependency>
</dependencies>
<build>
<plugins>
<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;
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.DBInfo
;
import
nl.uva.sne.drip.model.cloud.storm.DCMetaInfo
;
/**
*
...
...
@@ -51,9 +50,9 @@ class CloudStormDAO {
if
(
targetCloudDB
!=
null
)
{
List
<
CloudsStormVM
>
vMMetaInfos
=
new
ArrayList
<>();
DBInfo
dbInfo
=
objectMapper
.
readValue
(
new
File
(
cloudStormDBPath
+
File
.
separator
+
targetCloudDB
.
getDbInfoFile
()),
DBInfo
.
class
);
List
<
DCMetaInfo
>
metaInfos
=
dbInfo
.
getDcMetaInfo
();
for
(
DCMetaInfo
metaInfo
:
metaInfos
)
{
DBInfo
dbInfo
=
objectMapper
.
readValue
(
new
File
(
cloudStormDBPath
+
File
.
separator
+
targetCloudDB
.
getDbInfoFile
()),
nl
.
uva
.
sne
.
drip
.
model
.
cloud
.
storm
.
DBInfo
.
class
);
List
<
nl
.
uva
.
sne
.
drip
.
model
.
cloud
.
storm
.
CloudStorm
DCMetaInfo
>
metaInfos
=
dbInfo
.
getDcMetaInfo
();
for
(
nl
.
uva
.
sne
.
drip
.
model
.
cloud
.
storm
.
CloudStorm
DCMetaInfo
metaInfo
:
metaInfos
)
{
vMMetaInfos
.
addAll
(
metaInfo
.
getVmMetaInfo
());
}
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;
import
nl.uva.sne.drip.sure.tosca.client.ApiException
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.math3.ml.distance.EuclideanDistance
;
/**
*
...
...
@@ -181,14 +182,9 @@ class CloudStormService {
List
<
NodeTemplateMap
>
vmTemplatesMap
=
helper
.
getTemplateVMsForVMTopology
(
nodeTemplateMap
);
int
j
=
0
;
for
(
NodeTemplateMap
vmMap
:
vmTemplatesMap
)
{
CloudsStormVM
cloudsStormVM
=
new
CloudsStormVM
();
String
vmType
=
getVMType
(
vmMap
,
provider
);
cloudsStormVM
.
setNodeType
(
vmType
);
cloudsStormVM
.
setName
(
"vm"
+
j
);
String
os
=
helper
.
getVMNOS
(
vmMap
);
// cloudsStormVM.setOS(os);
cloudsStormVM
.
setOstype
(
os
);
vms
.
add
(
cloudsStormVM
);
CloudsStormVM
cloudStromVM
=
getBestMatchingCloudStormVM
(
vmMap
,
provider
);
cloudStromVM
.
setName
(
"vm"
+
j
);
vms
.
add
(
cloudStromVM
);
j
++;
}
cloudsStormVMs
.
setVms
(
vms
);
...
...
@@ -202,21 +198,27 @@ class CloudStormService {
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
memSize
=
helper
.
getVMNMemSize
(
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
));
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
(
Objects
.
equals
(
numOfCores
,
Double
.
valueOf
(
vmInfo
.
getCPU
()))
&&
Objects
.
equals
(
memSize
,
Double
.
valueOf
(
vmInfo
.
getMEM
()))
&&
os
.
toLowerCase
().
equals
(
vmInfo
.
getOstype
().
toLowerCase
()))
{
return
vmInfo
.
getVmType
();
if
(
os
.
toLowerCase
().
equals
(
vmInfo
.
getOstype
().
toLowerCase
()))
{
double
[]
aveliableVector
=
convert2ArrayofDoubles
(
Double
.
valueOf
(
vmInfo
.
getCPU
()),
Double
.
valueOf
(
vmInfo
.
getMEM
()));
EuclideanDistance
dist
=
new
EuclideanDistance
();
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
{
...
...
@@ -244,17 +246,15 @@ class CloudStormService {
CredentialInfo
cloudStormCredentialInfo
=
new
CredentialInfo
();
switch
(
toscaCredentials
.
getCloudProviderName
().
toLowerCase
())
{
case
"exogeni"
:
String
base64Keystore
=
toscaCredentials
.
getKeys
().
get
(
"keystore"
);
Converter
.
decodeBase64BToFile
(
base64Keystore
,
tmpPath
+
File
.
separator
+
"user.jks"
);
cloudStormCredentialInfo
.
setUserKeyName
(
"user.jks"
);
cloudStormCredentialInfo
.
setKeyAlias
(
toscaCredentials
.
getUser
());
cloudStormCredentialInfo
.
setKeyPassword
(
toscaCredentials
.
getToken
());
return
cloudStormCredentialInfo
;
case
"ec2"
:
// cloudStormCredentialInfo.setAccessKey(toscaCredentials.get);
cloudStormCredentialInfo
.
setSecretKey
(
toscaCredentials
.
getToken
());
cloudStormCredentialInfo
.
setAccessKey
(
toscaCredentials
.
getKeys
().
get
(
"aws_access_key_id"
));
return
cloudStormCredentialInfo
;
}
...
...
@@ -366,4 +366,9 @@ class CloudStormService {
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