mintproject / mint

Entry point repository to the core software of the MINT framework
Apache License 2.0
0 stars 1 forks source link

APIs are working fine but there is no data. #9

Open mosoriob opened 1 year ago

mosoriob commented 1 year ago

Issue 2: APIs are working fine but there is no data.

Running helm install iu mintproject/MINT -f values.yaml --wait, I got this output.

 Initialize the database
      # Create database tables

      $ kubectl -n default exec deployment/iu-hasura -c hasura -- \
          hasura migrate apply

      $ kubectl -n default exec deployment/iu-mic-api -c mic-api -- \
          yarn migrate

      # Create metadata

      $ kubectl -n default exec deployment/iu-hasura -c hasura -- \
          hasura metadata apply

      # Populate with regions and variables
      $ kubectl -n default exec deployment/iu-hasura -c hasura -- \
          hasura seeds apply

      $ kubectl -n default exec deployment/iu-model-catalog-endpoint -c endpoint -- \

        sh -c '
          curl -v http://localhost:3030/$/datasets \
          -X POST \
          -u admin:${ADMIN_PASSWORD} \
          --data-raw "dbName=modelcatalog&dbType=tdb2"
        '

      $ kubectl -n default exec deployment/iu-model-catalog-endpoint -c endpoint -- \
        sh -c '
          curl localhost:3030/modelcatalog/data \
           -X POST \
           -u admin:${ADMIN_PASSWORD} \
           --upload-file /fuseki-base/seeds/model-catalog.trig \
           -H  "Content-Type: application/trig"
           '

In the case1 log file, I followed the order to initialize the database, but got an error message:

root@thrush:/home/luoyu/mint# kubectl -n default exec deployment/iu-mic-api -c mic-api --           yarn migrate

yarn run v1.22.19

warning package.json: License should be a valid SPDX license expression

$ yarn run build

warning package.json: License should be a valid SPDX license expression

$ lb-tsc

$ node ./dist/migrate

Migrating schemas (alter existing schema)

WARNING: relational database doesn't support {strict: false} mode. {strict: true} mode will be set for model Input instead.

Cannot migrate database schema Error: Timeout in connecting after 5000 ms

    at Timeout._onTimeout (/home/node/app/node_modules/loopback-datasource-juggler/lib/datasource.js:2658:10)

    at listOnTimeout (node:internal/timers:559:17)

    at processTimers (node:internal/timers:502:7)

command terminated with exit code 137

In the case 2 log file, I ignored that command and no error happened. However, there is no data in the Explore Models pages. I think the database initialization was failed because I ignored that command or made some mistakes. Do you have any thoughts about that error message? Or how can we modify the database to support {strict: false} mode?

mosoriob commented 1 year ago

The instructions aren't clear.

mosoriob commented 1 year ago

I tested using the latest version without issues:

kubectl -n default exec deployment/test-mic-api -c mic-api -- \
          yarn migrate
yarn run v1.22.19
warning package.json: License should be a valid SPDX license expression
$ yarn run build
warning package.json: License should be a valid SPDX license expression
$ lb-tsc
$ node ./dist/migrate
Migrating schemas (alter existing schema)
WARNING: relational database doesn't support {strict: false} mode. {strict: true} mode will be set for model Input instead.
Done in 3.62s.

Can you retry using the latest version:

$ helm repo update
$ helm install iu mintproject/MINT -f values.yaml --wait