Skip to content

Commit

Permalink
implemented the first pass at bmir-radx/radx-project#37
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorf committed Dec 17, 2023
1 parent 1a62241 commit 1f38e8a
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 25 deletions.
54 changes: 29 additions & 25 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ GIT

GIT
remote: https://github.com/ncbo/ncbo_annotator.git
revision: 067104ae94c0e9d058cfbf419364fbf03f34de43
revision: d7ee80860a0eab9293af81083a0700d099c50263
branch: develop
specs:
ncbo_annotator (0.0.1)
Expand All @@ -42,7 +42,7 @@ GIT

GIT
remote: https://github.com/ncbo/ncbo_ontology_recommender.git
revision: e6d4449d8b854f17bb54af6de142bc64bff22ab3
revision: 003b65c5e5ce8b0736085d6825ee1b8e9548826e
branch: develop
specs:
ncbo_ontology_recommender (0.0.1)
Expand Down Expand Up @@ -159,11 +159,11 @@ GEM
google-analytics-data-v1beta (0.9.0)
gapic-common (>= 0.20.0, < 2.a)
google-cloud-errors (~> 1.0)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-core (1.6.1)
google-cloud-env (>= 1.0, < 3.a)
google-cloud-errors (~> 1.0)
google-cloud-env (1.6.0)
faraday (>= 0.17.3, < 3.0)
google-cloud-env (2.0.1)
faraday (>= 1.0, < 3.a)
google-cloud-errors (1.3.1)
google-protobuf (3.25.1-aarch64-linux)
google-protobuf (3.25.1-arm64-darwin)
Expand All @@ -173,22 +173,26 @@ GEM
google-protobuf (~> 3.14)
googleapis-common-protos-types (~> 1.2)
grpc (~> 1.27)
googleapis-common-protos-types (1.10.0)
googleapis-common-protos-types (1.11.0)
google-protobuf (~> 3.18)
googleauth (1.8.1)
faraday (>= 0.17.3, < 3.a)
googleauth (1.9.0)
faraday (>= 1.0, < 3.a)
google-cloud-env (~> 2.0, >= 2.0.1)
jwt (>= 1.4, < 3.0)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
grpc (1.59.2)
google-protobuf (~> 3.24)
grpc (1.60.0-aarch64-linux)
google-protobuf (~> 3.25)
googleapis-common-protos-types (~> 1.0)
grpc (1.59.2-x86_64-darwin)
google-protobuf (~> 3.24)
grpc (1.60.0-arm64-darwin)
google-protobuf (~> 3.25)
googleapis-common-protos-types (~> 1.0)
grpc (1.59.2-x86_64-linux)
google-protobuf (~> 3.24)
grpc (1.60.0-x86_64-darwin)
google-protobuf (~> 3.25)
googleapis-common-protos-types (~> 1.0)
grpc (1.60.0-x86_64-linux)
google-protobuf (~> 3.25)
googleapis-common-protos-types (~> 1.0)
haml (5.2.2)
temple (>= 0.8.0)
Expand All @@ -198,10 +202,10 @@ GEM
domain_name (~> 0.5)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
json (2.6.3)
json (2.7.1)
json-schema (2.8.1)
addressable (>= 2.4)
json_pure (2.6.3)
json_pure (2.7.1)
jwt (2.7.1)
kgio (2.11.4)
language_server-protocol (3.17.0.3)
Expand All @@ -217,15 +221,15 @@ GEM
method_source (1.0.0)
mime-types (3.5.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2023.1003)
mime-types-data (3.2023.1205)
mini_mime (1.1.5)
minitest (4.7.5)
minitest-stub_any_instance (1.0.3)
mlanett-redis-lock (0.2.7)
redis
multi_json (1.15.0)
net-http-persistent (2.9.4)
net-imap (0.4.6)
net-imap (0.3.7)
date
net-protocol
net-pop (0.1.2)
Expand Down Expand Up @@ -265,7 +269,7 @@ GEM
rack (>= 0.4)
rack-cors (1.0.6)
rack (>= 1.6.0)
rack-mini-profiler (3.1.1)
rack-mini-profiler (3.3.0)
rack (>= 1.2.0)
rack-protection (1.5.5)
rack
Expand All @@ -280,14 +284,14 @@ GEM
redcarpet (3.6.0)
redis (5.0.8)
redis-client (>= 0.17.0)
redis-client (0.18.0)
redis-client (0.19.0)
connection_pool
redis-rack-cache (2.2.1)
rack-cache (>= 1.10, < 2)
redis-store (>= 1.6, < 2)
redis-store (1.10.0)
redis (>= 4, < 6)
regexp_parser (2.8.2)
regexp_parser (2.8.3)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
Expand All @@ -297,15 +301,15 @@ GEM
rsolr (2.5.0)
builder (>= 2.1.2)
faraday (>= 0.9, < 3, != 2.0.0)
rubocop (1.57.2)
rubocop (1.58.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
Expand Down Expand Up @@ -420,4 +424,4 @@ DEPENDENCIES
unicorn-worker-killer

BUNDLED WITH
2.4.21
2.3.15
17 changes: 17 additions & 0 deletions controllers/admin_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,23 @@ class AdminController < ApplicationController
halt 204
end

# on demand ontology pull
post "/ontologies/:acronym/pull" do
LOGGER.info "Forcing the pull and processing of ontology #{params['acronym']}"
actions = NcboCron::Models::OntologySubmissionParser::ACTIONS.dup
actions[:remote_pull] = true
ont = Ontology.find(params["acronym"]).first
error 404, "You must provide a valid `acronym` to retrieve an ontology" if ont.nil?
ont.bring(:acronym, :submissions)
latest = ont.latest_submission(status: :any)
error 404, "Ontology #{params["acronym"]} contains no submissions" if latest.nil?
check_last_modified(latest)
latest.bring(*OntologySubmission.goo_attrs_to_load(includes_param))
NcboCron::Models::OntologySubmissionParser.new.queue_submission(latest, actions)
LOGGER.info "Ontology #{params['acronym']} has been queued for pull and processing"
halt 204
end

private

def process_long_operation(timeout, args)
Expand Down

0 comments on commit 1f38e8a

Please sign in to comment.