Skip to content

Commit 043a8a0

Browse files
authored
Merge pull request #94 from ncbo/develop
Develop -> Master merge, release v6.1.0
2 parents d697b7a + 8eaa81f commit 043a8a0

File tree

6 files changed

+95
-42
lines changed

6 files changed

+95
-42
lines changed

Gemfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,18 @@ gem 'redis'
2020
gem 'rest-client'
2121
gem 'sys-proctable'
2222

23-
gem 'net-ftp' # remove in v6.0.0
24-
2523
# Monitoring
2624
gem 'cube-ruby', require: 'cube'
2725

2826
# NCBO
29-
gem 'goo', github: 'ncbo/goo', branch: 'master'
30-
gem 'ncbo_annotator', github: 'ncbo/ncbo_annotator', branch: 'master'
31-
gem 'ontologies_linked_data', github: 'ncbo/ontologies_linked_data', tag: 'v5.33.5'
32-
gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'master'
27+
gem 'goo', github: 'ncbo/goo', branch: 'develop'
28+
gem 'ncbo_annotator', github: 'ncbo/ncbo_annotator', branch: 'develop'
29+
gem 'ontologies_linked_data', github: 'ncbo/ontologies_linked_data', branch: 'develop'
30+
gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'develop'
31+
32+
group :development do
33+
gem 'rubocop', require: false
34+
end
3335

3436
group :test do
3537
gem 'email_spec'

Gemfile.lock

Lines changed: 50 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GIT
22
remote: https://github.com/ncbo/goo.git
3-
revision: b9019ad9e1eb78c74105fc6c6a879085066da17d
4-
branch: master
3+
revision: c3f9a7f789bf2f52ed31f0272d2725117d3ac04e
4+
branch: develop
55
specs:
66
goo (0.0.2)
77
addressable (~> 2.8)
@@ -16,8 +16,8 @@ GIT
1616

1717
GIT
1818
remote: https://github.com/ncbo/ncbo_annotator.git
19-
revision: 4fb9114b80b99f0a654c7f70aaa96839c74fc615
20-
branch: master
19+
revision: 6671099a39fffa8b98f21db7593cef35dd296b65
20+
branch: develop
2121
specs:
2222
ncbo_annotator (0.0.1)
2323
goo
@@ -27,8 +27,8 @@ GIT
2727

2828
GIT
2929
remote: https://github.com/ncbo/ontologies_linked_data.git
30-
revision: e26859c574c8d9440d8b22eb2388bb1db2f7817a
31-
tag: v5.33.5
30+
revision: bf575f8dddb28719e8ae64855f9dd9ffc301f046
31+
branch: develop
3232
specs:
3333
ontologies_linked_data (0.0.1)
3434
activesupport
@@ -37,6 +37,7 @@ GIT
3737
json
3838
libxml-ruby
3939
multi_json
40+
net-ftp
4041
oj
4142
omni_logger
4243
pony
@@ -47,8 +48,8 @@ GIT
4748

