Skip to content

Commit

Permalink
Feature: Update docker compose to add ncbo cron (#80)
Browse files Browse the repository at this point in the history
* update config.rb sample with the new SOLR configuration values

* add ncbo_cron service to the API docker compose file and sync the volumes beetween the two
  • Loading branch information
syphax-bouazzouni authored Jun 8, 2024
1 parent 3cc0045 commit cbf9fe7
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 26 deletions.
4 changes: 2 additions & 2 deletions config/environments/config.rb.sample
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ REDIS_PORT = ENV.include?("REDIS_PORT") ? ENV["REDIS_PORT"
REPORT_PATH = ENV.include?("REPORT_PATH") ? ENV["REPORT_PATH"] : "./test/ontologies_report.json"
REPOSITORY_FOLDER = ENV.include?("REPOSITORY_FOLDER") ? ENV["REPOSITORY_FOLDER"] : "./test/data/ontology_files/repo"
REST_URL_PREFIX = ENV.include?("REST_URL_PREFIX") ? ENV["REST_URL_PREFIX"] : ENV["API_URL"] || "http://localhost:9393"
SOLR_PROP_SEARCH_URL = ENV.include?("SOLR_PROP_SEARCH_URL") ? ENV["SOLR_PROP_SEARCH_URL"] : "http://localhost:8983/solr/prop_search_core1"
SOLR_TERM_SEARCH_URL = ENV.include?("SOLR_TERM_SEARCH_URL") ? ENV["SOLR_TERM_SEARCH_URL"] : "http://localhost:8983/solr/term_search_core1"
SOLR_PROP_SEARCH_URL = ENV.include?("SOLR_PROP_SEARCH_URL") ? ENV["SOLR_PROP_SEARCH_URL"] : "http://localhost:8983/solr"
SOLR_TERM_SEARCH_URL = ENV.include?("SOLR_TERM_SEARCH_URL") ? ENV["SOLR_TERM_SEARCH_URL"] : "http://localhost:8983/solr"

begin
# For prefLabel extract main_lang first, or anything if no main found.
Expand Down
79 changes: 55 additions & 24 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,25 @@ x-app: &app
environment: &env
# default bundle config resolves to /usr/local/bundle/config inside of the container
# we are setting it to local app directory if we need to use 'bundle config local'
BUNDLE_APP_CONFIG: /srv/ontoportal/ontologies_api/.bundle
BUNDLE_PATH: /srv/ontoportal/bundle
COVERAGE: 'true' # enable simplecov code coverage
REDIS_HOST: redis-ut
REDIS_PORT: 6379
SOLR_TERM_SEARCH_URL: http://solr-ut:8983/solr
SOLR_PROP_SEARCH_URL: http://solr-ut:8983/solr
GOO_BACKEND_NAME: 4store
GOO_PORT: 9000
GOO_HOST: 4store-ut
MGREP_HOST: mgrep-ut
MGREP_PORT: 55555
REPOSITORY_FOLDER: /srv/ontoportal/data/repository
REPORT_PATH: /srv/ontoportal/data/reports
MGREP_DICTIONARY_FILE: /srv/ontoportal/data/mgrep
stdin_open: true
tty: true
command: /bin/bash
volumes:
# bundle volume for hosting gems installed by bundle; it speeds up gem install in local development
- bundle:/srv/ontoportal/bundle
- .:/srv/ontoportal/ontologies_api
# mount directory containing development version of the gems if you need to use 'bundle config local'
#- /Users/alexskr/ontoportal:/Users/alexskr/ontoportal
depends_on: &depends_on
solr-prop-ut:
condition: service_healthy
solr-term-ut:
condition: service_healthy
redis-ut:
condition: service_healthy



services:
api:
Expand All @@ -34,21 +30,48 @@ services:
.env
environment:
<<: *env
GOO_BACKEND_NAME: 4store
GOO_PORT: 9000
GOO_HOST: 4store-ut
GOO_PATH_QUERY: /sparql/
GOO_PATH_DATA: /data/
GOO_PATH_UPDATE: /update/
BUNDLE_APP_CONFIG: /srv/ontoportal/ontologies_api/.bundle
profiles:
- 4store
depends_on:
- solr-ut
- redis-ut
- mgrep-ut
- 4store-ut
- ncbo_cron
ports:
- "9393:9393"
volumes:
# bundle volume for hosting gems installed by bundle; it speeds up gem install in local development
- bundle_api:/srv/ontoportal/bundle
- app_api:/srv/ontoportal/ontologies_api
- repository:/srv/ontoportal/data/repository

ncbo_cron:
<<: *app
image: agroportal/ncbo_cron:master
env_file:
.env
environment:
<<: *env
BUNDLE_APP_CONFIG: /srv/ontoportal/ncbo_cron/.bundle
command: "bundle exec bin/ncbo_cron"
profiles:
- 4store
volumes:
- bundle_api:/srv/ontoportal/bundle
- app_cron:/srv/ontoportal/ncbo_cron
- repository:/srv/ontoportal/data/repository
- history:/usr/local/hist
- reports:/srv/ontoportal/data/reports
- mgrep:/srv/ontoportal/data/mgrep
- logs:/srv/ontoportal/ncbo_cron/logs
depends_on:
- solr-ut
- redis-ut
- mgrep-ut
- 4store-ut


mgrep-ut:
image: ontoportal/mgrep-ncbo:0.1
Expand Down Expand Up @@ -84,8 +107,9 @@ services:
ports:
- 8983:8983
command: bin/solr start -cloud -f
# volumes:
#- solr_data:/var/solr/data
volumes:
- solr_data:/var/solr/data

agraph-ut:
image: franzinc/agraph:v8.1.0
platform: linux/amd64
Expand Down Expand Up @@ -152,7 +176,14 @@ services:
- gb

volumes:
bundle:
app_api:
bundle_api:
app_cron:
agdata:
4store:
#solr_data:
repository:
solr_data:
reports:
mgrep:
logs:
history:

0 comments on commit cbf9fe7

Please sign in to comment.