Commit 75bcb354 authored by Alexander Lercher's avatar Alexander Lercher

Added data-access-microservice

parent d80bca29
FROM python:3
LABEL maintainer="Alexander Lercher"
ENV http_proxy http://proxy.uni-klu.ac.at:3128/
ENV https_proxy http://proxy.uni-klu.ac.at:3128/
RUN apt-get update
RUN pip install flask
RUN pip install connexion[swagger-ui]
EXPOSE 5000
WORKDIR /app
COPY transaction-hub-out/data-access-microservice/app/ /app/
RUN chmod a+x main.py
CMD ["python", "./main.py"]
\ No newline at end of file
# Data Access Microservice
The data access microservice offers the heuristics and data from SMART to enable other components to apply evaluation and cognition for different use-cases.
## Technologies
- Python 3.x
(Check Dockerfile for used Python modules)
- Docker
- Kubernetes
\ No newline at end of file
swagger: "2.0"
info:
title: Data Access microservice
description: This is the documentation for the data access microservice.
version: "1.0.0"
consumes:
- "application/json"
produces:
- "application/json"
basePath: "/api"
paths:
/debug:
post:
operationId: "debug.echo"
tags:
- "Echo"
summary: "Echo function for debugging purposes"
description: "Echoes the input back to the caller."
parameters:
- in: body
name: "Object"
required: true
schema:
type: object
responses:
200:
description: "Successful echo of request data"
from flask import request
def echo():
return request.json
\ No newline at end of file
import connexion
# load swagger config
app = connexion.App(__name__, specification_dir='configs/')
app.add_api('swagger.yml')
@app.route('/', methods=['GET'])
def api_root():
return 'Endpoint of data-access-microservice!'
# start app
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000, debug=True)
apiVersion: apps/v1
kind: Deployment
metadata:
name: data-access
spec:
replicas: 2
selector:
matchLabels:
app: data-access
template:
metadata:
labels:
app: data-access
spec:
containers:
- name: data-access
image: 172.16.1.20:5000/data-access-microservice
ports:
- containerPort: 5000
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
name: data-access
spec:
type: LoadBalancer
externalIPs:
- 143.205.173.36
selector:
app: data-access
ports:
- name: http
port: 80
targetPort: 5000
nodePort: 30205
protocol: TCP
\ 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