sfu-natlang / lensingwikipedia

Lensing Wikipedia is an interface to visually browse through human history as represented in Wikipedia. This the source code that runs the website:
http://lensingwikipedia.cs.sfu.ca
Other
11 stars 4 forks source link

Reorganize backend/ #181

Closed avacariu closed 9 years ago

avacariu commented 9 years ago

There are a few things I changed here:

All these are in the commit messages below, but I thought I'd write a nice list.

I've tested that the backend still works the same as before (and it does), but as always, I'd appreciate if someone else could confirm.

theq629 commented 9 years ago

I just test it quickly and it seems to work well except that the README says to use the relative path to the domain dir:

CONFIG=domains/wikipediahistory/ make
CONFIG=domains/avherald/ make

whereas the makefile actually adds the domains/. I'd slightly favour having the makefile use $(CONFIG) directly since it's in keeping with $(SRC) and $(OUT).

theq629 commented 9 years ago

Also, it might be good to take the Makefile.local thing from my mwhitneybackendmakefileproposal branch (for #176) even if we don't decide to use the other changes there. That way the domain can be set in Makefile.local, corresponding to the frontend domain setting in local_config.py.

avacariu commented 9 years ago

I fixed the CONFIG thing in the README. I prefer without the path since it's less typing and all domain-specific files should be in domains/ (and in git) so that when we build these automatically using Docker, you can quickly clone the repo and build a set of Docker images for a specific domain.

RE: Makefile.local Do you have an example Makefile.local in that branch? I didn't see one in backend/ or domains/*/. Is that file supposed to just set some environment variables and then run the main Makefile?

theq629 commented 9 years ago

I didn't have any example, but it would get sourced by the makefile and could change either the paths that are defined in Makefile or standard system paths like PATH and LD_LIBRARY_PATH. So if a user wants to save their local setup they use Makefile.local, and since that file isn't in the repository it's harder to accidentally commit local settings. Similar to local_config.py on the frontend.

The change is just to add "-include Makefile.local" after the SRC, CONFIG, OUT definitions, plus a line of documentation somewhere.

theq629 commented 9 years ago

Also, the top level README and the top part of website.md ("Choose a domain") still refer to domains/.

avacariu commented 9 years ago

As long as you can still pass it those definitions as environment variables, then I think the Makefile.local is a good idea.

theq629 commented 9 years ago

Yes, but in that case the "-include Makefile.local" should be before the variables, and anything in Makefile.local that might need to be overridden by the environment should be defined with ?= instead of =.

I just pushed my suggestion to move-backend-domains-local.

avacariu commented 9 years ago

I think the suggestion's going to work well. I merged your commits into move-backend-domains.