EBISPOT / ols4

Version 4 of the EMBL-EBI Ontology Lookup Service (OLS)
http://www.ebi.ac.uk/ols4/
Apache License 2.0
47 stars 22 forks source link

Deploying OLS to a server #746

Closed hkir-dev closed 2 months ago

hkir-dev commented 2 months ago

Describe the bug

I have a set of application specific ontologies and I want to setup a local instance of the OLS 4 to explore those ontologies.

I deployed OLS to a server following the docker compose based steps. Deployment completed successfully but frontend is trying to access Solr from localhost not through my server ip.

To Reproduce Steps to reproduce the behavior:

  1. On a server (172.27.20.150) completed the docker compose based OLS installation. All OLS modules installed to the same server using the docker compose up command.
  2. In the frontend make a search
  3. UI made request to http://localhost:8080/api/v2/entities?search=VAp&size=5&lang=en&exactMatch=false&includeObsoleteEntities=false however Solr is deployed at 172.27.20.150 and I can see a meaningful response at http://172.27.20.150:8080/api/v2/entities?search=VAp&size=5&lang=en&exactMatch=false&includeObsoleteEntities=false

image

Additionally, I have a set of ontologies to deploy to local OLS instance. I added all of them to the dataload/configs folder. However, only the ontology I provided with parameter export OLS4_CONFIG=./dataload/configs/my_ont1.json is available for search. Is there a way to add multiple ontologies or load all ontologies in the dataload/configs folder?

haideriqbal commented 2 months ago

did you start your backend as well in docker? from the SS it appears that frontend can't communicate with the backend...

hkir-dev commented 2 months ago

Yes, I just run the following commands in the server:

git clone https://github.com/EBISPOT/ols4.git
cd  ols4
// manually added some configs here
export OLS4_CONFIG=./dataload/configs/my_ont1.json
JAVA_OPTS="-Xms5G -Xmx25G"  docker compose up
haideriqbal commented 2 months ago

okay! you can try by changing the env value for API URL in this file https://github.com/EBISPOT/ols4/blob/dev/frontend/.env#L4 to your corresponding link instead of localhost as it tries to connect to localhost whereas your backend is using your server IP and rerun the docker... i suggest using following docker command:

docker compose up --force-recreate --build --always-recreate-deps --attach-dependencies ols4-solr ols4-neo4j ols4-backend ols4-frontend

hkir-dev commented 2 months ago

Great, thanks. Do you have any suggestions for this part:

Additionally, I have a set of ontologies to deploy to local OLS instance. I added all of them to the dataload/configs folder. However, only the ontology I provided with parameter export OLS4_CONFIG=./dataload/configs/my_ont1.json is available for search. Is there a way to add multiple ontologies or load all ontologies in the dataload/configs folder?

haideriqbal commented 2 months ago

You can load multiple ontologies by defining them in a single json file something like this:

{
  "ontologies": [
      {
          "id": "upheno",
          "ontology_purl": "https://github.com/obophenotype/upheno-dev/releases/latest/download/upheno.owl"
      },
      {
          "id": "uniprotrdfs",
          "ontology_purl": "https://ftp.uniprot.org/pub/databases/uniprot/current_release/rdf/core.owl"
      },
      {
          "id": "hra",
          "ontology_purl": "https://cdn.humanatlas.io/digital-objects/collection/hra-ols/latest/graph.ttl",
                  "hierarchical_property": [
              "http://purl.org/ccf/ccf_part_of"
              ],
                  "label_property": [
              "http://purl.org/ccf/ccf_pref_label"
              ]
      },
      {
          "id": "dcat",
          "ontology_purl": "https://www.w3.org/ns/dcat.ttl"
      },
      {
          "id": "biolink",
          "ontology_purl": "https://github.com/biolink/biolink-model/raw/master/project/owl/biolink_model.owl.ttl",
          "homepage": "https://biolink.github.io/biolink-model/"
      }
]
}

and then export this file as OLS4_CONFIG