Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Kernel: add config fragment support #646

Merged

Conversation

devimc
Copy link

@devimc devimc commented Jul 19, 2019

original pull request #314

devimc pushed a commit to devimc/kata-runtime that referenced this pull request Jul 19, 2019
Depends-on: github.com/kata-containers/packaging#646

Fixes: #1234567

Signed-off-by: Julio Montes <[email protected]>
kernel/build-kernel.sh Outdated Show resolved Hide resolved
local cmdpath="${kernel_path}/scripts/kconfig/merge_config.sh"
local config_path="${arch_path}/.config"

local arch_configs="$(ls ${arch_path}/*.conf)"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need arch-specific kernel fragment config files for all the other (non-x86_64) architectures to ensure those kernel continue to build as they do today?

Copy link
Contributor

Choose a reason for hiding this comment

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

The code is written so if it does not find arch specific fragments it reverts to using the non-fragment configs. Thus, we can add arches as and when they have their fragments ready, and not delay the merge of the framework and x86 fragments :-)

@devimc
Copy link
Author

devimc commented Jul 22, 2019

/test

1 similar comment
@devimc
Copy link
Author

devimc commented Jul 22, 2019

/test

@devimc
Copy link
Author

devimc commented Jul 22, 2019

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@devimc devimc force-pushed the topic/kernel/fragmentsSupport branch from b686006 to 6bc311f Compare July 22, 2019 20:57
@devimc
Copy link
Author

devimc commented Jul 22, 2019

/test

@devimc
Copy link
Author

devimc commented Jul 24, 2019

/test

@devimc
Copy link
Author

devimc commented Jul 24, 2019

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@devimc
Copy link
Author

devimc commented Jul 24, 2019

@egernst @grahamwhaley @ganeshmaharaj CI is happy, can we merge this?

@grahamwhaley
Copy link
Contributor

@devimc

  • any progress/update on SRIOV support?
  • @egernst - would we be happy merging without SRIOV - that would then become the default kernel config for Kata x86 releases...
  • obs packaging CI looks to have failed

Copy link
Member

@egernst egernst left a comment

Choose a reason for hiding this comment

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

Let's do this! Thanks Graham and Julio!

@egernst
Copy link
Member

egernst commented Jul 25, 2019

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Graham Whaley and others added 5 commits July 25, 2019 18:13
Add the framework to build kernel config files from trees
of kernel fragments.

If no fragment directory is found for the requested kernel
version and architecture then revert to looking for a whole
prebuilt kernel config file instead.

Fixes: kata-containers#234

Signed-off-by: Graham Whaley <[email protected]>
Embellish the README a bit, and add some details about the
new fragment method.

Signed-off-by: Graham Whaley <[email protected]>
Add the base common fragments and x86_64 specific fragments
for the 4.19.x kernel.

Signed-off-by: Graham Whaley <[email protected]>
Now we are using the fragments, drop the x86_64 4.19 config file
so we default to fragment mode.

Signed-off-by: Graham Whaley <[email protected]>
bump kernel version to 46

Signed-off-by: Julio Montes <[email protected]>
@devimc devimc force-pushed the topic/kernel/fragmentsSupport branch from 42a3acb to 9b0fdf2 Compare July 25, 2019 18:13
@devimc
Copy link
Author

devimc commented Jul 25, 2019

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@devimc
Copy link
Author

devimc commented Jul 25, 2019

/test

use `merge_config.sh` script to generate the final `.config` file if the
`${arch}_kata_kvm_*` file doesn't exist.

Signed-off-by: Julio Montes <[email protected]>
@devimc devimc force-pushed the topic/kernel/fragmentsSupport branch from 9b0fdf2 to 9e8cd7d Compare July 25, 2019 19:12
@devimc
Copy link
Author

devimc commented Jul 25, 2019

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@devimc
Copy link
Author

devimc commented Jul 25, 2019

/test

@jcvenegas jcvenegas merged commit 3df25f2 into kata-containers:master Jul 25, 2019
@jcvenegas
Copy link
Member

All green - merged :) , kudos @devimc

