Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sources api #19

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4336620
refactor sources (WIP)
bielr May 15, 2019
f420b75
upgrade all requirements and container to python 3.7
bielr May 15, 2019
afbdc15
missing docker-compose.yml from previous commit
bielr May 23, 2019
dce052f
stringdb sources API bugfixing, working
bielr May 23, 2019
cfe51ad
correctly set column names for stringdb network queries (PSQL)
bielr May 23, 2019
d869005
update Sources API GO route
bielr May 27, 2019
cd84731
split sources from server to libs
bielr Jun 5, 2019
2599497
guard a few optional asynccontextmanager imports (not available in py…
bielr Jun 5, 2019
8b0e1d9
delete leftover file after rebase
bielr Jun 6, 2019
ff93e3a
dev/prod docker-compose and environment files
bielr Jul 29, 2019
7239eea
remove ppi-sources from index (moved to separate repository: biocom-u…
bielr Jul 29, 2019
ef64232
add ppi-sources as git submodule
bielr Jul 29, 2019
2f920c3
Merge branch 'dev-prod' into sources-api
bielr Jul 29, 2019
c7b6851
fix scores/functional.py bug introduced in 3929c6e1208c3670f7b8
bielr Jun 23, 2020
ee2b4ce
update libs
bielr Jun 23, 2020
501ba4a
ignore prod.env
bielr Jun 23, 2020
3589cae
remove mysql as we have the better sources api now
bielr Jun 23, 2020
5519ead
update ppi-sources (fixes spinal)
bielr Jun 23, 2020
935b15a
remove unused function, clean whitespace and add timeouts
bielr Jun 23, 2020
3dd27f6
remove (now unused) mysql-initdb.d and scripts/update_mysql.py
bielr Jun 23, 2020
b3f7805
Update requirements & docker image
bielr Mar 15, 2021
67b8784
truncate long log line in main.py
bielr Mar 17, 2021
d2f3163
update ppi-sources
bielr Mar 17, 2021
419a9ab
add restart: unless-stopped to docker-compose.yml
bielr Apr 19, 2021
8d79565
always report fc data, update the mongo backend
bielr Apr 8, 2022
2ecc87c
update ppi-sources and silence annoying mongodb output
bielr Apr 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ celerybeat-schedule

# dotenv
.env
prod.env

# virtualenv
.venv
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "libs/stringdb-tools"]
path = libs/stringdb-tools
url = https://github.com/bielr/stringdb-tools.git
[submodule "libs/ppi-sources"]
path = libs/ppi-sources
url = https://github.com/biocom-uib/ppi-sources
11 changes: 11 additions & 0 deletions dev.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CELERY_BROKER_URL=amqp://util-aligner:util-aligner@rabbitmq:5672//
CELERY_TASK_TIME_LIMIT=
SERVER_ALIGNER_CONCURRENCY=1

FINISHED_ALIGNMENT_URL=http://util-aligner-api/v2/finished-alignment
FINISHED_COMPARISON_URL=http://util-aligner-api/v2/finished-comparison

RABBITMQ_DEFAULT_USER=util-aligner
RABBITMQ_DEFAULT_PASS=util-aligner

SOURCES_API_URL=http://ltimbigd2.uib.es:11080/
24 changes: 24 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: '3'

services:
server-aligner:
env_file:
- dev.env
networks:
- util-aligner-net

server-comparer:
env_file:
- dev.env
networks:
- util-aligner-net

rabbitmq:
env_file:
- dev.env
networks:
- util-aligner-net

networks:
util-aligner-net:
external: true
30 changes: 30 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: '3'

services:
server-aligner:
env_file:
- prod.env
networks:
- sources-net


server-comparer:
env_file:
- prod.env
networks:
- sources-net

rabbitmq:
env_file:
- prod.env
ports:
- 15672:15672
- 5672:5672

mongo:
ports:
- 27017:27017

networks:
sources-net:
external: true
202 changes: 80 additions & 122 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,137 +1,95 @@
version: '3'

services:
server-aligner:
build:
context: .
dockerfile: ./docker/Dockerfile
depends_on:
- rabbitmq
- mysql
- mongo
command:
- celery
- -A
- server_queue
- worker
- -Q
- server_aligner
- -l
- info
- -c
- "8"
volumes:
- .:/opt/:rw
environment:
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
- CELERY_TASK_DEFAULT_QUEUE=server_aligner
- CELERY_TASK_TIME_LIMIT=
- FINISHED_ALIGNMENT_URL=${FINISHED_ALIGNMENT_URL}
- FINISHED_COMPARISON_URL=${FINISHED_COMPARISON_URL}
networks:
server-net:
ipv4_address: 172.20.0.2
aliases: [server]
stringdb-net:
geneontology-net:
server-aligner:
image: bielr/util-aligner-server:0.2
restart: unless-stopped
build:
context: ./docker
dockerfile: ./Dockerfile
depends_on:
- rabbitmq
- mongo
command:
- celery
- -A
- server_queue
- worker
- -Q
- server_aligner
- -l
- info
- -c
- "${SERVER_ALIGNER_CONCURRENCY:?SERVER_ALIGNER_CONCURRENCY not set in .env}"
volumes:
- .:/opt/:rw
environment:
- CELERY_TASK_DEFAULT_QUEUE=server_aligner
networks:
server-net:
ipv4_address: 172.20.0.2
aliases: [server-aligner]

server-comparer:
build:
context: .
dockerfile: ./docker/Dockerfile
depends_on:
- rabbitmq
- mysql
- mongo
command:
- celery
- -A
- server_queue
- worker
- -Q
- server_comparer
- -l
- info
- -c
- "1"
volumes:
- .:/opt/:rw
environment:
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
- CELERY_TASK_DEFAULT_QUEUE=server_comparer
- CELERY_TASK_TIME_LIMIT=
- FINISHED_ALIGNMENT_URL=${FINISHED_ALIGNMENT_URL}
- FINISHED_COMPARISON_URL=${FINISHED_COMPARISON_URL}
networks:
server-net:
ipv4_address: 172.20.0.3
aliases: [server]
stringdb-net:
geneontology-net:
server-comparer:
image: bielr/util-aligner-server:0.2
restart: unless-stopped
# build:
# context: ./docker
# dockerfile: ./Dockerfile
depends_on:
- rabbitmq
- mongo
command:
- celery
- -A
- server_queue
- worker
- -Q
- server_comparer
- -l
- info
volumes:
- .:/opt/:rw
environment:
- CELERY_TASK_DEFAULT_QUEUE=server_comparer
networks:
server-net:
ipv4_address: 172.20.0.3
aliases: [server-comparer]

mysql:
image: mysql:5.7.17
ports:
- 3306:3306
command:
- --character-set-server=utf8
- --collation-server=utf8_unicode_ci
- --skip-character-set-client-handshake
- --bind-address=0.0.0.0
volumes:
- mysql-data:/var/lib/mysql
- ./dumps:/opt/dumps
- ./mysql-initdb.d:/docker-entrypoint-initdb.d:ro
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=protein_db
networks:
server-net:
ipv4_address: 172.20.0.4
aliases: [mysql]
rabbitmq:
image: rabbitmq:3-management-alpine
restart: unless-stopped
networks:
server-net:
ipv4_address: 172.20.0.5
aliases: [rabbitmq]

rabbitmq:
image: rabbitmq:3-management-alpine
ports:
- 15672:15672
- 5672:5672
environment:
- RABBITMQ_DEFAULT_USER
- RABBITMQ_DEFAULT_PASS
networks:
server-net:
ipv4_address: 172.20.0.5
aliases: [rabbitmq]

mongo:
image: mongo:latest
command:
- mongod
- --storageEngine=mmapv1
- --auth
- --bind_ip_all
security_opt:
- seccomp:seccomp_numa.json
ports:
- 27017:27017
volumes:
- mongo-data:/data/db
- ./mongo-initdb.d:/docker-entrypoint-initdb.d:ro
networks:
server-net:
ipv4_address: 172.20.0.6
aliases: [mongo]
mongo:
image: mongo:latest
restart: unless-stopped
command:
- mongod
- --storageEngine=wiredTiger
- --auth
- --bind_ip_all
- --logpath
- /var/log/mongodb/mongod.log
security_opt:
- seccomp:seccomp_numa.json
volumes:
- mongo-data:/data/db
- ./mongo-initdb.d:/docker-entrypoint-initdb.d:ro
networks:
server-net:
ipv4_address: 172.20.0.6
aliases: [mongo]

volumes:
mysql-data:
mongo-data:

networks:
server-net:
ipam:
config:
- subnet: 172.20.0.0/24
stringdb-net:
external: true
geneontology-net:
external: true
17 changes: 15 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
FROM bielr/util-aligner-server
FROM python:3.9

ARG APP_ENV=base

ENV APP_ENV=$APP_ENV
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive

COPY ./requirements /requirements
COPY ./r-requirements /r-requirements

RUN apt-get update && apt-get -y install tzdata
RUN ln -fs /usr/share/zoneinfo/Europe/Madrid /etc/localtime
RUN dpkg-reconfigure --frontend noninteractive tzdata

RUN apt-get update \
&& apt-get -y install build-essential libxml2-dev zlib1g-dev pkg-config libffi6 libffi-dev libssl-dev libcurl4-openssl-dev \
r-base gfortran \
libc6-i386 lib32stdc++6

RUN python3.9 -m pip install pip --upgrade
RUN python3.9 -m pip install wheel
RUN pip install -r /requirements/${APP_ENV}.txt

RUN Rscript --vanilla /r-requirements/${APP_ENV}.R

CMD ["bash"]

ENV PYTHONPATH /opt/server:/opt/libs/stringdb-tools/scripts:/opt/libs/geneontology-tools/scripts:/opt/libs/semantic-similarity

ENV PYTHONPATH /opt/server:/opt/libs/stringdb-tools/scripts:/opt/libs/geneontology-tools/scripts:/opt/libs/semantic-similarity:/opt/libs/ppi-sources
WORKDIR /opt

19 changes: 19 additions & 0 deletions docker/Dockerfile_cached
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM bielr/util-aligner-server

ARG APP_ENV=base

ENV APP_ENV=$APP_ENV
ENV PYTHONUNBUFFERED=1

COPY ./requirements /requirements
COPY ./r-requirements /r-requirements

RUN pip install -r /requirements/${APP_ENV}.txt

RUN Rscript --vanilla /r-requirements/${APP_ENV}.R

CMD ["bash"]

ENV PYTHONPATH /opt/server:/opt/libs/stringdb-tools/scripts:/opt/libs/geneontology-tools/scripts:/opt/libs/semantic-similarity:/opt/libs/ppi-sources
WORKDIR /opt

33 changes: 0 additions & 33 deletions docker/Dockerfile_old

This file was deleted.

2 changes: 1 addition & 1 deletion r-requirements/base.R → docker/r-requirements/base.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ install.packages('clue', verbose=TRUE)
install.packages('plyr', verbose=TRUE)
install.packages('lpSolveAPI', verbose=TRUE)
library(devtools)
install_github("adriaalcala/AligNet", build_vignettes=TRUE)
install_github("adriaalcala/AligNet", build_vignettes=FALSE)
Loading