Hey team,
I came across
uv a while back, and it's awesome!
I managed to bundle it and create distributions for linux_x64(amd), Apple macOS intel, and Apple macOS Silicon.
These distributions are NOT reliant on docker.
Here's what we get:
- Users do not need to have python installed in the first place!!!
- No more annoying problems with asking the users to install python.
- python gets installed locally (not-globally) within Mathesar's installation folder.
- Frontend is pre-compiled and is part of the distributions.
- No need to host frontend assets anymore.
- Django translations are pre-compiled and are part of the distributions.
However,
- Users still need to have PostgreSQL running somewhere.
- We don't bundle PostgreSQL and aren't going to be able to do so for a while.
- It's not going to be easy, but technically possible for Windows and MacOS.
Here's the branch where I have
the distributions and the build script:
simplify-install.
Here's how you can install Mathesar and test. These commands are for Linux amd x64 platform (Use links further below if you want to install on Mac):
1. Have PostgreSQL running somewhere. Create a mathesar_django database in it.
2. Create a folder to install Mathesar, and cd into it.
mkdir -p /etc/mathesar-test/
2. Download the linux_64 binary. Note: This distribution is amd based and will not work on ARM machines.
3. Extract it:
tar -xzf mathesar-linux_x64.tar.gz
4. Set env variables and Run it:
export SECRET_KEY='2gr6ud88x=(p855_5nbj_+7^bw-iz&n7ldqv%94mjaecl+b985'
export POSTGRES_DB=mathesar_django
export POSTGRES_USER=mathesar
export POSTGRES_PASSWORD=mathesar
export POSTGRES_HOST=localhost
export POSTGRES_PORT=5432
./run-uv.sh
That's it! Visit `localhost:8000` and Mathesar should be running.
If you face any error while running `run-uv.sh`, ensure you have gcc installed. This is needed for installing some of our python requirements like clevercsv.
Here are the download links for:
This heavily simplifies our install from scratch setups.
- Makes Mathesar way more portable, enabling local-first installations.
- We can build for more platforms if we want to. Eg., Linux arm platforms.
- Opens the possibility of creating more sophisticated binary installation setups.
- Imagine a 'Mathesar.app', or 'Mathesar.exe'.
Further steps/discussions I'd like to have:
- I think we should consider creating distributions for our next release (after 0.2.0).
- We already have a working POC.
- We should restart discussions on considering SQLite for the Django database again.
- I still think we should definitely allow creating databases from within Mathesar. We would have to find a different flow for it.
I'm excited about this!
- Pavish.