Commit 0eb7e855 authored by Spiros Koulouzis's avatar Spiros Koulouzis

Save converted compose

parent 4daa36a2
version: '3' version: '3'
services: services:
telegreen: graphite:
build: restart: always
context: ../software/telegreen image: vladwing/graphite
image: beia/telegreen volumes:
- graphite_data:/opt/graphite/storage
environment:
- VIRTUAL_HOST=graphite.beia.switch
networks:
- web
- graphite
grafana:
restart: always
image: grafana/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-secret}
- VIRTUAL_HOST=grafana.beia.switch
volumes:
- grafana_data:/var/lib/grafana
depends_on:
- graphite
networks:
- web
monitoring_server:
image: salmant/ul_monitoring_server_container_image
ports: ports:
- "8080:80" - "8080:8080"
- "4242:4242"
- "4245:4245"
- "7199:7199"
- "7000:7000"
- "7001:7001"
- "9160:9160"
- "9042:9042"
- "8012:8012"
- "61621:61621"
environment:
- MONITORING_SERVER=monitoring_server
- VIRTUAL_HOST=jcatascopia.beia.switch
- VIRTUAL_PORT=8080
networks:
- asap
- web
monitoring_adapter:
restart: always
image: beia/monitoring_adapter
environment: environment:
- MYSQL_ROOT_PASSWORD=doesntmatter - GRAPHITE_SERVER=graphite
- MYSQL_DATABASE=telegreen - MONITORING_PREFIX=eu.beia.switch
- MYSQL_USER=telegreen - MONITORING_SERVER=${MONITORING_SERVER:-monitoring_server}
- MYSQL_PASSWORD=password
- MYSQL_HOST=telegreen_db
depends_on: depends_on:
- telegreen_db - graphite
- monitoring_server
networks: networks:
- db - graphite
- monitoring - data
- external - asap
telegreen_db: data_collector:
build: image: beia/data_collector
context: ../software/database
image: beia/telegreen_db
environment: environment:
- MYSQL_ROOT_PASSWORD=doesntmatter # - CONFIG=config
- MYSQL_DATABASE=telegreen - STATSD_HOST=monitoring_adapter
- MYSQL_USER=telegreen depends_on:
- MYSQL_PASSWORD=password # - config
- MYSQL_HOST=telegreen_db - monitoring_adapter
networks: networks:
- db # - config
- monitoring - data
alerter: alerter:
build:
context: ../software/samplegen
image: beia/alerter
command:
- "/srv/beia/scripts/run-node.sh /srv/beia/samplegen app/AlerterApp.class.js"
image: beia/alerter image: beia/alerter
environment: environment:
- MYSQL_ROOT_PASSWORD=doesntmatter # - CONFIG=config
- MYSQL_DATABASE=telegreen - STATSD_HOST=monitoring_adapter
- MYSQL_USER=telegreen - VIRTUAL_HOST=alerter.beia.switch
- MYSQL_PASSWORD=password - NOTIFICATION_SERVICE=notify
- MYSQL_HOST=telegreen_db
depends_on: depends_on:
- telegreen_db - notify
# - config
networks: networks:
- db # - config
- external - web
samplegen: - data
build: # config:
context: ../software/samplegen # image: beia/config_manager
image: beia/samplegen # environment:
command: # - TOSCA_URL=${TOSCA_URL:-http://www.google.com}
- "/srv/beia/scripts/run-node.sh /srv/beia/samplegen app/SampleGeneratorApp.class.js" # networks:
# - config
web:
image: jwilder/nginx-proxy
ports: ports:
- "8128:8000" - "80:80/tcp"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
- web
notify:
image: beia/notify
environment: environment:
- MYSQL_ROOT_PASSWORD=doesntmatter
- MYSQL_DATABASE=telegreen
- MYSQL_USER=telegreen
- MYSQL_PASSWORD=password
- MYSQL_HOST=telegreen_db
depends_on: depends_on:
- telegreen_db - monitoring_adapter
- notify_asterisk
- notify_redis
environment:
# - CONFIG=config
- ARI_URL=http://notify_asterisk:8088
- ARI_USERNAME=ari_user
- ARI_PASSWORD=ari_secret
- REDIS_HOST=notify_redis
- REDIS_PORT=6379
- DEFAULT_SIP=sipserver
- MONITORING_ADAPTER=monitoring_adapter
networks: networks:
- db # - config
- external - data
beia_mon: - sip
build: notify_asterisk:
context: ../software/monitoring image: beia/asterisk
image: beia/monitoring environment:
depends_on: - SIP_USERNAME=${SIP_USERNAME}
- telegreen - SIP_HOST=${SIP_HOST}
- telegreen_db - SIP_PORT=${SIP_PORT:-26999}
- SIP_SECRET=${SIP_SECRET}
- SIP_EXTENSION=${SIP_EXTENSION}
- SIP_PEERNAME=sipserver
- ARI_USERNAME=ari_user
- ARI_SECRET=ari_secret
networks:
- sip
notify_redis:
image: redis:alpine
networks: networks:
- monitoring - sip
- external volumes:
graphite_data:
grafana_data:
networks: networks:
db: # config:
external: data:
monitoring: web:
\ No newline at end of file graphite:
sip:
asap:
...@@ -36,6 +36,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -36,6 +36,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import nl.uva.sne.drip.api.exception.BadRequestException; import nl.uva.sne.drip.api.exception.BadRequestException;
import nl.uva.sne.drip.api.service.ConfigurationService;
import nl.uva.sne.drip.api.service.ToscaService; import nl.uva.sne.drip.api.service.ToscaService;
import nl.uva.sne.drip.api.service.UserService; import nl.uva.sne.drip.api.service.UserService;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -57,6 +58,9 @@ public class ToscaController { ...@@ -57,6 +58,9 @@ public class ToscaController {
@Autowired @Autowired
private ToscaService toscaService; private ToscaService toscaService;
@Autowired
private ConfigurationService configurationService;
@RequestMapping(value = "/post", method = RequestMethod.POST) @RequestMapping(value = "/post", method = RequestMethod.POST)
@RolesAllowed({UserService.USER, UserService.ADMIN}) @RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody public @ResponseBody
...@@ -152,7 +156,8 @@ public class ToscaController { ...@@ -152,7 +156,8 @@ public class ToscaController {
public @ResponseBody public @ResponseBody
String transform(@PathVariable("id") String id, @RequestParam(value = "type") String type) { String transform(@PathVariable("id") String id, @RequestParam(value = "type") String type) {
try { try {
return toscaService.transform(id, type); String ymlContents = toscaService.transform(id, type);
return configurationService.saveStringContents(ymlContents);
} catch (JSONException | IOException | TimeoutException | InterruptedException ex) { } catch (JSONException | IOException | TimeoutException | InterruptedException ex) {
Logger.getLogger(ToscaController.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(ToscaController.class.getName()).log(Level.SEVERE, null, ex);
} }
......
...@@ -117,23 +117,23 @@ def execute_playbook(hosts, playbook_path,user,ssh_key_file,extra_vars,passwords ...@@ -117,23 +117,23 @@ def execute_playbook(hosts, playbook_path,user,ssh_key_file,extra_vars,passwords
ok = results_callback.host_ok ok = results_callback.host_ok
answer = [] answer = []
for res in ok: for res in ok:
resp = json.dumps({"host":res['ip'], "result":res['result']._result,"task":res['task']._task}) resp = json.dumps({"host":res['ip'], "result":res['result']._result,"task":res['task']})
logger.info(resp) logger.info(resp)
answer.append({"host":res['ip'], "result":res['result']._result}) answer.append({"host":res['ip'], "result":res['result']._result,"task":res['task']})
unreachable = results_callback.host_unreachable unreachable = results_callback.host_unreachable
for res in unreachable: for res in unreachable:
resp = json.dumps({"host":res['ip'], "result":res['result']._result,"task":res['task']._task}) resp = json.dumps({"host":res['ip'], "result":res['result']._result,"task":res['task']})
logger.info(resp) logger.info(resp)
answer.append({"host":res['ip'], "result":res['result']._result}) answer.append({"host":res['ip'], "result":res['result']._result,"task":res['task']})
host_failed = results_callback.host_failed host_failed = results_callback.host_failed
for res in host_failed: for res in host_failed:
resp = json.dumps({"host":res['ip'], "result":res['result']._result, "task":res['task']._task}) resp = json.dumps({"host":res['ip'], "result":res['result']._result, "task":res['task']})
logger.info(resp) logger.info(resp)
answer.append({"host":res['ip'], "result":res['result']._result}) answer.append({"host":res['ip'], "result":res['result']._result,"task":res['task']})
return json.dumps(answer) return json.dumps(answer)
......
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