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
Hide 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:
repository
:
docker_hub
#
topology:
#
type: tosca.nodes.ARTICONF.VM.topology
#
interfaces:
#
CloudsStorm:
#
provision:
#
inputs:
#
code_type: SEQ
#
object_type: SubTopology
#
properties:
#
domain: UvA (Amsterdam, The Netherlands) XO Rack
#
provider: ExoGENI
topology
:
type
:
tosca.nodes.ARTICONF.VM.topology
interfaces
:
CloudsStorm
:
provision
:
inputs
:
code_type
:
SEQ
object_type
:
SubTopology
properties
:
domain
:
UvA (Amsterdam, The Netherlands) XO Rack
provider
:
ExoGENI
TOSCA/types/nodes.yaml
View file @
cbe0c324
...
...
@@ -179,7 +179,7 @@ node_types:
disk_size
:
type
:
scalar-unit.size
required
:
true
default
:
40
000 MB
default
:
25
000 MB
constraints
:
-
greater_or_equal
:
15000 MB
mem_size
:
...
...
docker-compose.yml
View file @
cbe0c324
...
...
@@ -116,10 +116,10 @@ services:
ports
:
-
"
30000:8080"
#
sure-tosca:
#
image: sure-tosca:3.0.0
#
ports:
#
- "8081:8081"
sure-tosca
:
image
:
sure-tosca:3.0.0
ports
:
-
"
8081:8081"
planner
:
depends_on
:
...
...
@@ -129,14 +129,14 @@ services:
environment
:
RABBITMQ_HOST
:
rabbit
provisioner
:
depends_on
:
-
rabbit
-
sure-tosca
image
:
provisioner:3.0.0
environment
:
RABBITMQ_HOST
:
rabbit
SURE_TOSCA_BASE_PATH
:
http://sure-tosca:8081/tosca-sure/1.0.0
#
provisioner:
#
depends_on:
#
- rabbit
#
- sure-tosca
#
image: provisioner:3.0.0
#
environment:
#
RABBITMQ_HOST: rabbit
#
SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0
deployer
:
depends_on
:
...
...
manager/src/main/java/nl/uva/sne/drip/api/ToscaTemplateApiController.java
View file @
cbe0c324
...
...
@@ -16,8 +16,10 @@ import javax.validation.Valid;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.concurrent.TimeoutException
;
import
java.util.logging.Level
;
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.sure.tosca.client.ApiException
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -34,6 +36,9 @@ public class ToscaTemplateApiController implements ToscaTemplateApi {
@Autowired
private
ToscaTemplateService
toscaTemplateService
;
@Autowired
private
DRIPService
dripService
;
@org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
public
ToscaTemplateApiController
(
ObjectMapper
objectMapper
,
HttpServletRequest
request
)
{
this
.
request
=
request
;
...
...
@@ -44,9 +49,9 @@ public class ToscaTemplateApiController implements ToscaTemplateApi {
String
accept
=
request
.
getHeader
(
"Accept"
);
if
(
accept
!=
null
&&
accept
.
contains
(
"*/*"
))
{
try
{
toscaTemplateService
.
deleteByID
(
id
);
return
new
ResponseEntity
<>(
""
,
HttpStatus
.
OK
);
}
catch
(
NotFoundException
|
IOException
|
ApiException
|
TypeExeption
ex
)
{
String
deleteedYemplateId
=
dripService
.
delete
(
id
);
return
new
ResponseEntity
<>(
deleteedYemplateId
,
HttpStatus
.
OK
);
}
catch
(
NotFoundException
|
IOException
|
ApiException
|
TypeExeption
|
TimeoutException
|
InterruptedException
ex
)
{
java
.
util
.
logging
.
Logger
.
getLogger
(
ToscaTemplateApiController
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
null
,
ex
);
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 {
}
private
String
execute
(
ToscaTemplate
toscaTemplate
)
throws
JsonProcessingException
,
ApiException
,
IOException
,
TimeoutException
,
InterruptedException
{
caller
.
init
();
Logger
.
getLogger
(
DRIPService
.
class
.
getName
()).
log
(
Level
.
INFO
,
"toscaTemplate:\n{0}"
,
toscaTemplate
);
Message
message
=
new
Message
();
...
...
@@ -172,19 +171,19 @@ public class DRIPService {
return
toscaTemplate
;
}
void
deleteActions
(
ToscaTemplate
toscaTemplate
)
throws
ApiException
,
TypeExeption
,
IO
Exception
{
helper
.
uploadToscaTemplate
(
toscaTemplate
);
public
String
delete
(
String
id
)
throws
NotFoundException
,
IOException
,
JsonProcessingException
,
ApiException
,
TypeExeption
,
TimeoutException
,
Interrupted
Exception
{
ToscaTemplate
toscaTemplate
=
initExecution
(
id
);
List
<
NodeTemplateMap
>
vmTopologies
=
helper
.
getVMTopologyTemplates
();
if
(
vmTopologies
!=
null
)
{
for
(
NodeTemplateMap
vmTopology
:
vmTopologies
)
{
CloudsStormSubTopology
.
StatusEnum
status
=
helper
.
getVMTopologyTemplateStatus
(
vmTopology
);
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 {
@Autowired
private
ToscaTemplateDAO
dao
;
@Autowired
private
DRIPService
dripService
;
public
String
save
(
ToscaTemplate
tt
)
{
dao
.
save
(
tt
);
...
...
@@ -85,7 +84,6 @@ public class ToscaTemplateService {
public
void
deleteByID
(
String
id
)
throws
JsonProcessingException
,
NotFoundException
,
IOException
,
ApiException
,
TypeExeption
{
ToscaTemplate
toscaTemplate
=
getYaml2ToscaTemplate
(
findByID
(
id
));
dripService
.
deleteActions
(
toscaTemplate
);
dao
.
deleteById
(
id
);
}
...
...
provisioner/src/main/java/nl/uva/sne/drip/provisioner/CloudStormService.java
View file @
cbe0c324
...
...
@@ -206,20 +206,27 @@ class CloudStormService {
}
private
CloudsStormVM
getBestMatchingCloudStormVM
(
NodeTemplateMap
vmMap
,
String
provider
)
throws
IOException
,
Exception
{
Double
n
umOfCores
=
helper
.
getVMNumOfCores
(
vmMap
);
Double
m
emSize
=
helper
.
getVMNMemSize
(
vmMap
);
String
o
s
=
helper
.
getVMNOS
(
vmMap
);
Double
d
iskSize
=
helper
.
getVMNDiskSize
(
vmMap
);
double
[]
requestedVector
=
convert2ArrayofDoubles
(
numOfCores
,
memSize
,
d
iskSize
);
Double
requestedN
umOfCores
=
helper
.
getVMNumOfCores
(
vmMap
);
Double
requestedM
emSize
=
helper
.
getVMNMemSize
(
vmMap
);
String
requestedO
s
=
helper
.
getVMNOS
(
vmMap
);
Double
requestedD
iskSize
=
helper
.
getVMNDiskSize
(
vmMap
);
double
[]
requestedVector
=
convert2ArrayofDoubles
(
requestedNumOfCores
,
requestedMemSize
,
requestedD
iskSize
);
double
min
=
Double
.
MAX_VALUE
;
CloudsStormVM
bestMatchingVM
=
null
;
List
<
CloudsStormVM
>
vmInfos
=
cloudStormDAO
.
findVmMetaInfoByProvider
(
CloudProviderEnum
.
fromValue
(
provider
));
for
(
CloudsStormVM
vmInfo
:
vmInfos
)
{
if
(
o
s
.
toLowerCase
().
equals
(
vmInfo
.
getOstype
().
toLowerCase
()))
{
Double
cloudsStormVMdiskSize
=
null
;
if
(
requestedO
s
.
toLowerCase
().
equals
(
vmInfo
.
getOstype
().
toLowerCase
()))
{
Double
cloudsStormVMdiskSize
;
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
{
cloudsStormVMdiskSize
=
Double
.
valueOf
(
vmInfo
.
getDiskSize
());
}
...
...
@@ -232,8 +239,9 @@ class CloudStormService {
}
}
}
if
(
bestMatchingVM
!=
null
&&
bestMatchingVM
.
getDiskSize
()
==
null
){
bestMatchingVM
.
setDiskSize
(
diskSize
.
intValue
());
if
(
bestMatchingVM
!=
null
&&
bestMatchingVM
.
getDiskSize
()
==
null
&&
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
);
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