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

Feature: Align to AgroPortal 3.0 #14

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
452c5e2
Feature: mappings statistics slices support (#78)
Bilelkihal May 21, 2024
c2ac9e0
update owl wrapper version to v1.4.3
syphax-bouazzouni Jun 26, 2024
0bb7916
update test search multilingual test to ensure selecting one prefLabel
syphax-bouazzouni Jun 27, 2024
147e44b
add filter search results attributes by language
syphax-bouazzouni Jun 27, 2024
955817a
add search multiple languages or all languages tests
syphax-bouazzouni Jun 27, 2024
923629e
implement display search results in multiple languages
syphax-bouazzouni Jun 27, 2024
6abcaaa
fix annotator prefLabel language selection
syphax-bouazzouni Jun 27, 2024
ab38c60
fix: remove duplicated agents endpoint ('/Agents') (#85)
Bilelkihal Jul 23, 2024
67bc9fb
Feature: implement ontology agents endpoint (#84)
syphax-bouazzouni Jul 23, 2024
4534006
Merge pull request #82 from ontoportal-lirmm/fix/search-multilingual-…
Bilelkihal Jul 24, 2024
014eb3d
Feature: update agents search endpoint to add option to have a custom…
Bilelkihal Aug 1, 2024
fc11608
Fix: hide duplicated agents endpoint ('/Agents') (#91)
syphax-bouazzouni Aug 1, 2024
e9d1db6
Merge branch 'master' into development
syphax-bouazzouni Aug 5, 2024
189a35c
Feature: Add OntoPortal API deployment CI (#88)
syphax-bouazzouni Aug 8, 2024
34ebd68
Merge branch 'master' into development
syphax-bouazzouni Aug 8, 2024
b434252
Merge pull request #87 from ontoportal-lirmm/development
syphax-bouazzouni Aug 8, 2024
67f376c
Merge branch 'master' into development
syphax-bouazzouni Aug 8, 2024
54424ed
Merge branch 'development'
syphax-bouazzouni Aug 8, 2024
16fedb9
Feature: Add unmapped, range and domain attributes for properties end…
syphax-bouazzouni Aug 23, 2024
fc6635f
update home endpoint to add portal config information
syphax-bouazzouni Aug 30, 2024
dd3be1f
set the portal config id as the the api endpoint host
syphax-bouazzouni Sep 4, 2024
82ded73
Feature: Add unmapped, range and domain attributes for properties end…
syphax-bouazzouni Aug 23, 2024
41743a6
Merge branch 'master' into development
syphax-bouazzouni Sep 10, 2024
5d56ebb
add submission diff endpoint
syphax-bouazzouni Sep 16, 2024
30476b5
Merge branch 'feature/add-portal-config-endpoint' into development
Bilelkihal Sep 19, 2024
2c2d837
Merge branch 'development' into feature/add-diff-parsing-endpoint
syphax-bouazzouni Oct 4, 2024
1c27d64
add a test for parent category
Bilelkihal Oct 5, 2024
129294f
use parent category branch in the gemfile
Bilelkihal Oct 5, 2024
3afae26
update test parent category to use parentCategory instead of parentCa…
Bilelkihal Oct 5, 2024
40c5444
save category and fetch it in test parent category
Bilelkihal Oct 10, 2024
87b4add
Merge pull request #97 from ontoportal-lirmm/feature/test-parent-cate…
syphax-bouazzouni Oct 10, 2024
eb15fd3
Merge branch 'development' into feature/add-diff-parsing-endpoint
syphax-bouazzouni Oct 19, 2024
e0cfbd9
Merge pull request #95 from ontoportal-lirmm/feature/add-diff-parsing…
syphax-bouazzouni Oct 19, 2024
4b62667
Fix: Broken password reset after merging (ontologies_linked_data PR#1…
muhammedBkf Oct 21, 2024
3fb29ce
Fix: remove file parameters when no file is uploaded (#99)
muhammedBkf Oct 22, 2024
34ecc2d
Fix: multilingual generated missing labels issue (#101)
syphax-bouazzouni Oct 24, 2024
8a21637
Feature: Migrate to minitest 5 (#102)
syphax-bouazzouni Oct 26, 2024
9e77603
Merge branch 'development' into ecoportal
syphax-bouazzouni Oct 26, 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
7 changes: 6 additions & 1 deletion .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,4 +10,8 @@ tmp/*
# Editor temp files
*.swp
*.swo
test/solr
coverage
# Ignore generated test data
test/data/uploaded_ontologies/**/*
test/data/ontology_files/repo/**/*
test/log
123 changes: 65 additions & 58 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,92 @@
# 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.
# Workflow to deploy OntoPortal API to stage/prod systems
#
# Required github secrets:
#
# CONFIG_REPO - github repo containing config and customizations for the API. Format 'author/private_config_repo'
# CONFIG_REPO - github repo containing config and customizations for 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.
# PRIVATE_CONFIG_REPO env var is constructed from it which is used by capistrano on the API hosts for pulling configs.
#
# GH_PAT - github Personal Access Token for accessing PRIVATE_CONFIG_REPO
# 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.
# SSH_JUMPHOST - ssh jump/proxy host though which deployments have to though if API nodes live on private network.
# SSH_JUMPHOST_USER - username to use to connect to the ssh jump/proxy.
#
# 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.
# DEPLOY_ENC_KEY - key for decrypting deploymnet ssh key residing in config/
# this SSH key is used for accessing jump host, API 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]
push:
branches:
- stage
- test
# Allows running this workflow manually from the Actions tab
workflow_dispatch:
branches: [master, develop]
inputs:
BRANCH:
description: 'Branch/tag to deploy'
default: develop
description: "Branch/tag to deploy"
options:
- stage
- test
- master
default: stage
required: true
environment:
description: 'target environment to deploy to'
description: "target environment to deploy to"
type: choice
options:
- staging
- production
default: staging

- agroportal
- test
default: stage
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
BUNDLE_WITHOUT: default #install gems required primarely for deployment in order to speed up workflow
PRIVATE_CONFIG_REPO: ${{ format('[email protected]:{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
- 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:github.head_ref:-master}" >> $GITHUB_ENV

USER_INPUT_ENVIRONMENT=${{ inputs.environment }}
echo "TARGET=${USER_INPUT_ENVIRONMENT:-staging}" >> $GITHUB_ENV

CONFIG_REPO=${{ secrets.CONFIG_REPO }}
GH_PAT=${{ secrets.GH_PAT }}
echo "PRIVATE_CONFIG_REPO=https://${GH_PAT}@github.com/${CONFIG_REPO}" >> $GITHUB_ENV

echo "SSH_JUMPHOST=${{ secrets.SSH_JUMPHOST }}" >> $GITHUB_ENV
echo "SSH_JUMPHOST_USER=${{ secrets.SSH_JUMPHOST_USER }}" >> $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.8 # 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/${{ inputs.environment }}/* .
# add ssh hostkey so that capistrano doesn't complain
- name: Add jumphost's hostkey to Known Hosts
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_JUMPHOST }}"
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
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ config/environments/*
!config/environments/config.rb.sample

#ignore capistrano deployment
config/deploy/*
config/*.p12

# Ignore generated test data
Expand All @@ -56,8 +55,6 @@ test/data/ontology_files/repo/**/*

*.swp

.ruby-version

config/environments/console.rb

config/environments/development.rb.sample
Expand Down
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.6
4 changes: 2 additions & 2 deletions Capfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ install_plugin Capistrano::SCM::Git
# https://github.com/capistrano/rails
#
# require 'capistrano/rvm'
# require 'capistrano/rbenv'
require 'capistrano/rbenv'
# require 'capistrano/chruby'
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 }
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG RUBY_VERSION
ARG RUBY_VERSION=3.0
ARG DISTRO_NAME=bullseye

FROM ruby:$RUBY_VERSION-$DISTRO_NAME
Expand Down
30 changes: 19 additions & 11 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
source 'https://rubygems.org'

gem 'activesupport', '~> 3.2'
gem 'activesupport', '~> 5'
# see https://github.com/ncbo/ontologies_api/issues/69
gem 'bigdecimal', '1.4.2'
gem 'faraday', '~> 1.9'
gem 'bigdecimal'
# gem 'faraday', '~> 1.9'
gem 'json-schema', '~> 2.0'
gem 'multi_json', '~> 1.0'
gem 'multi_json'
gem 'oj'
gem 'parseconfig'
gem 'rack'
gem 'rake', '~> 10.0'
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 'request_store'
gem 'parallel'
gem 'json-ld'

gem 'google-protobuf', '3.25.3'

# Rack middleware
gem 'ffi', '~> 1.15.5'
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'
Expand All @@ -35,7 +35,7 @@ gem 'redis-store', '~>1.10'

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

# HTTP server
gem 'unicorn'
Expand All @@ -53,16 +53,21 @@ gem 'sparql-client', github: 'ontoportal-lirmm/sparql-client', branch: 'developm
gem 'ontologies_linked_data', git: 'https://github.com/lifewatch-eric/ontologies_linked_data.git', branch: 'master'
gem 'ncbo_cron', git: 'https://github.com/lifewatch-eric/ncbo_cron.git', 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 'ed25519', '>= 1.2', '< 2.0', require: false
gem 'pry'
gem 'shotgun', github: 'palexander/shotgun', branch: 'ncbo'
end


Expand All @@ -71,10 +76,13 @@ group :profiling do
end

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