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

Sync: bring OntoPortal up-to-date with BioPortal releases 5.26.2 and onward #4

Merged
merged 136 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
faa3a99
fix get a submission metrics
syphax-bouazzouni Feb 11, 2022
926fe1e
Auto stash before merge of "upstream" and "upstream/master"
syphax-bouazzouni Feb 11, 2022
acbf289
Merge remote-tracking branch 'upstream/master' into upstream
syphax-bouazzouni May 13, 2022
84d100f
add the slice get endpoint
syphax-bouazzouni May 23, 2022
d822e95
add the slices create endpoint
syphax-bouazzouni May 23, 2022
6b598b5
add the slices delete endpoint
syphax-bouazzouni May 23, 2022
a1d37f0
add the slices update endpoint
syphax-bouazzouni May 23, 2022
2414aba
Add caching for analytics for 24 hours.
alexskr Jul 29, 2022
398a80c
Merge remote-tracking branch 'upstream/master' into upstream
syphax-bouazzouni Aug 19, 2022
6094bcd
Fix for #97. Check for ontology existence before brining attributes
alexskr Aug 26, 2022
80e562f
Handle edge case for submission downloads which do not have UploadFil…
alexskr Aug 26, 2022
940cc3f
Gemfile.lock update
mdorf Nov 3, 2022
9f239d6
Merge pull request #96 from ncbo/enable_expires_analytics
mdorf Nov 3, 2022
8875ec5
Add GH workflow for capistrano deployments
alexskr Nov 15, 2022
1492935
Update Gemfile.lock
jvendetti Nov 17, 2022
64742d1
Merge branch 'develop'
alexskr Nov 17, 2022
3cc1358
fix ability to run deployment manually
alexskr Nov 18, 2022
ab27dfc
Fix for deprecation notice of Rack::Attack.throttled_response
alexskr Nov 21, 2022
51b7fa3
Update version of actions/checkout to address deprecation notices
alexskr Nov 21, 2022
672b29b
Fix: Documentation rendering (#107)
syphax-bouazzouni Nov 29, 2022
a09b646
Merge branch 'master' into develop
alexskr Nov 29, 2022
de5b678
Update Gemfile
alexskr Nov 29, 2022
6b71451
Restore branch specifier to master
alexskr Nov 29, 2022
6398e8e
Merge remote-tracking branch 'upstream/master' into upstream
syphax-bouazzouni Dec 17, 2022
3dc0699
Update capistrano sample config to include setting which branch to de…
alexskr Jan 13, 2023
c41efdf
Gemfile.lock update
mdorf Jan 31, 2023
71a538c
Gemfile.lock update
mdorf Jan 31, 2023
ca338cf
Gemfile.lock update
mdorf Feb 1, 2023
8315162
Merge staging for release
mdorf Feb 1, 2023
c940625
Gemfile.lock update
mdorf Feb 1, 2023
83f5bed
Make sure ontology is present when accessing submissions.
alexskr Feb 3, 2023
a4c5527
Remove owlapi_wrapper.jar file. It is included elsewhere
alexskr Feb 11, 2023
f80a8cf
Add health checks for docker services and add more config file options
alexskr Feb 12, 2023
44b25a0
Remove wait-for-it
alexskr Feb 12, 2023
0936ebe
Add health check to AG service
alexskr Feb 14, 2023
5cc4562
Add GH workflow for publishing docker images
alexskr Feb 14, 2023
c5d8a50
Merge branch 'develop'
alexskr Feb 15, 2023
373c53e
Add missing redis port number
alexskr Feb 15, 2023
0f9052a
Restore branch specifier to develop
alexskr Feb 16, 2023
dda5091
Set mgrep port to 55556
alexskr Feb 18, 2023
ff049fe
add arm64 platform
alexskr Mar 25, 2023
8a2258b
bump up version of solr-ut
alexskr May 5, 2023
bf2cd51
Fix https://github.com/ncbo/ontologies_api/issues/116
alexskr May 5, 2023
e619169
Restore branch specifier to master
alexskr May 5, 2023
9743042
fix for wrongly replaced string
alexskr May 5, 2023
e6257c9
Delete fix_purls.rb
alexskr Jul 10, 2023
fbd84f8
Remove google analytics depenencies since those needed only in ncbo_cron
alexskr Jul 20, 2023
e5d703b
bump up major version of oj and faraday
alexskr Jul 21, 2023
e2f8677
remove search_index.rb script
alexskr Jul 21, 2023
7c2ad53
lock gem rack-cache to 1.13.0
alexskr Jul 21, 2023
0875cfd
remove depenency on redis-activesupport
alexskr Jul 21, 2023
9b64d0c
unpin redis-store
alexskr Jul 21, 2023
a66dd7e
use redis-store from forked repo containing redis 5 compat fixes
alexskr Jul 24, 2023
c4baa22
Merge branch 'develop'
alexskr Jul 27, 2023
29dd13b
use patched version of agraph v7.3.1
alexskr Aug 1, 2023
060b393
unpin faraday gem
alexskr Aug 1, 2023
7c6c25b
Gemfile.lock update
alexskr Aug 8, 2023
d88b121
fixed an issue with the GA4 Analytics migration
mdorf Aug 8, 2023
dde48c2
fixed an issue with the GA4 Analytics migration
mdorf Aug 8, 2023
5f2fdc9
Merge branch 'develop'
alexskr Aug 9, 2023
f39bb01
reduce request limit for resource intensive api calls (#121)
alexskr Aug 15, 2023
ac42238
Announce deployments in NewRelic (#124)
alexskr Aug 30, 2023
895d3bf
Merge pull request #125 from ncbo/develop
alexskr Aug 31, 2023
074ddfa
Gemfile update, goo version including goo#138 and goo#139
alexskr Sep 6, 2023
436eedb
Gemfile.lock update
mdorf Sep 6, 2023
ed3f344
Gemfile.lock update
mdorf Sep 6, 2023
71e15ff
Merge pull request #78 from ontoportal-lirmm/pl/fix-get-submission-me…
mdorf Sep 6, 2023
9ef904d
Merge branch 'master' of https://github.com/ncbo/ontologies_api
mdorf Sep 6, 2023
8444a98
Merge pull request #78 from master
mdorf Sep 6, 2023
e9cc25d
Gemfile.lock update
mdorf Sep 6, 2023
b4bac7e
update slice write operation to check if user is admin
syphax-bouazzouni Sep 7, 2023
719d500
Merge remote-tracking branch 'upstream/master' into pr/add-slice-get-…
syphax-bouazzouni Sep 7, 2023
5ad69e8
Gemfile.lock update
mdorf Sep 7, 2023
ca8a3fb
fixed an accidental commit of docker compose file
mdorf Sep 7, 2023
b2957f5
Merge staging for release
mdorf Sep 7, 2023
7ad1e2c
fixed Gemfile after merging from master
mdorf Sep 7, 2023
dc22c65
Gemfile.lock update
mdorf Sep 8, 2023
6652268
update Gemfile.lock
alexskr Sep 8, 2023
90ecfb8
Gemfile.lock update
alexskr Sep 11, 2023
4c51365
redis-store gem with redis 5 compatibility fix
alexskr Sep 11, 2023
9e57a68
Merge branch 'develop' into remove_redis-activesupport
alexskr Sep 11, 2023
a0532bc
Merge pull request #120 from ncbo/remove_redis-activesupport
alexskr Sep 11, 2023
0659065
Gemfile.lock update
alexskr Sep 11, 2023
194cac3
Merge branch 'develop'
alexskr Sep 12, 2023
852d939
Merge remote-tracking branch 'upstream/master' into upstream
syphax-bouazzouni Sep 21, 2023
22eba94
make the check_access helper use filter_access if the object is a list
syphax-bouazzouni Sep 21, 2023
6d98714
add test for submissions access check with two ontologies private and…
syphax-bouazzouni Sep 21, 2023
275b7ae
check access of ontologies in /ontologies/:acronym/submissions endpoint
syphax-bouazzouni Sep 21, 2023
4950f27
Merge pull request #126 from ontoportal-lirmm/pr/fix/access-control-o…
alexskr Sep 22, 2023
39a45f5
Set gem branch specifier to develop
alexskr Sep 22, 2023
7fcc87a
reset branch specifier to master
alexskr Oct 27, 2023
6f89433
add the slice get endpoint
syphax-bouazzouni May 23, 2022
e7b6cb3
add the slices create endpoint
syphax-bouazzouni May 23, 2022
aad2173
add the slices delete endpoint
syphax-bouazzouni May 23, 2022
37f539b
add the slices update endpoint
syphax-bouazzouni May 23, 2022
c987f55
update slice write operation to check if user is admin
syphax-bouazzouni Sep 7, 2023
6dc238d
add slices creation & deletion unit tests
syphax-bouazzouni Oct 28, 2023
8489f2b
Merge remote-tracking branch 'origin/pr/add-slice-get-endpoint' into …
syphax-bouazzouni Oct 28, 2023
803b3b6
Merge pull request #87 from ontoportal-lirmm/pr/add-slice-get-endpoint
mdorf Nov 1, 2023
2c3b3de
Gemfile.lock update
mdorf Nov 1, 2023
ecd8c80
Gemfile.lock update
mdorf Nov 2, 2023
6670531
Merging pull request from master
mdorf Nov 2, 2023
fb9bcf4
Merged #87 from master
mdorf Nov 2, 2023
2a0ca03
fixed Gemfile after merge
mdorf Nov 2, 2023
3cbf739
Gemfile.lock update
mdorf Nov 2, 2023
6f737ca
update Gemfile.lock
alexskr Nov 2, 2023
becc4dc
Add configurable option for github org where code is deployed from
alexskr Nov 8, 2023
4da3786
Gemfile update
alexskr Nov 8, 2023
0402dc4
Gemfile update
alexskr Nov 8, 2023
f0e5dc2
check existance of acroym before fetching details
alexskr Nov 17, 2023
2c3cba8
Merge pull request #130 from ncbo/fix/downloads_of_non_existing_ontol…
alexskr Nov 18, 2023
2281f12
Merge branch 'develop'
alexskr Nov 20, 2023
aa071c1
extract slice tests helper to the parent class for reusability
syphax-bouazzouni Nov 28, 2023
cd8051e
add a test for the creation of an admin user
syphax-bouazzouni Nov 28, 2023
5ace41c
enforce the security of admin user creation
syphax-bouazzouni Nov 28, 2023
6e68eaf
enforce user deletion security to be admin only
syphax-bouazzouni Nov 28, 2023
1a62241
Merge pull request #131 from ontoportal-lirmm/feature/fix-user-creati…
alexskr Nov 30, 2023
9d6a20d
Gemfile.lock update
mdorf Dec 10, 2023
ef49ce5
update Gemfile.lock
alexskr Dec 15, 2023
a756442
Gemfile update
alexskr Dec 15, 2023
1f38e8a
implemented the first pass at bmir-radx/radx-project#37
mdorf Dec 17, 2023
34a876c
Gemfile.lock update
mdorf Dec 17, 2023
35c41c8
set bundler version to be comptatible with ruby 2.7
alexskr Dec 19, 2023
14afd31
Gemfile.lock update
alexskr Dec 19, 2023
f147504
implemented #127 - Add API call to trigger ontology pull from remote …
mdorf Jan 10, 2024
0eda478
Merge branch 'develop' of https://github.com/ncbo/ontologies_api into…
mdorf Jan 10, 2024
60fee47
Gemfile.lock
mdorf Jan 10, 2024
cd7ca2a
implemented a test for #127 - Add API call to trigger ontology pull f…
mdorf Jan 11, 2024
9d3e799
Gemfile.lock update
mdorf Jan 11, 2024
89168e9
implemented a test for #127 - Add API call to trigger ontology pull f…
mdorf Jan 11, 2024
243dba3
implemented a test for #127 - Add API call to trigger ontology pull f…
mdorf Jan 11, 2024
8566648
Gemfile.lock update
alexskr Jan 12, 2024
955268b
use agraph v8.0.0
alexskr Jan 12, 2024
78499c3
Merge branch 'develop'
alexskr Jan 12, 2024
725b2e2
Gemfile.lock update
alexskr Jan 12, 2024
7fe0bf9
Gemfile.lock update
alexskr Jan 12, 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
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Git
.git
.gitignore
.github
create_permissions.log
# Logs
log/*
Expand All @@ -9,3 +10,8 @@ tmp/*
# Editor temp files
*.swp
*.swo
coverage
# Ignore generated test data
test/data/uploaded_ontologies/**/*
test/data/ontology_files/repo/**/*
test/log
85 changes: 85 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Workflow for deploying ontologies_api to stage/prod systems via capistrano.
# This workflow runs after a successeful execution of the unit test workflow and it
# can also be triggered manually.
#
# Required github secrets:
#
# CONFIG_REPO - github repo containing config and customizations for the API. Format 'author/private_config_repo'
# it is used for getting capistrano deployment configuration for stages on the github actions runner and
# PRIVATE_CONFIG_REPO env var is constructed from it which is used by capistrano on the remote servers for pulling configs.
#
# GH_PAT - github Personal Access Token for accessing PRIVATE_CONFIG_REPO
#
# SSH_JUMPHOST - ssh jump/proxy host though which deployments have to though if app servers are hosted on private network.
#
# DEPLOY_ENC_KEY - key for decrypting deploymnet ssh key residing in config/deploy_id_rsa_enc (see miloserdow/capistrano-deploy)
# this SSH key is used for accessing jump host, UI nodes, and private github repo.

name: Capistrano Deployment
# Controls when the action will run.
on:
# Trigger deployment to staging after unit test action completes
workflow_run:
workflows: ["Ruby Unit Tests"]
types:
- completed
branches: [master, develop]
# Allows running this workflow manually from the Actions tab
workflow_dispatch:
branches: [master, develop]
inputs:
BRANCH:
description: 'Branch/tag to deploy'
default: develop
required: true
environment:
description: 'target environment to deploy to'
type: choice
options:
- staging
- production
default: staging

jobs:
deploy:
runs-on: ubuntu-latest
# run deployment only if "Ruby Unit Tests" workflow completes sucessefully or when manually triggered
if: ${{ (github.event.workflow_run.conclusion == 'success') || (github.event_name == 'workflow_dispatch') }}
env:
BUNDLE_WITHOUT: default #install gems required primarily for the deployment in order to speed this workflow
PRIVATE_CONFIG_REPO: ${{ format('git@github.com:{0}.git', secrets.CONFIG_REPO) }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: set branch/tag and environment to deploy from inputs
run: |
# workflow_dispatch default input doesn't get set on push so we need to set defaults
# via shell parameter expansion
# https://dev.to/mrmike/github-action-handling-input-default-value-5f2g
USER_INPUT_BRANCH=${{ inputs.branch }}
echo "BRANCH=${USER_INPUT_BRANCH:-develop}" >> $GITHUB_ENV
USER_INPUT_ENVIRONMENT=${{ inputs.environment }}
echo "TARGET=${USER_INPUT_ENVIRONMENT:-staging}" >> $GITHUB_ENV
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.6 # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: get-deployment-config
uses: actions/checkout@v3
with:
repository: ${{ secrets.CONFIG_REPO }} # repository containing deployment settings
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT
path: deploy_config
- name: copy-deployment-config
run: cp -r deploy_config/ontologies_api/* .
# add ssh hostkey so that capistrano doesn't complain
- name: Add jumphost's hostkey to Known Hosts
run: |
mkdir -p ~/.ssh
ssh-keyscan -H ${{ secrets.SSH_JUMPHOST }} > ~/.ssh/known_hosts
shell: bash
- uses: miloserdow/capistrano-deploy@master
with:
target: ${{ env.TARGET }} # which environment to deploy
deploy_key: ${{ secrets.DEPLOY_ENC_KEY }} # Name of the variable configured in Settings/Secrets of your github project
42 changes: 42 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Docker Image CI

on:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: bioportal/ontologies_api

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
build-args: |
RUBY_VERSION=2.7
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
5 changes: 3 additions & 2 deletions .github/workflows/ruby-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@ on:
jobs:
test:
strategy:
fail-fast: false
matrix:
backend: ['api', 'api-agraph'] # api runs tests with 4store backend and api-agraph runs with AllegroGraph backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build docker-compose
run: docker-compose --profile 4store build #profile flag is set in order to build all containers in this step
- 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 --rm ${{ matrix.backend }} wait-for-it solr-ut:8983 -- bundle exec rake test TESTOPTS='-v'
docker-compose run $ci_env -e CI --rm ${{ matrix.backend }} bundle exec rake test TESTOPTS='-v'
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,5 @@ test/test_run.log
test/data/ontology_files/catalog-v001.xml

create_permissions.log

ontologies_api.iml
2 changes: 1 addition & 1 deletion Capfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ require 'capistrano/bundler'
# require 'capistrano/rails/assets'
# require 'capistrano/rails/migrations'
require 'capistrano/locally'

require 'new_relic/recipes' # announce deployments in NewRelic
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ FROM ruby:$RUBY_VERSION-$DISTRO_NAME
RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \
openjdk-11-jre-headless \
raptor2-utils \
wait-for-it \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p /srv/ontoportal/ontologies_api
Expand All @@ -15,12 +14,16 @@ COPY Gemfile* /srv/ontoportal/ontologies_api/

WORKDIR /srv/ontoportal/ontologies_api

RUN gem update --system
# set rubygem and bundler to the last version supported by ruby 2.7
# remove version after ruby v3 upgrade
RUN gem update --system '3.4.22'
RUN gem install bundler -v 2.4.22
RUN gem install bundler
ENV BUNDLE_PATH=/srv/ontoportal/bundle
RUN bundle install

COPY . /srv/ontoportal/ontologies_api
RUN cp /srv/ontoportal/ontologies_api/config/environments/config.rb.sample /srv/ontoportal/ontologies_api/config/environments/development.rb

EXPOSE 9393
CMD ["bundle", "exec", "rackup", "-p", "9393", "--host", "0.0.0.0"]
24 changes: 15 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
source 'https://rubygems.org'

gem 'activesupport', '~> 3.0'
gem 'activesupport', '~> 3.2'
# see https://github.com/ncbo/ontologies_api/issues/69
gem 'bigdecimal', '1.4.2'
gem 'faraday', '~> 1.9'
gem 'json-schema', '~> 2.0'
gem 'multi_json', '~> 1.0'
gem 'oj', '~> 2.0'
gem 'oj', '~> 3.0'
gem 'parseconfig'
gem 'rack'
gem 'rake', '~> 10.0'
Expand All @@ -18,7 +17,7 @@ gem 'sinatra-contrib', '~> 1.0'
gem 'ffi'
gem 'rack-accept', '~> 0.4'
gem 'rack-attack', '~> 6.6.1', require: 'rack/attack'
gem 'rack-cache', '~> 1.0'
gem 'rack-cache', '~> 1.13.0' # see https://github.com/ncbo/ontologies_api/issues/118
gem 'rack-cors', require: 'rack/cors'
# GitHub dependency can be removed when https://github.com/niko/rack-post-body-to-params/pull/6 is merged and released
gem 'rack-post-body-to-params', github: 'palexander/rack-post-body-to-params', branch: 'multipart_support'
Expand All @@ -27,18 +26,18 @@ gem 'redis-rack-cache', '~> 2.0'

# Data access (caching)
gem 'redis'
gem 'redis-activesupport'
gem 'redis-store', '~>1.10'

# Monitoring
gem 'cube-ruby', require: 'cube'
gem 'newrelic_rpm'
gem 'newrelic_rpm', group: [:default, :deployment]

# HTTP server
gem 'unicorn'
gem 'unicorn-worker-killer'

# Templating
gem 'haml'
gem 'haml', '~> 5.2.2' # pin see https://github.com/ncbo/ontologies_api/pull/107
gem 'redcarpet'

# NCBO
Expand All @@ -50,12 +49,19 @@ gem 'ontologies_linked_data', github: 'ncbo/ontologies_linked_data', branch: 'ma
gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'master'

group :development do
# bcrypt_pbkdf and ed35519 is required for capistrano deployments when using ed25519 keys; see https://github.com/miloserdow/capistrano-deploy/issues/42
gem 'shotgun', github: 'palexander/shotgun', branch: 'ncbo'
gem 'rubocop'
end

group :deployment do
# bcrypt_pbkdf and ed35519 is required for capistrano deployments when using ed25519 keys; see https://github.com/miloserdow/capistrano-deploy/issues/42
gem 'bcrypt_pbkdf', '>= 1.0', '< 2.0', require: false
gem 'capistrano', '~> 3', require: false
gem 'capistrano-bundler', require: false
gem 'capistrano-locally', require: false
gem 'capistrano-rbenv', require: false
gem 'pry'
gem 'shotgun', github: 'palexander/shotgun', branch: 'ncbo'
gem 'ed25519', '>= 1.2', '< 2.0', require: false
end

group :profiling do
Expand Down
Loading