knowledge-repo
knowledge-repo copied to clipboard
Docker for testing
This PR:
- Dockerizes the knowledge_repo application, using an image based on the current Travis build environment
- Updates the Travis build/test script to use the dockerized application
- Adds a system test container to check that the application is being served correctly (this consists of a stub for now with just one test to check that GET /feed returns a page)
- Deploys a Docker image to Docker Hub, providing that the environment variables DOCKER_USERNAME, DOCKER_PASSWORD and DOCKER_REPO are configured in Travis
- Adds a requirements.txt so that prerequisites can be installed in a Docker layer without running setup.py (improves caching of Docker layers during development)
- Adds environment variables PYPI_USER, PYPI_PASS_SECURE and PYPI_REPO to make the deploy process to PyPI configurable in Travis (and prevent deploy being triggered from an outside fork like this one!)
Auto-reviewers: @NiharikaRay @matthewwardrop @earthmancash @danfrankj
Hi @zerogjoe,
Thanks for you contribution 👍 , I have some issues with the pycosat dependency, when trying to build the Docker image I get the following error :
Collecting pycosat==0.6.2
Could not find a version that satisfies the requirement pycosat==0.6.2 (from versions: 0.6.1)
No matching distribution found for pycosat==0.6.2
Switching the package version to 0.6.1 seems to fix the problem.
Regards, Said026
In case anyone else runs into this in the future - I had problems with running the container and getting a RuntimeError: Database configuration is not suitable for deployment (not thread-safe). error. Adding --engine flask as per this issue to CMD ["bash", "-c", "knowledge_repo --repo ./default_repo deploy --port ${PORT} --engine flask"] fixed the problem.
@zerogjoe Can you document setting up local testing environment in the folder /docs so that it's easier for a person who has just discovered this repository to easily contribute right away?
Currently, the churn rate for contributing (especially for me) is pretty high due to lack of knowledge on setting things up properly on your machine. Thanks!