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
05902775
Commit
05902775
authored
Dec 30, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
write cloudstrom schema
parent
38af6e0b
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
285 additions
and
259 deletions
+285
-259
CloudsStormVM.java
...java/nl/uva/sne/drip/model/cloud/storm/CloudsStormVM.java
+157
-162
CloudsStormVMs.java
...ava/nl/uva/sne/drip/model/cloud/storm/CloudsStormVMs.java
+60
-88
ExoGENI.yml
drip-provisioner/etc/ExoGENI.yml
+2
-2
CloudStormService.java
...n/java/nl/uva/sne/drip/provisioner/CloudStormService.java
+22
-7
CloudsStormInfrasCode.yml
openAPI/schema/CloudStorm/CloudsStormInfrasCode.yml
+9
-0
InfrasCode.yml
openAPI/schema/CloudStorm/InfrasCode.yml
+13
-0
OpCode.yml
openAPI/schema/CloudStorm/OpCode.yml
+15
-0
Options.yml
openAPI/schema/CloudStorm/Options.yml
+7
-0
No files found.
drip-commons/src/main/java/nl/uva/sne/drip/model/cloud/storm/CloudsStormVM.java
View file @
05902775
...
...
@@ -2,26 +2,18 @@ package nl.uva.sne.drip.model.cloud.storm;
import
java.util.Objects
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonCreator
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonRootName
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.springframework.validation.annotation.Validated
;
import
javax.validation.Valid
;
import
javax.validation.constraints.*
;
/**
* CloudsStormVM
*/
@Validated
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.SpringCodegen"
,
date
=
"2019-12-
11T19:44:34.555
Z"
)
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.SpringCodegen"
,
date
=
"2019-12-
30T16:13:55.433
Z"
)
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
@JsonRootName
(
value
=
"VMs"
)
public
class
CloudsStormVM
{
@JsonIgnore
@JsonProperty
(
"name"
)
private
String
name
=
null
;
@JsonProperty
(
"nodeType"
)
...
...
@@ -43,11 +35,12 @@ public class CloudsStormVM {
/**
* Get name
*
* @return name
**/
*
*/
@ApiModelProperty
(
value
=
""
)
public
String
getName
()
{
return
name
;
}
...
...
@@ -63,11 +56,12 @@ public class CloudsStormVM {
/**
* Get nodeType
*
* @return nodeType
**/
*
*/
@ApiModelProperty
(
value
=
""
)
public
String
getNodeType
()
{
return
nodeType
;
}
...
...
@@ -83,11 +77,12 @@ public class CloudsStormVM {
/**
* Get osType
*
* @return osType
**/
*
*/
@ApiModelProperty
(
value
=
""
)
public
String
getOsType
()
{
return
osType
;
}
...
...
@@ -103,11 +98,12 @@ public class CloudsStormVM {
/**
* Get script
*
* @return script
**/
*
*/
@ApiModelProperty
(
value
=
""
)
public
String
getScript
()
{
return
script
;
}
...
...
@@ -123,11 +119,12 @@ public class CloudsStormVM {
/**
* Get publicAddress
*
* @return publicAddress
**/
*
*/
@ApiModelProperty
(
value
=
""
)
public
String
getPublicAddress
()
{
return
publicAddress
;
}
...
...
@@ -136,7 +133,6 @@ public class CloudsStormVM {
this
.
publicAddress
=
publicAddress
;
}
@Override
public
boolean
equals
(
java
.
lang
.
Object
o
)
{
if
(
this
==
o
)
{
...
...
@@ -146,11 +142,11 @@ public class CloudsStormVM {
return
false
;
}
CloudsStormVM
cloudsStormVM
=
(
CloudsStormVM
)
o
;
return
Objects
.
equals
(
this
.
name
,
cloudsStormVM
.
name
)
&&
Objects
.
equals
(
this
.
nodeType
,
cloudsStormVM
.
nodeType
)
&&
Objects
.
equals
(
this
.
osType
,
cloudsStormVM
.
osType
)
&&
Objects
.
equals
(
this
.
script
,
cloudsStormVM
.
script
)
&&
Objects
.
equals
(
this
.
publicAddress
,
cloudsStormVM
.
publicAddress
);
return
Objects
.
equals
(
this
.
name
,
cloudsStormVM
.
name
)
&&
Objects
.
equals
(
this
.
nodeType
,
cloudsStormVM
.
nodeType
)
&&
Objects
.
equals
(
this
.
osType
,
cloudsStormVM
.
osType
)
&&
Objects
.
equals
(
this
.
script
,
cloudsStormVM
.
script
)
&&
Objects
.
equals
(
this
.
publicAddress
,
cloudsStormVM
.
publicAddress
);
}
@Override
...
...
@@ -183,4 +179,3 @@ public class CloudsStormVM {
return
o
.
toString
().
replace
(
"\n"
,
"\n "
);
}
}
drip-commons/src/main/java/nl/uva/sne/drip/model/cloud/storm/CloudsStormVMs.java
View file @
05902775
...
...
@@ -2,80 +2,55 @@ package nl.uva.sne.drip.model.cloud.storm;
import
java.util.Objects
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonCreator
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.springframework.validation.annotation.Validated
;
import
javax.validation.Valid
;
import
javax.validation.constraints.*
;
/**
* CloudsStormVMs
*/
@Validated
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.SpringCodegen"
,
date
=
"2019-12-
11T19:44:34.555
Z"
)
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.SpringCodegen"
,
date
=
"2019-12-
30T16:13:55.433
Z"
)
public
class
CloudsStormVMs
{
@JsonProperty
(
"name"
)
private
String
name
=
null
;
@JsonProperty
(
"CloudsStormVM
"
)
@JsonProperty
(
"VMs
"
)
@Valid
private
List
<
CloudsStormVM
>
cloudsStormVM
=
null
;
private
List
<
CloudsStormVM
>
vms
=
null
;
public
CloudsStormVMs
name
(
String
name
)
{
this
.
name
=
name
;
public
CloudsStormVMs
vms
(
List
<
CloudsStormVM
>
vms
)
{
this
.
vms
=
vms
;
return
this
;
}
/**
* Get name
* @return name
**/
@ApiModelProperty
(
value
=
""
)
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
public
CloudsStormVMs
addVmsItem
(
CloudsStormVM
vmsItem
)
{
if
(
this
.
vms
==
null
)
{
this
.
vms
=
new
ArrayList
<
CloudsStormVM
>();
}
public
CloudsStormVMs
cloudsStormVM
(
List
<
CloudsStormVM
>
cloudsStormVM
)
{
this
.
cloudsStormVM
=
cloudsStormVM
;
return
this
;
}
public
CloudsStormVMs
addCloudsStormVMItem
(
CloudsStormVM
cloudsStormVMItem
)
{
if
(
this
.
cloudsStormVM
==
null
)
{
this
.
cloudsStormVM
=
new
ArrayList
<
CloudsStormVM
>();
}
this
.
cloudsStormVM
.
add
(
cloudsStormVMItem
);
this
.
vms
.
add
(
vmsItem
);
return
this
;
}
/**
* Get cloudsStormVM
* @return cloudsStormVM
**/
* Get vms
*
* @return vms
*
*/
@ApiModelProperty
(
value
=
""
)
@Valid
public
List
<
CloudsStormVM
>
getCloudsStormVM
()
{
return
cloudsStormVM
;
public
List
<
CloudsStormVM
>
getVms
()
{
return
vms
;
}
public
void
setCloudsStormVM
(
List
<
CloudsStormVM
>
cloudsStormVM
)
{
this
.
cloudsStormVM
=
cloudsStormVM
;
public
void
setVms
(
List
<
CloudsStormVM
>
vms
)
{
this
.
vms
=
vms
;
}
@Override
public
boolean
equals
(
java
.
lang
.
Object
o
)
{
if
(
this
==
o
)
{
...
...
@@ -85,13 +60,12 @@ public class CloudsStormVMs {
return
false
;
}
CloudsStormVMs
cloudsStormVMs
=
(
CloudsStormVMs
)
o
;
return
Objects
.
equals
(
this
.
name
,
cloudsStormVMs
.
name
)
&&
Objects
.
equals
(
this
.
cloudsStormVM
,
cloudsStormVMs
.
cloudsStormVM
);
return
Objects
.
equals
(
this
.
vms
,
cloudsStormVMs
.
vms
);
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
name
,
cloudsStormVM
);
return
Objects
.
hash
(
vms
);
}
@Override
...
...
@@ -99,8 +73,7 @@ public class CloudsStormVMs {
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"class CloudsStormVMs {\n"
);
sb
.
append
(
" name: "
).
append
(
toIndentedString
(
name
)).
append
(
"\n"
);
sb
.
append
(
" cloudsStormVM: "
).
append
(
toIndentedString
(
cloudsStormVM
)).
append
(
"\n"
);
sb
.
append
(
" vms: "
).
append
(
toIndentedString
(
vms
)).
append
(
"\n"
);
sb
.
append
(
"}"
);
return
sb
.
toString
();
}
...
...
@@ -116,4 +89,3 @@ public class CloudsStormVMs {
return
o
.
toString
().
replace
(
"\n"
,
"\n "
);
}
}
drip-provisioner/etc/ExoGENI.yml
View file @
05902775
...
...
@@ -835,7 +835,7 @@ DCMetaInfo:
OS_URL
:
"
http://geni-images.renci.org/images/standard/ubuntu/ub1404-v1.0.4.xml"
OS_GUID
:
"
9394ca154aa35eb55e604503ae7943ddaecc6ca5"
DiskSize
:
75
-
OS
:
"
Ubuntu
1
6
.04"
-
OS
:
"
Ubuntu
1
8
.04"
CPU
:
4
MEM
:
12
VMType
:
"
XOXLarge"
...
...
@@ -845,7 +845,7 @@ DCMetaInfo:
OS_URL
:
"
http://geni-images.renci.org/images/standard/ubuntu-comet/ubuntu-18.04/ubuntu-18.04.xml"
OS_GUID
:
"
fe66b08bffa14c385ad64edd124350a2da826af9"
DiskSize
:
75
-
OS
:
"
Ubuntu
1
6
.04"
-
OS
:
"
Ubuntu
1
8
.04"
CPU
:
2
MEM
:
6
VMType
:
"
XOLarge"
...
...
drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/CloudStormService.java
View file @
05902775
...
...
@@ -24,6 +24,8 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Properties
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
nl.uva.sne.drip.commons.utils.ToscaHelper
;
import
nl.uva.sne.drip.model.cloud.storm.CloudsStormVM
;
import
nl.uva.sne.drip.model.NodeTemplateMap
;
...
...
@@ -75,7 +77,7 @@ class CloudStormService {
if
(!(
topologyTempInputDir
.
mkdirs
()))
{
throw
new
FileNotFoundException
(
"Could not create input directory: "
+
topologyTempInputDir
.
getAbsolutePath
());
}
writeCloudStormTopologyFiles
(
topologyTempInputDirPath
);
Map
<
String
,
Object
>
subTopologiesAndVMs
=
writeCloudStormTopologyFiles
(
topologyTempInputDirPath
);
String
credentialsTempInputDirPath
=
tempInputDirPath
+
File
.
separator
+
"credentials"
;
File
credentialsTempInputDir
=
new
File
(
credentialsTempInputDirPath
);
...
...
@@ -88,11 +90,12 @@ class CloudStormService {
if
(!(
infrasCodeTempInputDir
.
mkdirs
()))
{
throw
new
FileNotFoundException
(
"Could not create input directory: "
+
topologyTempInputDir
.
getAbsolutePath
());
}
writeCloudStormInfrasCodeFiles
(
infrasCodeTempInputDirPath
);
List
<
CloudsStormSubTopology
>
cloudStormSubtopologies
=
(
List
<
CloudsStormSubTopology
>)
subTopologiesAndVMs
.
get
(
"cloud_storm_subtopologies"
);
writeCloudStormInfrasCodeFiles
(
infrasCodeTempInputDirPath
,
cloudStormSubtopologies
);
return
toscaTemplate
;
}
private
void
writeCloudStormTopologyFiles
(
String
tempInputDirPath
)
throws
JSchException
,
IOException
,
ApiException
,
Exception
{
private
Map
<
String
,
Object
>
writeCloudStormTopologyFiles
(
String
tempInputDirPath
)
throws
JSchException
,
IOException
,
ApiException
,
Exception
{
CloudsStormTopTopology
topTopology
=
new
CloudsStormTopTopology
();
String
publicKeyPath
=
buildSSHKeyPair
(
tempInputDirPath
);
topTopology
.
setPublicKeyPath
(
publicKeyPath
);
...
...
@@ -103,6 +106,8 @@ class CloudStormService {
topTopology
.
setTopologies
(
cloudsStormSubTopology
);
objectMapper
.
writeValue
(
new
File
(
tempInputDirPath
+
File
.
separator
+
"top.yml"
),
topTopology
);
return
subTopologiesAndVMs
;
}
private
String
buildSSHKeyPair
(
String
tempInputDirPath
)
throws
JSchException
,
IOException
{
...
...
@@ -138,7 +143,6 @@ class CloudStormService {
CloudsStormVMs
cloudsStormVMs
=
new
CloudsStormVMs
();
List
<
CloudsStormVM
>
vms
=
new
ArrayList
<>();
cloudsStormVMs
.
setName
(
"vm_topology"
+
i
);
List
<
NodeTemplateMap
>
vmTemplatesMap
=
helper
.
getTemplateVMsForVMTopology
(
nodeTemplateMap
);
int
j
=
0
;
for
(
NodeTemplateMap
vmMap
:
vmTemplatesMap
)
{
...
...
@@ -151,7 +155,7 @@ class CloudStormService {
vms
.
add
(
cloudsStormVM
);
j
++;
}
cloudsStormVMs
.
set
CloudsStormVM
(
vms
);
cloudsStormVMs
.
set
Vms
(
vms
);
objectMapper
.
writeValue
(
new
File
(
tempInputDirPath
+
File
.
separator
+
"vm_topology"
+
i
+
".yml"
),
cloudsStormVMs
);
cloudsStormVMsList
.
add
(
cloudsStormVMs
);
cloudsStormSubTopologies
.
add
(
cloudsStormSubTopology
);
...
...
@@ -168,6 +172,8 @@ class CloudStormService {
String
os
=
helper
.
getVMNOS
(
vmMap
);
List
<
VMMetaInfo
>
vmInfos
=
cloudStormDAO
.
findVmMetaInfoByProvider
(
provider
);
for
(
VMMetaInfo
vmInfo
:
vmInfos
)
{
Logger
.
getLogger
(
CloudStormService
.
class
.
getName
()).
log
(
Level
.
INFO
,
"vmInfo: {0}"
,
vmInfo
);
Logger
.
getLogger
(
CloudStormService
.
class
.
getName
()).
log
(
Level
.
INFO
,
"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
.
getOS
().
toLowerCase
()))
{
return
vmInfo
.
getVmType
();
}
...
...
@@ -219,7 +225,16 @@ class CloudStormService {
return
null
;
}
private
void
writeCloudStormInfrasCodeFiles
(
String
infrasCodeTempInputDirPath
)
{
private
void
writeCloudStormInfrasCodeFiles
(
String
infrasCodeTempInputDirPath
,
List
<
CloudsStormSubTopology
>
cloudStormSubtopologies
)
throws
ApiException
{
List
<
NodeTemplateMap
>
vmTopologiesMaps
=
helper
.
getVMTopologyTemplates
();
int
i
=
0
;
for
(
NodeTemplateMap
vmTopologyMap
:
vmTopologiesMaps
)
{
Map
<
String
,
Object
>
provisionInterface
=
helper
.
getProvisionerInterfaceFromVMTopology
(
vmTopologyMap
);
String
operation
=
provisionInterface
.
keySet
().
iterator
().
next
();
Map
<
String
,
Object
>
inputs
=
(
Map
<
String
,
Object
>)
provisionInterface
.
get
(
operation
);
inputs
.
put
(
"object_type"
,
cloudStormSubtopologies
.
get
(
i
).
getTopology
());
}
}
...
...
openAPI/schema/CloudStorm/CloudsStormInfrasCode.yml
0 → 100644
View file @
05902775
CloudsStormInfrasCode
:
type
:
"
object"
properties
:
Mode
:
type
:
"
string"
InfrasCodes
:
type
:
"
array"
items
:
$ref
:
"
https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/openAPI/schema/CloudStorm/InfrasCode.yml#/InfrasCode"
openAPI/schema/CloudStorm/InfrasCode.yml
0 → 100644
View file @
05902775
InfrasCode
:
type
:
"
object"
properties
:
CodeType
:
type
:
"
string"
OpCode
:
$ref
:
"
https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/openAPI/schema/CloudStorm/OpCode.yml#/OpCode"
Count
:
type
:
"
integer"
OpCodes
:
type
:
"
array"
items
:
$ref
:
"
https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/openAPI/schema/CloudStorm/OpCode.yml#/OpCode"
openAPI/schema/CloudStorm/OpCode.yml
0 → 100644
View file @
05902775
OpCode
:
type
:
"
object"
properties
:
Operation
:
type
:
"
string"
Operation
:
type
:
"
string"
Objects
:
type
:
"
string"
Command
:
type
:
"
string"
Log
:
type
:
"
boolean"
Options
:
type
:
$ref
:
"
https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/openAPI/schema/CloudStorm/Options.yml#/Options"
openAPI/schema/CloudStorm/Options.yml
0 → 100644
View file @
05902775
Options
:
type
:
"
object"
properties
:
Src
:
type
:
"
string"
Dst
:
type
:
"
string"
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