-
Notifications
You must be signed in to change notification settings - Fork 24
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
[WJ-1187] Automatic reload on configuration change #1626
Merged
Merged
Conversation
This file contains 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
Also log command line before executing.
Gets absolute path from env::current_exe().
inotify isn't working with Docker mounts it seems. This also cuts out a middleman crate. I have to rename the feature to 'watch' for this to work.
PollWatcher isn't working across virtual mounts for some reason.
Codecov Report
@@ Coverage Diff @@
## develop #1626 +/- ##
===========================================
- Coverage 42.87% 1.58% -41.29%
===========================================
Files 328 120 -208
Lines 10048 4603 -5445
===========================================
- Hits 4308 73 -4235
+ Misses 5740 4530 -1210
|
In anticipation of WJ-1188.
Zokhoi
approved these changes
Sep 29, 2023
thanks @Zokhoi |
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.
cargo watch
will rebuilddeepwell
when any watched files change. However this can take a bit even if no source files have changed, as it rebuilds the binary. I have implemented a feature,-w
or--watch-files
, which will restart the process (via self-exec
) if the configuration TOML file or anything underlocales
changes. This option is CLI-only, and is not found in the configuration files. It only applies to alocal
feature flagged build only.However, I cannot get this to work with Docker. None of the events are coming through like with a local instance.
For now, I have re-enabled the
cargo watch
approach for deploy, and changed to use theRecommendedWatcher
(inotify on linux). (If you want to try to get this to work on Docker, keep in mindPollWatcher
must be used, and you need to disable the-w [path]
flags incargo watch
.) This works fine, but is slower. To use-w
you can manually stop the container and then run deepwell locally on your host machine. This will restart on file change nearly instanteously, it's quite nice.