Closed bdewilde closed 1 year ago
@samanz i think i got the everything* working in docker! to test for yourself, you'll have to comment out all of the lock functionality in tasks.py
(ugh sorry), then get the services up and running with docker compose up --build
. shell into the colandr-api
container and run flask reset-db
followed by flask add-admin --name [NAME] --email [EMAIL]
, plus an immediate password prompt. then you can try running my old "test" script outside docker like python repopulate_db --email [EMAIL] --password [PASSWORD]
. you should see lots of logging in the api as well as worker containers that confirms things are chugging along.
*excluding ~full-text uploads~, redis task locking, and user auth in unit testing, as mentioned in the PR message; ~as well as citation deduplication, which should be easy to fix (just have to get the model files into the docker container)~
imho this is a big improvement over the old setup!! just gotta get a couple key missing pieces working before we can really start hacking on this code.
update: full-text uploads and citation deduping now appear to be working 👍
hi @samanz , i think i've gotten everything working, except for the unit testing user auth issue. I'm just going to merge, so I can work on the testing issue separately. Please feel free to review this PR after the fact.
changes
very sorry to dump a bunch of changes together like this 😞 i was obliged to iteratively reorganize and update various aspects of the app's setup+structure in order to make progress on dockerizing and testing the app, which remains my primary goal.
app.py
, various extensions initialized inextensions.py
, and errors initialized separately on aBlueprint
, to greatly simplify and standardize the "app factory" code__init__.py
code as a temporary reference, just commented outget_uploaded_fulltext_file()
route from that file into the api where other similar routes are definedflask-script
dependency and itsmanage.py
interface, in favor of flask's more modern, built-in click cli functionality viacli.py
; behavior is effectively unchanged, but the calls are more intuitivecolandr.api
packageflask_restx.Namespace
s (the api equivalent offlask.Blueprints
)questions
flask-login
or something ... would love another perpsective on this problem.REDIS_CONN
intasks.py
: that redis connection uses localhost by default, and even when specifying a host name that works in the compose file, it doesn't appear to work here. The only way I got this to work was by removing the lock entirely, which is only a temporary fix.btw, this is where i landed on what was originally posted here: https://github.com/datakind/permanent-colandr-back/pull/48