Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
709849d
Fix: explicitly load `resetTokenExpireTime` in password reset (#109)
maboukerfa Nov 26, 2024
fb89c6c
Merge pull request #110 from ontoportal-lirmm/development
imadbourouche Nov 28, 2024
ce2c8d0
Feature: add provision to parse ontology when running api locally (#111)
imadbourouche Dec 9, 2024
da9283e
update Gemfile to get new versions of ontologies_linked_data
syphax-bouazzouni Dec 12, 2024
909a8aa
Fix: hide private ontologies for non admin users in groups controller…
imadbourouche Jan 8, 2025
07290db
Feature: create graphs endpoints to list, create and delete (#115)
syphax-bouazzouni Jan 23, 2025
3589732
Feature: Add last 24hours SPARQL Query logs endpoint (#116)
syphax-bouazzouni Jan 23, 2025
8103e4f
Feature: Implement MOD-API routes (#114)
imadbourouche Jan 27, 2025
4284245
Feature: Migrate ruby 3.2 (#121)
syphax-bouazzouni Feb 6, 2025
620e0e8
Add Redis host environment variables
maboukerfa Feb 10, 2025
60596cd
Merge pull request #122 from muhammedBkf/development
imadbourouche Feb 11, 2025
989a9c3
Merge branch 'master' into development
syphax-bouazzouni Feb 14, 2025
798aad4
Merge pull request #119 from ontoportal-lirmm/development
syphax-bouazzouni Feb 14, 2025
02d84f3
Update deploy.yml to use ruby 3.1.0
syphax-bouazzouni Feb 14, 2025
4c824a3
fix root endpoint after migrating to ruby 3
syphax-bouazzouni Feb 14, 2025
6c591f1
add paging by default to /artefacts (#125)
imadbourouche Feb 15, 2025
9d64f2d
fix image generation of docker image for ruby 3.1
syphax-bouazzouni Feb 15, 2025
7a8a421
fix: fork shotgun to support ruby 3 and rack 3
syphax-bouazzouni Feb 17, 2025
e9051ab
Merge branch 'master' into development
syphax-bouazzouni Feb 20, 2025
bde47ba
remove appuser from the dockerfile (#133)
imadbourouche Feb 24, 2025
f3efd63
Feature: add / route for SemanticartefactCatalog (#117)
imadbourouche Feb 24, 2025
4e127c5
add pandoc so to render the documentation (#136)
imadbourouche Feb 25, 2025
ad9d940
Merge to master: release 3.0.1 (#135)
syphax-bouazzouni Feb 25, 2025
7d0d8f2
add file command in dockerfile (#138)
imadbourouche Feb 27, 2025
56234d7
Merge remote-tracking branch 'origin/master' into development
syphax-bouazzouni Feb 27, 2025
af75001
fix redirection of routes that ends with / (#137)
imadbourouche Feb 28, 2025
5fc6463
Feature: optimize metrics controller (#140)
imadbourouche Mar 14, 2025
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
13 changes: 12 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
API_URL=http://localhost:9393
ONTOLOGIES_LINKED_DATA_PATH=
GOO_PATH=
SPARQL_CLIENT_PATH=
SPARQL_CLIENT_PATH=

REDIS_GOO_CACHE_HOST=redis-ut
REDIS_HTTP_CACHE_HOST=redis-ut
REDIS_PERSISTENT_HOST=redis-ut

## An ontology that will be imported in the starting of the API server
STARTER_ONTOLOGY=STY
## API key of a remote API used to download the starter ontology
OP_API_KEY=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb
## API url of the remote API used to download the starter ontology
OP_API_URL="https://data.bioontology.org"
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.8 # Not needed with a .ruby-version file
ruby-version: 3.1.0 # 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
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Docker branch Images build

on:
push:
branches:
Expand All @@ -9,48 +8,54 @@ on:
- 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
uses: actions/checkout@v4

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64

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

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v3
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
uses: docker/metadata-action@v5
with:
images: |
agroportal/ontologies_api
ghcr.io/${{ github.repository }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
build-args: |
RUBY_VERSION=2.7.8
RUBY_VERSION=3.1
BUILDPLATFORM=${{ github.job_name }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
10 changes: 4 additions & 6 deletions .github/workflows/ruby-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ name: Ruby Unit Tests

on:
push:
pull_request:

jobs:
test:
strategy:
fail-fast: false
matrix:
goo-slice: [ '20', '100', '500' ]
ruby-version: [ '2.7' ]
goo-slice: [ '100' ]
ruby-version: [ '3.2.0' ]
triplestore: [ 'fs', 'ag', 'vo', 'gb' ]
runs-on: ubuntu-latest
steps:
Expand All @@ -28,11 +27,10 @@ jobs:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- 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)`
GOO_SLICES=${{ matrix.goo-slice }} bundle exec rake test:docker:${{ matrix.triplestore }} TESTOPTS="-v"
GOO_SLICES=${{ matrix.goo-slice }} bundle exec rake test:docker:${{ matrix.triplestore }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.0
66 changes: 47 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,57 @@
ARG RUBY_VERSION=3.0
ARG DISTRO_NAME=bullseye
# syntax=docker/dockerfile:1

FROM ruby:$RUBY_VERSION-$DISTRO_NAME
# Build arguments with specific versions for better reproducibility
ARG RUBY_VERSION=3.1
ARG DISTRO_NAME=slim-bookworm

RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \
openjdk-11-jre-headless \
raptor2-utils \
wait-for-it \
libraptor2-dev \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p /srv/ontoportal/ontologies_api
RUN mkdir -p /srv/ontoportal/bundle
COPY Gemfile* /srv/ontoportal/ontologies_api/
FROM ruby:${RUBY_VERSION}-${DISTRO_NAME}

WORKDIR /srv/ontoportal/ontologies_api

RUN gem update --system 3.4.22 # the 3.4.22 can be removed if we support Ruby version > 3.0
# Set environment variables
ENV BUNDLE_PATH=/srv/ontoportal/bundle \
BUNDLE_JOBS=4 \
BUNDLE_RETRY=5 \
RAILS_ENV=production \
DEBIAN_FRONTEND=noninteractive

# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
openjdk-17-jre-headless \
raptor2-utils \
wait-for-it \
libraptor2-dev \
build-essential \
libxml2 \
libxslt-dev \
libmariadb-dev \
git \
curl \
libffi-dev \
file \
pandoc \
pkg-config && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

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
RUN cp /srv/ontoportal/ontologies_api/config/environments/config.rb.sample /srv/ontoportal/ontologies_api/config/environments/production.rb
COPY Gemfile* ./

# Install dependencies
RUN bundle install --jobs ${BUNDLE_JOBS} --retry ${BUNDLE_RETRY}

# Copy application code
COPY . .

# Copy config files
RUN cp config/environments/config.rb.sample config/environments/development.rb && \
cp config/environments/config.rb.sample config/environments/production.rb

# Expose port
EXPOSE 9393

# Start command
CMD ["bundle", "exec", "rackup", "-p", "9393", "--host", "0.0.0.0"]
55 changes: 30 additions & 25 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,62 +1,65 @@
source 'https://rubygems.org'
gem 'activesupport', '~> 5'
# see https://github.com/ncbo/ontologies_api/issues/69
gem 'activesupport'
gem 'bigdecimal'
# gem 'faraday', '~> 1.9'
gem 'json-schema', '~> 2.0'
gem 'json-schema'
gem 'multi_json'
gem 'oj'
gem 'parseconfig'
gem 'rack'
gem 'rake', '~> 10.0'
gem 'rake'
gem 'rexml' # Investigate why unicorn fails to start under ruby 3 without adding rexml gem to the Gemfile
gem 'sinatra', '~> 1.0'
gem 'sinatra-advanced-routes'
gem 'sinatra-contrib', '~> 1.0'
gem 'sinatra'
gem 'rackup'

github 'sinatra/sinatra' do
gem 'sinatra-contrib'
end

gem 'request_store'
gem 'parallel'
gem 'json-ld'
gem 'google-protobuf', '3.25.3'
gem 'google-protobuf'
gem 'net-ftp'
gem 'json-ld', '~> 3.2.0'
gem 'rdf-raptor', github:'ruby-rdf/rdf-raptor', ref: '6392ceabf71c3233b0f7f0172f662bd4a22cd534' # use version 3.3.0 when available

# Rack middleware
gem 'ffi', '~> 1.16.3'
gem 'rack-accept', '~> 0.4'
gem 'rack-attack', '~> 6.6.1', require: 'rack/attack'
gem 'rack-cache', '~> 1.13.0'
gem 'ffi', '~> 1.15.0'
gem 'rack-accept'
gem 'rack-attack', require: 'rack/attack'
gem 'rack-cache'
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'
gem 'rack-timeout'
gem 'redis-rack-cache', '~> 2.0'
gem 'redis-rack-cache'

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

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

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

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

# NCBO gems (can be from a local dev path or from rubygems/git)
gem 'ncbo_annotator', git: 'https://github.com/ontoportal-lirmm/ncbo_annotator.git', branch: 'development'
gem 'ncbo_cron', git: 'https://github.com/ontoportal-lirmm/ncbo_cron.git', branch: 'master'
gem 'ncbo_ontology_recommender', git: 'https://github.com/ontoportal-lirmm/ncbo_ontology_recommender.git', branch: 'development'
gem 'ontologies_linked_data', github: 'ontoportal-lirmm/ontologies_linked_data', branch: 'development'
gem 'goo', github: 'ontoportal-lirmm/goo', branch: 'development'
gem 'sparql-client', github: 'ontoportal-lirmm/sparql-client', branch: 'development'
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
gem 'shotgun', github: 'palexander/shotgun', branch: 'ncbo'
gem 'shotgun', github: 'syphax-bouazzouni/shotgun', branch: 'master'
gem 'rubocop'
end

Expand All @@ -77,12 +80,14 @@ end

group :test do
gem 'crack', '0.4.5'
gem 'minitest', '~> 5.0'
gem 'minitest-hooks', "~> 1.5"
gem 'minitest'
gem 'minitest-hooks'
gem 'minitest-stub_any_instance'
gem 'minitest-reporters'
gem 'minitest-fail-fast'
gem 'rack-test'
gem 'simplecov', require: false
gem 'simplecov-cobertura' # for codecov.io
gem 'webmock', '~> 3.19.1'
gem 'webmock'
gem 'webrick'
end
Loading