docker-archive / classicswarm

Swarm Classic: a container clustering system. Not to be confused with Docker Swarm which is at https://github.com/docker/swarmkit
Apache License 2.0
5.75k stars 1.08k forks source link

Add more robust detection of node OS #2959

Closed dperny closed 5 years ago

dperny commented 5 years ago

Here's the deal: this in the only reasonable way to do this without writing a bunch of code to, for example, pull the image manifest and inspect it directly, which is a whole rodeo i'm not interested in getting into. It's fragile and likely to break (again) later on, but whatever.

dperny commented 5 years ago

The trouble isn't that we don't know the OS of each node, but rather that we don't know the OS of the container to be run.

zsun21 commented 5 years ago

I see that the trouble is to get the OS of the container. I still think that we should add code to inspect the container in order to decide what types of OS to deploy the container on. Otherwise, I see two problems here: 1. UCP will fail to create Windows container (as you said earlier); 2. the latency of ContainerCreate() on windows will be even slower after retries.

dperny commented 5 years ago

How do you mean to inspect the container? The OS is a property of the image. Do you think we should retrieve the image manifest in swarm?

zsun21 commented 5 years ago

I don't know swarm enough to come up with the best solution here, so I was simply repeating what you stated earlier. The basic idea is swarm must select the best node for a container to deploy on. The best node could be based on the container manifest, labels, runtime cluster resources (cpu/mem), hardware topological requirements, etc. The bottom line is that swarm cannot blindly deploy a Windows container on a Linux Controller and then check error messages by parsing words from resulting error messages. In a customer's production, there could be hundreds or thousands (if not more) of cluster nodes. Any solution must scale and perform. If swarm cannot do these, I think we have an architectural problem to solve.