Open Concept Lab Setup

Hello @paynejd @raff @christopherkala and I are trying to get the application ready to be able to add the dictionary endpoints for OpenMRS OCL, however, we are receiving the error [ ERROR: manifest for openconceptlab/oclapi:dev not found ], we are stuck and unable to move, kindly advise.

cc @darius

@waweru, please indicate what instructions you are following, and what commands you have run, etc.

Hi Josephat,

Can you please explain where in the set up process you are? What have you completed?

@darius @paynejd
Using Docker as per the Readme:

I have cloned the application then run docker-compose up I then run into this error [ ERROR: manifest for openconceptlab/oclapi:dev not found]

Using The Manual MAC installation:

error 1: After installing Mongo, creating a virtualenv and downloading the required Solr-4.9.0 files, then setting both the $SOLR_HOME and the $SOLR_ROOT the Solr instance ($OCLAPI_ROOT/run_solr.sh) cannot run as the run_solr.sh does not exist in the project directory

error 2: Ignoring the first error and going on to run the api without solr python manage.py syncdb and python manage.py createsuperuser throws the following error [ServerSelectionTimeoutError: mongo.openconceptlab.org:27017: [Errno 8] nodename nor servname provided, or not known] Interestingly python manage.py runserver works and runs the API

To trouble shoot the second error i have tried using both python 2.7 and 3.6 and also downgrading the version of pymongo all of which have not worked.

Can you please try docker-compose build first? It might be needed for the first time (we need to tweak dependencies). Run:

docker-compose build
docker-compose up
2 Likes

This actually works. @raff thanks alot. Should I do a PR to include the docker-compose build?

Yes, let’s add that to README for now.

hey @raff given that the docker container is running well, i am assuming (i might be wrong) that i have to have a running instance of the application locally before triggering a docker-compose build. However, i am trying to set up the local instance without docker, it is working well until when i try [python manage.py syncdb] to run my migrations … Its throwing the error below without completing the process of creating all the tables, what is the fix to this?

 raise OperationFailure(details["err"], details["code"])
 pymongo.errors.OperationFailure: The field 'unique' is not valid for an _id index specification. Specification: { 
 v: 2, unique: true, name: "_id_1", key: { _id: 1 }, ns: "ocl.auth_permission", sparse: false }

I am running pymongo version 2.8, python version 2.7, django version 1.5.11 and the latest mongo version. I am literally stuck since i cannot test what i have been workin on.

cc @darius @dkayiwa

You either do a docker setup or a manual setup, never both, because there will be collision of ports.

After you run docker-compose up you should have API running at http://localhost:8000. If you want to have a UI, clone https://github.com/OpenConceptLab/ocl_web and run docker-compose up from ocl_web project. You should have UI running at http://localhost:7000. That’s it.

If you have any errors running docker-compose up, share them here.

hey, @raff I want to make changes to the API, as i develop, that is why i thought a manual setup will work. i am not trying to run both instances. I am just wondering how do i develop in the live docker container or else if it is possible to manually setup so that i can see my changes as i develop. I want a developer approach on how to edit and make changes to the api either using docker or using the manual setup.

Changes are automatically picked up by the docker container when it is running. All you have to do is start it up with ‘docker-compose up’. For debugging see https://github.com/OpenConceptLab/oclapi#debugging-in-container

The manual setup is quite tedious and error prone and I haven’t done it for a while. I’m only using docker and recommend you too. It’s better to figure out why docker is not working for you. Did you get any errors after changing code? What file are you modifying that isn’t automatically picked up?

Thanks @raff i have actually been able to sort some of the things out, figured out to run the migrations inside the container and to debug from the docker container. I also had errors in the code which i fixed and everything seems to be okay as at now. thanks a lot.