fix(image_spec): re-install nix in build step if cache mount was cleared#37
Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Open
fix(image_spec): re-install nix in build step if cache mount was cleared#37devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Conversation
When depot's Docker layer cache marks the nix install step as CACHED but the /nix cache mount has been independently cleared, the build step fails because nix-daemon.sh doesn't exist. This adds a conditional check in the build step to re-install nix if the cache mount is empty. Co-Authored-By: Lakee Sivaraya <lakeesivaraya@gmail.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are the changes needed?
When using Depot for nix-based container builds, there are two independent caching layers:
RUNinstruction needs re-execution based on instruction text + context hash--mount=type=cache) — persistent storage shared across buildsIf the cache mount at
/nixis cleared independently (e.g., manual cache nuke on Depot), but the Docker layer cache still considers the nix install step (#9) asCACHED, that step is skipped entirely. The subsequent build step (#12) then fails because/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.shdoesn't exist:This was causing all
depot buildCI jobs to fail on monorepo PR #17697.What changes were proposed in this pull request?
NIX_INSTALL_SCRIPTconstantRUNstep: ifnix-daemon.shis missing, re-run the nix installer before proceedingRUNstep is kept as-is for the happy path (warm cache mount = fast no-op)How was this patch tested?
This will be validated by re-running the failing CI jobs on monorepo PR #17697 after bumping the flytekit dependency to this commit.
Human review checklist
NIX_INSTALL_SCRIPT(which uses Python\line continuations to become a single-line string) produces valid shell when substituted into both the standalone installRUNand theifblock in the buildRUN/nixis partially populated (not just fully empty)$NIX_INSTALL_CMDdoesn't collide with anystring.Template$-prefixed shell variables in the Dockerfile templateCheck all the applicable boxes
Related PRs
Link to Devin run: https://app.devin.ai/sessions/1b5b4648b3d64e4fbc22d634a5c1afe1
Requested by: @lakeesiv