Commit 15ef25dd authored by Alexander Lercher's avatar Alexander Lercher

Renamed microservices and moved source code

parent a697b99c
# add modules folder to interpreter path
import sys
import os
modules_path = '../../../modules/'
if os.path.exists(modules_path):
sys.path.insert(1, modules_path)
### init logging ###
import logging
LOG_FORMAT = ('%(levelname) -5s %(asctime)s %(name)s:%(funcName) -35s %(lineno) -5d: %(message)s')
logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)
LOGGER = logging.getLogger(__name__)
#############################
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 community-detection-microservice!'
# start app
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000, debug=True)
......@@ -5,17 +5,14 @@ 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
# https://www.aptible.com/documentation/faq/deploy/dockerfile-caching/pip-dockerfile-caching.html
COPY src/data-hub/community-detection-microservice/app/requirements.txt /app/
RUN pip install -r requirements.txt
COPY src/modules/ /app/
COPY src/data-hub/community-detection-microservice/app/ /app/
COPY src/data-hub/proactive-community-detection-microservice/app/ /app/
RUN chmod a+x main.py
CMD ["python", "./main.py"]
\ No newline at end of file
# Community Detection Microservice
# Proactive Community Detection Microservice
The community detection microservice helps in deeper network understand-
ing and reveals interesting properties shared by the members. We propose a novel approach that combines event clustering and link analysis to detect communities along with clustering users into overlapping communities via agent, role, stage discovery microservices.
......
swagger: "2.0"
info:
title: Proactive Community Detection microservice
description: This is the documentation for the proactive community detection 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"
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 proactive-community-detection-microservice!'
# start app
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000, debug=True)
apiVersion: v1
kind: Service
metadata:
name: community-detection
name: proactive-community-detection
spec:
type: LoadBalancer
selector:
app: community-detection
app: proactive-community-detection
ports:
- name: http
port: 80
......@@ -16,54 +16,54 @@ spec:
apiVersion: apps/v1
kind: Deployment
metadata:
name: community-detection
name: proactive-community-detection
spec:
replicas: 1
selector:
matchLabels:
app: community-detection
app: proactive-community-detection
template:
metadata:
labels:
app: community-detection
app: proactive-community-detection
spec:
containers:
- name: community-detection
image: alexx882/community-detection-microservice
- name: proactive-community-detection
image: alexx882/proactive-community-detection-microservice
ports:
- containerPort: 5000
---
apiVersion: v1
kind: Service
metadata:
name: community-detection-db
name: proactive-community-detection-db
spec:
type: LoadBalancer
selector:
app: community-detection-db
app: proactive-community-detection-db
ports:
- name: http
port: 27017
targetPort: 27017
nodePort: 30110
nodePort: 30111
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: community-detection-db
name: proactive-community-detection-db
spec:
replicas: 1
selector:
matchLabels:
app: community-detection-db
app: proactive-community-detection-db
template:
metadata:
labels:
app: community-detection-db
app: proactive-community-detection-db
spec:
containers:
- name: community-detection-db
- name: proactive-community-detection-db
image: mongo
env:
- name: MONGO_INITDB_ROOT_USERNAME
......
......@@ -5,12 +5,16 @@ 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
# https://www.aptible.com/documentation/faq/deploy/dockerfile-caching/pip-dockerfile-caching.html
COPY src/data-hub/role-stage-discovery-microservice/app/requirements.txt /app/
RUN pip install -r requirements.txt
COPY src/modules/ /app/
COPY src/data-hub/role-stage-discovery-microservice/app/ /app/
RUN chmod a+x main.py
......
# add modules folder to interpreter path
import sys
import os
modules_path = '../../../modules/'
if os.path.exists(modules_path):
sys.path.insert(1, modules_path)
### init logging ###
import logging
LOG_FORMAT = ('%(levelname) -5s %(asctime)s %(name)s:%(funcName) -35s %(lineno) -5d: %(message)s')
logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)
LOGGER = logging.getLogger(__name__)
#############################
import connexion
# load swagger config
# 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 role-discovery-microservice!'
return 'Endpoint of role-stage-discovery-microservice!'
# start app
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000, debug=True)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000, debug=True)
apiVersion: v1
kind: Service
metadata:
name: role-discovery
name: role-stage-discovery
spec:
type: LoadBalancer
selector:
app: role-discovery
app: role-stage-discovery
ports:
- name: http
port: 80
targetPort: 5000
nodePort: 30102
nodePort: 30103
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: role-discovery
name: role-stage-discovery
spec:
replicas: 1
selector:
matchLabels:
app: role-discovery
app: role-stage-discovery
template:
metadata:
labels:
app: role-discovery
app: role-stage-discovery
spec:
containers:
- name: role-discovery
image: alexx882/role-discovery-microservice
image: alexx882/role-stage-discovery-microservice
ports:
- containerPort: 5000
\ No newline at end of file
- containerPort: 5000
---
# todo change DB name!
apiVersion: v1
kind: Service
metadata:
name: community-detection-db
spec:
type: LoadBalancer
selector:
app: community-detection-db
ports:
- name: http
port: 27017
targetPort: 27017
nodePort: 30110
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: community-detection-db
spec:
replicas: 1
selector:
matchLabels:
app: community-detection-db
template:
metadata:
labels:
app: community-detection-db
spec:
containers:
- name: community-detection-db
image: mongo
env:
- name: MONGO_INITDB_ROOT_USERNAME
value: root
- name: MONGO_INITDB_ROOT_PASSWORD
value: root
ports:
- containerPort: 27017
\ 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