Skip to content

Commit c87a839

Browse files
committed
Updated apk, pip deps and usage of arango lib because version drift led to ossification
1 parent 0ebd60d commit c87a839

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

web/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ WORKDIR /data/
33
RUN pip install --no-cache-dir pip==18.0
44
RUN pip install --no-cache-dir pipenv
55
COPY src/Pipfile Pipfile
6-
RUN apk add --no-cache --virtual .build-deps gcc musl-dev
6+
RUN apk add --no-cache --virtual .build-deps gcc file make musl-dev libffi-dev libevent-dev
77
RUN pipenv --three install
88
RUN apk del .build-deps gcc musl-dev
99
COPY src/ .

web/src/Pipfile

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ python-arango = "*"
1212
flask-wtf = "*"
1313
elasticsearch = "*"
1414
gevent = "*"
15+
email_validator = "*"
1516

1617

1718
[dev-packages]

web/src/web/views.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
from . import forms
2626
from . import app
2727

28+
ARANGO_PORT = 8529
29+
2830
@app.route('/')
2931
def index():
3032
return flask.render_template('index.html')
@@ -959,7 +961,7 @@ def map_datapath_calculation_single(name, description, equation, author, InCalcu
959961
calc_result_doc = check_collection_fields('DataPath', check_fields, calc_result)
960962
if calc_result_doc is not None:
961963
calculation_result_ids.add(calc_result_doc.next()['_id'])
962-
client = ArangoClient(protocol='http', host='dbms')
964+
client = ArangoClient(hosts='http://dbms:{}'.format(ARANGO_PORT))
963965
db = client.db('tdm', username='root', password='tdm')
964966
calculation_collection = db.collection('Calculation')
965967
calculation_exists = calculation_collection.find({'name': name})
@@ -1032,7 +1034,7 @@ def map_datapath_single_by_key(basepath_key, matchpath_key, author, weight, anno
10321034
matchpath = fetch_datapath(matchpath_key)
10331035
if not matchpath:
10341036
raise Exception('Specified matching DataPath not found!')
1035-
client = ArangoClient(protocol='http', host='dbms')
1037+
client = ArangoClient(hosts='http://dbms:{}'.format(ARANGO_PORT))
10361038
db = client.db('tdm', username='root', password='tdm')
10371039
datapath_matches = db.collection('DataPathMatch')
10381040
datapath_match_exist = datapath_matches.find({'_from': basepath['_id'], '_to': matchpath['_id']})
@@ -1057,7 +1059,7 @@ def map_datapath_single_by_key(basepath_key, matchpath_key, author, weight, anno
10571059

10581060
def check_collection_fields(collection, fields, value, return_single=True, db=None):
10591061
if db is None:
1060-
client = ArangoClient(protocol='http', host='dbms')
1062+
client = ArangoClient(hosts='http://dbms:{}'.format(ARANGO_PORT))
10611063
db = client.db('tdm', username='root', password='tdm')
10621064
collection_ref = db.collection(collection)
10631065
return_val = None
@@ -1077,7 +1079,7 @@ def check_collection_fields(collection, fields, value, return_single=True, db=No
10771079

10781080
def add_mapping(edge_collection, from_id, to_id, body=None, check_bidirectional=True, db=None):
10791081
if db is None:
1080-
client = ArangoClient(protocol='http', host='dbms')
1082+
client = ArangoClient(hosts='http://dbms:{}'.format(ARANGO_PORT))
10811083
db = client.db('tdm', username='root', password='tdm')
10821084
collection_ref = db.collection(edge_collection)
10831085
mapping = collection_ref.find({'_from': from_id, '_to': to_id})
@@ -1221,7 +1223,7 @@ def fetch_dump_mappings():
12211223

12221224
def query_db(query, bind_vars=None, unlist=True):
12231225
"""Generically query database."""
1224-
client = ArangoClient(protocol='http', host='dbms')
1226+
client = ArangoClient(hosts='http://dbms:{}'.format(ARANGO_PORT))
12251227
db = client.db('tdm', username='root',password='tdm')
12261228
cursor = db.aql.execute(query, bind_vars=bind_vars)
12271229
# TODO: Pass as generator instead of fill array

0 commit comments

Comments
 (0)