-
Notifications
You must be signed in to change notification settings - Fork 259
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
Remove osversion usage in computestorage APIs #1463
Conversation
@TBBle I've went back and forth on this. As a user of the package, what do you think? Funnily enough this is not the only exposed API that calls osversion, ExpandSandboxSize bounces to wclayer.ExpandScratchSize which calls it to handle some edgecases on 19h1, albeit the work needed is much more than the breaking change with the disk handle described in this https://github.com/microsoft/hcsshim/blob/master/internal/wclayer/expandscratchsize.go#L35-L142 I don't want to end up in a spot where someone adding in a workaround in their code can break depending on whether they manifest in the future or not. e.g. someone adds in the file handle workaround for FormatWritableLayerVhd by checking the registry or RtlGetVersion etc. and then decide to manifest their binary later on causes us to enter that condition and try and AttachVirtualDisk using their file handle they passed us and their code breaks. While it is a tad annoying, maybe the best place to keep this API easily callable is to let the application worry about the extra logic on RS5. I do still think we should manifest containerd however as it's likely far overdue, even though this is what spurred it. |
Did you consider a different approach: just stop using GetVersion docs say that you should not use it at all:
|
They still require the binary to be manifested to return correct info. If it were up to me I'd just swap osversion to checking the registry or RtlGetVersion, but they were both recommended against internally as manifesting is still the route. I didn't hear any shouts for a need to get off GetVersion however. Curious if that notion has shifted since the last I checked though. VerifyVersionInfo which is what those helpers call underneath is also "deprecated" since Windows 10 which is funny |
Yuck lol |
For real |
@jterry75 We may be able to use the supported schema version here. It seems the minor gets incremented per official windows release, but all we really care about is 2.1 (RS5) or > 2.1 here. There may be an odd pre-release build in between rs5 and 19h1 where they made the breaking change but the schema version was still 2.1 (not sure when they increment it in development, asked), but I don't think that'd be a huge population to worry about |
Interesting idea. Insider builds are not supported anyways so I think thats fine. I suppose at the end of the day is no different than using build numbers. We say build NNN means features XYZ. We could just as easily say Schema Y.N means features XYZ |
Right, they have a doc detailing the increments in schema version for each version so it'd even be possible to adopt it for other checks if need be. They just rev the minor for every windows release. Although your parsing of |
So funny If we are ok calling We can figure out a new way to get a cool icon.. |
The only thing cmd /c ver brings to mind is the classic text parsing dilemma, if the format changes our parsing will implode. Don't picture that happening anytime soon, but something to note. Also.. I kind of like the idea of the |
Fallback works for me. Then if someone wants to manifest they get the perf for free. I like it |
@jterry75 Before making an osversion change, we're gonna try to fix the problem in here first. Given 0.9.x didn't have any friendly logic and just passed whatever handle you give it, if anyone WAS doing the workaround themselves, if they updated to v0.10.x and we try and be friendly inside that would also break them. I think we're going to try and stick with this change, e.g. just revert any osversion usage, and then make another wrapper for this function for v0.10.0 with the "friendly" behavior and ideally deprecate this one. We're trying to get the HCS teams blessing if just checking the schemas sufficient |
@kevpar Undrafted this. Lets get back to the v0.9.x behavior first and then we can deprecate/recommend a new call that handles things for the caller |
67a0760
to
b0d9330
Compare
@kevpar Reverted the commit instead of doing it manually and added an additional commit to document things a bit, PTAL |
… RS5 (microsoft#1204)" This reverts commit aaf5db9. We'd added a change to FormatWritableLayerVhd to help the caller work around a breaking change in the OS, but this would actually cause a breaking change in our wrapper of it if the caller was already working around the issue themselves. To avoid this scenario, revert the commit that added the "friendly" behavior. Signed-off-by: Daniel Canter <dcanter@microsoft.com>
b0d9330
to
7007547
Compare
I haven't worked through the codebase, but since the early comment mentioned So maybe that check/workaround can be dropped too. I think it'd be an interesting result if we can get rid of all the |
@TBBle I'm more curious if the OS fix that's mentioned that is being worked around was ever fixed 🤣. We can probably remove that as well though yes (not in this PR) |
Add a comment on our wrapper of HcsFormatWritableLayerVhd to describe that it expects a different handle on anything above ws2019. Additionally add a comment above SetupBaseOSVolume stating what build it's supported on and that the application must be manifested Signed-off-by: Daniel Canter <dcanter@microsoft.com>
7007547
to
2c82abd
Compare
As an experiment I threw the current PR into the containerd test-case from #1375, and it looks good. There's some unrelated failures, but unit and integration tests passed on both WS 2019 and WS 2022. (Both failed on |
That test has been on and off failing for a bit, we'll fix one cause and out pops another. I think I saw it fail on main there a couple days ago so I don't think it's from this either, but we should take another look as it seems to be causing a mess again. I'm glad the pkg/os test that uses formatwritablelayer is passing again though it sounds like |
This change reverts commit aaf5db9.
We'd added a change to FormatWritableLayerVhd to help the caller work around
a breaking change in the OS, but this would actually cause a breaking change
in our wrapper of it if the caller was already working around the issue
themselves. To avoid this scenario, revert the commit that added the
"friendly" behavior.
This additionally adds a comment on our wrapper of HcsFormatWritableLayerVhd to describe that
it expects a different handle on anything above ws2019 and adds a comment above SetupBaseOSVolume
stating what build it's supported on.