forked from ontoportal/ontologies_api
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: add ontoportal bash script (#59)
* add ontoportal bash script to run test and development servers * update README.md * update docker CI to work in production releases
- Loading branch information
1 parent
1d13691
commit 64b2af7
Showing
10 changed files
with
305 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
API_URL=http://localhost:9393 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Docker branch Images build - ARM version | ||
|
||
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/arm64 | ||
build-args: | | ||
RUBY_VERSION=2.7 | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }}-${{ env.BRANCH_NAME }}-arm64 | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,3 +71,5 @@ test/data/ontology_files/catalog-v001.xml | |
create_permissions.log | ||
|
||
ontologies_api.iml | ||
|
||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,53 @@ | |
|
||
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. | ||
``` | ||
### Configuration | ||
``` | ||
cp .env.sample .env | ||
``` | ||
|
||
### 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) | ||
|
@@ -19,7 +65,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: | ||
|
||
|
@@ -46,22 +92,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 | ||
|
@@ -73,7 +119,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: | ||
|
||
|
@@ -87,7 +133,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 | ||
|
Oops, something went wrong.