forked from ontoportal/ontoportal_docker
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/create-a-script-to-ontoportal-docker…
…-api-ui
- Loading branch information
Showing
10 changed files
with
148 additions
and
409 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,5 +1,7 @@ | ||
.env | ||
dip.override.yml | ||
/ontologies_linked_data/ | ||
/.idea/ | ||
|
||
|
||
.kamal/hooks/ |
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,74 +1,16 @@ | ||
# OntoPortal docker development environment | ||
|
||
This repo contains docker compose and [DIP](https://github.com/bibendi/dip) configuration for running and | ||
developing OntoPortal stack in 3 different ways: | ||
|
||
1. docker-compose.backend_only.yml contains just the backend services required for developing and running API on your local system. To take advantage of that you would need to run `docker compose -f docker-compose.backend_only.yml up -d` | ||
2. Run API/ncbo_cron and depenencies in docker using DIP | ||
3. Run API/ncbo_cron in docker with mounted source code volumes from your local system. This will allow editing files on your local machine while running code inside docker container. | ||
|
||
|
||
```sh | ||
# clone this repo | ||
git clone https://github.com/bioportal/ontoportal_docker.git | ||
|
||
# clone ontologies_linked_data repo which is needed for creating solr configsets | ||
git clone https://github.com/bioportal/ontologies_linked_data.git | ||
|
||
# generate configsets: | ||
cd ontologies_linked_data | ||
./test/solr/generate_ncbo_configsets.sh | ||
|
||
cd ../ontoportal_docker | ||
|
||
# install DIP | ||
bundle install | ||
|
||
# export bioportal APIKEY which is needed for importing ontologies from bioportal when provisioning | ||
cp .env.sample .env | ||
|
||
# run provisioning via dip | ||
dip provision | ||
# OntoPortal docker environment | ||
See help | ||
``` | ||
|
||
`dip provision` will: | ||
- clear existing volumes, i.e removing all data | ||
- create 4store kb | ||
- run ncbo_cron rake tasks for creating admin user acccount | ||
- run bin/ncbo_ontology_import script on ncbo_cron container to import STY | ||
ontology from bioportal | ||
- run ontology pull script | ||
- process STY ontology | ||
|
||
# DIP commands: | ||
|
||
list available dip commands | ||
|
||
`dip ls` | ||
|
||
starts api which you would be able to access on http://localhost:9393 | ||
|
||
`dip api rackup` | ||
|
||
run ncbo_cron scripts: | ||
|
||
`dip cron bundle exe bin/<script>` | ||
|
||
For example, to import new ontology from BioPortal, pull and process it you would run: | ||
```sh | ||
dip cron bundle exec bin/ncbo_ontology_import --from-apikey ${BP_APIKEY} -o PO --from https://data.bioontology.org --admin-user admin | ||
dip cron bundle exec bin/ncbo_ontology_pull -o PO | ||
dip cron bundle exec bin/ncbo_ontology_process -o PO | ||
./run -h | ||
``` | ||
|
||
# API Development | ||
|
||
When developing API it is possible to mount the source code from your local directory inside the container so that it runs your latest changes. To do that you need to make changes to dip.yml file and uncomment the line containing `# - docker-compose.dev.yml`. docker-compose.dev.yml contains overwrights to the docker-compose.yml which mounts your local directory. | ||
|
||
to install gems inside the API container you would need to run `dip api bundle install` or `dip api bundle update` to get newer gems | ||
to know how to run an ontoportal API docker instance | ||
|
||
to test your changes you would need to run `dip api test` | ||
|
||
# AllegroGraph | ||
``` | ||
Usage: ./run [-k API_KEY] [-u API_URL] [-r IMAGE_REPOSITORY] [-t IMAGE_TAG] [-s STARTER_ONTOLOGY] [--no-provision] | ||
``` | ||
|
||
Ontoportal has support for running AllegroGraph as triple store backend. To change default 4store triple store to AllgegroGraph you would need to rename dip.override.yml.sample to dip.override.yml | ||
Example | ||
```bash | ||
./run -k <apikey>-r agroportal -t master -s STY -u "https://data.bioontology.org" | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.