ncbo / ontoportal_docker

Scripts for running and developing ontoportal with docker
0 stars 6 forks source link

Dip command "ag-create-repo" doesn't work #4

Open jvendetti opened 6 months ago

jvendetti commented 6 months ago

I'm trying to execute the ag-create-repo dip command, but it's failing with a "no such service" message:

➜  ontoportal_docker git:(main) ✗ docker compose -f docker-compose.backend_only.yml --profile agraph up -d
[+] Building 0.0s (0/0)                                                                                                                                                                                                                 docker:desktop-linux
[+] Running 6/6
 ✔ Network ontoportal_docker_default     Created                                                                                                                                                                                                        0.1s
 ✔ Container ontoportal_docker-solr-1    Started                                                                                                                                                                                                        0.2s
 ✔ Container ontoportal_docker-mgrep-1   Started                                                                                                                                                                                                        0.1s
 ✔ Container ontoportal_docker-agraph-1  Started                                                                                                                                                                                                        0.1s
 ✔ Container ontoportal_docker-redis-1   Started                                                                                                                                                                                                        0.1s
 ✔ Container ontoportal_docker-4store-1  Started                                                                                                                                                                                                        0.1s

➜  ontoportal_docker git:(main) ✗ dip ag-create-repo
no such service: agraph

Context

Now that we're running on AllegroGraph in production, I want to run BioPortal REST API unit tests against AllegroGraph in my local development environment (instead of against 4store, which I'm still currently doing).

For example, I want to execute the unit test suite for ontologies_linked_data like so:

➜  ontologies_linked_data git:(develop) ✗ bundle exec rake test TESTOPTS="-v"

But this results in an error message about a missing triplestore:

Unable to open triple-store "ontoportal_test" (it does not appear to exist). (SPARQL::Client::ClientError)
jvendetti commented 5 months ago

In case it's helpful, I'm posting a workaround from @alexskr

Launch containers using the AllegroGraph profile

docker compose -f docker-compose.backend_only.yml --profile agraph up -d

Delete the 4store container

It's a known issue that both 4store and AllegroGraph are started when using the agraph profile. Use the Docker Desktop application to delete the 4store container.

This step is optional, but it may assist in avoiding insufficient memory errors with subsequent steps:

When allocating the string table failed to create shared memory segment of size 134,225,920, message: "insufficient shared memory space available"

Create an AllegroGraph test database

docker compose -f docker-compose.backend_only.yml --profile agraph exec -it agraph agtool repos create ontoportal_test

In my development environment, this command often fails with insufficient shared memory errors. The only way I can created the test database is to repeatedly execute the command until it succeeds.

Grant user privileges

docker compose -f docker-compose.backend_only.yml --profile agraph exec -it agraph agtool users grant anonymous root:ontoportal_test:rw