4849
GIT
4950
remote: https://github.com/ncbo/sparql-client.git
50-
revision: e89c26aa96f184dbe9b52d51e04fb3d9ba998dbc
51-
branch: master
51+
revision: 1657f0dd69fd4b522d3549a6848670175f5e98cc
52+
branch: develop
5253
specs:
5354
sparql-client (1.0.1)
5455
json_pure (>= 1.4)
@@ -79,6 +80,7 @@ GEM
7980
multi_json (~> 1.0)
8081
addressable (2.8.7)
8182
public_suffix (>= 2.0.2, < 7.0)
83+
ast (2.4.3)
8284
base64 (0.2.0)
8385
bcrypt (3.1.20)
8486
bigdecimal (3.1.9)
@@ -87,7 +89,7 @@ GEM
8789
logger (~> 1.5)
8890
coderay (1.1.3)
8991
concurrent-ruby (1.3.5)
90-
connection_pool (2.5.0)
92+
connection_pool (2.5.3)
9193
cube-ruby (0.0.3)
9294
dante (0.2.0)
9395
date (3.4.1)
@@ -98,20 +100,20 @@ GEM
98100
htmlentities (~> 4.3.3)
99101
launchy (>= 2.1, < 4.0)
100102
mail (~> 2.7)
101-
faraday (2.12.2)
103+
faraday (2.13.1)
102104
faraday-net_http (>= 2.0, < 3.5)
103105
json
104106
logger
105107
faraday-follow_redirects (0.3.0)
106108
faraday (>= 1, < 3)
107109
faraday-net_http (3.4.0)
108110
net-http (>= 0.5.0)
109-
faraday-retry (2.2.1)
111+
faraday-retry (2.3.1)
110112
faraday (~> 2.0)
111-
ffi (1.17.1)
112-
ffi (1.17.1-aarch64-linux-gnu)
113-
ffi (1.17.1-arm64-darwin)
114-
ffi (1.17.1-x86_64-linux-gnu)
113+
ffi (1.17.2)
114+
ffi (1.17.2-aarch64-linux-gnu)
115+
ffi (1.17.2-arm64-darwin)
116+
ffi (1.17.2-x86_64-linux-gnu)
115117
gapic-common (0.25.0)
116118
faraday (>= 1.9, < 3.a)
117119
faraday-retry (>= 1.0, < 3.a)
@@ -192,15 +194,17 @@ GEM
192194
mutex_m
193195
i18n (0.9.5)
194196
concurrent-ruby (~> 1.0)
195-
json (2.10.2)
197+
json (2.11.3)
196198
json_pure (2.8.1)
197199
jwt (2.10.1)
198200
base64
201+
language_server-protocol (3.17.0.4)
199202
launchy (3.1.1)
200203
addressable (~> 2.8)
201204
childprocess (~> 5.0)
202205
logger (~> 1.6)
203206
libxml-ruby (5.0.3)
207+
lint_roller (1.1.0)
204208
logger (1.7.0)
205209
macaddr (1.7.2)
206210
systemu (~> 2.6.5)
@@ -213,7 +217,7 @@ GEM
213217
mime-types (3.6.2)
214218
logger
215219
mime-types-data (~> 3.2015)
216-
mime-types-data (3.2025.0325)
220+
mime-types-data (3.2025.0422)
217221
mini_mime (1.1.5)
218222
minitest (4.7.5)
219223
mlanett-redis-lock (0.2.7)
@@ -226,7 +230,7 @@ GEM
226230
net-http (0.6.0)
227231
uri
228232
net-http-persistent (2.9.4)
229-
net-imap (0.5.6)
233+
net-imap (0.5.8)
230234
date
231235
net-protocol
232236
net-pop (0.1.2)
@@ -243,23 +247,31 @@ GEM
243247
logger
244248
os (1.1.4)
245249
ostruct (0.6.1)
250+
parallel (1.27.0)
246251
parseconfig (1.1.2)
252+
parser (3.3.8.0)
253+
ast (~> 2.4.1)
254+
racc
247255
pony (1.13.1)
248256
mail (>= 2.0)
257+
prism (1.4.0)
249258
pry (0.15.2)
250259
coderay (~> 1.1)
251260
method_source (~> 1.0)
252261
public_suffix (6.0.1)
253-
rack (3.1.12)
262+
racc (1.8.1)
263+
rack (3.1.13)
254264
rack-test (2.2.0)
255265
rack (>= 1.3)
266+
rainbow (3.1.1)
256267
rake (13.2.1)
257268
rdf (1.0.8)
258269
addressable (>= 2.2)
259270
redis (5.4.0)
260271
redis-client (>= 0.22.0)
261272
redis-client (0.24.0)
262273
connection_pool
274+
regexp_parser (2.10.0)
263275
representable (3.2.0)
264276
declarative (< 0.1.0)
265277
trailblazer-option (>= 0.1.1, < 0.2.0)
@@ -276,6 +288,21 @@ GEM
276288
rsolr (2.6.0)
277289
builder (>= 2.1.2)
278290
faraday (>= 0.9, < 3, != 2.0.0)
291+
rubocop (1.75.4)
292+
json (~> 2.3)
293+
language_server-protocol (~> 3.17.0.2)
294+
lint_roller (~> 1.1.0)
295+
parallel (~> 1.10)
296+
parser (>= 3.3.0.2)
297+
rainbow (>= 2.2.2, < 4.0)
298+
regexp_parser (>= 2.9.3, < 3.0)
299+
rubocop-ast (>= 1.44.0, < 2.0)
300+
ruby-progressbar (~> 1.7)
301+
unicode-display_width (>= 2.4.0, < 4.0)
302+
rubocop-ast (1.44.1)
303+
parser (>= 3.3.7.2)
304+
prism (~> 1.4)
305+
ruby-progressbar (1.13.0)
279306
ruby-xxHash (0.4.0.2)
280307
rubyzip (2.4.1)
281308
rufus-scheduler (2.0.24)
@@ -306,6 +333,9 @@ GEM
306333
tzinfo (2.0.6)
307334
concurrent-ruby (~> 1.0)
308335
uber (0.1.0)
336+
unicode-display_width (3.1.4)
337+
unicode-emoji (~> 4.0, >= 4.0.4)
338+
unicode-emoji (4.0.4)
309339
uri (1.0.3)
310340
uuid (2.3.9)
311341
macaddr (~> 1.0)
@@ -328,7 +358,6 @@ DEPENDENCIES
328358
multi_json
329359
ncbo_annotator!
330360
ncbo_cron!
331-
net-ftp
332361
oj (~> 3.0)
333362
ontologies_linked_data!
334363
parseconfig
@@ -337,6 +366,7 @@ DEPENDENCIES
337366
rake
338367
redis
339368
rest-client
369+
rubocop
340370
simplecov
341371
simplecov-cobertura
342372
sparql-client!

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2013, The Board of Trustees of Leland Stanford Junior University
1+
Copyright (c) 2025, The Board of Trustees of Leland Stanford Junior University
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification, are

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# ncbo_cron
2+
This repository contains scheduled tasks that support the ongoing operations of the
3+
[BioPortal](https://bioportal.bioontology.org/) ontology repository.
4+
5+
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/ncbo/ncbo_cron/ruby-unit-tests.yml)
6+
7+
## Contact
8+
Please don't file issues to ask questions. You'll get the fastest response by sending a message to our
9+
support list: [[email protected]](mailto:[email protected]).
10+
11+
## Contributors
12+
<a href="https://github.com/ncbo/ncbo_cron/graphs/contributors">
13+
<img src="https://contrib.rocks/image?repo=ncbo/ncbo_cron" />
14+
</a>
15+
16+
## License
17+
The 2-Clause BSD License. See [LICENSE.txt](/LICENSE.txt) for more information.

