-
Notifications
You must be signed in to change notification settings - Fork 10
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
file access conflict for shim binaries #66
Comments
Generally this begs the question if we even can update shim binaries with the same name (i.e. same major version) |
Can we rename the old binary and place the new binary after it? |
Maybe, I'll try it later. Alternatively we could include a hash of the file in the name and only need to update the containerd config with the new binary path. |
@phyrog and I discussed the problem and decided to append a hash to the binary as an interim solution. Unfortunately, we couldn't come up with a good solution to avoid accumulating trash binaries after multiple updates. According to https://iximiuz.com/en/posts/implementing-container-runtime-shim/ and some tests using the test manifests from #65 (comment), the shim process only lives if there is a workload, we can't just delete any unused binary by simply using This issue still needs to be addressed. |
when we update the shim-binary, what is the expected (and current) behavior of workloads which are currently running?
in my opinion, we should force the workloads to restart somehow when we have new version. but also look forward to hearing what others think about this and what is the current behavior. |
For major version updates, existing workloads should be unaffected (runtime class name includes the major version), minor/patch version update handling is currently undefined, afaik. As for what the handling should be: I don't know, but I suppose we could make the behavior configurable via the CRD. |
We had considered this question a while back in https://github.com/deislabs/containerd-wasm-shims/blob/main/proposals/2022-09-14-kubernetes-versioning.md. The bin names should probably have the version encoded in the file name. Then the only concerns are how to clean up old versions and when to update the containerd config mapping the runtime handler to the version specific file name. Replacing the same file name |
I think I "accidentally" addressed the issue in #68. I'm renaming the shim binary to IMO this approach makes debugging easier, as the relation shim-resource-in-cluster <-> binary-on-node is clear. This technically allows to install the same shim twice on the same node, but address it with a different runtimeclass (cool if you want to run a debug build of the same version). Edit: Argh, it is too late ;) I'm rereading the conversation and realize, that it does not actually fix the "update" scenario: Shim Resource installed:
Updating Shim Resource with new version of shim:
Will then lead to the mentioned error. However, in a prod scenario, I'd rather run two versions of the same runtime and switch Apps one by one to the new version, as this leaves me with a roll-back option. |
In some cases, the node installer exits with this error:
This happens when containerd has already started a shim process with that binary and the installer wants to overwrite the binary file.
I believe we need to change the behavior of always copying the shim binaries and then detecting if something changed to first detect a change and then copy the binary:
runtime-class-manager/cmd/node-installer/install.go
Line 81 in 6f849a8
The text was updated successfully, but these errors were encountered: