Skip to content

fix(docker): add fastembed-cache-empty placeholder so default bake builds#409

Open
SandyChapman wants to merge 1 commit into
mainfrom
fix-fastembed-empty-context/schapman
Open

fix(docker): add fastembed-cache-empty placeholder so default bake builds#409
SandyChapman wants to merge 1 commit into
mainfrom
fix-fastembed-empty-context/schapman

Conversation

@SandyChapman

@SandyChapman SandyChapman commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

A clean checkout cannot run the default Docker build. docker-bake.hcl defaults FASTEMBED_CACHE_CONTEXT to docker/fastembed-cache-empty (added in #384), and Dockerfile.nmp-api consumes it via COPY --from=fastembed-cache .. That directory was never committed — git can't track empty dirs and there was no placeholder file — so the documented local build fails before it starts:

ERROR: failed to get build context fastembed-cache: stat docker/fastembed-cache-empty: no such file or directory
make: *** [docker-load] Error 1

CI's "Build CPU smoke images" job never hits this because ci.yaml overrides FASTEMBED_CACHE_CONTEXT to a ${RUNNER_TEMP}/fastembed-cache dir it mkdirs — so only the committed default path (local dev, make docker-build / docker-load) is broken.

Fix

Commit a tracked placeholder (docker/fastembed-cache-empty/.gitkeep) so the default context exists on checkout. The empty context just means the image downloads the embed model at build time — the existing else-branch in Dockerfile.nmp-api already handles that.

Testing

  • Reproduced on a clean main checkout: make docker-load TARGET=docker-cpu failed immediately with the context error above.
  • With the directory present, the same command proceeds past context resolution into the image builds.

Notes

Found while doing RCA on an unrelated docker-build status failure. This is a separate, pre-existing bug (default/local builds only); the external CI docker-build gate is unaffected because it overrides the cache context.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated build infrastructure to ensure proper directory structure tracking during deployments.

…ilds

docker-bake.hcl's FASTEMBED_CACHE_CONTEXT defaults to docker/fastembed-cache-empty,
which Dockerfile.nmp-api COPYs (`COPY --from=fastembed-cache .`). The directory was
never committed — git can't track empty dirs and there was no placeholder — so any
build using the committed default (a clean checkout running `make docker-build` /
`docker-load`, the documented local path) fails immediately:

  ERROR: failed to get build context fastembed-cache: stat docker/fastembed-cache-empty: no such file or directory

CI's image jobs don't hit this because ci.yaml overrides FASTEMBED_CACHE_CONTEXT to a
RUNNER_TEMP dir it creates. Commit a tracked placeholder so the default context exists
on checkout; the empty cache just makes the image download the embed model at build
time (the existing else-branch in Dockerfile.nmp-api).

Verified: with the dir present, `make docker-load TARGET=docker-cpu` proceeds past
context resolution into the image builds.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Sandy Chapman <schapman@nvidia.com>
@SandyChapman SandyChapman requested review from a team as code owners June 23, 2026 17:09
@github-actions github-actions Bot added the fix label Jun 23, 2026
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 375396b3-6412-4a17-93d2-50f7cb42497d

📥 Commits

Reviewing files that changed from the base of the PR and between 70ccdca and 2caf4b4.

📒 Files selected for processing (1)
  • docker/fastembed-cache-empty/.gitkeep

📝 Walkthrough

Walkthrough

Adds a .gitkeep placeholder file to docker/fastembed-cache-empty/ so Git tracks the otherwise-empty directory. Inline comments document that docker-bake.hcl and Dockerfile.nmp-api require the directory to exist as a Docker build context.

Changes

Fastembed Cache Directory Placeholder

Layer / File(s) Summary
Add .gitkeep to fastembed-cache-empty
docker/fastembed-cache-empty/.gitkeep
Adds a commented .gitkeep so Git retains the empty directory needed by Docker build context logic in docker-bake.hcl / Dockerfile.nmp-api.

Possibly related PRs

  • NVIDIA-NeMo/nemo-platform#384: Introduces the Docker bake and workflow changes that consume docker/fastembed-cache-empty as a build context — the directory this .gitkeep preserves.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title accurately describes the main change: adding a .gitkeep file to ensure the fastembed-cache-empty directory exists for default Docker builds.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-fastembed-empty-context/schapman

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 21176/27762 76.3% 61.2%
Integration Tests 12216/26531 46.0% 19.5%

@crookedstorm crookedstorm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry, I failed to commit mine locally! LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants