Skip to content
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

Support custom docker runtimes #7589

Merged
merged 2 commits into from
May 12, 2020
Merged

Conversation

benbuzbee
Copy link
Contributor

This enables customers who want to use gvisor and have it configured on their clients.

@benbuzbee
Copy link
Contributor Author

@notnoop can you hook me up with the right reviewers for this?

We want to be able to use gvisor as the docker runtime and I feel this change only adds more power. Users can use constraints to ensure a job with a custom runtime is scheduled on machines which are configured for it

Copy link
Contributor

@notnoop notnoop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for submitting your PR - the PR looks good. I have a couple of questions/suggestions - if you address them by Monday, I'll make sure it's included in 0.11.0.

drivers/docker/config.go Outdated Show resolved Hide resolved
drivers/docker/driver.go Outdated Show resolved Hide resolved
@@ -1029,6 +1029,29 @@ func TestDockerDriver_SecurityOptFromFile(t *testing.T) {
require.Contains(t, container.HostConfig.SecurityOpt[0], "reboot")
}

func TestDockerDriver_OCIRuntime(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest pattern matching against TestDockerDriver_CreateContainerConfig_* tests - those are a bit more lightweight as they don't actually create containers.

This enables customers who want to use gvisor and have it configured on their clients.
@notnoop
Copy link
Contributor

notnoop commented Apr 7, 2020

Upon reflecting further, we had a concern about runtime security. Given that runtime offer varying level of security, we worry about operators bypassing host or operator using a less secure runtime other than the default one or ones that provide more capabilities than intended.

We've decided to target this for 0.11.1 and would love to see include/exclude/disable options in the client config. We can follow up with that after cutting 0.11.0 as well!

Does that sound reasonable? Thanks a lot again.

@benbuzbee
Copy link
Contributor Author

No concerns with timeline, thank you for updating.

Regarding next steps:
If I understand correctly the general concern is that a cluster operator has no way of making security guarantees if someone can schedule a task with an arbitrary runtime that may enforce no sandbox?

Concern makes sense. However docker will reject a runtime unless it is configured at the daemon, so one answer to this is that an explicit allow list already exists - it is whatever is configured at the docker daemon. I am not sure if adding client config expands on that capability?

@@ -760,6 +760,12 @@ func (d *Driver) createContainerConfig(task *drivers.TaskConfig, driverConfig *T
}
hostConfig.Runtime = d.config.GPURuntimeName
}
if driverConfig.Runtime != "" && driverConfig.Runtime != hostConfig.Runtime {
if hostConfig.Runtime != "" {
return c, fmt.Errorf("runtime '%s' requested conflicts with gpu runtime '%s'", driverConfig.Runtime, hostConfig.Runtime)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what GPU runtime? I don't understand this error message :)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the runtime is set above as part of the docker.nvidia_runtime docker client configuration. looks like this errors instead of allowing a job to override the value with a configured runtime

@benbuzbee
Copy link
Contributor Author

Just poking this thread, it looks like 0.11.1 has already release. @notnoop what do you think needs to be added to this? What do you think of the argument that cluster admins can control this behavior by choosing which runtimes to install to docker on the machine in the first place? For example, if they do not want users to pick runc they can configure the docker daemon to only have the runsc runtime installed?

@notnoop
Copy link
Contributor

notnoop commented May 4, 2020

Thanks for the ping! I'll follow up. Sadly, 0.11.1 was an urgent fix for the panic so caused us to shift plans a bit.

@notnoop notnoop mentioned this pull request May 12, 2020
@notnoop
Copy link
Contributor

notnoop commented May 12, 2020

Sorry for the slowness here. I have followed up in #7932 . Thank you so much again for your contribution!

@notnoop notnoop merged commit 3bd675e into hashicorp:master May 12, 2020
@github-actions
Copy link

github-actions bot commented Jan 6, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants