From b111a1d5b61d112ad6752f17d3ad94c9c3cf69db Mon Sep 17 00:00:00 2001 From: mdorf Date: Tue, 27 Feb 2024 16:09:40 -0800 Subject: [PATCH 01/11] Gemfile.lock update --- Gemfile.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 412e9f9b..681ff4e0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/ncbo/goo.git - revision: db2b330fb6c5fd4ea9ee17d5b58ca997f304a340 + revision: 4ad4db41216ab9a0e328d4c08cd4a27c82e9b917 branch: develop specs: goo (0.0.2) @@ -15,7 +15,7 @@ GIT GIT remote: https://github.com/ncbo/ontologies_linked_data.git - revision: 4b6b7f42882b9ad815ff5e90c354212aca085fda + revision: 4cdcf8d96d9e525aecb8110f02656bd45520b133 branch: develop specs: ontologies_linked_data (0.0.1) @@ -55,10 +55,10 @@ GEM addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) bcrypt (3.1.20) - bigdecimal (3.1.5) + bigdecimal (3.1.6) builder (3.2.4) coderay (1.1.3) - concurrent-ruby (1.2.2) + concurrent-ruby (1.2.3) connection_pool (2.4.1) cube-ruby (0.0.3) date (3.3.4) @@ -107,13 +107,13 @@ GEM method_source (1.0.0) mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2023.1205) + mime-types-data (3.2024.0206) mini_mime (1.1.5) minitest (4.7.5) multi_json (1.15.0) - multipart-post (2.3.0) + multipart-post (2.4.0) net-http-persistent (2.9.4) - net-imap (0.4.9.1) + net-imap (0.3.7) date net-protocol net-pop (0.1.2) @@ -133,15 +133,15 @@ GEM coderay (~> 1.1) method_source (~> 1.0) public_suffix (5.0.4) - rack (3.0.8) + rack (3.0.9.1) rack-test (2.1.0) rack (>= 1.3) rake (10.5.0) rdf (1.0.8) addressable (>= 2.2) - redis (5.0.8) + redis (5.1.0) redis-client (>= 0.17.0) - redis-client (0.19.1) + redis-client (0.20.0) connection_pool rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) @@ -192,4 +192,4 @@ DEPENDENCIES sparql-client! BUNDLED WITH - 2.4.22 + 2.3.15 From fe0783c542479ed0a12da5663ef28e1673e80eba Mon Sep 17 00:00:00 2001 From: mdorf Date: Sat, 2 Mar 2024 11:54:50 -0800 Subject: [PATCH 02/11] Gemfile.lock update --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 681ff4e0..d09be353 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/ncbo/goo.git - revision: 4ad4db41216ab9a0e328d4c08cd4a27c82e9b917 + revision: 4ea0e70a4361fc694700e11f1012129452278c7d branch: develop specs: goo (0.0.2) @@ -15,7 +15,7 @@ GIT GIT remote: https://github.com/ncbo/ontologies_linked_data.git - revision: 4cdcf8d96d9e525aecb8110f02656bd45520b133 + revision: 2575a6ecf62f6f1161f103429fc278939630ad87 branch: develop specs: ontologies_linked_data (0.0.1) From 2527ee6d1f8662aa052ab9e4a236ca66ecbd8d0c Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Mon, 4 Mar 2024 20:45:58 -0800 Subject: [PATCH 03/11] update ruby v3.0 --- Dockerfile | 11 +++++---- Gemfile | 2 +- Gemfile.lock | 42 ++++++++++------------------------ dip.yml | 56 +++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 57 +++++++++++++++++++++++++--------------------- run-unit-tests.sh | 6 ++--- 6 files changed, 109 insertions(+), 65 deletions(-) create mode 100644 dip.yml diff --git a/Dockerfile b/Dockerfile index 5016faa1..8911c31d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,15 +8,16 @@ RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \ raptor2-utils \ && rm -rf /var/lib/apt/lists/* -# The Gemfile Caching Trick RUN mkdir -p /srv/ontoportal/ncbo_annotator -COPY *.gemspec Gemfile* /srv/ontoportal/ncbo_annotator/ +RUN mkdir -p /srv/ontoportal/bundle +COPY Gemfile* *.gemspec /srv/ontoportal/ncbo_annotator/ WORKDIR /srv/ontoportal/ncbo_annotator -# 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 gem update --system +RUN gem install bundler +ENV BUNDLE_PATH=/srv/ontoportal/bundle RUN bundle install + COPY . /srv/ontoportal/ncbo_annotator CMD ["/bin/bash"] diff --git a/Gemfile b/Gemfile index 11eea763..09d65eda 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' gem 'cube-ruby' -gem 'faraday', '~> 1.9' +gem 'faraday' gem 'ffi' gem 'oj', '~> 3.0' gem 'rake', '~> 10.0' diff --git a/Gemfile.lock b/Gemfile.lock index d09be353..442260e5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,7 +15,7 @@ GIT GIT remote: https://github.com/ncbo/ontologies_linked_data.git - revision: 2575a6ecf62f6f1161f103429fc278939630ad87 + revision: b78284bac1a2d9c7b04245e55f3708de5dfe591e branch: develop specs: ontologies_linked_data (0.0.1) @@ -64,29 +64,10 @@ GEM 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) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) - ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - 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) + faraday (2.9.0) + faraday-net_http (>= 2.0, < 3.2) + faraday-net_http (3.1.0) + net-http ffi (1.16.3) http-accept (1.7.0) http-cookie (1.0.5) @@ -111,9 +92,10 @@ GEM mini_mime (1.1.5) minitest (4.7.5) multi_json (1.15.0) - multipart-post (2.4.0) + net-http (0.4.1) + uri net-http-persistent (2.9.4) - net-imap (0.3.7) + net-imap (0.4.10) date net-protocol net-pop (0.1.2) @@ -141,7 +123,7 @@ GEM addressable (>= 2.2) redis (5.1.0) redis-client (>= 0.17.0) - redis-client (0.20.0) + redis-client (0.21.0) connection_pool rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) @@ -153,7 +135,6 @@ GEM 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) simplecov (0.22.0) docile (~> 1.1) @@ -168,6 +149,7 @@ GEM thread_safe (0.3.6) timeout (0.4.1) tzinfo (0.3.62) + uri (0.13.0) uuid (2.3.9) macaddr (~> 1.0) @@ -177,7 +159,7 @@ PLATFORMS DEPENDENCIES cube-ruby - faraday (~> 1.9) + faraday ffi goo! minitest (~> 4.0) @@ -192,4 +174,4 @@ DEPENDENCIES sparql-client! BUNDLED WITH - 2.3.15 + 2.4.22 diff --git a/dip.yml b/dip.yml new file mode 100644 index 00000000..46b9bc08 --- /dev/null +++ b/dip.yml @@ -0,0 +1,56 @@ +version: '7.1' + +# Define default environment variables to pass +# to Docker Compose +#environment: +# RAILS_ENV: development + +compose: + files: + - docker-compose.yml + # project_name: ncbo_annotator + +interaction: + # This command spins up a ontologies_api container with the required dependencies (solr, 4store, etc), + # and opens a terminal within it. + runner: + description: Open a Bash shell within a ontologies_api container (with dependencies up) + service: ruby + command: /bin/bash + + # Run a Rails container without any dependent services (useful for non-Rails scripts) + bash: + description: Run an arbitrary script within a container (or open a shell without deps) + service: ruby + command: /bin/bash + compose_run_options: [ no-deps ] + + # A shortcut to run Bundler commands + bundle: + description: Run Bundler commands + service: ruby + command: bundle + compose_run_options: [ no-deps ] + + # A shortcut to run unit tests + test: + description: Run minitest unit tests + service: ruby + command: bundle exec rake test + + test-ag: + description: Run minitest unit tests + service: ruby-ag + command: bundle exec rake test + + + 'redis-cli': + description: Run Redis console + service: redis-ut + command: redis-cli -h redis-ut + +#provision: + #- dip compose down --volumes + #- dip compose up -d solr 4store + #- dip bundle install + #- dip bash -c bin/setup diff --git a/docker-compose.yml b/docker-compose.yml index 3b343882..7f831884 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,30 +1,35 @@ version: '3.8' x-app: &app - build: - context: . - args: - RUBY_VERSION: '2.7' - environment: &env - COVERAGE: 'true' # enable simplecov code coverage - REDIS_HOST: redis-ut - REDIS_PORT: 6379 - MGREP_HOST: mgrep-ut - MGREP_PORT: 55556 - SOLR_TERM_SEARCH_URL: http://solr-ut:8983/solr/term_search_core1 - SOLR_PROP_SEARCH_URL: http://solr-ut:8983/solr/prop_search_core1 - volumes: - - .:/srv/ontoportal/ncbo_annotator - stdin_open: true - tty: true - command: "bundle exec rake test TESTOPTS='-v'" - depends_on: &depends_on - solr-ut: - condition: service_healthy - redis-ut: - condition: service_healthy - mgrep-ut: - condition: service_healthy + image: ncbo_annotator:0.0.1 + build: + context: . + args: + RUBY_VERSION: '3.0' + environment: &env + BUNDLE_PATH: /srv/ontoportal/bundle + # 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/ncbo_annotator/.bundle + COVERAGE: 'true' # enable simplecov code coverage + REDIS_HOST: redis-ut + REDIS_PORT: 6379 + MGREP_HOST: mgrep-ut + MGREP_PORT: 55556 + SOLR_TERM_SEARCH_URL: http://solr-ut:8983/solr/term_search_core1 + SOLR_PROP_SEARCH_URL: http://solr-ut:8983/solr/prop_search_core1 + volumes: + - .:/srv/ontoportal/ncbo_annotator + stdin_open: true + tty: true + command: "bundle exec rake test TESTOPTS='-v'" + depends_on: &depends_on + solr-ut: + condition: service_healthy + redis-ut: + condition: service_healthy + mgrep-ut: + condition: service_healthy services: ruby: @@ -59,7 +64,7 @@ services: - agraph solr-ut: - image: ontoportal/solr-ut:0.0.2 + image: ontoportal/solr-ut:0.1.0 healthcheck: test: ["CMD-SHELL", "curl -sf http://localhost:8983/solr/term_search_core1/admin/ping?wt=json | grep -iq '\"status\":\"OK\"}' || exit 1"] start_period: 3s @@ -96,7 +101,7 @@ services: - 4store agraph-ut: - image: franzinc/agraph:v8.0.0 + image: franzinc/agraph:v8.1.0 platform: linux/amd64 environment: - AGRAPH_SUPER_USER=test diff --git a/run-unit-tests.sh b/run-unit-tests.sh index 476c2b83..e25a7a8b 100755 --- a/run-unit-tests.sh +++ b/run-unit-tests.sh @@ -5,6 +5,6 @@ [ -f config/config.rb ] || cp config/config.test.rb config/config.rb docker-compose build -docker-compose run --rm ruby bundle exec rake test TESTOPTS='-v' -#docker-compose run --rm ruby-agraph bundle exec rake test TESTOPTS='-v' -docker-compose --profile agraph --profile 4store kill +docker compose run --rm ruby bundle exec rake test TESTOPTS='-v' +#docker compose run --rm ruby-agraph bundle exec rake test TESTOPTS='-v' +docker compose --profile agraph --profile 4store stop From a427ff3719f88f887e04ac695a002ef24ce3afb8 Mon Sep 17 00:00:00 2001 From: mdorf Date: Wed, 24 Apr 2024 12:39:36 -0700 Subject: [PATCH 04/11] Gemfile.lock update --- Gemfile.lock | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index d09be353..bbe0b98c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/ncbo/goo.git - revision: 4ea0e70a4361fc694700e11f1012129452278c7d + revision: c7ee4a6a44cdf69c8186decc5da0c80887af1b11 branch: develop specs: goo (0.0.2) @@ -15,7 +15,7 @@ GIT GIT remote: https://github.com/ncbo/ontologies_linked_data.git - revision: 2575a6ecf62f6f1161f103429fc278939630ad87 + revision: d885010c4dcb79a71fd161988a8feceb77331b58 branch: develop specs: ontologies_linked_data (0.0.1) @@ -35,7 +35,7 @@ GIT GIT remote: https://github.com/ncbo/sparql-client.git - revision: 55e7dbf858eb571c767bc67868f9af61663859cb + revision: 1657f0dd69fd4b522d3549a6848670175f5e98cc branch: develop specs: sparql-client (1.0.1) @@ -55,7 +55,7 @@ GEM addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) bcrypt (3.1.20) - bigdecimal (3.1.6) + bigdecimal (3.1.7) builder (3.2.4) coderay (1.1.3) concurrent-ruby (1.2.3) @@ -93,9 +93,9 @@ GEM domain_name (~> 0.5) i18n (0.9.5) concurrent-ruby (~> 1.0) - json (2.7.1) - json_pure (2.7.1) - libxml-ruby (5.0.2) + json (2.7.2) + json_pure (2.7.2) + libxml-ruby (5.0.3) logger (1.6.0) macaddr (1.7.2) systemu (~> 2.6.5) @@ -104,10 +104,10 @@ GEM net-imap net-pop net-smtp - method_source (1.0.0) + method_source (1.1.0) mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2024.0206) + mime-types-data (3.2024.0305) mini_mime (1.1.5) minitest (4.7.5) multi_json (1.15.0) @@ -120,7 +120,7 @@ GEM net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0.1) + net-smtp (0.5.0) net-protocol netrc (0.11.0) oj (3.16.3) @@ -132,16 +132,16 @@ GEM pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (5.0.4) - rack (3.0.9.1) + public_suffix (5.0.5) + rack (3.0.10) rack-test (2.1.0) rack (>= 1.3) rake (10.5.0) rdf (1.0.8) addressable (>= 2.2) - redis (5.1.0) - redis-client (>= 0.17.0) - redis-client (0.20.0) + redis (5.2.0) + redis-client (>= 0.22.0) + redis-client (0.22.1) connection_pool rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) @@ -149,7 +149,7 @@ GEM mime-types (>= 1.16, < 4.0) netrc (~> 0.8) rexml (3.2.6) - rsolr (2.5.0) + rsolr (2.6.0) builder (>= 2.1.2) faraday (>= 0.9, < 3, != 2.0.0) ruby-xxHash (0.4.0.2) From 36125bdaafd36f394263b9495af96d21a81b1217 Mon Sep 17 00:00:00 2001 From: mdorf Date: Wed, 24 Apr 2024 14:19:04 -0700 Subject: [PATCH 05/11] Gemfile.lock update after merging pull request #150 --- Gemfile.lock | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index bbe0b98c..6ec4e9e4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/ncbo/goo.git - revision: c7ee4a6a44cdf69c8186decc5da0c80887af1b11 + revision: 563a47fa4329ffb8a774731be210f44a054726c0 branch: develop specs: goo (0.0.2) @@ -8,6 +8,7 @@ GIT pry rdf (= 1.0.8) redis + request_store rest-client rsolr sparql-client @@ -15,7 +16,7 @@ GIT GIT remote: https://github.com/ncbo/ontologies_linked_data.git - revision: d885010c4dcb79a71fd161988a8feceb77331b58 + revision: ab7b2f0eb6c4256ff1a01ace55b5a966c040e1ca branch: develop specs: ontologies_linked_data (0.0.1) @@ -113,7 +114,7 @@ GEM multi_json (1.15.0) multipart-post (2.4.0) net-http-persistent (2.9.4) - net-imap (0.3.7) + net-imap (0.4.10) date net-protocol net-pop (0.1.2) @@ -143,6 +144,8 @@ GEM redis-client (>= 0.22.0) redis-client (0.22.1) connection_pool + request_store (1.6.0) + rack (>= 1.4) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) @@ -192,4 +195,4 @@ DEPENDENCIES sparql-client! BUNDLED WITH - 2.3.15 + 2.4.22 From f9a1be204e81d72f408927b8f60c0be208611929 Mon Sep 17 00:00:00 2001 From: mdorf Date: Wed, 24 Apr 2024 14:32:04 -0700 Subject: [PATCH 06/11] Gemfile.lock update --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6ec4e9e4..4eb16011 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/ncbo/goo.git - revision: 563a47fa4329ffb8a774731be210f44a054726c0 + revision: 5d911f587f22059581ae3e713e5fe9bde9de82e7 branch: develop specs: goo (0.0.2) @@ -16,7 +16,7 @@ GIT GIT remote: https://github.com/ncbo/ontologies_linked_data.git - revision: ab7b2f0eb6c4256ff1a01ace55b5a966c040e1ca + revision: cf8100e47090be1bfb79e7ea642eb6a528013efa branch: develop specs: ontologies_linked_data (0.0.1) From 7531e10ad55ac66e925c099d7fc05a5a3ceae67e Mon Sep 17 00:00:00 2001 From: mdorf Date: Tue, 30 Apr 2024 15:54:12 -0700 Subject: [PATCH 07/11] Gemfile.lock update --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4eb16011..eb64cba5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/ncbo/goo.git - revision: 5d911f587f22059581ae3e713e5fe9bde9de82e7 + revision: 33583fd1c1d72b449cd6bb91815e3422b8448983 branch: develop specs: goo (0.0.2) @@ -16,7 +16,7 @@ GIT GIT remote: https://github.com/ncbo/ontologies_linked_data.git - revision: cf8100e47090be1bfb79e7ea642eb6a528013efa + revision: da1642ed8f9f04db2e427e35d88f235a55138d03 branch: develop specs: ontologies_linked_data (0.0.1) From b75f425f83aa10468a30dc4e8982749d4b959f55 Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Wed, 3 Jul 2024 13:30:29 -0700 Subject: [PATCH 08/11] fix failing unit tests --- Gemfile | 4 --- Gemfile.lock | 69 +++++++++++++++---------------------------- dip.yml | 44 +++++++++++++++++++++++++++ docker-compose.yml | 21 +++++++------ lib/ncbo_annotator.rb | 4 +-- test/test_case.rb | 4 +-- 6 files changed, 82 insertions(+), 64 deletions(-) create mode 100644 dip.yml diff --git a/Gemfile b/Gemfile index 11eea763..f1d18c01 100644 --- a/Gemfile +++ b/Gemfile @@ -1,11 +1,7 @@ source 'https://rubygems.org' gem 'cube-ruby' -gem 'faraday', '~> 1.9' -gem 'ffi' -gem 'oj', '~> 3.0' gem 'rake', '~> 10.0' -gem 'redis' gem 'ruby-xxHash' group :development do diff --git a/Gemfile.lock b/Gemfile.lock index eb64cba5..225ea490 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/ncbo/goo.git - revision: 33583fd1c1d72b449cd6bb91815e3422b8448983 + revision: 70007faf43d0d96292809f89f15a27a757ccaa25 branch: develop specs: goo (0.0.2) @@ -16,7 +16,7 @@ GIT GIT remote: https://github.com/ncbo/ontologies_linked_data.git - revision: da1642ed8f9f04db2e427e35d88f235a55138d03 + revision: 013a322440b4cfd899908d15ff605799acf8e6ef branch: develop specs: ontologies_linked_data (0.0.1) @@ -53,44 +53,26 @@ GEM multi_json (~> 1.3) thread_safe (~> 0.1) tzinfo (~> 0.3.37) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + base64 (0.2.0) bcrypt (3.1.20) - bigdecimal (3.1.7) - builder (3.2.4) + bigdecimal (3.1.8) + builder (3.3.0) coderay (1.1.3) - concurrent-ruby (1.2.3) + concurrent-ruby (1.3.3) connection_pool (2.4.1) cube-ruby (0.0.3) 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) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) + faraday (2.8.1) + base64 + faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - 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.16.3) + faraday-net_http (3.0.2) http-accept (1.7.0) - http-cookie (1.0.5) + http-cookie (1.0.6) domain_name (~> 0.5) i18n (0.9.5) concurrent-ruby (~> 1.0) @@ -108,13 +90,12 @@ GEM method_source (1.1.0) mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2024.0305) + mime-types-data (3.2024.0702) mini_mime (1.1.5) minitest (4.7.5) multi_json (1.15.0) - multipart-post (2.4.0) net-http-persistent (2.9.4) - net-imap (0.4.10) + net-imap (0.4.14) date net-protocol net-pop (0.1.2) @@ -124,7 +105,7 @@ GEM net-smtp (0.5.0) net-protocol netrc (0.11.0) - oj (3.16.3) + oj (3.16.4) bigdecimal (>= 3.0) omni_logger (0.1.4) logger @@ -133,8 +114,8 @@ GEM pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (5.0.5) - rack (3.0.10) + public_suffix (5.1.1) + rack (3.1.6) rack-test (2.1.0) rack (>= 1.3) rake (10.5.0) @@ -142,16 +123,17 @@ GEM addressable (>= 2.2) redis (5.2.0) redis-client (>= 0.22.0) - redis-client (0.22.1) + redis-client (0.22.2) connection_pool - request_store (1.6.0) + request_store (1.7.0) rack (>= 1.4) 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) + rexml (3.3.1) + strscan rsolr (2.6.0) builder (>= 2.1.2) faraday (>= 0.9, < 3, != 2.0.0) @@ -167,6 +149,7 @@ GEM simplecov (~> 0.19) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) + strscan (3.1.0) systemu (2.6.5) thread_safe (0.3.6) timeout (0.4.1) @@ -175,20 +158,16 @@ GEM macaddr (~> 1.0) PLATFORMS - ruby + aarch64-linux x86_64-linux DEPENDENCIES cube-ruby - faraday (~> 1.9) - ffi goo! minitest (~> 4.0) - oj (~> 3.0) ontologies_linked_data! pry rake (~> 10.0) - redis ruby-xxHash simplecov simplecov-cobertura diff --git a/dip.yml b/dip.yml new file mode 100644 index 00000000..8bf3a609 --- /dev/null +++ b/dip.yml @@ -0,0 +1,44 @@ +version: '7.1' + +# Define default environment variables to pass +# to Docker Compose +#environment: +# RAILS_ENV: development + +interaction: + # This command spins up a container with the required dependencies (solr, 4store, etc), + # and opens a terminal within it. + runner: + description: Open a Bash shell within a ncbo_annotator container (with dependencies up) + service: ruby + command: /bin/bash + + # Run a container without any dependent services + bash: + description: Run an arbitrary script within a container (or open a shell without deps) + service: ruby + command: /bin/bash + compose_run_options: [ no-deps ] + + # A shortcut to run Bundler commands + bundle: + description: Run Bundler commands + service: ruby + command: bundle + compose_run_options: [ no-deps ] + + # A shortcut to run unit tests + test: + description: Run minitest unit tests + service: ruby + command: bundle exec rake test TESTOPTS='-v' + + test-agraph: + description: Run minitest unit tests + service: ruby-agraph + command: bundle exec rake test TESTOPTS='-v' + + 'redis-cli': + description: Run Redis console + service: redis-ut + command: redis-cli -h redis-ut diff --git a/docker-compose.yml b/docker-compose.yml index 3b343882..1e7e22a4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.8' - x-app: &app build: context: . @@ -15,6 +13,7 @@ x-app: &app SOLR_PROP_SEARCH_URL: http://solr-ut:8983/solr/prop_search_core1 volumes: - .:/srv/ontoportal/ncbo_annotator + - bundle:/bundle stdin_open: true tty: true command: "bundle exec rake test TESTOPTS='-v'" @@ -48,9 +47,9 @@ services: GOO_BACKEND_NAME: ag GOO_PORT: 10035 GOO_HOST: agraph-ut - GOO_PATH_QUERY: /repositories/bioportal_test - GOO_PATH_DATA: /repositories/bioportal_test/statements - GOO_PATH_UPDATE: /repositories/bioportal_test/statements + GOO_PATH_QUERY: /repositories/ontoportal_test + GOO_PATH_DATA: /repositories/ontoportal_test/statements + GOO_PATH_UPDATE: /repositories/ontoportal_test/statements depends_on: <<: *depends_on agraph-ut: @@ -59,7 +58,7 @@ services: - agraph solr-ut: - image: ontoportal/solr-ut:0.0.2 + image: ontoportal/solr-ut:0.2.0 healthcheck: test: ["CMD-SHELL", "curl -sf http://localhost:8983/solr/term_search_core1/admin/ping?wt=json | grep -iq '\"status\":\"OK\"}' || exit 1"] start_period: 3s @@ -79,7 +78,7 @@ services: image: ontoportal/mgrep:0.0.2 platform: linux/amd64 healthcheck: - test: ["CMD", "nc", "-z", "-v", "localhost", "55556"] + test: ["CMD", "nc", "-z", "-v", "127.0.0.1", "55556"] start_period: 3s interval: 10s timeout: 5s @@ -96,7 +95,7 @@ services: - 4store agraph-ut: - image: franzinc/agraph:v8.0.0 + image: franzinc/agraph:v8.2.0 platform: linux/amd64 environment: - AGRAPH_SUPER_USER=test @@ -104,12 +103,12 @@ services: shm_size: 1g command: > bash -c "/agraph/bin/agraph-control --config /agraph/etc/agraph.cfg start - ; agtool repos create bioportal_test + ; agtool repos create --supersede ontoportal_test ; agtool users add anonymous - ; agtool users grant anonymous root:bioportal_test:rw + ; agtool users grant anonymous root:ontoportal_test:rw ; tail -f /agraph/data/agraph.log" healthcheck: - test: ["CMD-SHELL", "agtool storage-report bioportal_test || exit 1"] + test: ["CMD-SHELL", "agtool storage-report ontoportal_test || exit 1"] start_period: 30s interval: 10s timeout: 5s diff --git a/lib/ncbo_annotator.rb b/lib/ncbo_annotator.rb index 4631b53a..e1e76c3b 100644 --- a/lib/ncbo_annotator.rb +++ b/lib/ncbo_annotator.rb @@ -142,10 +142,10 @@ def generate_dictionary_file() end outFile.close - redis_mgrep_dict_refresh_timestamp() + redis_mgrep_dict_refresh_timestamp end - @logger.info("Completed generating a dictionary file in #{(time/60).round(1)} minutes.") + @logger.info("Completed generating a dictionary file in #{time.round(2)} seconds.") end def create_term_cache_from_ontologies(ontologies, delete_cache=false, redis_prefix=nil) diff --git a/test/test_case.rb b/test/test_case.rb index 52476b5d..aa9817f2 100644 --- a/test/test_case.rb +++ b/test/test_case.rb @@ -48,8 +48,8 @@ def self.ontologies def before_suites # code to run before the very first test LinkedData::SampleData::Ontology.delete_ontologies_and_submissions - @@ontologies = LinkedData::SampleData::Ontology.sample_owl_ontologies - @@sty = LinkedData::SampleData::Ontology.load_semantic_types_ontology + @@ontologies = LinkedData::SampleData::Ontology.sample_owl_ontologies(process_submission: true) + @@sty = LinkedData::SampleData::Ontology.load_semantic_types_ontology(process_submission: true) annotator = Annotator::Models::NcboAnnotator.new annotator.init_redis_for_tests annotator.create_term_cache_from_ontologies(@@ontologies, true) From c766e2ad136d846d28f0b4020a62f86d2fd4e64b Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Mon, 23 Sep 2024 17:07:13 -0700 Subject: [PATCH 09/11] Fix intermittent unit test failures by adding sleep(1) fix for #21 --- test/test_annotator.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_annotator.rb b/test/test_annotator.rb index 755c99c1..f63e0235 100644 --- a/test/test_annotator.rb +++ b/test/test_annotator.rb @@ -71,6 +71,7 @@ def test_all_classes_in_cache def test_generate_dictionary_file start_timestamp = Time.now + sleep(1) ontologies = AnnotatorUnit.ontologies.dup class_pages = TestAnnotator.all_classes(ontologies) assert class_pages.length > 100, "No classes in system ???" From d776b5c456870c9c7a95bf47181a02f4ec8eb87c Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Mon, 23 Sep 2024 17:13:36 -0700 Subject: [PATCH 10/11] use docker compose instead of docker-compose --- .github/workflows/ruby-unit-tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ruby-unit-tests.yml b/.github/workflows/ruby-unit-tests.yml index c4268d19..aefeb2c0 100644 --- a/.github/workflows/ruby-unit-tests.yml +++ b/.github/workflows/ruby-unit-tests.yml @@ -12,19 +12,19 @@ jobs: matrix: backend: ['ruby', 'ruby-agraph'] # api runs tests with 4store backend and api-agraph runs with AllegroGraph backend steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: copy config file run: cp config/config.test.rb config/config.rb - - name: Build docker-compose - run: docker-compose build + - name: Build docker compose + run: docker compose build - name: Run unit tests # 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' + 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 + uses: codecov/codecov-action@v4 with: flags: unittests verbose: true From d46d667ec1b2343fbcdab587f1a70e763b894133 Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Mon, 7 Oct 2024 18:03:41 -0700 Subject: [PATCH 11/11] reset branch specifier to master --- Gemfile | 6 +++--- Gemfile.lock | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Gemfile b/Gemfile index f45945cb..8e5b5a40 100644 --- a/Gemfile +++ b/Gemfile @@ -15,6 +15,6 @@ group :development do end # NCBO gems (can be from a local dev path or from rubygems/git) -gem 'goo', github: 'ncbo/goo', branch: 'develop' -gem 'ontologies_linked_data', github: 'ncbo/ontologies_linked_data', branch: 'develop' -gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'develop' +gem 'goo', github: 'ncbo/goo', branch: 'master' +gem 'ontologies_linked_data', github: 'ncbo/ontologies_linked_data', branch: 'master' +gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'master' diff --git a/Gemfile.lock b/Gemfile.lock index f706d744..d430872b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GIT remote: https://github.com/ncbo/goo.git - revision: 70007faf43d0d96292809f89f15a27a757ccaa25 - branch: develop + revision: f943ac33e87c55c88131c32d826ed5d39c89302c + branch: master specs: goo (0.0.2) addressable (~> 2.8) @@ -16,8 +16,8 @@ GIT GIT remote: https://github.com/ncbo/ontologies_linked_data.git - revision: c30887ee907acd39500cae6c12f45edb06fe0802 - branch: develop + revision: 9ab4be437ed84f5a480e7f0d8799824fcea310ae + branch: master specs: ontologies_linked_data (0.0.1) activesupport @@ -36,8 +36,8 @@ GIT GIT remote: https://github.com/ncbo/sparql-client.git - revision: 1657f0dd69fd4b522d3549a6848670175f5e98cc - branch: develop + revision: e89c26aa96f184dbe9b52d51e04fb3d9ba998dbc + branch: master specs: sparql-client (1.0.1) json_pure (>= 1.4) @@ -89,9 +89,10 @@ GEM net-pop net-smtp method_source (1.1.0) - mime-types (3.5.2) + mime-types (3.6.0) + logger mime-types-data (~> 3.2015) - mime-types-data (3.2024.0903) + mime-types-data (3.2024.1001) mini_mime (1.1.5) minitest (4.7.5) multi_json (1.15.0) @@ -135,7 +136,7 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rexml (3.3.7) + rexml (3.3.8) rsolr (2.6.0) builder (>= 2.1.2) faraday (>= 0.9, < 3, != 2.0.0)