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

github: rework Docker build, and publish new images #489

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thoughtpolice
Copy link
Contributor

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.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 24, 2025
Copy link

netlify bot commented Jan 24, 2025

Deploy Preview for fb-oss-glean canceled.

Name Link
🔨 Latest commit 925fd19
🔍 Latest deploy log https://app.netlify.com/sites/fb-oss-glean/deploys/67944aff179248000897fa6d

Copy link
Contributor

@simonmar simonmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for doing this!

@@ -132,9 +132,18 @@ cxx-libraries:
cxx-test-%: force
@$(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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks fragile, can we make it independent of the version numbers?

Copy link
Contributor Author

@thoughtpolice thoughtpolice Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can just do librocksdb.so.* or something like that and let bash do the rest of the magic for us

@thoughtpolice
Copy link
Contributor Author

Note that this still needs to actually push the images to the Docker registry, so it's not quite ready yet.

@thoughtpolice thoughtpolice force-pushed the aseipp/push-zsqoxtmnunrl branch 3 times, most recently from b2dc3a0 to 31bf67a Compare January 24, 2025 22:58
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 <[email protected]>
@thoughtpolice thoughtpolice force-pushed the aseipp/push-zsqoxtmnunrl branch from 31bf67a to 925fd19 Compare January 25, 2025 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants