Allow switching Windows runtimes.#42089
Conversation
|
Looks that finding runtime binaries with this logic fails to error: Way how I set it on #41479 works. Which is enabling experimental mode + DOCKER_WINDOWS_CONTAINERD_RUNTIME which are called on: moby/pkg/system/init_windows.go Lines 15 to 29 in 46cdcd2 and setting containerd runtime name on: Line 15 in 46cdcd2 |
|
Closing this one as I think the work @olljanat is exactly the right way to handle this. |
|
Actually, I take that back. There's some other work I'd like to do (namely embed containerd instead of relying on an external one when no --containerd= is set) that needs this work. |
d6277dd to
81fb2be
Compare
81fb2be to
1a72df5
Compare
|
RS5 failures look unrelated. |
54ebe0b to
e1a1bf3
Compare
|
|
||
| rt := daemon.configStore.GetDefaultRuntimeName() | ||
| if rt == "" { | ||
| if daemon.configStore.ContainerdAddr == "" { |
There was a problem hiding this comment.
No cases where we use a default value for the containerd address or anything like that? ISTR some talk about trying to default to V2 on 2022+? (I guess that ship sailed?)
There was a problem hiding this comment.
So my plan is to follow-up with a PR to embed containerd and use that if no address is specified on both linux and windows.
There was a problem hiding this comment.
That said, even on Linux we don't default a socket here.
On Windows we just don't start a containerd process like we do on Linux.
There was a problem hiding this comment.
Ahhh, got it; thanks for the added detail.
tianon
left a comment
There was a problem hiding this comment.
Looks pretty straightforward to me 😇
| // This is used by the `default-runtime` flag in dockerd as the default value. | ||
| // On windows we'd prefer to keep this empty so the value is auto-detected based on other options. | ||
| StockRuntimeName = "" |
There was a problem hiding this comment.
The whole StockRuntimeName vs DefaultRuntimeName is a bit confusing.
Wondering, will setting this to an empty string cause some odd behavior if somehow the option is set to an empty string?
Lines 44 to 46 in 7b9275c
There was a problem hiding this comment.
Ah, never mind; looks like we first check if it's not empty;
Lines 39 to 41 in 7b9275c
thaJeztah
left a comment
There was a problem hiding this comment.
oh! looks like CI is failing; looks relevant;
ERRO Running error: buildssa: analysis skipped: errors in package: [/go/src/github.com/docker/docker/daemon/config/config_linux_test.go:153:5: unknown field DefaultRuntime in struct literal]
|
Could you also open a PR in the CLI repository to update the |
|
This should fix the failure; diff --git a/daemon/config/config_linux_test.go b/daemon/config/config_linux_test.go
index 424bfc00e6..cfc635567d 100644
--- a/daemon/config/config_linux_test.go
+++ b/daemon/config/config_linux_test.go
@@ -150,7 +150,9 @@ func TestUnixValidateConfigurationErrors(t *testing.T) {
Runtimes: map[string]types.Runtime{
"foo": {},
},
- DefaultRuntime: "bar",
+ CommonConfig: CommonConfig{
+ DefaultRuntime: "bar",
+ },
},
},
} |
This adds support for 2 runtimes on Windows, one that uses the built-in HCSv1 integration and another which uses containerd with the runhcs shim. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
e1a1bf3 to
7ccf750
Compare
This adds support for 2 runtimes on Windows, one that uses the built-in
HCSv1 integration and another which uses containerd with the runhcs
shim.
Related to #41455