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

Enable TmpFS when possible #235

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
type=porto;
"start_uid"=19500;
};
"enable_tmpfs"=%true;
};
"gpu_manager"={
"gpu_info_source"={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"use_job_proxy_from_image"=%false;
};
"do_not_set_user_id"=%true;
"enable_tmpfs"=%false;
};
"gpu_manager"={
"gpu_info_source"={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
type=simple;
"start_uid"=19500;
};
"enable_tmpfs"=%false;
};
"gpu_manager"={
"gpu_info_source"={
Expand Down
2 changes: 1 addition & 1 deletion pkg/ytconfig/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ func (g *Generator) getControllerAgentConfigImpl(spec *ytv1.ControllerAgentsSpec
return ControllerAgentServer{}, err
}

c.ControllerAgent.EnableTmpfs = g.ytsaurus.Spec.UsePorto
c.ControllerAgent.EnableTmpfs = true
c.ControllerAgent.UseColumnarStatisticsDefault = true

g.fillCommonService(&c.CommonServer, &spec.InstanceSpec)
Expand Down
18 changes: 18 additions & 0 deletions pkg/ytconfig/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,29 @@ func fillJobEnvironment(execNode *ExecNode, spec *ytv1.ExecNodesSpec, commonSpec
// FIXME(khlebnikov): For now running jobs as non-root is more likely broken.
execNode.SlotManager.DoNotSetUserId = ptr.Bool(ptr.BoolDeref(envSpec.UseArtifactBinds, true))

// Enable tmpfs if exec node can mount and propagate into job container.
execNode.SlotManager.EnableTmpfs = ptr.Bool(func() bool {
if !spec.Privileged {
return false
}
if !ptr.BoolDeref(envSpec.Isolated, true) {
return true
}
for _, location := range ytv1.FindAllLocations(spec.Locations, ytv1.LocationTypeSlots) {
mount := findVolumeMountForPath(location.Path, spec.InstanceSpec)
if mount == nil || mount.MountPropagation == nil || *mount.MountPropagation != corev1.MountPropagationBidirectional {
return false
}
}
return true
}())
} else if commonSpec.UsePorto {
jobEnv.Type = JobEnvironmentTypePorto
execNode.SlotManager.EnableTmpfs = ptr.Bool(true)
// TODO(psushin): volume locations, root fs binds, etc.
} else {
jobEnv.Type = JobEnvironmentTypeSimple
execNode.SlotManager.EnableTmpfs = ptr.Bool(spec.Privileged)
}

return nil
Expand Down
Loading