mysociety / mapit

A web service to map postcodes to administrative boundaries and more
Other
269 stars 88 forks source link

Fix MapIt install script #413

Closed mikejamesthompson closed 8 months ago

mikejamesthompson commented 10 months ago

This PR attempts to fix the automated installation script for MapIt on more recent versions of Ubuntu (but not Jammy, 22.04) and Debian Linux.

I have confirmed the installation succeeds on clean installs of Ubuntu Focal (20.04) and Debian Bullseye (11) on Amazon EC2 instances at the default hostname, and tested subsequent loading of boundary data works on Debian Bullseye.

It does not appear to work automatically on Ubuntu Jammy (22.04) because of changes in apt-get install behaviour, I think related to the needrestart command, but I haven't had time to investigate this properly.

To use this version of the install script, you can use the override behaviour in the install-site.sh script. Run the following commands:

curl -O https://raw.githubusercontent.com/mysociety/commonlib/master/bin/install-site.sh
chmod u+x install-site.sh
export REPOSITORY_URL_OVERRIDE=https://github.com/mikejamesthompson/mapit
export BRANCH_OVERRIDE=fix-install-script
sudo --preserve-env ./install-site.sh --default mapit mapit

Changes are explained in commit messages.

mikejamesthompson commented 10 months ago

If this is the kind of thing that you'd like to merge into the repo then I'd be happy to also contribute documentation changes as well.

dracos commented 10 months ago

Thanks, looks good! Happy to merge with doc changes :)

mikejamesthompson commented 10 months ago

Thanks, looks good! Happy to merge with doc changes :)

I was thinking of these docs but can't find them in this repo and I'm not sure what else I would update. Can you point me in the right direction please 🙏 ?

dracos commented 10 months ago

Sure, it looks like they're the gh-pages branch of this repo.

mikejamesthompson commented 10 months ago

Sure, it looks like they're the gh-pages branch of this repo.

Ok, I'll need to do that in a separate PR.

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (6b66c97) 74.66% compared to head (aba534a) 74.97%. Report is 4 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #413 +/- ## ========================================== + Coverage 74.66% 74.97% +0.30% ========================================== Files 45 47 +2 Lines 2759 2805 +46 ========================================== + Hits 2060 2103 +43 - Misses 699 702 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mikejamesthompson commented 9 months ago

Just looking at this now, and an issue is that gunicorn isn't a necessary component of mapit itself, so I'm not sure we want that in install_requires - because it doesn't. Could that be taken out of there, and put back in site-specific-install.sh - but installed into the virtual env as you suggest, rather than installed with apt?

Yes, fair enough.

I've added a couple of commits that make that change, PTAL.

dracos commented 8 months ago

Thanks :)