Skip to content

Commit

Permalink
Merge pull request #34 from ncbo/ruby-v3
Browse files Browse the repository at this point in the history
Update Ruby: v2.7 → v3.0
  • Loading branch information
alexskr authored Sep 24, 2024
2 parents d776b5c + 46efb79 commit b2731c9
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 49 deletions.
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ 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/

WORKDIR /srv/ontoportal/ncbo_annotator
COPY Gemfile* *.gemspec /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 install bundler
ENV BUNDLE_PATH=/bundle
RUN bundle install

COPY . /srv/ontoportal/ncbo_annotator
CMD ["/bin/bash"]
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
source 'https://rubygems.org'

gem 'cube-ruby'
gem 'faraday'
gem 'ffi'
gem 'oj', '~> 3.0'
gem 'rake', '~> 10.0'
gem 'ruby-xxHash'

Expand Down
33 changes: 19 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ GIT

GIT
remote: https://github.com/ncbo/ontologies_linked_data.git
revision: 013a322440b4cfd899908d15ff605799acf8e6ef
revision: c30887ee907acd39500cae6c12f45edb06fe0802
branch: develop
specs:
ontologies_linked_data (0.0.1)
Expand Down Expand Up @@ -60,26 +60,27 @@ GEM
bigdecimal (3.1.8)
builder (3.3.0)
coderay (1.1.3)
concurrent-ruby (1.3.3)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
cube-ruby (0.0.3)
date (3.3.4)
docile (1.4.0)
docile (1.4.1)
domain_name (0.6.20240107)
faraday (2.8.1)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
ffi (1.17.0)
http-accept (1.7.0)
http-cookie (1.0.6)
http-cookie (1.0.7)
domain_name (~> 0.5)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
json (2.7.2)
json_pure (2.7.2)
libxml-ruby (5.0.3)
logger (1.6.0)
logger (1.6.1)
macaddr (1.7.2)
systemu (~> 2.6.5)
mail (2.8.1)
Expand All @@ -90,12 +91,12 @@ GEM
method_source (1.1.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0702)
mime-types-data (3.2024.0903)
mini_mime (1.1.5)
minitest (4.7.5)
multi_json (1.15.0)
net-http-persistent (2.9.4)
net-imap (0.4.14)
net-imap (0.4.16)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -105,23 +106,25 @@ GEM
net-smtp (0.5.0)
net-protocol
netrc (0.11.0)
oj (3.16.4)
oj (3.16.6)
bigdecimal (>= 3.0)
ostruct (>= 0.2)
omni_logger (0.1.4)
logger
ostruct (0.6.0)
pony (1.13.1)
mail (>= 2.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.1.1)
rack (3.1.6)
rack (3.1.7)
rack-test (2.1.0)
rack (>= 1.3)
rake (10.5.0)
rdf (1.0.8)
addressable (>= 2.2)
redis (5.2.0)
redis (5.3.0)
redis-client (>= 0.22.0)
redis-client (0.22.2)
connection_pool
Expand All @@ -132,8 +135,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.3.1)
strscan
rexml (3.3.7)
rsolr (2.6.0)
builder (>= 2.1.2)
faraday (>= 0.9, < 3, != 2.0.0)
Expand All @@ -147,9 +149,8 @@ GEM
simplecov-cobertura (2.1.0)
rexml
simplecov (~> 0.19)
simplecov-html (0.12.3)
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
strscan (3.1.0)
systemu (2.6.5)
thread_safe (0.3.6)
timeout (0.4.1)
Expand All @@ -159,12 +160,16 @@ GEM

PLATFORMS
aarch64-linux
arm64-darwin-22
x86_64-linux

DEPENDENCIES
cube-ruby
faraday
ffi
goo!
minitest (~> 4.0)
oj (~> 3.0)
ontologies_linked_data!
pry
rake (~> 10.0)
Expand Down
55 changes: 30 additions & 25 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
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
- bundle:/bundle
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
# 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
BUNDLE_PATH: /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
- bundle:/bundle
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:
Expand Down
6 changes: 3 additions & 3 deletions run-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b2731c9

Please sign in to comment.