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

Feature: Sync annotator code with NCBO code #27

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
09a6db6
Update branch specifier to develop
jvendetti Mar 7, 2022
4e599cf
remove deprecated ncbo_resource_index
alexskr Mar 10, 2022
25ee301
update ruby v2.6 -> 2.7
alexskr Mar 25, 2022
76b55c3
ruby v2.7, bundler optimization - v2.3
alexskr Mar 31, 2022
7ec0456
Merge branch 'remove_ncbo_resource_index' into develop
jvendetti Apr 18, 2022
08732ff
Reset branch specifier to develop
jvendetti Apr 18, 2022
5bdb6ee
Update Gemfile.lock
jvendetti Apr 18, 2022
73d7fb7
Reconcile divergent branches
jvendetti Apr 18, 2022
84114f9
Update Gemfile.lock
jvendetti Apr 18, 2022
76d5e4a
Add Linux platform
jvendetti Apr 19, 2022
532f896
Update Gemfile.lock
jvendetti Apr 19, 2022
54c1e3a
Fix - deprecation warning for pipelining commands on a Redis instance
alexskr Jun 29, 2022
521c4f7
Remove duplicated line
alexskr Jun 29, 2022
00d04b4
Merge pull request #24 from ncbo/fix_redis_pipeline_deprecation_notice
mdorf Jul 5, 2022
d053a08
Restore branch specifier to master
jvendetti Jul 14, 2022
ed325ae
Update Gemfile.lock
jvendetti Jul 18, 2022
5bf8165
Bump tzinfo from 0.3.60 to 0.3.61
dependabot[bot] Jul 21, 2022
71d41e3
Merge pull request #25 from ncbo/dependabot/bundler/tzinfo-0.3.61
jvendetti Jul 28, 2022
bad8c64
Reset branch specifier to develop
jvendetti Jul 28, 2022
75d1a8f
Gemfile.lock update
mdorf Nov 3, 2022
0d5a4d8
Gemfile.lock update
mdorf Jan 31, 2023
f5484f7
Gemfile.lock update
mdorf Jan 31, 2023
9546713
Merge staging for release
mdorf Feb 1, 2023
6bb32f1
Gemfile had references to develop branch
mdorf Feb 1, 2023
fa8fc96
Gemfile.lock update
mdorf Feb 1, 2023
f1da45b
Allow setting ruby version in the docker-compose file
alexskr Feb 1, 2023
d77efb1
Add codecov reporting
alexskr Feb 1, 2023
2ee3915
fixed a failing unit test, test_annotate_minsize_term
mdorf Feb 1, 2023
7d870ea
Merge staging for release
mdorf Feb 1, 2023
964f068
Gemfile.lock update
mdorf Feb 1, 2023
88cc449
Set mgrep default port to 55556
alexskr Feb 18, 2023
276973b
gem version update
alexskr Feb 18, 2023
a8999d3
fixed #26 - annotator cache generation failure - Unsupported command …
mdorf May 4, 2023
3a3ba4e
Merge branch 'develop' of github.com:ncbo/ncbo_annotator into develop
mdorf May 4, 2023
9fd2649
Gemfile.lock update
mdorf May 4, 2023
3ae6bfb
bundle update
alexskr Jul 17, 2023
f4aa1c3
Merge branch 'develop'
alexskr Jul 17, 2023
067104a
Gemfile.lock update
mdorf Sep 7, 2023
ac11b22
Merge staging for release
mdorf Sep 7, 2023
04226ac
Gemfile.lock update
mdorf Sep 8, 2023
4f4361e
Gemfile.lock update
mdorf Nov 2, 2023
ebbb7a3
Gemfile.lock update
mdorf Nov 2, 2023
c72bbfe
resolved an issue with the Recommender query in AllegroGraph
mdorf Dec 15, 2023
1170a94
Merge branch 'develop'
alexskr Dec 15, 2023
d7ee808
an improved fix to ncbo/ncbo_ontology_recommender#21
mdorf Dec 15, 2023
944af97
Add AllegroGraph backend to unit test matrix
alexskr Dec 20, 2023
354b388
minitest style change for troubleshooting purposes
alexskr Dec 20, 2023
1462e2f
Merge pull request #30 from ncbo/allegrograph_unit_tests
alexskr Dec 20, 2023
9a037b9
Gemfile.lock update
mdorf Jan 10, 2024
f60341e
Gemfile.lock update
alexskr Jan 12, 2024
63c9868
Merge branch 'develop'
alexskr Jan 12, 2024
2d2c3af
Merge branch 'master' into sync-ncbo
syphax-bouazzouni Feb 28, 2024
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
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Git
.bundle
.git
.gitignore
.github
.DS_Store
vendor/bundle
# Logs
log/*
# Temp files
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/ruby-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,25 @@ on:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
backend: ['ruby', 'ruby-agraph'] # api runs tests with 4store backend and api-agraph runs with AllegroGraph backend
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: copy config file
run: cp config/config.rb.test config/config.rb
run: cp config/config.test.rb config/config.rb
- name: Build docker-compose
run: docker-compose build
- name: Run unit tests
run: docker-compose up --exit-code-from unit-test
# unit tests are run inside a container
# http://docs.codecov.io/docs/testing-with-docker
run: |
ci_env=`bash <(curl -s https://codecov.io/env)`
docker-compose run $ci_env -e CI ${{ matrix.backend }} bundle exec rake test TESTOPTS='-v'
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
flags: unittests
verbose: true
fail_ci_if_error: false # optional (default = false)
20 changes: 16 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
FROM ruby:2.6
ARG RUBY_VERSION
ARG DISTRO_NAME=bullseye

FROM ruby:$RUBY_VERSION-$DISTRO_NAME

RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \
openjdk-11-jre-headless \
raptor2-utils \
&& rm -rf /var/lib/apt/lists/*

RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends openjdk-11-jre-headless raptor2-utils
# The Gemfile Caching Trick
RUN mkdir -p /srv/ontoportal/ncbo_annotator
COPY Gemfile* /srv/ontoportal/ncbo_annotator/
COPY *.gemspec Gemfile* /srv/ontoportal/ncbo_annotator/

WORKDIR /srv/ontoportal/ncbo_annotator
RUN gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)"

# set bundler to v2.4.22 which is the last version supported by ruby 2.7
RUN gem install bundler -v 2.4.22
ENV BUNDLE_PATH /bundle
RUN bundle install
COPY . /srv/ontoportal/ncbo_annotator
CMD ["/bin/bash"]
14 changes: 8 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
source 'https://rubygems.org'

gem 'cube-ruby', require: 'cube'
gem 'cube-ruby'
gem 'faraday', '~> 1.9'
gem 'ffi'
gem 'minitest', '~> 4.0'
gem 'oj', '~> 2.0'
gem 'oj', '~> 3.0'
gem 'rake', '~> 10.0'
gem 'redis'
gem 'ruby-xxHash'

# Development
gem 'pry', group: :development
group :development do
gem 'minitest', '~> 4.0'
gem 'pry'
gem 'simplecov'
gem 'simplecov-cobertura' # for codecov.io
end

# NCBO gems (can be from a local dev path or from rubygems/git)
gem 'goo', github: 'ontoportal-lirmm/goo', branch: 'development'
gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'master'
gem 'ontologies_linked_data', github: 'ontoportal-lirmm/ontologies_linked_data', branch: 'development'
gem 'ncbo_resource_index', github: 'ncbo/resource_index'
131 changes: 66 additions & 65 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
GIT
remote: https://github.com/ncbo/resource_index.git
revision: 24a7f14a6da4f4a0eaba1016ca5a378dfccd7441
specs:
ncbo_resource_index (0.0.1)
elasticsearch (= 2.0.0)
mysql2 (= 0.5.2)
pony
ref
ruby-xxHash
sequel
typhoeus

GIT
remote: https://github.com/ncbo/sparql-client.git
remote: https://github.com/ontoportal-lirmm/sparql-client.git
revision: fb4a89b420f8eb6dda5190a126b6c62e32c4c0c9
branch: master
specs:
Expand All @@ -27,14 +14,13 @@ GIT
branch: development
specs:
goo (0.0.2)
addressable (= 2.3.5)
addressable (~> 2.8)
pry
rdf (= 1.0.8)
redis
rest-client
rsolr
sparql-client
systemu
uuid

GIT
Expand All @@ -49,7 +35,6 @@ GIT
json
libxml-ruby
multi_json
ncbo_resource_index
oj
omni_logger
pony
Expand All @@ -67,25 +52,19 @@ GEM
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
addressable (2.3.5)
bcrypt (3.1.17)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
bcrypt (3.1.20)
bigdecimal (3.1.5)
builder (3.2.4)
coderay (1.1.3)
concurrent-ruby (1.1.10)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
cube-ruby (0.0.3)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
elasticsearch (2.0.0)
elasticsearch-api (= 2.0.0)
elasticsearch-transport (= 2.0.0)
elasticsearch-api (2.0.0)
multi_json
elasticsearch-transport (2.0.0)
faraday
multi_json
ethon (0.15.0)
ffi (>= 1.15.0)
faraday (1.10.0)
date (3.3.4)
docile (1.4.0)
domain_name (0.6.20240107)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
Expand All @@ -101,94 +80,116 @@ GEM
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.3)
multipart-post (>= 1.2, < 3)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
ffi (1.15.5)
ffi (1.16.3)
http-accept (1.7.0)
http-cookie (1.0.4)
http-cookie (1.0.5)
domain_name (~> 0.5)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
json (2.6.1)
json_pure (2.6.1)
libxml-ruby (3.2.2)
logger (1.5.1)
json (2.7.1)
json_pure (2.7.1)
libxml-ruby (5.0.2)
logger (1.6.0)
macaddr (1.7.2)
systemu (~> 2.6.5)
mail (2.7.1)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
method_source (1.0.0)
mime-types (3.4.1)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2022.0105)
mini_mime (1.1.2)
mime-types-data (3.2023.1205)
mini_mime (1.1.5)
minitest (4.7.5)
multi_json (1.15.0)
multipart-post (2.1.1)
mysql2 (0.5.2)
multipart-post (2.3.0)
net-http-persistent (2.9.4)
net-imap (0.4.9.1)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
timeout
net-smtp (0.4.0.1)
net-protocol
netrc (0.11.0)
oj (2.18.5)
oj (3.16.3)
bigdecimal (>= 3.0)
omni_logger (0.1.4)
logger
pony (1.13.1)
mail (>= 2.0)
pry (0.14.1)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
rack (2.2.3)
rack-test (1.1.0)
rack (>= 1.0, < 3)
public_suffix (5.0.4)
rack (3.0.8)
rack-test (2.1.0)
rack (>= 1.3)
rake (10.5.0)
rdf (1.0.8)
addressable (>= 2.2)
redis (4.6.0)
ref (2.0.0)
redis (5.0.8)
redis-client (>= 0.17.0)
redis-client (0.19.1)
connection_pool
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.6)
rsolr (2.5.0)
builder (>= 2.1.2)
faraday (>= 0.9, < 3, != 2.0.0)
ruby-xxHash (0.4.0.2)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
sequel (5.56.0)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-cobertura (2.1.0)
rexml
simplecov (~> 0.19)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
systemu (2.6.5)
thread_safe (0.3.6)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (0.3.60)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.1)
timeout (0.4.1)
tzinfo (0.3.62)
uuid (2.3.9)
macaddr (~> 1.0)

PLATFORMS
x86_64-darwin-21
ruby
x86_64-linux

DEPENDENCIES
cube-ruby
faraday (~> 1.9)
ffi
goo!
minitest (~> 4.0)
ncbo_resource_index!
oj (~> 2.0)
oj (~> 3.0)
ontologies_linked_data!
pry
rake (~> 10.0)
redis
ruby-xxHash
simplecov
simplecov-cobertura
sparql-client!

BUNDLED WITH
2.3.7
2.4.22
29 changes: 0 additions & 29 deletions config/config.rb.test

This file was deleted.

36 changes: 36 additions & 0 deletions config/config.test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# frozen_string_literal: true

#
# configuration for unit testing
#
GOO_HOST = ENV.include?('GOO_HOST') ? ENV['GOO_HOST'] : 'localhost'
GOO_PORT = ENV.include?('GOO_PORT') ? ENV['GOO_PORT'] : 9000
GOO_BACKEND_NAME = ENV.include?("GOO_BACKEND_NAME") ? ENV["GOO_BACKEND_NAME"] : "4store"
GOO_PATH_QUERY = ENV.include?("GOO_PATH_QUERY") ? ENV["GOO_PATH_QUERY"] : "/sparql/"
GOO_PATH_DATA = ENV.include?("GOO_PATH_DATA") ? ENV["GOO_PATH_DATA"] : "/data/"
GOO_PATH_UPDATE = ENV.include?("GOO_PATH_UPDATE") ? ENV["GOO_PATH_UPDATE"] : "/update/"
REDIS_HOST = ENV.include?('REDIS_HOST') ? ENV['REDIS_HOST'] : 'localhost'
REDIS_PORT = ENV.include?('REDIS_PORT') ? ENV['REDIS_PORT'] : 6379
MGREP_HOST = ENV.include?('MGREP_HOST') ? ENV['MGREP_HOST'] : 'localhost'
MGREP_PORT = ENV.include?('MGREP_PORT') ? ENV['MGREP_PORT'] : 55556
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/prop_search_core1"


LinkedData.config do |config|
config.goo_backend_name = GOO_BACKEND_NAME.to_s
config.goo_host = GOO_HOST.to_s
config.goo_port = GOO_PORT.to_i
config.goo_path_query = GOO_PATH_QUERY.to_s
config.goo_path_data = GOO_PATH_DATA.to_s
config.goo_path_update = GOO_PATH_UPDATE.to_s
config.search_server_url = SOLR_TERM_SEARCH_URL.to_s
config.property_search_server_url = SOLR_PROP_SEARCH_URL.to_s
end
Annotator.config do |config|
config.mgrep_host = MGREP_HOST.to_s
config.mgrep_port = MGREP_PORT.to_i
config.mgrep_dictionary_file = './test/data/dictionary.txt'
config.annotator_redis_host = REDIS_HOST.to_s
config.annotator_redis_port = REDIS_PORT.to_i
end
Loading
Loading