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
4b2ce29a
Commit
4b2ce29a
authored
May 21, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make sure we read the disk size
parent
0a8cfe25
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
11 deletions
+19
-11
dockerize.sh
bin/dockerize.sh
+6
-6
ansible_service.py
deployer/service/ansible_service.py
+3
-1
CloudStormService.java
...n/java/nl/uva/sne/drip/provisioner/CloudStormService.java
+10
-4
No files found.
bin/dockerize.sh
View file @
4b2ce29a
...
@@ -4,10 +4,10 @@ echo "----------Building manager Docker--------------"
...
@@ -4,10 +4,10 @@ echo "----------Building manager Docker--------------"
cd
manager
&&
mvn
-Dmaven
.test.skip
=
true
dockerfile:build
cd
manager
&&
mvn
-Dmaven
.test.skip
=
true
dockerfile:build
status
=
$?
status
=
$?
[
$status
-eq
0
]
&&
echo
"build successful"
||
exit
-1
[
$status
-eq
0
]
&&
echo
"build successful"
||
exit
-1
cd
../
#
cd ../
echo
"----------Building provisioner Docker--------------"
#
echo "----------Building provisioner Docker--------------"
cd
provisioner
&&
mvn
-Dmaven
.test.skip
=
true
dockerfile:build
#
cd provisioner && mvn -Dmaven.test.skip=true dockerfile:build
[
$status
-eq
0
]
&&
echo
"build successful"
||
exit
-1
#
[ $status -eq 0 ] && echo "build successful" || exit -1
# cd ../
# cd ../
# echo "----------Building sure_tosca-flask-server Docker--------------"
# echo "----------Building sure_tosca-flask-server Docker--------------"
# cd sure_tosca-flask-server && docker build -t sure-tosca:3.0.0 .
# cd sure_tosca-flask-server && docker build -t sure-tosca:3.0.0 .
...
@@ -26,5 +26,5 @@ cd provisioner && mvn -Dmaven.test.skip=true dockerfile:build
...
@@ -26,5 +26,5 @@ cd provisioner && mvn -Dmaven.test.skip=true dockerfile:build
# docker tag sure-tosca:3.0.0 qcdis/sure-tosca:3.0.0
# docker tag sure-tosca:3.0.0 qcdis/sure-tosca:3.0.0
# docker tag planner:3.0.0 qcdis/planner:3.0.0
# docker tag planner:3.0.0 qcdis/planner:3.0.0
# docker tag deployer:3.0.0 qcdis/deployer:3.0.0
# docker tag deployer:3.0.0 qcdis/deployer:3.0.0
#
docker tag manager:3.0.0 qcdis/manager:3.0.0
docker tag manager:3.0.0 qcdis/manager:3.0.0
docker tag provisioner:3.0.0 qcdis/provisioner:3.0.0
#
docker tag provisioner:3.0.0 qcdis/provisioner:3.0.0
deployer/service/ansible_service.py
View file @
4b2ce29a
import
base64
import
base64
import
logging
import
logging
from
time
import
sleep
from
time
import
sleep
import
datetime
import
yaml
import
yaml
from
semaphore_client.semaphore_helper
import
SemaphoreHelper
from
semaphore_client.semaphore_helper
import
SemaphoreHelper
...
@@ -41,7 +42,8 @@ class AnsibleService:
...
@@ -41,7 +42,8 @@ class AnsibleService:
desired_state
=
application
.
node_template
.
attributes
[
'desired_state'
]
desired_state
=
application
.
node_template
.
attributes
[
'desired_state'
]
if
desired_state
:
if
desired_state
:
project_id
=
self
.
semaphore_helper
.
create_project
(
application
.
name
)
now
=
datetime
.
datetime
.
now
()
project_id
=
self
.
semaphore_helper
.
create_project
(
application
.
name
+
'_'
+
str
(
now
))
inventory_contents
=
yaml
.
dump
(
self
.
build_yml_inventory
(
vms
),
default_flow_style
=
False
)
inventory_contents
=
yaml
.
dump
(
self
.
build_yml_inventory
(
vms
),
default_flow_style
=
False
)
private_key
=
self
.
get_private_key
(
vms
)
private_key
=
self
.
get_private_key
(
vms
)
key_id
=
self
.
semaphore_helper
.
create_ssh_key
(
application
.
name
,
project_id
,
private_key
)
key_id
=
self
.
semaphore_helper
.
create_ssh_key
(
application
.
name
,
project_id
,
private_key
)
...
...
provisioner/src/main/java/nl/uva/sne/drip/provisioner/CloudStormService.java
View file @
4b2ce29a
...
@@ -238,7 +238,6 @@ class CloudStormService {
...
@@ -238,7 +238,6 @@ class CloudStormService {
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
(
requestedOs
.
toLowerCase
().
equals
(
vmInfo
.
getOstype
().
toLowerCase
()))
{
if
(
requestedOs
.
toLowerCase
().
equals
(
vmInfo
.
getOstype
().
toLowerCase
()))
{
Double
cloudsStormVMdiskSize
;
Double
cloudsStormVMdiskSize
;
if
(
vmInfo
.
getDiskSize
()
==
null
)
{
if
(
vmInfo
.
getDiskSize
()
==
null
)
{
...
@@ -253,7 +252,9 @@ class CloudStormService {
...
@@ -253,7 +252,9 @@ class CloudStormService {
}
else
{
}
else
{
cloudsStormVMdiskSize
=
Double
.
valueOf
(
vmInfo
.
getDiskSize
());
cloudsStormVMdiskSize
=
Double
.
valueOf
(
vmInfo
.
getDiskSize
());
}
}
double
[]
aveliableVector
=
convert2ArrayofDoubles
(
Double
.
valueOf
(
vmInfo
.
getCPU
()),
Double
.
valueOf
(
vmInfo
.
getMEM
()),
cloudsStormVMdiskSize
);
double
[]
aveliableVector
=
convert2ArrayofDoubles
(
Double
.
valueOf
(
vmInfo
.
getCPU
()),
Double
.
valueOf
(
vmInfo
.
getMEM
()),
cloudsStormVMdiskSize
);
EuclideanDistance
dist
=
new
EuclideanDistance
();
EuclideanDistance
dist
=
new
EuclideanDistance
();
double
res
=
dist
.
compute
(
requestedVector
,
aveliableVector
);
double
res
=
dist
.
compute
(
requestedVector
,
aveliableVector
);
if
(
res
<
min
)
{
if
(
res
<
min
)
{
...
@@ -262,10 +263,15 @@ class CloudStormService {
...
@@ -262,10 +263,15 @@ class CloudStormService {
}
}
}
}
}
}
if
(
bestMatchingVM
!=
null
&&
bestMatchingVM
.
getDiskSize
()
==
null
if
(
bestMatchingVM
!=
null
&&
provider
.
equals
(
"EC2"
))
{
&&
bestMatchingVM
.
getExtraInfo
()
==
null
&&
!
bestMatchingVM
.
getExtraInfo
().
containsKey
(
"DiskSize"
))
{
bestMatchingVM
.
setDiskSize
(
requestedDiskSize
.
intValue
());
bestMatchingVM
.
setDiskSize
(
requestedDiskSize
.
intValue
());
bestMatchingVM
.
getExtraInfo
().
put
(
"DiskSize"
,
requestedDiskSize
.
intValue
());
bestMatchingVM
.
getExtraInfo
().
put
(
"diskSize"
,
requestedDiskSize
.
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
.
FINE
,
"Found best matching VM: {0}"
,
bestMatchingVM
);
Logger
.
getLogger
(
CloudStormService
.
class
.
getName
()).
log
(
Level
.
FINE
,
"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