sourcegraph / checkup

Distributed, lock-free, self-hosted health checks and status pages
https://sourcegraph.github.io/checkup
MIT License
3.42k stars 248 forks source link

Heavy non-static dependency on SQL/SQLite #102

Closed parkr closed 4 years ago

parkr commented 5 years ago

Hi! I build a Docker image for checkup for my use. In order to get the most up-to-date releases, I build from source and choose a Git revision to build from.

I recently upgraded my automatic builds to Actions v2 and discovered (since it hasn't run in a while) that the more recent versions of checkup require gcc, sqlite, and libc! It also takes a full 90 seconds to compile, which is insane for a small Go app. I was super puzzled since this was meant to be a really simple app and discovered that #61 had been merged adding a mandatory SQL dependency. The compile dependencies & compile time increase are due to this addition.

Is there any way to add a build flag to remove this dependency? I use GitHub as a storage backend and have no need for SQL. Maybe we can make heavier dependencies like this optional.

parkr commented 4 years ago

:revolving_hearts:

titpetric commented 4 years ago

I think the main issue was the SQLite dependency, which requires CGO. Beyang closed the issue as the master already added an opt-in build for this, but additional refactors may push the compile time a bit. Tag me if you notice some issues.

parkr commented 4 years ago

I think the main issue was the SQLite dependency, which requires CGO.

This was part of it. The other part was how long compilation took. I run these builds in GitHub Actions and noticed how long it took to build. Today, it takes 75s to do the entire process of linting the Dockerfile, pulling down the base image, building the image and quickly testing it. This is a dramatic improvement since it was 90s for just the Go binary compilation before.

https://github.com/parkr/dockerfiles/runs/807906778?check_suite_focus=true