-
Notifications
You must be signed in to change notification settings - Fork 15
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
feature request: allow use of '--network host' #63
Comments
+1 for this, except make |
This seems like a good goal to me. One thing I want to avoid is leaking the implementation details around However, I've seen other projects like I also quite like option 3 because it would just allow passing arbitrary flags to the CLI under the hood, and I like @trxcllnt's suggestion of making it a simple list. However I worry a little about a future where we want to support Perhaps the way to deal with this us to just expose the implementation directly and have something like Any thoughts on a solution to this? |
I think we should pursue this The idea to namespace by container runtime is a good one. There are only a small number of container runtimes I can imagine this tool ever needing to support, so the proliferation of those And with all of this defined in static configuration, there's a path available to use warnings / errors to move configs over to top-level (portable-across-runtimes) options as new ones are added. Similar to the the example I gave above, by raising warnings / errors like this: "[WARN] Passing --gpus via I like this the most because it allows for experimentation. In the absence of this, right now to test if |
That sounds totally reasonable to me. Let's go with option 3 and in the future move things that we know people want to option 1 for better portability. |
I just published |
Excellent, thank you so much! |
Description
I'd like to be able to convince
container-canary
to run containers with--network host
.@trxcllnt and I have been using
container-canary
in a docker-in-docker context in CI, and he observed some networking instability in that environment that might be be resolved by avoiding double-nested network isolation.Benefits of this work
Allows finer-grained control over how
container-canary
is run.If this does seem to help for the docker-in-docker case specifically, would improve
container-canary
's usability in a common pattern used in CI.Acceptance Criteria
container-canary
pass--network host
todocker run
Approach
Options Considered
I see 3 options for exposing this configuration, @jacobtomlinson I'll happily defer to your opinion on which to pursue (assuming you're open to this idea generally).
Option 1: hostNetwork
The k8s V1 podSpec has an option
hostNetwork
, for exactly this purpose. (k8s docs).So that'd look like the
container-canary
config picking up a new boolean option:Option 2: named network argument
container-canary
could instead support passing any network name via a top-level config argument.This would allow greater customization, of the form described in "User-defined networks" (Docker docs).
Option 3: arbitrary array of extra arguments
container-canary
could support passing arbitrary flags to the container runtime via an array.Where the implication is that for each
key: value
pair there,{key} {value}
is passed todocker run
. Similar to this:container-canary/internal/container/docker.go
Lines 41 to 47 in c473896
GitHub Actions has a similar interface, where there are some container characteristics that are set via top-level configuration, and then any other arbitrary flags can be passed via
jobs.<job_id>.container.options
(GitHub Actions docs)Proposal
I (@jameslamb) personally prefer option 3. It offers high flexibility to experiment, so could add a lot of capability to
container-canary
all at once (beyond just--network host
).For example, it'd immediately also add support for running tests that require GPUs (you could just pass
--gpus all)
.And having the arguments be keys in the YAML map means that if, in the future, we wanted to have
container-canary
prohibit setting some option or require that it be set by some other top-level configuration value, it'd be straightforward to issue deprecation warnings and eventually errors like "Passing--gpus
viarunOptions
is now allowed. Please use top-level keygpus:
instead".The text was updated successfully, but these errors were encountered: