Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
a89f5913
Commit
a89f5913
authored
Jul 23, 2019
by
Alexander Lercher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Trace Retrieval microservice
parents
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
177 additions
and
0 deletions
+177
-0
.gitignore
.gitignore
+1
-0
Dockerfile
trace-retrieval-microservice/Dockerfile
+18
-0
README.md
trace-retrieval-microservice/README.md
+10
-0
blockchain_trace.py
trace-retrieval-microservice/app/blockchain_trace.py
+5
-0
swagger.yml
trace-retrieval-microservice/app/configs/swagger.yml
+82
-0
debug.py
trace-retrieval-microservice/app/debug.py
+7
-0
main.py
trace-retrieval-microservice/app/main.py
+13
-0
deployment.yml
trace-retrieval-microservice/deployment/deployment.yml
+22
-0
loadbalancer.yml
trace-retrieval-microservice/deployment/loadbalancer.yml
+19
-0
No files found.
.gitignore
0 → 100644
View file @
a89f5913
**/__pycache__
trace-retrieval-microservice/Dockerfile
0 → 100644
View file @
a89f5913
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
app/ /app/
RUN
chmod
a+x main.py
CMD
["python", "./main.py"]
\ No newline at end of file
trace-retrieval-microservice/README.md
0 → 100644
View file @
a89f5913
# Trace Retrieval Microservice
The trace retrieval microservice is used as an interface to the blockchain component (TIC). It receives and preprocesses all available traces.
## Technologies
-
Python 3.x
-
Python module Flask
-
Python module Connexion with Swagger
-
Docker
-
Kubernetes
\ No newline at end of file
trace-retrieval-microservice/app/blockchain_trace.py
0 → 100644
View file @
a89f5913
from
flask
import
request
,
Response
def
receive
():
# print(request.json)
return
Response
(
status
=
201
)
trace-retrieval-microservice/app/configs/swagger.yml
0 → 100644
View file @
a89f5913
swagger
:
"
2.0"
info
:
title
:
Trace Retrieval microservice
description
:
This is the documentation for the trace retrieval microservice.
version
:
"
1.0.0"
consumes
:
-
"
application/json"
produces
:
-
"
application/json"
basePath
:
"
/api"
# Paths supported by the server application
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"
/trace
:
post
:
operationId
:
"
blockchain_trace.receive"
tags
:
-
"
Blockchain
Trace"
summary
:
"
Add
a
new
blockchain
trace
to
SMART"
description
:
"
Receives
a
new
blockchain
trace
to
store
in
SMART."
parameters
:
-
in
:
body
name
:
"
BlockchainTrace"
description
:
"
The
trace
to
be
added"
required
:
true
schema
:
$ref
:
"
#/definitions/BlockchainTrace"
responses
:
201
:
description
:
"
Successful
operation"
400
:
description
:
"
Invalid
input"
definitions
:
BlockchainTrace
:
type
:
"
object"
properties
:
TransactionId
:
type
:
string
format
:
uuid
Timestamp
:
type
:
"
string"
format
:
"
date-time"
ApplicationType
:
type
:
"
string"
TransactionFrom
:
type
:
"
string"
format
:
"
uuid"
TransactionTo
:
type
:
"
string"
format
:
"
uuid"
TransferredAsset
:
type
:
"
string"
ResourceIds
:
type
:
"
string"
ResourceMd5
:
type
:
"
string"
ResourceState
:
type
:
"
string"
Metadata
:
type
:
"
string"
\ No newline at end of file
trace-retrieval-microservice/app/debug.py
0 → 100644
View file @
a89f5913
from
flask
import
request
def
echo
():
return
request
.
json
\ No newline at end of file
trace-retrieval-microservice/app/main.py
0 → 100644
View file @
a89f5913
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 trace-retrieval-microservice!'
# start app
if
__name__
==
'__main__'
:
app
.
run
(
host
=
'0.0.0.0'
,
port
=
5000
,
debug
=
True
)
trace-retrieval-microservice/deployment/deployment.yml
0 → 100644
View file @
a89f5913
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
name
:
trace-retrieval
spec
:
replicas
:
2
selector
:
matchLabels
:
app
:
trace-retrieval
template
:
metadata
:
labels
:
app
:
trace-retrieval
spec
:
containers
:
-
name
:
trace-retrieval
image
:
172.16.1.20:5000/trace-retrieval-microservice
ports
:
-
containerPort
:
5000
\ No newline at end of file
trace-retrieval-microservice/deployment/loadbalancer.yml
0 → 100644
View file @
a89f5913
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
trace-retrieval-endpoint
spec
:
type
:
LoadBalancer
externalIPs
:
-
143.205.173.36
selector
:
app
:
trace-retrieval
ports
:
-
name
:
http
port
:
80
targetPort
:
5000
nodePort
:
30001
protocol
:
TCP
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment