This adds a `hostsettings` package which can be used to check and
optionally automatically adjust host kernel settings.
This currently covers six kernel settings:
- `/proc/sys/kernel/yama/ptrace_scope`: must set to 0 or 1 when using
`ptrace`.
- `/proc/sys/user/max_user_namespaces`: must be >= 2, but also
suggest increasing it further if low.
- `/proc/sys/kernel/unprivileged_userns_clone`: Must be enabled in
rootless mode.
- `/proc/sys/kernel/unprivileged_userns_apparmor_policy`: Same.
- `/proc/sys/vm/max_map_count`: suggest increasing max host VMAs.
- `/sys/kernel/mm/transparent_hugepage/shmem_enabled`: suggest turning
on transparent hugepages.
This is flag-gated; by default `runsc` only checks that these settings
are optimal, but only warns if they are not optimal (unless marked as
mandatory). Other flag settings can be used to either bypass this process
entirely (to avoid the small startup overhead this adds), or to make it
auto-adjust any suboptiomal kernel settings, either on a best-effort or
mandatory basis.
Updates issue #5964
Updates issue #9006
PiperOrigin-RevId: 683375555