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
cbe0c324
Commit
cbe0c324
authored
Mar 18, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed default disk size. Added disk size to cloudstorm vm
parent
0662df0a
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
56 additions
and
46 deletions
+56
-46
lifeWatch_vre1.yaml
TOSCA/lifeWatch_vre1.yaml
+11
-11
nodes.yaml
TOSCA/types/nodes.yaml
+1
-1
docker-compose.yml
docker-compose.yml
+12
-12
ToscaTemplateApiController.java
.../java/nl/uva/sne/drip/api/ToscaTemplateApiController.java
+8
-3
DRIPService.java
...er/src/main/java/nl/uva/sne/drip/service/DRIPService.java
+5
-6
ToscaTemplateService.java
...in/java/nl/uva/sne/drip/service/ToscaTemplateService.java
+1
-3
CloudStormService.java
...n/java/nl/uva/sne/drip/provisioner/CloudStormService.java
+18
-10
No files found.
TOSCA/lifeWatch_vre1.yaml
View file @
cbe0c324
...
@@ -29,15 +29,15 @@ topology_template:
...
@@ -29,15 +29,15 @@ topology_template:
repository
:
docker_hub
repository
:
docker_hub
#
topology:
topology
:
#
type: tosca.nodes.ARTICONF.VM.topology
type
:
tosca.nodes.ARTICONF.VM.topology
#
interfaces:
interfaces
:
#
CloudsStorm:
CloudsStorm
:
#
provision:
provision
:
#
inputs:
inputs
:
#
code_type: SEQ
code_type
:
SEQ
#
object_type: SubTopology
object_type
:
SubTopology
#
properties:
properties
:
#
domain: UvA (Amsterdam, The Netherlands) XO Rack
domain
:
UvA (Amsterdam, The Netherlands) XO Rack
#
provider: ExoGENI
provider
:
ExoGENI
TOSCA/types/nodes.yaml
View file @
cbe0c324
...
@@ -179,7 +179,7 @@ node_types:
...
@@ -179,7 +179,7 @@ node_types:
disk_size
:
disk_size
:
type
:
scalar-unit.size
type
:
scalar-unit.size
required
:
true
required
:
true
default
:
40
000 MB
default
:
25
000 MB
constraints
:
constraints
:
-
greater_or_equal
:
15000 MB
-
greater_or_equal
:
15000 MB
mem_size
:
mem_size
:
...
...
docker-compose.yml
View file @
cbe0c324
...
@@ -116,10 +116,10 @@ services:
...
@@ -116,10 +116,10 @@ services:
ports
:
ports
:
-
"
30000:8080"
-
"
30000:8080"
#
sure-tosca:
sure-tosca
:
#
image: sure-tosca:3.0.0
image
:
sure-tosca:3.0.0
#
ports:
ports
:
#
- "8081:8081"
-
"
8081:8081"
planner
:
planner
:
depends_on
:
depends_on
:
...
@@ -129,14 +129,14 @@ services:
...
@@ -129,14 +129,14 @@ services:
environment
:
environment
:
RABBITMQ_HOST
:
rabbit
RABBITMQ_HOST
:
rabbit
provisioner
:
#
provisioner:
depends_on
:
#
depends_on:
-
rabbit
#
- rabbit
-
sure-tosca
#
- sure-tosca
image
:
provisioner:3.0.0
#
image: provisioner:3.0.0
environment
:
#
environment:
RABBITMQ_HOST
:
rabbit
#
RABBITMQ_HOST: rabbit
SURE_TOSCA_BASE_PATH
:
http://sure-tosca:8081/tosca-sure/1.0.0
#
SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0
deployer
:
deployer
:
depends_on
:
depends_on
:
...
...
manager/src/main/java/nl/uva/sne/drip/api/ToscaTemplateApiController.java
View file @
cbe0c324
...
@@ -16,8 +16,10 @@ import javax.validation.Valid;
...
@@ -16,8 +16,10 @@ import javax.validation.Valid;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.TimeoutException
;
import
java.util.logging.Level
;
import
java.util.logging.Level
;
import
nl.uva.sne.drip.model.Exceptions.TypeExeption
;
import
nl.uva.sne.drip.model.Exceptions.TypeExeption
;
import
nl.uva.sne.drip.service.DRIPService
;
import
nl.uva.sne.drip.service.ToscaTemplateService
;
import
nl.uva.sne.drip.service.ToscaTemplateService
;
import
nl.uva.sne.drip.sure.tosca.client.ApiException
;
import
nl.uva.sne.drip.sure.tosca.client.ApiException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -34,6 +36,9 @@ public class ToscaTemplateApiController implements ToscaTemplateApi {
...
@@ -34,6 +36,9 @@ public class ToscaTemplateApiController implements ToscaTemplateApi {
@Autowired
@Autowired
private
ToscaTemplateService
toscaTemplateService
;
private
ToscaTemplateService
toscaTemplateService
;
@Autowired
private
DRIPService
dripService
;
@org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
@org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
public
ToscaTemplateApiController
(
ObjectMapper
objectMapper
,
HttpServletRequest
request
)
{
public
ToscaTemplateApiController
(
ObjectMapper
objectMapper
,
HttpServletRequest
request
)
{
this
.
request
=
request
;
this
.
request
=
request
;
...
@@ -44,9 +49,9 @@ public class ToscaTemplateApiController implements ToscaTemplateApi {
...
@@ -44,9 +49,9 @@ public class ToscaTemplateApiController implements ToscaTemplateApi {
String
accept
=
request
.
getHeader
(
"Accept"
);
String
accept
=
request
.
getHeader
(
"Accept"
);
if
(
accept
!=
null
&&
accept
.
contains
(
"*/*"
))
{
if
(
accept
!=
null
&&
accept
.
contains
(
"*/*"
))
{
try
{
try
{
toscaTemplateService
.
deleteByID
(
id
);
String
deleteedYemplateId
=
dripService
.
delete
(
id
);
return
new
ResponseEntity
<>(
""
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
deleteedYemplateId
,
HttpStatus
.
OK
);
}
catch
(
NotFoundException
|
IOException
|
ApiException
|
TypeExeption
ex
)
{
}
catch
(
NotFoundException
|
IOException
|
ApiException
|
TypeExeption
|
TimeoutException
|
InterruptedException
ex
)
{
java
.
util
.
logging
.
Logger
.
getLogger
(
ToscaTemplateApiController
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
null
,
ex
);
java
.
util
.
logging
.
Logger
.
getLogger
(
ToscaTemplateApiController
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
null
,
ex
);
return
new
ResponseEntity
<>(
HttpStatus
.
INTERNAL_SERVER_ERROR
);
return
new
ResponseEntity
<>(
HttpStatus
.
INTERNAL_SERVER_ERROR
);
}
}
...
...
manager/src/main/java/nl/uva/sne/drip/service/DRIPService.java
View file @
cbe0c324
...
@@ -61,7 +61,6 @@ public class DRIPService {
...
@@ -61,7 +61,6 @@ public class DRIPService {
}
}
private
String
execute
(
ToscaTemplate
toscaTemplate
)
throws
JsonProcessingException
,
ApiException
,
IOException
,
TimeoutException
,
InterruptedException
{
private
String
execute
(
ToscaTemplate
toscaTemplate
)
throws
JsonProcessingException
,
ApiException
,
IOException
,
TimeoutException
,
InterruptedException
{
caller
.
init
();
caller
.
init
();
Logger
.
getLogger
(
DRIPService
.
class
.
getName
()).
log
(
Level
.
INFO
,
"toscaTemplate:\n{0}"
,
toscaTemplate
);
Logger
.
getLogger
(
DRIPService
.
class
.
getName
()).
log
(
Level
.
INFO
,
"toscaTemplate:\n{0}"
,
toscaTemplate
);
Message
message
=
new
Message
();
Message
message
=
new
Message
();
...
@@ -172,19 +171,19 @@ public class DRIPService {
...
@@ -172,19 +171,19 @@ public class DRIPService {
return
toscaTemplate
;
return
toscaTemplate
;
}
}
void
deleteActions
(
ToscaTemplate
toscaTemplate
)
throws
ApiException
,
TypeExeption
,
IO
Exception
{
public
String
delete
(
String
id
)
throws
NotFoundException
,
IOException
,
JsonProcessingException
,
ApiException
,
TypeExeption
,
TimeoutException
,
Interrupted
Exception
{
helper
.
uploadToscaTemplate
(
toscaTemplate
);
ToscaTemplate
toscaTemplate
=
initExecution
(
id
);
List
<
NodeTemplateMap
>
vmTopologies
=
helper
.
getVMTopologyTemplates
();
List
<
NodeTemplateMap
>
vmTopologies
=
helper
.
getVMTopologyTemplates
();
if
(
vmTopologies
!=
null
)
{
if
(
vmTopologies
!=
null
)
{
for
(
NodeTemplateMap
vmTopology
:
vmTopologies
)
{
for
(
NodeTemplateMap
vmTopology
:
vmTopologies
)
{
CloudsStormSubTopology
.
StatusEnum
status
=
helper
.
getVMTopologyTemplateStatus
(
vmTopology
);
CloudsStormSubTopology
.
StatusEnum
status
=
helper
.
getVMTopologyTemplateStatus
(
vmTopology
);
if
(!
status
.
equals
(
CloudsStormSubTopology
.
StatusEnum
.
DELETED
))
{
if
(!
status
.
equals
(
CloudsStormSubTopology
.
StatusEnum
.
DELETED
))
{
Logger
.
getLogger
(
ToscaHelper
.
class
.
getName
()).
log
(
Level
.
FINE
,
"Deleting VMs from "
+
vmTopology
);
toscaTemplate
=
setProvisionerOperation
(
toscaTemplate
,
PROVISIONER_OPERATION
.
DELETE
);
}
}
}
}
return
execute
(
toscaTemplate
);
}
}
return
null
;
}
}
}
}
manager/src/main/java/nl/uva/sne/drip/service/ToscaTemplateService.java
View file @
cbe0c324
...
@@ -44,8 +44,7 @@ public class ToscaTemplateService {
...
@@ -44,8 +44,7 @@ public class ToscaTemplateService {
@Autowired
@Autowired
private
ToscaTemplateDAO
dao
;
private
ToscaTemplateDAO
dao
;
@Autowired
private
DRIPService
dripService
;
public
String
save
(
ToscaTemplate
tt
)
{
public
String
save
(
ToscaTemplate
tt
)
{
dao
.
save
(
tt
);
dao
.
save
(
tt
);
...
@@ -85,7 +84,6 @@ public class ToscaTemplateService {
...
@@ -85,7 +84,6 @@ public class ToscaTemplateService {
public
void
deleteByID
(
String
id
)
throws
JsonProcessingException
,
NotFoundException
,
IOException
,
ApiException
,
TypeExeption
{
public
void
deleteByID
(
String
id
)
throws
JsonProcessingException
,
NotFoundException
,
IOException
,
ApiException
,
TypeExeption
{
ToscaTemplate
toscaTemplate
=
getYaml2ToscaTemplate
(
findByID
(
id
));
ToscaTemplate
toscaTemplate
=
getYaml2ToscaTemplate
(
findByID
(
id
));
dripService
.
deleteActions
(
toscaTemplate
);
dao
.
deleteById
(
id
);
dao
.
deleteById
(
id
);
}
}
...
...
provisioner/src/main/java/nl/uva/sne/drip/provisioner/CloudStormService.java
View file @
cbe0c324
...
@@ -206,20 +206,27 @@ class CloudStormService {
...
@@ -206,20 +206,27 @@ class CloudStormService {
}
}
private
CloudsStormVM
getBestMatchingCloudStormVM
(
NodeTemplateMap
vmMap
,
String
provider
)
throws
IOException
,
Exception
{
private
CloudsStormVM
getBestMatchingCloudStormVM
(
NodeTemplateMap
vmMap
,
String
provider
)
throws
IOException
,
Exception
{
Double
n
umOfCores
=
helper
.
getVMNumOfCores
(
vmMap
);
Double
requestedN
umOfCores
=
helper
.
getVMNumOfCores
(
vmMap
);
Double
m
emSize
=
helper
.
getVMNMemSize
(
vmMap
);
Double
requestedM
emSize
=
helper
.
getVMNMemSize
(
vmMap
);
String
o
s
=
helper
.
getVMNOS
(
vmMap
);
String
requestedO
s
=
helper
.
getVMNOS
(
vmMap
);
Double
d
iskSize
=
helper
.
getVMNDiskSize
(
vmMap
);
Double
requestedD
iskSize
=
helper
.
getVMNDiskSize
(
vmMap
);
double
[]
requestedVector
=
convert2ArrayofDoubles
(
numOfCores
,
memSize
,
d
iskSize
);
double
[]
requestedVector
=
convert2ArrayofDoubles
(
requestedNumOfCores
,
requestedMemSize
,
requestedD
iskSize
);
double
min
=
Double
.
MAX_VALUE
;
double
min
=
Double
.
MAX_VALUE
;
CloudsStormVM
bestMatchingVM
=
null
;
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
)
{
if
(
o
s
.
toLowerCase
().
equals
(
vmInfo
.
getOstype
().
toLowerCase
()))
{
if
(
requestedO
s
.
toLowerCase
().
equals
(
vmInfo
.
getOstype
().
toLowerCase
()))
{
Double
cloudsStormVMdiskSize
=
null
;
Double
cloudsStormVMdiskSize
;
if
(
vmInfo
.
getDiskSize
()
==
null
)
{
if
(
vmInfo
.
getDiskSize
()
==
null
)
{
cloudsStormVMdiskSize
=
Double
.
valueOf
(
7.0
);
if
(
vmInfo
.
getExtraInfo
()
!=
null
&&
vmInfo
.
getExtraInfo
().
containsKey
(
"DiskSize"
))
{
int
intSize
=
(
int
)
vmInfo
.
getExtraInfo
().
get
(
"DiskSize"
);
cloudsStormVMdiskSize
=
Double
.
valueOf
(
intSize
);
vmInfo
.
setDiskSize
(
intSize
);
}
else
{
cloudsStormVMdiskSize
=
7.0
;
}
}
else
{
}
else
{
cloudsStormVMdiskSize
=
Double
.
valueOf
(
vmInfo
.
getDiskSize
());
cloudsStormVMdiskSize
=
Double
.
valueOf
(
vmInfo
.
getDiskSize
());
}
}
...
@@ -232,8 +239,9 @@ class CloudStormService {
...
@@ -232,8 +239,9 @@ class CloudStormService {
}
}
}
}
}
}
if
(
bestMatchingVM
!=
null
&&
bestMatchingVM
.
getDiskSize
()
==
null
){
if
(
bestMatchingVM
!=
null
&&
bestMatchingVM
.
getDiskSize
()
==
null
bestMatchingVM
.
setDiskSize
(
diskSize
.
intValue
());
&&
bestMatchingVM
.
getExtraInfo
()
==
null
&&
!
bestMatchingVM
.
getExtraInfo
().
containsKey
(
"DiskSize"
))
{
bestMatchingVM
.
setDiskSize
(
requestedDiskSize
.
intValue
());
}
}
Logger
.
getLogger
(
CloudStormService
.
class
.
getName
()).
log
(
Level
.
INFO
,
"Found best matching VM: {0}"
,
bestMatchingVM
);
Logger
.
getLogger
(
CloudStormService
.
class
.
getName
()).
log
(
Level
.
INFO
,
"Found best matching VM: {0}"
,
bestMatchingVM
);
return
bestMatchingVM
;
return
bestMatchingVM
;
...
...
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