Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changes to make it easier to get started developing
- Loading branch information
Showing
6 changed files
with
149 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,43 @@ | ||
# Development Notes | ||
|
||
## Run development tasks | ||
## Developing | ||
|
||
In order to run in the appropriate development environment, you need to run | ||
the following from the top-level directory with the docker-compose.yml file. | ||
This bel_operations docker instance includes all of the python modules needed | ||
for the main bel_api instance as well as additional python development modules | ||
such as py.test | ||
After going through the setup. You will be able to edit the bel and belapi code and see | ||
the changes made to the docker containers immediately. The belapi code is volume mounted | ||
into the /app directory of the docker container. The bel code is volume mounted into the | ||
python 3.6 package location for the install bel package. | ||
|
||
## Setup | ||
|
||
docker-compose run bel_operations | ||
To get started: | ||
|
||
This will start a docker container with a python environment setup for testing, etc. | ||
bash <(curl -s https://raw.githubusercontent.com/belbio/bel_api/master/bin/setup_dev.sh) | ||
|
||
You may want to add the following to your .bash_aliases file | ||
Review configuration in the .env file and the conf directory files | ||
|
||
alias belops="docker-compose run bel_operations" | ||
Run: | ||
|
||
You can now run tests inside the bel_operations instance: | ||
docker-compose up -d | ||
|
||
## Docker info | ||
|
||
# Follows logs for the belapi service | ||
docker-compose logs -f bb_belapi | ||
|
||
Services: | ||
bb_belapi - provides BEL API endpoint | ||
bb_elasticsearch - used for terminology searches/term completion | ||
bb_arangodb - [graph] database for terms, orthologies, etc | ||
bb_celery_worker - queue/batch processing manager | ||
bb_flower - Web GUI for celery | ||
bb_rabbitmq - Message broker used for queues by celery | ||
bb_traefik - reverse proxy to provide access to the docker services | ||
|
||
## Misc | ||
|
||
This will start docker containers needed to run everything. | ||
|
||
To make life easier on Macs using local DNS dev domains: https://medium.com/@williamhayes/local-dev-on-docker-fun-with-dns-85ca7d701f0a | ||
|
||
./bin/runtests | ||
|
||
The bel_operations prompt will look like `api@<container_id>:/app$` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
URLROOT=https://raw.githubusercontent.com/belbio/bel_api/master | ||
|
||
# Create directories | ||
mkdir conf | ||
mkdir bel_specifications | ||
|
||
# Clone repos | ||
git clone git@github.com:belbio/bel_api.git belapi | ||
git clone git@github.com:belbio/bel.git | ||
|
||
# Set up configuration | ||
curl ${URLROOT}/conf/dotenv.sample -o .env | ||
curl ${URLROOT}/conf/belbio_conf.yml.sample -o conf/belbio_conf.yml | ||
curl ${URLROOT}/conf/elasticsearch.yml -o conf/elasticsearch.yml | ||
touch conf/belbio_secrets.yml | ||
|
||
curl ${URLROOT}/docker-compose.dev.yml -o docker-compose.yml | ||
|
||
docker network create belbio | ||
|
||
echo "Run following command to start belapi" | ||
echo " docker-compose up -d" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# belbio secrets - added to config['secrets'] | ||
|
||
# Location of this file can be found in one of the following locations | ||
# first found is the one that is used | ||
# - ./belbio_secrets.yml (just a regular file in the local directory or any parent directory) | ||
# - ~/.belbio_secrets (a dotfile in the home directory) | ||
|
||
|
||
bel_api: | ||
shared_secret: xxx # shared secret to validate JWT token | ||
servers: | ||
arangodb_password: '' | ||
mail: | ||
api_key: xxx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
BS_SERVER_MODE=DEV | ||
SERVICES_HOST_NAME=dev.belbio.test | ||
SERVER_MODE=DEV | ||
BELBIO_CONF=/belbio | ||
# GITHUB_ACCESS_TOKEN= | ||
ARANGO_USER=root | ||
ARANGO_PASSWD=root | ||
JWT_SECRET=testing | ||
RABBITMQ_USER=admin | ||
RABBITMQ_PASSWD=admin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters