Hey team,
I've been thinking about steps to automate release builds and to remove NodeJS & npm dependency from prod installations. Here's my high level plan on how to do this:
Automation to publish release images:
- When a tag is made and pushed to GH, build and push images (tagged as latest) to DockerHub.
- Use a mathesar_bot Docker account to do this.
- GH action:
- Trigger: On new tag
- Perform: Clone repo, check out tag, log into DockerHub, build and publish the images.
- For making the release itself on GH, I'd personally prefer it to come from a human.
- GH shows who made each release and it'll be good for it to come from different maintainers instead of a bot account.
Removing NodeJS from Production docker image
- I've already raised a PR to do this: https://github.com/mathesar-foundation/mathesar/pull/3474
- This has a >28% reduction in final image size.
- The frontend files are still built during the Docker image creation instead of downloading it from a hosted location to keep the image building process atomic and independent.
Removing NodeJS from 'Install from scratch' installation method
- When a release is made on GH:
- We'll have a GH action to build and add frontend files to the release assets.
- In the Install from scratch docs:
- Add a step to download frontend static files into the correct location.
- Remove steps that install NodeJS and npm.
Bonus: Make Caddy optional in 'Install from scratch' method
- Caddy is used here mainly to serve the static files.
- It would be better to serve them from gunicorn, make Caddy optional, and let the user decide their prod setup.
- This will vastly reduce the complexity in this installation method.
Let me know what you all think.
I've not yet made any basecamp tasks since we've not had a team wide discussion on this and on who's going to be doing them. However, I'd like to start work on these.
Unless I hear any objections or suggestions, I'm going to be making progress around these items this week.