devimc pushed a commit to devimc/kata-agent that referenced this pull request Jul 30, 2019
Some containers may require HW devices to improve its performance. In Kata
containers these devices can be passed though VFIO and used in the container
only if the guest kernel has the drivers built-in for them. When kernel
fragment support landed (kata-containers/packaging#646), kata lost support
for several HW devices like Intel GPUs, this was expected since one of the
goals of this change was to have a minimal kernel in order to improve boot
time, memory footprint and reduce the attack surface by enabling just the
features required to run kata containers.
Currently if the users want to use a HW device in kata container, He/She has
to build a custom kernel and create a custom image that includes the modules
that will be loaded by systemd. From user's perspective this is a pain, since
not all users know how to create a custom image or configure/build a custom
kernel.
Same as the `debug_console` feature (kata-containers#547), the goal of
this change is to facilitate the things to the final user and *do not* depend
on systemd.

fixes kata-containers#615

see kata-containers/osbuilder#77

Signed-off-by: Julio Montes <[email protected]>
devimc pushed a commit to devimc/kata-agent that referenced this pull request Jul 31, 2019
Some containers may require HW devices to improve its performance. In Kata
containers these devices can be passed though VFIO and used in the container
only if the guest kernel has the drivers built-in for them. When kernel
fragment support landed (kata-containers/packaging#646), kata lost support
for several HW devices like Intel GPUs, this was expected since one of the
goals of this change was to have a minimal kernel in order to improve boot
time, memory footprint and reduce the attack surface by enabling just the
features required to run kata containers.
Currently if the users want to use a HW device in kata container, He/She has
to build a custom kernel and create a custom image that includes the modules
that will be loaded by systemd. From user's perspective this is a pain, since
not all users know how to create a custom image or configure/build a custom
kernel.
Same as the `debug_console` feature (kata-containers#547), the goal of
this change is to facilitate the things to the final user and *do not* depend
on systemd.

fixes kata-containers#615

see kata-containers/osbuilder#77

Signed-off-by: Julio Montes <[email protected]>
devimc pushed a commit to devimc/kata-agent that referenced this pull request Jul 31, 2019
Some containers may require HW devices to improve its performance. In Kata
containers these devices can be passed though VFIO and used in the container
only if the guest kernel has the drivers built-in for them. When kernel
fragment support landed (kata-containers/packaging#646), kata lost support
for several HW devices like Intel GPUs, this was expected since one of the
goals of this change was to have a minimal kernel in order to improve boot
time, memory footprint and reduce the attack surface by enabling just the
features required to run kata containers.
Currently if the users want to use a HW device in kata container, He/She has
to build a custom kernel and create a custom image that includes the modules
that will be loaded by systemd. From user's perspective this is a pain, since
not all users know how to create a custom image or configure/build a custom
kernel.
Same as the `debug_console` feature (kata-containers#547), the goal of
this change is to facilitate the things to the final user and *do not* depend
on systemd.
The list of kernel modules and their options are set through gRPC when the
sandbox is created.

fixes kata-containers#615

see kata-containers/osbuilder#77

Signed-off-by: Julio Montes <[email protected]>
devimc pushed a commit to devimc/kata-agent that referenced this pull request Aug 1, 2019
Some containers may require HW devices to improve its performance. In Kata
containers these devices can be passed though VFIO and used in the container
only if the guest kernel has the drivers built-in for them. When kernel
fragment support landed (kata-containers/packaging#646), kata lost support
for several HW devices like Intel GPUs, this was expected since one of the
goals of this change was to have a minimal kernel in order to improve boot
time, memory footprint and reduce the attack surface by enabling just the
features required to run kata containers.
Currently if the users want to use a HW device in kata container, He/She has
to build a custom kernel and create a custom image that includes the modules
that will be loaded by systemd. From user's perspective this is a pain, since
not all users know how to create a custom image or configure/build a custom
kernel.
Same as the `debug_console` feature (kata-containers#547), the goal of
this change is to facilitate the things to the final user and *do not* depend
on systemd.
The list of kernel modules and their parameters are set through gRPC when the
sandbox is created.

fixes kata-containers#615

see kata-containers/osbuilder#77

Signed-off-by: Julio Montes <[email protected]>
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.

6 participants