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

Merge to master - Release 2.3.6 - add Docker image #35

Merged
merged 94 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
a312109
add request_lang middleware
syphax-bouazzouni Mar 6, 2023
207884b
pin redis gem version to 4.8.1
syphax-bouazzouni Mar 6, 2023
c4c6be1
Merge branch 'fix/bundle-update-redis-breaks-tests' into development
syphax-bouazzouni Mar 6, 2023
9ea1770
Merge branch 'development' into feature/support-multilingual-read-one…
syphax-bouazzouni Mar 6, 2023
ae23ce0
update Gemfile.lock
syphax-bouazzouni Mar 6, 2023
5a41c91
Merge pull request #32 from ontoportal-lirmm/feature/support-multilin…
syphax-bouazzouni Mar 6, 2023
be31e4f
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Mar 7, 2023
77bde06
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Mar 7, 2023
0d8e4fd
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Mar 7, 2023
aed3bf5
update Gemfile to use ontologies_linked_data new metadata branch
syphax-bouazzouni Mar 20, 2023
f0f56a6
update TestOntologySubmissionsController to be adapted to the new model
syphax-bouazzouni Mar 20, 2023
6699ae3
Merge branch 'feature/update-submission-mdetamodel-2023' into develop…
syphax-bouazzouni Mar 20, 2023
535e96e
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Mar 20, 2023
7320f50
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Mar 20, 2023
62f5831
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Mar 21, 2023
e259c1c
in submission_metadata rename display with category
syphax-bouazzouni Mar 21, 2023
2bf3ac8
add to submission_metadata description and example fields
syphax-bouazzouni Mar 21, 2023
b4d3536
Merge branch 'feature/update-submission-mdetamodel-2023' into develop…
syphax-bouazzouni Mar 21, 2023
ab8c876
add the option to do pagination for the submission endpoint
syphax-bouazzouni Apr 26, 2023
c6454e4
extract retrieve_latest_submissions method to submission helper
syphax-bouazzouni Apr 26, 2023
f1b1234
implement apply_filters to submissions endpoint using SPARQL FILTERs
syphax-bouazzouni Apr 26, 2023
64e7286
add test for submissions endpoint pagination
syphax-bouazzouni Apr 28, 2023
2cb2099
Merge pull request #34 from ontoportal-lirmm/feature/paginate-and-fil…
syphax-bouazzouni Apr 28, 2023
7e86f58
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Apr 28, 2023
1b7d514
fix private only submission filter
syphax-bouazzouni Apr 30, 2023
4cb42d0
add hasFormalityLevel filter for submissions endpoint
syphax-bouazzouni May 1, 2023
864e42f
add for ontology: reviews, notes, projects on the submissions endpoints
syphax-bouazzouni May 1, 2023
0497193
bring submission metrics for submissions endpoints
syphax-bouazzouni May 1, 2023
3abc430
bring all contact attributes if asked in the submissions endpoints
syphax-bouazzouni May 1, 2023
69ef8bd
refactor submissions endpoint filters by extracting some methods
syphax-bouazzouni May 1, 2023
1655473
add ontology acronym or name filters for submissions endpoints
syphax-bouazzouni May 1, 2023
060ed26
add submissions endpoint order_by option
syphax-bouazzouni May 1, 2023
b6e6434
Merge branch 'development' into feature/paginate-and-filter-ontologie…
syphax-bouazzouni May 1, 2023
b026d97
Merge pull request #36 from ontoportal-lirmm/feature/paginate-and-fil…
syphax-bouazzouni May 1, 2023
059d7e1
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm May 1, 2023
3f29887
fix including ontology and contacts in the submissions endpoints
syphax-bouazzouni May 1, 2023
198adbd
Merge remote-tracking branch 'origin/feature/paginate-and-filter-onto…
syphax-bouazzouni May 1, 2023
384d0ba
Merge branch 'feature/paginate-and-filter-ontologies-endpoint' into d…
syphax-bouazzouni May 1, 2023
b45618a
fix list admin filter_access control (e.g for submissions endpoints)
syphax-bouazzouni May 1, 2023
8657066
Merge branch 'feature/paginate-and-filter-ontologies-endpoint' into d…
syphax-bouazzouni May 1, 2023
b1e9ddf
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm May 1, 2023
34f19a3
check access of ontologies in /ontologies/:acronym/submissions endpoint
syphax-bouazzouni May 1, 2023
c942f87
Merge branch 'feature/paginate-and-filter-ontologies-endpoint' into d…
syphax-bouazzouni May 1, 2023
42dfb9b
Merge remote-tracking branch 'origin/development' into development
syphax-bouazzouni May 1, 2023
d5dcb9e
include ontology viewOf attribute in the submission endpoints
syphax-bouazzouni May 2, 2023
2e06a69
Merge branch 'feature/paginate-and-filter-ontologies-endpoint' into d…
syphax-bouazzouni May 2, 2023
57d1a1e
make apply_filters helper generic for any of model attributes
syphax-bouazzouni Jun 15, 2023
dd26aac
add Agents controller
syphax-bouazzouni Jun 15, 2023
76db662
add pagination to agents index endpoint if asked
syphax-bouazzouni Jun 15, 2023
49d4ab4
make agents routes work for /Agent and /agent
syphax-bouazzouni Jun 15, 2023
0ddc5de
handle agent indentifiers and affiliations attributes save and update
syphax-bouazzouni Jun 16, 2023
f7c9bb9
make agent controller work for affiliations attribute
syphax-bouazzouni Jun 18, 2023
3375586
add agent controller tests
syphax-bouazzouni Jun 18, 2023
c785dfc
don't update affiliations if only 'id' sent in params
syphax-bouazzouni Jun 27, 2023
09a7eb7
bring identifier attributes when we update an agent
syphax-bouazzouni Jul 5, 2023
cf74166
update agent test to work with the new Agent validators
syphax-bouazzouni Jul 5, 2023
070b1fb
bring the agent attributes on display all of the submissions endpoints
syphax-bouazzouni Jul 30, 2023
f0da26e
handle exception for class attribute but aren't in populate_from_params
syphax-bouazzouni Jul 31, 2023
f378950
update Gemfile to use development branch of OLD
syphax-bouazzouni Aug 1, 2023
3d05980
refactor user controller to extract reset password helpers
syphax-bouazzouni Aug 3, 2023
ae6bdd5
remove the send notification on user creation, now handled by user.save
syphax-bouazzouni Aug 3, 2023
2cdd4ff
add access token authentication
syphax-bouazzouni Aug 3, 2023
54db3c0
fix test after enforcing the uniqueness of user emails
syphax-bouazzouni Aug 3, 2023
3d79e40
fix search test
syphax-bouazzouni Aug 3, 2023
ac6d356
add oauth_authentication test
syphax-bouazzouni Aug 4, 2023
fce1674
bring the correct attributes when the oauth_authenticate is used
syphax-bouazzouni Aug 6, 2023
3ac46f3
Merge pull request #41 from ontoportal-lirmm/feature/add-multiprovide…
syphax-bouazzouni Aug 21, 2023
1250a92
Merge branch 'development' into feature/add-agent-crud-endpoint
syphax-bouazzouni Sep 5, 2023
e85558a
Merge pull request #39 from ontoportal-lirmm/feature/add-agent-crud-e…
syphax-bouazzouni Sep 5, 2023
ff7650e
Feature: Add support of multilingual search (#40)
haddadzineddine Sep 5, 2023
13c9145
add get submission all including all properties test
syphax-bouazzouni Sep 14, 2023
62c7b0e
extract and use submission_include_params where we use submission.bring
syphax-bouazzouni Sep 15, 2023
5bf6a05
use retrieve_submissions helper in the :acronym/submissions endpoint
syphax-bouazzouni Sep 15, 2023
0962139
Merge branch 'development' into feature/paginate-and-filter-ontologie…
syphax-bouazzouni Sep 15, 2023
ea90027
update Goo version and add submissions filters test
syphax-bouazzouni Sep 21, 2023
d8c8e5b
Fix: display contact for get submissions (#45)
syphax-bouazzouni Sep 21, 2023
25d7f84
Merge branch 'development' into fix/submission-filters-endpoints
syphax-bouazzouni Sep 21, 2023
bd6494c
Fix: Submissions filters with order_by for the same attribute (#46)
syphax-bouazzouni Sep 21, 2023
47ffdab
make the ontology submissions endpoint include views
syphax-bouazzouni Oct 9, 2023
801b693
Merge branch 'fix/submission-filters-endpoints' into development
syphax-bouazzouni Oct 9, 2023
37408c5
Merge branch 'master' into development
syphax-bouazzouni Oct 12, 2023
9fb09a2
include all metrics attribues in the submissions endpoints (#53)
syphax-bouazzouni Oct 22, 2023
1602a31
add ontology submissions filter by status (#56)
syphax-bouazzouni Nov 1, 2023
01cdda4
add agent usage attribute tests (#55)
syphax-bouazzouni Nov 3, 2023
d8eb63a
Fix: optimize fetching all agents usages query by batch loading them …
syphax-bouazzouni Nov 8, 2023
1d13691
Feature: Add ontologies_api docker image build CI (#58)
syphax-bouazzouni Nov 13, 2023
0e559c5
Feature: add ontoportal bash script (#59)
syphax-bouazzouni Nov 22, 2023
00967ef
Feature: add ontoportal bash script (#59)
syphax-bouazzouni Nov 22, 2023
ac0d71b
Merge remote-tracking branch 'origin/development' into development
syphax-bouazzouni Nov 24, 2023
be861eb
fix date list properties population helper
syphax-bouazzouni Nov 26, 2023
708be2c
Feature: update ontoportal bash script to handle local gems binding …
syphax-bouazzouni Nov 28, 2023
14e9a2b
add description filter to the submissions endpoint (#62)
syphax-bouazzouni Nov 30, 2023
72813a0
Merge branch 'master' into development
syphax-bouazzouni Dec 5, 2023
4aeb619
Merge branch 'master' into development
syphax-bouazzouni Dec 5, 2023
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
4 changes: 4 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
API_URL=http://localhost:9393
ONTOLOGIES_LINKED_DATA_PATH=
GOO_PATH=
SPARQL_CLIENT_PATH=
55 changes: 55 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Docker branch Images build

on:
push:
branches:
- development
- stage
- test
release:
types: [ published ]
jobs:
push_to_registry:
name: Push Docker branch 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@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
agroportal/ontologies_api
ghcr.io/${{ github.repository }}

- 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.8
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
3 changes: 3 additions & 0 deletions .github/workflows/ruby-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: copy-env-config
run: cp .env.sample .env
- 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 install
docker-compose run $ci_env -e CI --rm ${{ matrix.backend }} wait-for-it solr-ut:8983 -- bundle exec rake test TESTOPTS='-v'
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@ test/data/ontology_files/catalog-v001.xml
create_permissions.log

ontologies_api.iml

.env
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ 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"]
CMD ["bundle", "exec", "rackup", "-p", "9393", "--host", "0.0.0.0"]
7 changes: 4 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

gem 'activesupport', '~> 3.1'
gem 'activesupport', '~> 3.2'
# see https://github.com/ncbo/ontologies_api/issues/69
gem 'bigdecimal', '1.4.2'
gem 'faraday', '~> 1.9'
Expand Down Expand Up @@ -44,12 +44,12 @@ gem 'haml', '~> 5.2.2' # pin see https://github.com/ncbo/ontologies_api/pull/107
gem 'redcarpet'

# NCBO gems (can be from a local dev path or from rubygems/git)
gem 'goo', git: 'https://github.com/ontoportal-lirmm/goo.git', branch: 'master'
gem 'goo', git: 'https://github.com/ontoportal-lirmm/goo.git', branch: 'development'
gem 'ncbo_annotator', git: 'https://github.com/ontoportal-lirmm/ncbo_annotator.git', branch: 'master'
gem 'ncbo_cron', git: 'https://github.com/ontoportal-lirmm/ncbo_cron.git', branch: 'master'
gem 'ncbo_ontology_recommender', git: 'https://github.com/ncbo/ncbo_ontology_recommender.git', branch: 'master'
gem 'sparql-client', github: 'ontoportal-lirmm/sparql-client', branch: 'master'
gem 'ontologies_linked_data', git: 'https://github.com/ontoportal-lirmm/ontologies_linked_data.git', branch: 'master'
gem 'ontologies_linked_data', git: 'https://github.com/ontoportal-lirmm/ontologies_linked_data.git', branch: 'development'

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
Expand All @@ -63,6 +63,7 @@ group :development do
gem 'shotgun', github: 'palexander/shotgun', branch: 'ncbo'
end


group :profiling do
gem 'rack-mini-profiler'
end
Expand Down
19 changes: 9 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ GIT

GIT
remote: https://github.com/ontoportal-lirmm/goo.git
revision: 74ea47defc7f6260b045a6c6997bbe6a59c7bf62
branch: master
revision: 5979402d5138850fb9bdb34edfa350e9af1b5d22
branch: development
specs:
goo (0.0.2)
addressable (~> 2.8)
Expand Down Expand Up @@ -53,8 +53,8 @@ GIT

GIT
remote: https://github.com/ontoportal-lirmm/ontologies_linked_data.git
revision: 80a331d053ea04397a903452288c2186822c340c
branch: master
revision: a199eff007f5d7f18205d61194f3823445aa6460
branch: development
specs:
ontologies_linked_data (0.0.1)
activesupport
Expand Down Expand Up @@ -216,7 +216,7 @@ GEM
multi_json (1.15.0)
multipart-post (2.3.0)
net-http-persistent (2.9.4)
net-imap (0.4.7)
net-imap (0.4.6)
date
net-protocol
net-pop (0.1.2)
Expand Down Expand Up @@ -247,7 +247,7 @@ GEM
rack (>= 0.4)
rack-attack (6.6.1)
rack (>= 1.0, < 3)
rack-cache (1.14.0)
rack-cache (1.13.0)
rack (>= 0.4)
rack-cors (1.0.6)
rack (>= 1.6.0)
Expand All @@ -270,8 +270,8 @@ GEM
redis-rack-cache (2.2.1)
rack-cache (>= 1.10, < 2)
redis-store (>= 1.6, < 2)
redis-store (1.9.2)
redis (>= 4, < 6)
redis-store (1.9.1)
redis (>= 4, < 5)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
Expand Down Expand Up @@ -346,12 +346,11 @@ GEM
webrick (1.8.1)

PLATFORMS
x86_64-darwin-21
x86_64-darwin-23
x86_64-linux

DEPENDENCIES
activesupport (~> 3.1)
activesupport (~> 3.2)
bcrypt_pbkdf (>= 1.0, < 2.0)
bigdecimal (= 1.4.2)
capistrano (~> 3)
Expand Down
59 changes: 51 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,50 @@

ontologies_api provides a RESTful interface for accessing [BioPortal](https://bioportal.bioontology.org/) (an open repository of biomedical ontologies). Supported services include downloads, search, access to terms and concepts, text annotation, and much more.

## Prerequisites
# Run ontologies_api

## Using OntoPortal api utilities script
### See help

```bash
bin/ontoportal help
```

```
Usage: bin/ontoportal {dev|test|run|help} [--reset-cache] [--api-url API_URL] [--api-key API_KEY]
dev : Start the Ontoportal API development server.
Example: bin/ontoportal dev --api-url http://localhost:9393
Use --reset-cache to remove volumes: bin/ontoportal dev --reset-cache
test : Run tests.
run : Run a command in the Ontoportal API Docker container.
help : Show this help message.

Description:
This script provides convenient commands for managing an Ontoportal API
application using Docker Compose. It includes options for starting the development server,
running tests, and executing commands within the Ontoportal API Docker container.

Goals:
- Simplify common tasks related to Ontoportal API development using Docker.
- Provide a consistent and easy-to-use interface for common actions.


```


### Run dev
```bash
bin/ontoportal dev
```

### Run test with a local OntoPortal API
```bash
bin/ontoportal test
```


## Manually
### Prerequisites

- [Ruby 2.x](http://www.ruby-lang.org/en/downloads/) (most recent patch level)
- [rbenv](https://github.com/sstephenson/rbenv) and [ruby-build](https://github.com/sstephenson/ruby-build) (optional)
Expand All @@ -19,7 +62,7 @@ ontologies_api provides a RESTful interface for accessing [BioPortal](https://bi
- [Solr](http://lucene.apache.org/solr/)
- BioPortal indexes ontology class and property content using Solr (a Lucene-based server)

## Configuring Solr
### Configuring Solr

To configure Solr for ontologies_api usage, modify the example project included with Solr by doing the following:

Expand All @@ -46,22 +89,22 @@ To configure Solr for ontologies_api usage, modify the example project included
# Edit the ontologieS_api/config/environments/{env}.rb file to point to your running instance:
# http://localhost:8983/solr/NCBO1

## Installing
### Installing

### Clone the repository
#### Clone the repository

```
$ git clone [email protected]:ncbo/ontologies_api.git
$ cd ontologies_api
```

### Install the dependencies
#### Install the dependencies

```
$ bundle install
```

### Create an environment configuration file
#### Create an environment configuration file

```
$ cp config/environments/config.rb.sample config/environments/development.rb
Expand All @@ -73,7 +116,7 @@ production.rb<br />
development.rb<br />
test.rb

### Run the unit tests (optional)
#### Run the unit tests (optional)

Requires a configuration file for the test environment:

Expand All @@ -87,7 +130,7 @@ Execute the suite of tests from the command line:
$ bundle exec rake test
```

### Run the application
#### Run the application

```
$ bundle exec rackup --port 9393
Expand Down
Loading