orchestracities / ngsi-timeseries-api

QuantumLeap: a FIWARE Generic Enabler to support the usage of NGSIv2 (and NGSI-LD experimentally) data in time-series databases
https://quantumleap.rtfd.io/
MIT License
38 stars 49 forks source link

Failing to run up docker containers via docker-compose #270

Closed mtalhaf closed 3 years ago

mtalhaf commented 5 years ago

While trying to run a local instance of quantum leap with all the other necessary tools via the docker-compose provided, the quantum leap container fails with an error of "Failed to add operation for POST /v2/config", while the final error being "connexion.exceptions.ResolverError: <ResolverError: Cannot resolve operationId "reporter.reporter.config"! Import error was "No module named 'pytest'">"

To Reproduce Steps to reproduce the behavior:

  1. Download repository as zip
  2. Navigate to docker folder
  3. Run docker-compose -f docker-compose-dev.yml up -d

Expected behavior All tools should run properly to be able to test quantum leap.

Environment (please complete the following information):

Find attached the logs form Quantum leap while running the docker-compose without the -dcommand

Quantum-leap-error.txt

Any help with this is appreciated.

c0c0n3 commented 5 years ago

Hi @mtalhaf, it looks like your problem could be that you didn't run pipenv install (installs Python env + deps) and setup_dev_env.sh (sets up vars you'll need to run docker compose files). Try this:

$ cd wheres/you/extracted/ngsi-timeseries-api
$ pipenv install
$ sh setup_dev_env.sh
$ cd dir/where/docker-compose/you/want/to/run/is
$ docker-compose up -d

Let me know if that works for you :-)

chicco785 commented 5 years ago

i think the point is which image has been used, if it is the one from the docker hub repo, there is surely a problem, a local one was used, I believe andrea is correct

On Thu, 31 Oct 2019 at 15:15, c0c0n3 notifications@github.com wrote:

Hi @mtalhaf https://github.com/mtalhaf, it looks like your problem could be that you didn't run pipenv install (installs Python env + deps) and setup_dev_env.sh (sets up vars you'll need to run docker compose files). Try this:

$ cd wheres/you/extracted/ngsi-timeseries-api $ pipenv install $ sh setup_dev_env.sh $ cd dir/where/docker-compose/you/want/to/run/is $ docker-compose up -d

Let me know if that works for you :-)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/smartsdk/ngsi-timeseries-api/issues/270?email_source=notifications&email_token=AAF5YAWONODFFESYP73B6YDQRLR7LA5CNFSM4JHKDC72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECX5WXQ#issuecomment-548395870, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAF5YAQW6H2OFZRLNIBR3WTQRLR7LANCNFSM4JHKDC7Q .

kernchen commented 5 years ago

@chicco785, @c0c0n3,

Just writing, since I've been working on this with @mtalhaf together. We basically tried out QuantumLeap. I tried it out a bit earlier with this hash, that didn't have any issues:

sha256:d310ee076e91a60c857c9f49dee5524149d52b44afe763e9b8ac661f0f0de6bb

It's coming directly from Docker Hub. We've been using the same docker-compose-dev.yml file. While mine processed fine, it says "2 weeks ago". @mtalhaf is now having issues with latest.

Hope that helps.

kernchen commented 5 years ago

Maybe as an addition, would you recommend using 0.7.5 instead of latest?

chicco785 commented 5 years ago

for the time being yes, i suspect the issue is related with #269

On Thu, 31 Oct 2019 at 17:03, Ralf Kernchen notifications@github.com wrote:

Maybe as an addition, would you recommend using 0.7.5 instead of latest?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/smartsdk/ngsi-timeseries-api/issues/270?email_source=notifications&email_token=AAF5YAW2EMSHK7LAUNQZ3KLQRL6VBA5CNFSM4JHKDC72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECYKKMQ#issuecomment-548447538, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAF5YAXQR655INDNXIFFZG3QRL6VBANCNFSM4JHKDC7Q .

-- Dr. FEDERICO MICHELE FACCA CTO, Head of Martel Lab +41 788075838 MARTEL INNOVATE https://www.martel-innovate.com/ - INNOVATION, WE MAKE IT HAPPEN Click HERE to download Martel reports and white papers! https://www.martel-innovate.com/premium-content/ Follow us on TWITTER https://twitter.com/Martel_Innovate

c0c0n3 commented 5 years ago

@mtalhaf @kernchen hi guys, like I said, did you try doing what I suggested? In particular the reason for running setup_dev_env.sh is that it also builds a local QL image that the docker compose files pick up later---see env vars in those docker compose files, which btw get set up when you run setup_dev_env.sh. Anyway, like I said earlier it looks like your problem is that pytest isn't there, which is why you should try running pipenv install. Long story short, please try what I suggested earlier :-)

For the record, this works flawlessly on my Mac:

$ git clone https://github.com/smartsdk/ngsi-timeseries-api.git
$ cd ngsi-timeseries-api
$ pipenv install
$ sh setup_dev_env.sh
$ cd docker/
$ docker-compose -f docker-compose-dev.yml up -d
$ docker-compose -f docker-compose-dev.yml logs
   (...hunky dory...)
$ curl http://0.0.0.0:8668/v2/version
{
    "version": "0.7.5"
}

Again, shout if this still doesn't work for you, we'll be glad to help :-)

c0c0n3 commented 5 years ago

@mtalhaf @kernchen hi again, are you running on Linux by any chance? Just got this Travis build error:

https://travis-ci.org/smartsdk/ngsi-timeseries-api/builds/605998561?utm_source=github_status&utm_medium=notification

on a Linux box which looks similar to yours. Will dig deeper...

kernchen commented 5 years ago

@c0c0n3 hi, we tried it on an AWA EC2 instance, but also locally on a Mac had issues. We now managed to get a running setup online, but with the actual 0.7.5, so I'll try to follow your steps in the previous posts on my Mac and see if this throws any errors and let you know.

kernchen commented 5 years ago

OK, seems at least locally on my Mac this doesn't produce any issues for me according to your previous provided steps.

c0c0n3 commented 5 years ago

hi @kernchen, thanks for this. PR #271 implements a fix---what was broken is detailed in the comments to #269. As soon as we merge #271 into master you should be able to build and run the QuantumLeap image on any box, in particular on an EC2 instance. If you could please try again after we merge #271 and let us know if you still have any issues.

chicco785 commented 5 years ago

271 is merged and the build is successful