Fdb emulator 2#36464
Conversation
Install FoundationDB client and server alongside PostgreSQL in the emulator base image. The entrypoint script now reads MZ_METADATA_STORE (defaulting to "postgres") to select which backend to start and which URLs to configure. Set MZ_METADATA_STORE=foundationdb to use FDB. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use `foundationdb:?prefix=X` instead of embedding the cluster file path and legacy `options` parameter. Export FDB_CLUSTER_FILE so the FDB client discovers the cluster via the environment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Avoid penalizing postgres-only users with the ~100 MB FoundationDB packages. The postgres image (materialized) no longer includes FDB, and a new materialized-fdb image provides the FDB-backed variant. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace directory symlink with individual file symlinks, since mzbuild cannot traverse a symlinked directory. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
materialized-base and materialized-fdb-base duplicated ~40 lines of shared setup (user creation, apt packages, console, nginx config) and the console version had already drifted (26.14.0-dev.0 vs 26.13.0-dev.0). Extract the common parts into materialized-common-base so both backend-specific bases extend it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add publish-as/tag-suffix support to mzbuild so the FDB emulator image is published under the same Docker image name as the postgres variant but with a -fdb tag suffix (e.g. materialize/materialized:latest-fdb, materialize/materialized:v26.23.0-fdb). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
92cbe30 to
9d94e76
Compare
Docker COPY cannot follow symlinks that point outside the build context. Replace the entrypoint.sh and listener_configs symlinks with mzbuild copy pre-image steps that copy the files from ci/ at build time. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| publish-as: materialized | ||
| tag-suffix: -fdb | ||
| pre-image: | ||
| - type: cargo-build |
There was a problem hiding this comment.
Everything builds and the image seems to work
There was a problem hiding this comment.
I assume this still makes our docker images for the emulator significantly larger for an experiment. What is the goal? Edit: I see, so we use a -fdb version suffix, that's fine then. But it does make the build a bit slower
Based on https://buildkite.com/materialize/test/builds/122662 we seem to be still pushing materialized-fdb:
materialize/materialized-fdb-base:mzbuild-CEVVAAJFWG4OCU3BJ7F6PZALKAB477RU
materialize/materialized-fdb:mzbuild-3OCYPBBDFDNOF2H77HQGG4V7L7TEJ6HX
Why would it? we shouldn't be packaging FDB in our postgres based emulator so it shouldn't change the size.
My suspision is that this will actually make the emulator more resource efficient, especially for larger local testing with a lot of sources or low tic intervals. It seems like it lowers CPU a decent amount on some local demos where I'm setting a very low tic interval.
@def- wait... I don't see us pushing this to dockerhub? I think we're just using materialize-fdb as an internal name. |
def-
left a comment
There was a problem hiding this comment.
Thanks, lgtm for some experiments. I think long term we should decide what to use for emulator and stick with it. When I ran my experiments I saw lower CPU usage with postgres compared to fdb fwiw. I'm mostly afraid that we stay in this state and have to push two versions out for months or even years.
| name += f":{tag}" | ||
| return name | ||
|
|
||
| def publish_docker_name(self, tag: str | None = None) -> str: |
There was a problem hiding this comment.
I'm not super happy with this whole logic, and translating between materialized-fdb and materialized:...-fdb. Why don't we just build it as materialized-fdb directly instead of having this translation layer?
publish_multiarch_images iterates all images in the dependency set including non-publishable base images. Skip images with publish=false to avoid trying to create manifests for images that were never pushed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add FoundationDB as an alternative metadata store for the emulator image. Both PostgreSQL and FoundationDB are installed in the base image. The entrypoint reads MZ_METADATA_STORE (default: postgres) to select which backend to start. Set MZ_METADATA_STORE=foundationdb to use FDB.
in this case we'll publish a
-fdbmaterialize emulator image for every image ex:materialize/materialized:26.25.0-fdbrevival of #35087