Commit 7a859fa4 authored by Alexander Lercher's avatar Alexander Lercher

Added ping tool and RabbitMQ for message broker

parent 3c431769
...@@ -11,7 +11,8 @@ for r, _, f in os.walk('./'): ...@@ -11,7 +11,8 @@ for r, _, f in os.walk('./'):
command_args = [{'path': path, command_args = [{'path': path,
# ./transaction-hub-out/tokenized-decision-making-microservice/Dockerfile # ./transaction-hub-out/tokenized-decision-making-microservice/Dockerfile
# -> tokenized-decision-making # -> tokenized-decision-making
'name': '-'.join(str(path).split('/')[2].split('-')[:-1])} #'name': '-'.join(str(path).split('/')[2].split('-')[:-1])}
'name': str(path).split('/')[2]}
for path for path
in paths] in paths]
...@@ -19,3 +20,4 @@ for command_arg in command_args: ...@@ -19,3 +20,4 @@ for command_arg in command_args:
image_name = f"{docker_reg}/{command_arg['name']}" image_name = f"{docker_reg}/{command_arg['name']}"
os.system(f"docker image build -t {image_name} {command_arg['path']}") os.system(f"docker image build -t {image_name} {command_arg['path']}")
os.system(f"docker push {image_name}") os.system(f"docker push {image_name}")
print(f"Finished {image_name}")
\ No newline at end of file
apiVersion: apps/v1
kind: Deployment
metadata:
name: rabbit-mq
spec:
replicas: 2
selector:
matchLabels:
app: rabbit-mq
template:
metadata:
labels:
app: rabbit-mq
spec:
containers:
- name: rabbit-mq
image: rabbitmq:3-management
ports:
- containerPort: 15672
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
name: rabbit-mq-endpoint
spec:
type: LoadBalancer
externalIPs:
- 143.205.173.36
selector:
app: rabbit-mq
ports:
- name: http
port: 8080
targetPort: 15672
nodePort: 30301
protocol: TCP
\ No newline at end of file
import requests
import random
import json
ports = []
# transaction hub in
ports.extend(range(30001, 30003))
# data hub
ports.extend(range(30101, 30110))
# transaction hub out
ports.extend(range(30201, 30205))
print(f"Checking {len(ports)} ports")
home_url = 'http://143.205.173.36:{port}/'
debug_url = home_url + 'api/debug'
print(debug_url)
for port in ports:
response = requests.get(home_url.replace("{port}", str(port)))
print(response.text)
data = {'data': f"Echo {str(random.random())}"}
response = requests.post(debug_url.replace("{port}", str(port)), json=data)
print(response.text)
\ No newline at end of file
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