Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Vagrant development boxes #7503

Merged
merged 1 commit into from Oct 19, 2023
Merged

Drop Vagrant development boxes #7503

merged 1 commit into from Oct 19, 2023

Conversation

gbp
Copy link
Member

@gbp gbp commented Jan 5, 2023

What does this do?

Drop Vagrant development boxes

Why was this needed?

We are now using Docker for development instead.

Notes to reviewer

@garethrees are you okay with remove the Vagrantfile? As its of no use on M1 Macs I see no reason to keep it around as we can't test it. Going forward we need a plan on how to test OSs.

@garethrees
Copy link
Member

Need to think about this a bit. It looks like it may be possible to use VirtualBox on M1 soon.

I'd like to both simplify what we maintain, but also get back to a place where we develop with dev/prod parity, which we're not really doing right now, but were much closer with the Vagrant setup.

Also need to consider future mySociety infrastructure direction.

@garethrees
Copy link
Member

Looks like Rails is going to start generating a Dockerfile by default, so that's probably the way we want to go here.

@gbp
Copy link
Member Author

gbp commented Mar 30, 2023

In my recent install script changes I have been using UTM on my M1 mac, with the https://mac.getutm.app/gallery/debian-11-xfce sample image. Following https://alaveteli.org/docs/installing/script/ with some minor changes.

Login as the debian user and run:

sudo apt-get install curl
curl -O https://raw.githubusercontent.com/mysociety/commonlib/master/bin/install-site.sh
sudo sh install-site.sh alaveteli alaveteli alaveteli.192.168.64.2.nip.io

The install will fail with:

Installing packages from repository packages file...
E: Unable to locate package wkhtmltox

So I become the alaveteli user and cd /var/www/alaveteli.192.168.64.2.nip.io/alaveteli. Checkout the develop branch, update git submodules and make these changes:

diff --git a/config/packages.generic b/config/packages.generic
index c57c7f05a..cb7c2bf55 100644
--- a/config/packages.generic
+++ b/config/packages.generic
@@ -31,6 +31,6 @@ ttf-bitstream-vera
 unrtf
 unzip
 uuid-dev
-wkhtmltox
+wkhtmltopdf
 wv
 xapian-tools

Re-running the install script might error with:

Cloning or updating repository... updating... fatal: detected dubious ownership in repository at '/var/www/localhost/alaveteli'
To add an exception for this directory, call:
git config --global --add safe.directory /var/www/alaveteli.192.168.64.2.nip.io/alaveteli

If so, change the install script by:

diff --git a/bin/install-site.sh b/bin/install-site.sh
index a231959..a2addf6 100755
--- a/bin/install-site.sh
+++ b/bin/install-site.sh
@@ -668,6 +668,6 @@ add_unix_user
 update_apt_sources
 # Remove one crippling package, if it's installed:
 apt-get -qq remove -y --purge apt-xapian-index >/dev/null || true
-clone_or_update_repository
+# clone_or_update_repository
 chown -R "$UNIX_USER"."$UNIX_USER" "$DIRECTORY"
 run_site_specific_script

And now re-running the install script again should finally now work.

Next, we need to disable the default nginx site rm /etc/nginx/sites-enabeled/default. Then reboot sudo reboot or restart the services sudo systemctl reload nginx & sudo systemctl start alaveteli-thin.

The site should be accessible from http://alaveteli.192.168.64.2.nip.io/ - NB: no SSL by default.

@gbp
Copy link
Member Author

gbp commented Oct 17, 2023

The above wkhtmltox package change isn't needed anymore as mySociety provides Arm version of wkhtmltox now.

@gbp
Copy link
Member Author

gbp commented Oct 17, 2023

With the move to BUSL I think we should get this merged.

We now recommend using Docker for development instead.
@gbp gbp marked this pull request as ready for review October 17, 2023 15:53
@garethrees
Copy link
Member

Agree! 🧹

@gbp gbp merged commit 99beea6 into develop Oct 19, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants