Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is entr redundant in the 102-jib-live-update example? #24

Open
hiremaga opened this issue Aug 17, 2021 · 3 comments
Open

Is entr redundant in the 102-jib-live-update example? #24

hiremaga opened this issue Aug 17, 2021 · 3 comments

Comments

@hiremaga
Copy link

entrypoint='find /app | entr -r java -noverify -cp /app/resources:/app/classes:/app/libs/* dev.tilt.example.ExampleApplication')

This example also includes spring-dev-tools, which automatically restarts the Spring Boot ExampleApplication without restarting the entire Java process. The recommended example seems to rely on this this and doesn't use entr in its entrypoint.

Is there something different about using jib that makes entr necessary for live updates?

@nicks
Copy link
Member

nicks commented Aug 17, 2021

Sort of! This is a good question @hiremaga

In this example, Spring Dev tools also do their own live-reloading. We touch on this a bit in the tutorial:
https://docs.tilt.dev/example_java.html#optimizations

Re:

"The recommended example seems to rely on this this and doesn't use entr in its entrypoint."

Ah, this is subtle! The recommended example does use entr! It uses the docker_build_with_restart, which uses entr under the hood. The tutorial also touches on this: https://docs.tilt.dev/example_java.html#step-4-lets-live-update-it

So why do we recommend entr in this example? This is intended as a general purpose example for all Java users, including frameworks that:

  1. DON'T support live-reload
  2. SORT OF live-reload in SOME cases, but it's buggy inside containers
  3. DO support live-reload robustly

i haven't evaluated recently whether spring-dev-tools is in (2) or (3). But lots of users don't know how to evaluate how well their framework supports live-reload (and file bugs against us about it), so sometimes our examples err on the side of redundancy.

Maybe it would help to leave a note about this in the README? ya, if you're able to wire up a framework-native restart that works for you, you can remove the Tilt general-purpose one.

@hiremaga
Copy link
Author

Thanks for the clarification @nicks, both the subtlety about entr & the scope of this example.

A note in the README might help. Another approach might be having the examples that start off without spring-dev-tools initially and introducing it in a new example in lieu of entr. Similar in spirit to having a separate example for jib.

I've been playing around with Spring Boot and Tilt so I might be able to submit a PR for this. WDYT?

@nicks
Copy link
Member

nicks commented Aug 17, 2021

Yes, a PR to add some notes and pointers on spring-dev-tools would be much appreciated! (we're certainly not experts on Spring Boot)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants