Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
elixir
beacon
Commits
7e4529ed
Commit
7e4529ed
authored
Jun 14, 2019
by
Jacek Lebioda
Browse files
Improving Dockerfile
parent
b89e653b
Pipeline
#10737
passed with stage
in 1 minute and 5 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
7e4529ed
...
...
@@ -12,8 +12,7 @@ COPY code/backend/requirements.txt /home/beacon/elixir-beacon/
WORKDIR
/home/beacon/elixir-beacon
RUN
pip3
install
--default-timeout
=
60
-i
https://pypi.lcsb.uni.lu/simple
-r
requirements.txt
# Build front-end files
COPY
code/frontend/* /home/beacon/elixir-beacon/code/frontend/
RUN
ls
-laR
/home/beacon/elixir-beacon/code/frontend
COPY
code/frontend/ /home/beacon/elixir-beacon/code/frontend/
WORKDIR
/home/beacon/elixir-beacon/code/frontend
RUN
yarn
install
&&
\
node node_modules/gulp/bin/gulp.js
...
...
code/backend/beacon/beacon.py
View file @
7e4529ed
...
...
@@ -30,6 +30,15 @@ class Beacon(object):
info_for_user
=
self
.
datasources_manager
.
update_authorization_info
(
info
,
user_groups
)
return
info_for_user
def
shutdown
(
self
,
signum
,
frame
):
"""
Closes the opened connections.
Warning - closes only stateful connections, it does nothing to stateless ones.
For the optional parameters, see https://docs.python.org/3.9/library/signal.html#example
"""
logger
.
debug
(
' Received SIGINT or SIGTERM signal, disconnecting stateful data sources'
)
self
.
datasources_manager
.
disconnect_data_sources
()
def
handle_include_dataset_responses
(
self
,
response
:
List
[
dict
],
responses
,
flag
:
str
):
flag
=
flag
.
upper
()
...
...
code/backend/beacon/datasources/manager.py
View file @
7e4529ed
...
...
@@ -21,14 +21,23 @@ class DataSourcesManager:
self
.
datasets
=
[]
self
.
declared_connectors
=
[]
self
.
unparsed_structure
=
{}
self
.
connected
=
False
self
.
validator
=
DataSourcesValidator
()
def
reset
(
self
):
self
.
disconnect_data_sources
()
self
.
sources
=
{}
self
.
data_sources
=
{}
self
.
declared_connectors
=
[]
self
.
unparsed_structure
=
{}
def
disconnect_data_sources
(
self
):
if
not
self
.
connected
:
return
for
data_source
in
self
.
data_sources
:
data_source
.
disconnect
()
self
.
connected
=
False
def
load_data_sources_information_from_yaml_file
(
self
,
path_to_yaml_file
:
str
):
self
.
reset
()
self
.
unparsed_structure
=
load_yaml_file
(
path_to_yaml_file
)
...
...
@@ -47,6 +56,7 @@ class DataSourcesManager:
def
initialize_data_sources
(
self
,
data_sources
:
List
[
dict
]):
for
data_source
in
data_sources
:
self
.
initialize_data_source
(
data_source
)
self
.
connected
=
True
def
initialize_data_source
(
self
,
data_source
:
dict
):
new_data_source_id
=
data_source
.
get
(
'id'
)
...
...
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