-
Notifications
You must be signed in to change notification settings - Fork 634
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
fix: relax identifier limits #3279
fix: relax identifier limits #3279
Conversation
Hey @Shubhranshu153 So, identifiers no longer have a length limit, is that correct? Isn't this going to be problematic for anything that will end-up being used on the filesystem? Particularly Namestore etc. I am not a windows expert, though some liminary googling suggests that anything over 256 chars might spell trouble. |
yes that is correct, |
Just noting that the Windows file path length limit can be extended to |
We might want to make the effort and move to using shas on the filesystem so that we can allow random identifiers, but that is likely a lot of work to get there and support existing stuff. Meanwhile, I think we need to be mindful about what identifiers we are relaxing, depending on whether they are going to end-up on the filesystem... I think you mentioned some of (finch?) users were facing issues - so, is there a particular type of identifier (network name? image name? container name?) that is most problematic for them? |
@apostasie We can put it within a dockercompat flag to be more sure about it. |
May be the simplest thing would be to increase the limits of all to 255 as that seems to be able to support most of the use cases |
I just sent #3281 which suggests to change the VolumeStore to no longer use names as path components - which would remove the need for any limitations on volume names. |
@apostasie replied on the thread. Additionally: |
Thanks.
Well, we made the deliberate choice to store user-picked identifiers as path components - this is very much an internal implementation choice, not a feature - and not dealing with failures would just leak that choice into the UX... I don't think it is a good thing.
Not really for the VolumeStore. I have not looked at what it would mean for Networks, or the NameStore (although I think the NameStore is problematic in its own right and we might need to reconsider it). |
not really for volume store -> from user perspective if i would want to list out the volumes available will i be able to get it from the sha? From the above converstations it feels like we do want to keep a limit so probably 254 is a safe upper limit considering the system limits. its not exactly docker compatible though |
Nothing changes from a user perspective (with the VolStore PR). As I suggested above, how we construct the path on the filesystem is an implementation detail IMHO that should be kept entirely orthogonal to UX.
The containerd method IMHO the only way to lift these restrictions is to change our implementation(s) where it matters so we no longer use identifiers as path components (like I did for the VolumeStore). Short of doing that, and if we are to increase that length regardless, we need tests to match, and build confidence that it will work (clearly not only Windows has limitations on these). |
yeah length will be variable which is not ideal but we can have longer names and keeping the same checks. |
Agreed that handling legacy user data is generally a daunting proposition. That being said, in the context of containers, I feel like things tend to be a lot more ephemeral and easy to just rebuild (especially named volumes) - furthermore, having to deal with legacy is a fact of life no matter what, and right now (with v2 around the corner) is probably the ideal time to do things like that. On the general question of whether such a migration makes sense, I stand by my gun: using user-controlled-identifiers as-is as path components is a problematic design from the get go (regardless of the implementation imposing restrictions). Anyhow, just shooting the shit :-). Hope this is all helpful. |
Thats a fair point but handling the legacy would mean we need test for all the stuffs we want to support backward compatibility for. Or we can add an label to the identifier hash to suggest if it is something newly created, if that label doesnt exist we fallback to new workflow. Need to think for the different use cases what changes are needed Having said this i still feel the more simpler workflow is via having configurable identifier lengths, i am not saying its a great way, may be this is something we can merge to the current stable version. The reason is this is a request from a few of current users of finch and also needed to support dev containers. For the 2.0.0 we can discuss how we handle the backward compatibility. |
considering that we closed the other pr, i would make the suggested changes probably with a limit of 254 . |
6d16149
to
d953881
Compare
Added docs and changed the function name. |
There was typo in the previous comment:
|
185de34
to
8e3c228
Compare
de4c12d
to
f87519a
Compare
9a5afdc
to
933c887
Compare
@AkihiroSuda |
933c887
to
eba28ea
Compare
eba28ea
to
f883fcd
Compare
Signed-off-by: Shubharanshu Mahapatra <[email protected]>
f883fcd
to
1fbd776
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.
Thanks
Description
Some of users of finch are reporting max length of 76 characters, which seems to stem from this validation
https://github.com/containerd/containerd/blob/92900bf7300b4872db2a43e82128fda9cde08a79/pkg/identifiers/validate.go#L58
Docker skips this validation via containerd library and does its own regex validation
What changed
This change moves the validation function to nerdctl which would give greater control over it. This change modifies identifier validation for the following:
This brings these identifier compatible to docker but doesn't add checks for others. Docker seems to have additional checks, of which not all are required but some might be needed to be ported.
Test