-
-
Notifications
You must be signed in to change notification settings - Fork 585
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
refactor: enable Mutagen by default on Mac and Windows, fixes #4637 #4904
refactor: enable Mutagen by default on Mac and Windows, fixes #4637 #4904
Conversation
Download the artifacts for this pull request:
See Testing a PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just took a quick look through.
- Both mutagen and nfs can be enabled in the project as well as globally.
- It's true that the new mutagen default globally should be
true
. - But people should be able to change it globally to
false
- People should also be able to override it in a particular project, setting it to
false
if they want. - Mutagen should not automatically override NFS. Instead, if both are enabled, it should be an error. (And this needs to be done at the project level).
I think many of the things that you want to do here will best be checked with app.IsNFSMountEnabled() and app.IsMutagenEnabled(). That way you can check the app situation (error out if both are enabled, for example).
Should I also implement a change of the project if explicitly set to fasle?
That's still possbile.
Doesn't work currently, will fix it....
I hope this is already done at the moment because nothing change here. |
If
In current code, Some notes:
|
Okay, will simplify the patch... |
4b9f408
to
5289776
Compare
6a9f2dc
to
20472b2
Compare
For reference, here's what I did with traefik, which is a little simpler than mutagen but the same idea, and would love your review there @gilbertsoft Traefik is simpler because the existing settings don't have to be preserved, whereas mutagen we should be preserving. |
ed771b0
to
21f5501
Compare
I'm 100% in support of this change. We specifically call out mutagen in our ddev ADR. We didn't include Windows because none of our developers are using Windows enough to test it there. Since then, I would say probably 1/3rd of new ddev users setting it up have missed this setting. Then, it surfaces as "ddev / docker / the site" is slow or even at times crashing during heavy IO ops. Making this the default would solve all of that for sure. Thanks for working on this @gilbertsoft ! |
bfaf090
to
d20e736
Compare
e17a3e0
to
2df0814
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is all going to be fine, would just like to figure out a few things that may make the communication clearer:
- Let's do
performance_strategy
instead ofperformance
. We don't want people on Linux to think they're not going to have "performance" if it's "off" or "none" or whatever. Sorry we didn't figure this out earlier, but definitely will improve how the docs read. - Could we please use the options "none", "mutagen", and "nfs". An empty value on initialization should be changed into the default for the OS, as we do for the other things in globalconfig.New() for example.
Sorry we didn't figure these things out earlier, but it's easier to see them now when they're in black-and-white.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ddev describe
still uses "Mutagen enabled (ok)". I would hate to make that column wider by saying "performance strategy: mutagen" but we should think about what should go there. I don't think we need to change this right now.
@gilbertsoft currently the project .ddev/config.yaml comments say this:
Shouldn't this be the same as what it says in the global_config.yaml? Where "default" is default for OS?
What is the actual behavior? |
No, that's fine. As long as nothing is set in the project (or set to default) the value from the global config is taken. This way the user can predefine a default globally which will be used for most projects, exactly you can do it with Git e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops...
ddev config global --performance-mode=none
# Now global_config's performance_mode is `none`
ddev config global --performance-mode-reset
# It reports "mutagen" BUT `ddev config global` says "none"
# BUT `performance_mode` is still "none" in ~/.ddev/global_config.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor docs changes required too, for --performance-mode-reset
TestCmdMutagen seems to have been broken by this latest commit. |
Oh, didn't set dirty=true. Only related to Mac and Windows where I didn't test yesterday. |
e0f8948
to
73ac93f
Compare
Should be related to the missing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed and tested on macOS and Gitpod/Linux, and it all seems to be working great, thanks!
I have a few suggestions about the docs, think there are some leftover inaccuracies that should be fixed. I'd be fine with committing them with [skip ci] and avoiding another test cycle. We should probably have @mattstein take a quick look after the commit, or comment on these comments.
Yay, ready to go, thanks for the great work on this!
The Issue
How This PR Solves The Issue
This PR enables Mutagen on Mac and Windows by default. A new config
performance
(project and global) is introduced and the two existing ones for Mutagen and NFS are removed. This makes it much easier for the users to configure their environments because they can not end with invalid config having both Mutagen and NFS enabled. It's also possible now to override the global config project wise which was the other way around before.Manual Testing Instructions
ddev config global --performance=...
.ddev config --performance=...
.ddev config global -h
andddev config -h
.performance
is understandable in the.ddev/config.yaml
and~/.ddev/global_config.yaml
.Automated Testing Overview
So far, no tests are added. This may be changed if needed. Existing tests are adapted to the new default.
Related Issue Link(s)
Release/Deployment Notes