bin/ncbo_cron

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ opt_parser = OptionParser.new do |opts|
6666
opts.on("-h", "--redis-host HOST", String, "redis host (for shared locking)", "(default: #{options[:redis_host]})") do |host|
6767
options[:redis_host] = host
6868
end
69-
opts.on("-p", "--redis-port PORT", Integer, "redis port (for shared locking)", "(default: #{options[:redis_port]})") do |port|
69+
opts.on("--redis-port PORT", Integer, "redis port (for shared locking)", "(default: #{options[:redis_port]})") do |port|
7070
options[:redis_port] = port
7171
end
72-
opts.on("-l", "--log-level LEVEL", String, "set the log level (debug, info, error)", "(default: #{options[:log_level]})") do |c|
72+
opts.on("--log-level LEVEL", String, "set the log level (debug, info, error)", "(default: #{options[:log_level]})") do |c|
7373
options[:log_level] = c.to_sym
7474
end
7575
opts.on("-m", "--minutes MIN", Integer, "minutes between process queue checks (override seconds)", "(default: #{options[:minutes_between]})") do |m|
@@ -129,7 +129,7 @@ opt_parser = OptionParser.new do |opts|
129129
opts.on("-w", "--warm-long-queries SCHED", String, "cron schedule to warmup long time running queries", "(default: #{options[:cron_warmq]})") do |c|
130130
options[:cron_warmq] = c
131131
end
132-
opts.on("-m", "--create-mapping-counts SCHED", String, "cron schedule to create mapping counts", "(default: #{options[:cron_mapping_counts]})") do |c|
132+
opts.on("--create-mapping-counts SCHED", String, "cron schedule to create mapping counts", "(default: #{options[:cron_mapping_counts]})") do |c|
133133
options[:cron_mapping_counts] = c
134134
end
135135
opts.on("--ontology-analytics SCHED", String, "cron schedule to run ontology analytics refresh", "(default: #{options[:cron_ontology_analytics]})") do |c|
@@ -180,6 +180,13 @@ end
180180
# Update the NcboCron.settings with CLI options
181181
options.each_pair {|k,v| NcboCron.settings[k] = v}
182182

183+
# create log dir
184+
log_dir = File.dirname(options[:log_path])
185+
begin
186+
FileUtils.mkdir_p(log_dir) unless File.directory?(log_dir)
187+
rescue SystemCallError => e
188+
abort "Cannot create log directory #{log_dir}: #{e.message}"
189+
end
183190

184191
# Configure the process controller
185192
require 'dante'

lib/ncbo_cron/config.rb

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module NcboCron
88
@settings_run = false
99
def config(&block)
1010
return if @settings_run
11-
@settings_run = true
1211

1312
# Redis is used for two separate things in ncbo_cron:
1413
# 1) locating the queue for the submissions to be processed and
@@ -82,17 +81,8 @@ def config(&block)
8281
@settings.cron_dictionary_generation_cron_job ||= "30 3 * * *"
8382

8483
@settings.log_level ||= :info
85-
unless (@settings.log_path && File.exists?(@settings.log_path))
86-
log_dir = File.expand_path("../../../logs", __FILE__)
87-
FileUtils.mkdir_p(log_dir)
88-
@settings.log_path = "#{log_dir}/scheduler.log"
89-
end
90-
if File.exists?("/var/run/ncbo_cron")
91-
pid_path = File.expand_path("/var/run/ncbo_cron/ncbo_cron.pid", __FILE__)
92-
else
93-
pid_path = File.expand_path("../../../ncbo_cron.pid", __FILE__)
94-
end
95-
@settings.pid_path ||= pid_path
84+
@settings.log_dir ||= nil # let caller provide it
85+
@settings.log_path ||= nil # will build it later
9686

9787
# minutes between process queue checks (override seconds)
9888
@settings.minutes_between ||= 5
@@ -107,5 +97,12 @@ def config(&block)
10797

10898
# Override defaults
10999
yield @settings if block_given?
100+
101+
# ── choose defaults *after* user input ───────────────────────────────
102+
@settings.log_dir ||= File.expand_path("log", Dir.pwd)
103+
@settings.log_path ||= File.join(@settings.log_dir, "scheduler.log")
104+
@settings.pid_path ||= File.expand_path("ncbo_cron.pid", Dir.pwd)
105+
106+
@settings_run = true
110107
end
111108
end

0 commit comments

Comments
 (0)