tilt icon indicating copy to clipboard operation
tilt copied to clipboard

Connect dependencies of projects to `docker_build` ignore/only (possible integration with Nx Monorepo)

Open endurance-chorus opened this issue 10 months ago • 2 comments

Describe the Feature You Want

Hey! I have a question. Has anyone here tried Nx + PNPM workspaces + making sub packages + using those packages in your NodeJS app + tilt?

Nx gives you ways to manage your monorepo by building out a dependency graph, caching nodes, using that cache during builds, and exposes nice tooling for accessing this stuff (e.g. nx watch , nx build, nx run). PNPM gives you a way to make relate packages across your repo (e.g. package.json + the workspace:* syntax). We make packages and reuse them in our NodeJS projects, and we would like to be k8s native during local dev, and, naturally, that led us to Tilt.

Tilt's docker_build seems to be great at noticing the builds (tilt seems to be watching the Context window for Docker), but my shared package files exist in different places in the monorepo. This makes me have to push the monorepo root as context, which means i rebuild when any file changes. I can try to control it with only or ignore but now i have to list the exact subpackages in the repo that it cares about. Ideally, tilt would already know.

(Possible Feature Request here) Luckily, nx does know, and it would be great if i could pipe my project and its dependent subpackages automatically to tilt's ignore or only fields so it only rebuilds when it should, instead of whenever literally anything in the repo changes. Has anyone faced this? How did you solve it? Is my feature request possible?

Current Behavior

Tilt has only/ignore which works, but users must manually manage dependencies rather than being automatic.

Why Do You Want This?

I would like to reduce the complexity of the Tiltfile management process for teams.

endurance-chorus avatar Feb 17 '25 14:02 endurance-chorus

Yeah, we usually see Bazel users do this with either tilt extensions or tiltfile scripting, here's an example - https://docs.tilt.dev/example_bazel

nicks avatar Feb 17 '25 20:02 nicks

https://docs.tilt.dev/example_bazel.html is the updated URL

vinaybedre avatar Sep 16 '25 14:09 vinaybedre