-
Notifications
You must be signed in to change notification settings - Fork 617
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
Be mindful of image architectures when scheduling tasks #2770
Comments
Based on conversation with @wsong: our real desire here is to run a service only on windows nodes with named pipe support rather than image architecture; what we really need here is scheduling based on named pipe support. |
Thanks for the clarification @anshulpundir |
If we implement it this way, the solution becomes far less general. Can we implement this based on platform support in the multi-arch image manifest? If we do that then this scheduling smarts will be generally useful for anyone using multi-arch, and not unique to just this named pipe usecase. |
@dhiltgen @anshulpundir @wsong : do I understand correctly that the goal here is to ensure that we only schedules tasks on nodes with the right architecture & OS according to the image's manifest? If so, it looks like this is already the case: when creating a service, by default (and except if the This is then used by swarm when filtering which nodes are eligible to run the task (/~https://github.com/docker/swarmkit/blob/bc032e24784ea618044ee438fedec3458abb2ef9/manager/scheduler/filter.go#L253-L320). So I'm not sure what the problem/goal here is. Could you please clarify? Thanks! |
@wk8 The problem today is if Swarm can't get the manifest from the registry (e.g. if it's a private image or if we don't have Internet connectivity). In that case, Swarmkit won't be able to tell what platforms the image supports, and therefore it won't be able to filter the nodes. One way of solving this would be to add support for loading image manifests from an offline bundle (i.e. a |
@wsong : thanks for the quick reply! :) Just to make sure I understand correctly: currently, the client does query the registry for an image's manifest if there's a registry, but in the case of local multi-arch images loaded with |
My understanding is that |
@wsong this can be stupid question but why you guys don't just focus to get docker manifest command marked as non-experimental so users can store manifest to local registries? |
@olljanat That's basically what we're talking about here. What we need is a user-friendly way of shipping manifests to users without Internet connectivity. |
@wsong : tried this morning, it seems that you can |
(@wsong : the small caveat is that it seems that you do need to push the images in the manifest, and the manifest itself, to a registry before you can |
Ugh please ignore my previous comment #2770 (comment). Manifests are indeed not saved at all. So what we need is a way to save manifests, I guess, i.e. bundle a manifest and its images in a single archive. Would we want a |
Actually, what we want is to just save the manifest (i.e. the metadata about which platforms a multi-arch image supports). For our purposes, we want to run a service on Windows nodes that are Windows Server 1709 or newer, but we want to create the service on a Linux node. That means that the Swarmkit manager (which will run on Linux) needs to have the manifest image metadata for the Windows images, but it doesn't need to load the actual image layers. |
@wsong have you seen this one? https://medium.com/@mauridb/docker-multi-architecture-images-365a44c26be6 As far I understand this you should be able to store manifest to private registry using commands:
|
That's fine, but we still need an offline solution for air-gapped clusters. |
@wsong sorry but now I didn't understood. You need anyway some method to distribute images and manifest for swarm nodes so why you are not just running private registry inside of that air-gapped cluster? |
Not all of our airgapped users have a private registry. |
On that case how correct nodes gets image? From some external process? Why they are not then checking during import process that only nodes with correct OS version gets that image?
Btw. One option which we are using for similar use cases are add engine/node labels to nodes and use constraints based on them. PS. Let me know if I'm bothering your working too much. This just sounds interesting use case so I'm trying to understand it. |
We just use |
It looks to be that So adding two new commands @wsong would it work on your use case that you would use And just as reference. Current manifest commands are implemented on docker/cli#138 and when all known issues on them have been fixed we can mark it non-experimental by merging docker/cli#1355 |
@olljanat Yeah, that's what I was thinking; some sort of |
Some more info which can be useful:
But that is fully client side implementation so to be usable on here it would need to be modified as engine side solution. Other thing which I noticed that swarmkit does not currently care about OS version even if that is specified on manifest, only CPU architecture and OS: I also tested to save Windows image to tar and import back with
One options is also add support for |
After more discussion, going to add a OS version constraint. The manifest approach, while fitting the UCP use case, was also deemed clunky and half-baked as a generic feature, mainly because in the offline (ie, no registry) case it would have required all the nodes in the clusters to locally have the same version of all the manifests, as well as all the workers to locally have all the images relevant to their arch/OS listed in all the manifests, while providing no mechanism to actually handle this synchronisation nor the deployment of new manifest/image versions. On the other hand, adding OS version constraints is easy for users to understand, and also perfectly addresses the UCP use case. |
@wk8 Was this ever merged in Moby? it looks like this is a dependency for Kube on Windows. |
Looks to be still pending moby/moby#38349 |
Will do next week, thanks :) |
This is needed so that we can add OS version constraints in Swarmkit, which does require the engine to report its host's OS version (see moby/swarmkit#2770). The OS version is parsed from the `os-release` file on Linux, and from the `ReleaseId` string value of the `SOFTWARE\Microsoft\Windows NT\CurrentVersion` registry key on Windows. Added unit tests when possible, as well as Prometheus metrics. Signed-off-by: Jean Rouge <rougej+github@gmail.com>
This is needed so that we can add OS version constraints in Swarmkit, which does require the engine to report its host's OS version (see moby/swarmkit#2770). The OS version is parsed from the `os-release` file on Linux, and from the `ReleaseId` string value of the `SOFTWARE\Microsoft\Windows NT\CurrentVersion` registry key on Windows. Added unit tests when possible, as well as Prometheus metrics. Signed-off-by: Jean Rouge <rougej+github@gmail.com> (cherry picked from commit d363a18) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This is needed so that we can add OS version constraints in Swarmkit, which does require the engine to report its host's OS version (see moby/swarmkit#2770). The OS version is parsed from the `os-release` file on Linux, and from the `ReleaseId` string value of the `SOFTWARE\Microsoft\Windows NT\CurrentVersion` registry key on Windows. Added unit tests when possible, as well as Prometheus metrics. Signed-off-by: Jean Rouge <rougej+github@gmail.com> Upstream-commit: d363a1881ec256e1be5a48a90046ff16e84ddc02 Component: engine
@wk8 Should we close this issue since it looks like the work got merged? |
@david-yu : the needed part in moby/moby got merged, but I still need to do the swarmkit partn sorry. Will do shortly. |
This is needed so that we can add OS version constraints in Swarmkit, which does require the engine to report its host's OS version (see moby/swarmkit#2770). The OS version is parsed from the `os-release` file on Linux, and from the `ReleaseId` string value of the `SOFTWARE\Microsoft\Windows NT\CurrentVersion` registry key on Windows. Added unit tests when possible, as well as Prometheus metrics. Signed-off-by: Jean Rouge <rougej+github@gmail.com> Signed-off-by: zach <Zachary.Joyner@linux.com>
This is needed so that we can add OS version constraints in Swarmkit, which does require the engine to report its host's OS version (see moby/swarmkit#2770). The OS version is parsed from the `os-release` file on Linux, and from the `ReleaseId` string value of the `SOFTWARE\Microsoft\Windows NT\CurrentVersion` registry key on Windows. Added unit tests when possible, as well as Prometheus metrics. Signed-off-by: Jean Rouge <rougej+github@gmail.com>
This is needed so that we can add OS version constraints in Swarmkit, which does require the engine to report its host's OS version (see moby/swarmkit#2770). The OS version is parsed from the `os-release` file on Linux, and from the `ReleaseId` string value of the `SOFTWARE\Microsoft\Windows NT\CurrentVersion` registry key on Windows. Added unit tests when possible, as well as Prometheus metrics. Signed-off-by: Jean Rouge <rougej+github@gmail.com>
No description provided.
The text was updated successfully, but these errors were encountered: