Commit a93108ad authored by Spiros Koulouzis's avatar Spiros Koulouzis

set cloud provider. New WT docker-compose.yml

parent 77a5a24d
#####################################################
### PLEASE, CONFIGURE MONITOR-ADAPTER ENVIRONMENT ###
#####################################################
version: "3.3"
services:
monitor-adapter:
image: beia/monitoring_agent
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: any
placement:
constraints: [node.role == manager]
environment:
- MONITORING_SERVER=194.249.1.175
- MONITORING_PREFIX=eu.switch.wt
hostname: monitor-adapter
networks:
uc-ol:
aliases:
- monitor-adapter
mongo:
image: wtelecom/mongo:switch
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: any
placement:
constraints: [node.role == manager]
depends_on:
- monitor-adapter
volumes:
- mongo-volume:/data/db
hostname: mongo
networks:
uc-ol:
aliases:
- mongo
redis:
image: redis:4.0-alpine
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: any
placement:
constraints: [node.role == manager]
depends_on:
- monitor-adapter
volumes:
- redis-volume:/data
hostname: redis
networks:
uc-ol:
aliases:
- redis
db:
image: wtelecom/mysql:switch
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: any
placement:
constraints: [node.role == manager]
depends_on:
- monitor-adapter
environment:
- MYSQL_ROOT_PASSWORD=supersecret
volumes:
- db-volume:/var/lib/mysql
hostname: db
networks:
uc-ol:
aliases:
- db
asterisk:
image: wtelecom/asterisk:switch
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: any
depends_on:
- monitor-adapter
- db
hostname: asterisk
networks:
uc-ol:
aliases:
- asterisk
doubango:
image: wtelecom/doubango:switch
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: any
depends_on:
- monitor-adapter
- db
hostname: doubango
networks:
uc-ol:
aliases:
- doubango
kamailio:
image: wtelecom/kamailio:switch
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: any
placement:
constraints: [node.role == manager]
depends_on:
- monitor-adapter
- db
- asterisk
- doubango
environment:
- SUBNET_OVERLAY=192.168.2.0
volumes:
- /etc/hostname:/docker-entrypoint/hostname:ro
ports:
- target: 5060
published: 5060
protocol: udp
mode: host
- target: 5061
published: 5061
protocol: udp
mode: host
- target: 443
published: 443
protocol: tcp
mode: host
- target: 80
published: 80
protocol: tcp
mode: host
hostname: kamailio
networks:
uc-ol:
aliases:
- kamailio
rtpengine:
image: wtelecom/rtpengine:switch
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: any
depends_on:
- monitor-adapter
- db
- kamailio
environment:
- PORT_MAX=10050
- PORT_MIN=10000
- SUBNET_OVERLAY=192.168.2.0
- BRIDGE_MODE=YES
volumes:
- /etc/hostname:/docker-entrypoint/hostname:ro
ports:
- target: 10000
published: 10000
protocol: udp
mode: host
- target: 10001
published: 10001
protocol: udp
mode: host
- target: 10002
published: 10002
protocol: udp
mode: host
- target: 10003
published: 10003
protocol: udp
mode: host
- target: 10004
published: 10004
protocol: udp
mode: host
- target: 10005
published: 10005
protocol: udp
mode: host
- target: 10006
published: 10006
protocol: udp
mode: host
- target: 10007
published: 10007
protocol: udp
mode: host
- target: 10008
published: 10008
protocol: udp
mode: host
- target: 10009
published: 10009
protocol: udp
mode: host
- target: 10010
published: 10010
protocol: udp
mode: host
- target: 10011
published: 10011
protocol: udp
mode: host
- target: 10012
published: 10012
protocol: udp
mode: host
- target: 10013
published: 10013
protocol: udp
mode: host
- target: 10014
published: 10014
protocol: udp
mode: host
- target: 10015
published: 10015
protocol: udp
mode: host
- target: 10016
published: 10016
protocol: udp
mode: host
- target: 10017
published: 10017
protocol: udp
mode: host
- target: 10018
published: 10018
protocol: udp
mode: host
- target: 10019
published: 10019
protocol: udp
mode: host
- target: 10020
published: 10020
protocol: udp
mode: host
- target: 10021
published: 10021
protocol: udp
mode: host
- target: 10022
published: 10022
protocol: udp
mode: host
- target: 10023
published: 10023
protocol: udp
mode: host
- target: 10024
published: 10024
protocol: udp
mode: host
- target: 10025
published: 10025
protocol: udp
mode: host
- target: 10026
published: 10026
protocol: udp
mode: host
- target: 10027
published: 10027
protocol: udp
mode: host
- target: 10028
published: 10028
protocol: udp
mode: host
- target: 10029
published: 10029
protocol: udp
mode: host
- target: 10030
published: 10030
protocol: udp
mode: host
- target: 10031
published: 10031
protocol: udp
mode: host
- target: 10032
published: 10032
protocol: udp
mode: host
- target: 10033
published: 10033
protocol: udp
mode: host
- target: 10034
published: 10034
protocol: udp
mode: host
- target: 10035
published: 10035
protocol: udp
mode: host
- target: 10036
published: 10036
protocol: udp
mode: host
- target: 10037
published: 10037
protocol: udp
mode: host
- target: 10038
published: 10038
protocol: udp
mode: host
- target: 10039
published: 10039
protocol: udp
mode: host
- target: 10040
published: 10040
protocol: udp
mode: host
- target: 10041
published: 10041
protocol: udp
mode: host
- target: 10042
published: 10042
protocol: udp
mode: host
- target: 10043
published: 10043
protocol: udp
mode: host
- target: 10044
published: 10044
protocol: udp
mode: host
- target: 10045
published: 10045
protocol: udp
mode: host
- target: 10046
published: 10046
protocol: udp
mode: host
- target: 10047
published: 10047
protocol: udp
mode: host
- target: 10048
published: 10048
protocol: udp
mode: host
- target: 10049
published: 10049
protocol: udp
mode: host
- target: 10050
published: 10050
protocol: udp
mode: host
networks:
uc-ol:
aliases:
- rtpengine
webportalbackend:
image: wtelecom/webportalbackend:switch
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: any
depends_on:
- monitor-adapter
- redis
- mongo
- kamailio
- rtpengine
ports:
- "3000:3000"
volumes:
- /etc/hostname:/docker-entrypoint/hostname:ro
hostname: webportalbackend
networks:
uc-ol:
aliases:
- webportalbackend
webportal:
image: wtelecom/webportal:switch
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: any
depends_on:
- monitor-adapter
- kamailio
- rtpengine
- webportalbackend
ports:
- "4200:4200"
volumes:
- /etc/hostname:/docker-entrypoint/hostname:ro
hostname: webportal
networks:
uc-ol:
aliases:
- webportal
volumes:
db-volume:
redis-volume:
mongo-volume:
networks:
uc-ol:
driver: overlay
ipam:
driver: default
config:
- subnet: 192.168.2.0/24
...@@ -79,7 +79,7 @@ public class PlannerService { ...@@ -79,7 +79,7 @@ public class PlannerService {
logger.addHandler(new DRIPLogHandler(messageBrokerHost)); logger.addHandler(new DRIPLogHandler(messageBrokerHost));
} }
public PlanResponse getPlan(String toscaId) throws JSONException, UnsupportedEncodingException, IOException, TimeoutException, InterruptedException { public PlanResponse getPlan(String toscaId, String cloudProvider) throws JSONException, UnsupportedEncodingException, IOException, TimeoutException, InterruptedException {
try (DRIPCaller planner = new PlannerCaller(messageBrokerHost)) { try (DRIPCaller planner = new PlannerCaller(messageBrokerHost)) {
Message plannerInvokationMessage = buildPlannerMessage(toscaId); Message plannerInvokationMessage = buildPlannerMessage(toscaId);
logger.log(Level.INFO, "Calling planner"); logger.log(Level.INFO, "Calling planner");
...@@ -100,8 +100,9 @@ public class PlannerService { ...@@ -100,8 +100,9 @@ public class PlannerService {
jsonArrayString.append(jsonValue); jsonArrayString.append(jsonValue);
} }
jsonArrayString.append("]"); jsonArrayString.append("]");
if (cloudProvider == null) {
String cloudProvider = getBestCloudProvider(); cloudProvider = getBestCloudProvider();
}
String domainName = getBestDomain(cloudProvider); String domainName = getBestDomain(cloudProvider);
// SimplePlanContainer simplePlan = P2PConverter.convert(jsonArrayString.toString(), "vm_user", "Ubuntu 16.04", clusterType); // SimplePlanContainer simplePlan = P2PConverter.convert(jsonArrayString.toString(), "vm_user", "Ubuntu 16.04", clusterType);
......
...@@ -65,7 +65,7 @@ public class PlannerController0 { ...@@ -65,7 +65,7 @@ public class PlannerController0 {
String yaml = plan0.file; String yaml = plan0.file;
yaml = yaml.replaceAll("\\\\n", "\n"); yaml = yaml.replaceAll("\\\\n", "\n");
String id = toscaService.saveYamlString(yaml, null); String id = toscaService.saveYamlString(yaml, null);
nl.uva.sne.drip.drip.commons.data.v1.external.PlanResponse plan1 = plannerService.getPlan(id); nl.uva.sne.drip.drip.commons.data.v1.external.PlanResponse plan1 = plannerService.getPlan(id, null);
Result r = new Result(); Result r = new Result();
r.info = ("INFO"); r.info = ("INFO");
r.status = ("Success"); r.status = ("Success");
......
...@@ -61,7 +61,6 @@ public class PlannerController { ...@@ -61,7 +61,6 @@ public class PlannerController {
// @Autowired // @Autowired
// private ToscaService toscaService; // private ToscaService toscaService;
/** /**
* verifies plan. Checks if this is a concrete plan * verifies plan. Checks if this is a concrete plan
* *
...@@ -87,7 +86,7 @@ public class PlannerController { ...@@ -87,7 +86,7 @@ public class PlannerController {
String plan(@PathVariable("tosca_id") String toscaId) { String plan(@PathVariable("tosca_id") String toscaId) {
try { try {
PlanResponse plan = plannerService.getPlan(toscaId); PlanResponse plan = plannerService.getPlan(toscaId, null);
if (plan == null) { if (plan == null) {
throw new NotFoundException("Could not make plan"); throw new NotFoundException("Could not make plan");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment