github: rework Docker build, and publish new images#489
github: rework Docker build, and publish new images#489thoughtpolice wants to merge 1 commit intofacebookincubator:mainfrom
Conversation
✅ Deploy Preview for fb-oss-glean ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
simonmar
left a comment
There was a problem hiding this comment.
LGTM, thanks for doing this!
| @$(MAKE) -f mk/cxx.mk --no-print-directory CXX_MODE=$(CXX_MODE) CXX_DIR=$(CXX_DIR) $@ | ||
|
|
||
| GLEAN_CABAL_BINS=glean glean-server glean-hyperlink | ||
| GLEAN_NATIVE_LIBS=librocksdb.so.8 libfolly.so.0.58.0-dev libfmt.so.11 |
There was a problem hiding this comment.
this looks fragile, can we make it independent of the version numbers?
There was a problem hiding this comment.
Maybe we can just do librocksdb.so.* or something like that and let bash do the rest of the magic for us
There was a problem hiding this comment.
I looked into this but it's not quite that simple, because just copying everything with an asterisk copies way too much and bloats up the container again. Instead, I think I'll just make sure that the built docker container has test queries run against it, which should ensure that the proper shared libraries are available (otherwise it wouldn't launch), so at least a break will be obvious and reported.
|
Note that this still needs to actually push the images to the Docker registry, so it's not quite ready yet. |
31bf67a to
925fd19
Compare
This reworks the `Dockerfile` to now build multiple images, including one for end users to run their own copy of Glean, and an updated version of the React demo database. It includes x86_64 and aarch64 Linux images using public GHA runners, which probably covers 98% of all realistic uses. (Using GHA runners means this workflow is trivially usable for public forks, too.) There is a new `bindist` target used by the Dockerfile that creates a directory of needed binaries and libraries, and properly packages them for usage in the container. There are now three containers published from the `Dockerfile`, all based on Ubuntu 24.04: - `glean/client`, which only contains the `glean` command, then - `glean/server`, including `glean-server`, then - `glean/demo`, including a precanned `glean-hyperlink` + react DB These containers are all size-optimized; the final images have no development tools installed and the absolute minimum necessary installed packages. For example, the new x86_64 `glean/demo` is only 486MB uncompressed, compared to the 2.4GB of the previous demo version. The `client` and `server` images are 251MB and 300MB, respectively. The `client` image should probably include `gen-schema` so that end users can generate code from their own non-upstream `.angle` files, but that can be added in a future patch. In theory, this new container could also be used to replace most of the junk in `ci.yml` in order to repeat ourselves less, but it would need another image in order to add more things so that the test suite can be run. That can happen in a future patch. Signed-off-by: Austin Seipp <aseipp@pobox.com>
925fd19 to
f3eb90f
Compare
|
FYI, I'm still working on this, but it turns out figuring out how to push a multi-arch docker manifest to ghcr.io is somehow little trodden territory. |
|
@thoughtpolice I am just wondering the status of this as we'd love to pull in an externally built docker image as opposed to building our own |
This reworks the
Dockerfileto now build multiple images, including one for end users to run their own copy of Glean, and an updated version of the React demo database. It includes x86_64 and aarch64 Linux images using public GHA runners, which probably covers 98% of all realistic uses. (Using GHA runners means this workflow is trivially usable for public forks, too.)There is a new
bindisttarget used by the Dockerfile that creates a directory of needed binaries and libraries, and properly packages them for usage in the container.There are now three containers published from the
Dockerfile, all based on Ubuntu 24.04:glean/client, which only contains thegleancommand, thenglean/server, includingglean-server, thenglean/demo, including a precannedglean-hyperlink+ react DBThese containers are all size-optimized; the final images have no development tools installed and the absolute minimum necessary installed packages. For example, the new x86_64
glean/demois only 486MB uncompressed, compared to the 2.4GB of the previous demo version. Theclientandserverimages are 251MB and 300MB, respectively.The
clientimage should probably includegen-schemaso that end users can generate code from their own non-upstream.anglefiles, but that can be added in a future patch.In theory, this new container could also be used to replace most of the junk in
ci.ymlin order to repeat ourselves less, but it would need another image in order to add more things so that the test suite can be run. That can happen in a future patch.