sincecutoff.com
← all changes

Tilt live_update adds initial_sync for pre-built images

Introduced 2026-04-30 · score 0.97

HOW TO USE IT

For a pre-built image, add `initial_sync()` first in `live_update` to upload files from its `sync` paths when Tilt first observes a running container and after restarts. Then define `sync` steps and optional `run` triggers; during initial sync, untriggered `run` steps execute and triggered ones execute only when synced files match.

live_update=[ initial_sync(), sync('./src', '/app/src'), run('npm install', trigger=['./src/package.json']), ]

WHY THIS HELPS

Use a pre-built image in a Tiltfile and sync local files into its container on start or restart.

REQUIREMENTS AND LIMITATIONS

  • Version: v0.37.3
  • initial_sync(): Must be first if provided. Takes no arguments; uploads files from `sync` paths when Tilt first observes a running container and whenever it restarts.
  • sync(local_path, remote_path) (required): Local file or directory path and destination path in the container.
  • run(cmd, trigger) (required): `cmd` runs in the container. Optional `trigger` is a filepath or list of filepaths; the command runs if synced files match. Without a trigger, it runs after initial sync completes.
  • live_update (required): List of live update steps supplied when building or deploying an image; `initial_sync` precedes `sync`, which precedes `run`.
  • Prerequisite: The image or deploy must be sufficient to start a running container without relying on synced files or `run` commands.
  • Prerequisite: `sync` paths must be within the watched build context (or custom build dependencies).
  • `initial_sync()` must be first in the list.
  • No compression; tested with gzip, but CPU overhead exceeded network savings for typical workloads (~20k files, ~90MB in under 20s to remote EKS).
  • No changes to existing `live_update` behavior.
  • Docs conflict: The release note describes `initial_sync(ignore=..., dockerignore=...)`, but the current official reference says `initial_sync()` takes no arguments and describes exclusions through the image or custom deploy's file-watching controls. Do not use the release-note parameters based on this page. The official reference's current content may be newer than v0.37.3.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card