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

Conversation

@egernst
Copy link
Member

@egernst egernst commented Mar 12, 2018

this PR creates a use-cases subdirectory and adds an initial use case,
booting a kata container which makes use of vpp vhost-user interface.

Going forward, will add similar documents for SRIOV support, vhost-user-scsi / SPDK, RDMA, QAT, etc.

This starts to address #22

Signed-off-by: Eric Ernst eric.ernst@intel.com

@egernst egernst added the review label Mar 12, 2018
# Setup to run VPP

The Data Plane Development Kit (DPDK) is a set of libraries and drivers for
fast packet processing. The Vector Packet Processing (VPP) is a platform

Choose a reason for hiding this comment

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

s/The Vector Packet Processing/Vector Packet Processing/ ?

Copy link
Member Author

Choose a reason for hiding this comment

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

ack

extensible framework which provides out-of-the-box production quality
switch and router functionality. VPP is a high performance packet-processing
stack which can run on commodity CPUs. Enabling VPP with DPDK support can
yield significant performance improvements over a Linux\*-bridge providing a

Choose a reason for hiding this comment

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

s/Linux*-bridge/Linux* bridge/ ?

Copy link
Member Author

Choose a reason for hiding this comment

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

ack

enable memory preallocation and huge page support:

```
sudo sed -i -e 's/^# *\(enable_hugepages\).*=.*$/\1 = true/g' /usr/share/defaults/kata-containers/configuration.toml

Choose a reason for hiding this comment

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

Can you add a $ prefix here?

Copy link
Member

Choose a reason for hiding this comment

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

You mentioned memory prealloc earlier, but havent enabled it in the config here. Is memory prealloc really required?

Follow the [Kata Containers' setup instructions](https://github.com/kata-containers/documentation/wiki/Developer-Guide).

In order to make use of vhost-user based interfaces, the container needs to be backed
by huge pages. After enabling huge-pages support on the host system, update the Kata configuration to

Choose a reason for hiding this comment

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

I think it would be clearer to state somewhere in this paragraph that "huge pages" are a kernel feature.

Copy link
Member

Choose a reason for hiding this comment

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

I think it will be useful to specify the kernel configuration that needs to be checked for huge pages as well. Along with the kernel configuration, it is also necessary to enable huge pages on the kernel command line as well iirc.
Will be useful to mention a check for that.


In order to make use of vhost-user based interfaces, the container needs to be backed
by huge pages. After enabling huge-pages support on the host system, update the Kata configuration to
enable memory preallocation and huge page support:

Choose a reason for hiding this comment

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

How about changing this to:

and huge page support in the guest kernel:

Copy link
Member Author

Choose a reason for hiding this comment

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

ack

@@ -0,0 +1,76 @@
# Setup to run VPP

Choose a reason for hiding this comment

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

Pet peeve - could you consider adding a table of contents here? That would make it much clearer which level each section is part of.

To create a network and connect Kata Containers easily to that network via
Docker, install a VPP Docker plugin.

To install the plugin, you can follow the [plugin installation instructions](https://github.com/clearcontainers/vpp).

Choose a reason for hiding this comment

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

Should we be linking to a Clear Containers repo here? Maybe we should consider creating a new repo under Kata for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm fine either way - it isn't clear or kata specific really, though.

$ sudo docker rm $(sudo docker ps --no-trunc -aq)
$ sudo docker network rm vpp_net
$ sudo service vpp stop
$ sudo service vpp start

Choose a reason for hiding this comment

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

  • Why is the service being restarted?
  • But if it needs to be, why not sudo systemctl restart vpp?

Copy link
Member Author

Choose a reason for hiding this comment

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

you're right - not necessary.

use this branch's runtime:

```
$ sudo docker run --net=vpp_net --ip=192.168.1.2 --mac-address=CA:FE:CA:FE:01:02 -it debian bash -c "ip a; ip route; sleep 300"

Choose a reason for hiding this comment

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

Our informal "standard image" is busybox (as it's one of the smallest), and docker pull time will be minimised if you specify that.

Copy link
Member Author

Choose a reason for hiding this comment

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

ack

Follow the [Kata Containers' setup instructions](https://github.com/kata-containers/documentation/wiki/Developer-Guide).

In order to make use of vhost-user based interfaces, the container needs to be backed
by huge pages. After enabling huge-pages support on the host system, update the Kata configuration to
Copy link
Member

Choose a reason for hiding this comment

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

I think it will be useful to specify the kernel configuration that needs to be checked for huge pages as well. Along with the kernel configuration, it is also necessary to enable huge pages on the kernel command line as well iirc.
Will be useful to mention a check for that.

enable memory preallocation and huge page support:

```
sudo sed -i -e 's/^# *\(enable_hugepages\).*=.*$/\1 = true/g' /usr/share/defaults/kata-containers/configuration.toml
Copy link
Member

Choose a reason for hiding this comment

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

You mentioned memory prealloc earlier, but havent enabled it in the config here. Is memory prealloc really required?


Follow the [VPP installation instructions](https://wiki.fd.io/view/VPP/Installing_VPP_binaries_from_packages).

After a successful installation, your host system is ready to start
Copy link
Member

Choose a reason for hiding this comment

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

/is ready/should be ready/ ?

Copy link
Member Author

Choose a reason for hiding this comment

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

updated.


### Install the VPP Docker\* plugin

To create a network and connect Kata Containers easily to that network via
Copy link
Member

Choose a reason for hiding this comment

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

/network/Docker network/?

Copy link
Member Author

Choose a reason for hiding this comment

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

ack

```

Test connectivity by launching two containers, assuming Docker is setup to
use this branch's runtime:
Copy link
Member

Choose a reason for hiding this comment

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

Shouldnt you be getting rid of "assuming Docker is setup to use this branch's runtime"?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes.

@amshinde
Copy link
Member

@egernst Any update on this?

@egernst
Copy link
Member Author

egernst commented Apr 12, 2018

Shame on me. I'll work through these before tomorrow.

@intelkevinputnam
Copy link

@egernst @amshinde looks like this is still waiting for updates. If so, I'll hold off on grammar/wording review until those changes are completed.

@jodh-intel
Copy link

Hi @egernst - any chance you'll be able to update this PR this week?

@jodh-intel
Copy link

Hi @egernst - this has been open for 143 days. Please could you update "real soon now"... ? :)

@klynnrif - ptal.

Copy link

@klynnrif klynnrif left a comment

Choose a reason for hiding this comment

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

Scrubbed for grammar, structure, and flow. A few suggestions. Thanks!


The Data Plane Development Kit (DPDK) is a set of libraries and drivers for
fast packet processing. The Vector Packet Processing (VPP) is a platform
extensible framework which provides out-of-the-box production quality
Copy link

Choose a reason for hiding this comment

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

sub out "which" for "that": extensible framework that provides out-of-the-box production quality

Copy link
Member Author

Choose a reason for hiding this comment

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

ack

Copy link
Member

Choose a reason for hiding this comment

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

@egernst This needs to be addressed.

fast packet processing. The Vector Packet Processing (VPP) is a platform
extensible framework which provides out-of-the-box production quality
switch and router functionality. VPP is a high performance packet-processing
stack which can run on commodity CPUs. Enabling VPP with DPDK support can
Copy link

Choose a reason for hiding this comment

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

sub out "which" for "that": stack that can run on commodity CPUs.

Copy link
Member Author

Choose a reason for hiding this comment

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

ack

Copy link
Member

Choose a reason for hiding this comment

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

This as well.

To create a network and connect Kata Containers easily to that network via
Docker, install a VPP Docker plugin.

To install the plugin, you can follow the [plugin installation instructions](https://github.com/clearcontainers/vpp).
Copy link

Choose a reason for hiding this comment

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

Removing "you can":
To install the plugin, follow the plugin installation instructions.

Copy link
Member Author

Choose a reason for hiding this comment

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

ack

To install the plugin, you can follow the [plugin installation instructions](https://github.com/clearcontainers/vpp).

This VPP plugin allows the creation of a VPP network. Every container added
to this network will be connected via an L2 bridge-domain provided by VPP.
Copy link

Choose a reason for hiding this comment

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

Suggested rewrite to stay active:
to this network is connected through an L2 bridge-domain provided by VPP.

Copy link
Member Author

Choose a reason for hiding this comment

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

ack


## Example: Launch two Kata Containers using VPP

To use VPP, use Docker to create a network which will make use of VPP.
Copy link

Choose a reason for hiding this comment

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

sub out "which" for "that" and rewrite to stay active:
To use VPP, use Docker to create a network that makes use of VPP.

Copy link
Member Author

@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.

believe it or not, tomorrow finally came; I made updates. take a look...

# Setup to run VPP

The Data Plane Development Kit (DPDK) is a set of libraries and drivers for
fast packet processing. The Vector Packet Processing (VPP) is a platform
Copy link
Member Author

Choose a reason for hiding this comment

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

ack


The Data Plane Development Kit (DPDK) is a set of libraries and drivers for
fast packet processing. The Vector Packet Processing (VPP) is a platform
extensible framework which provides out-of-the-box production quality
Copy link
Member Author

Choose a reason for hiding this comment

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

ack

fast packet processing. The Vector Packet Processing (VPP) is a platform
extensible framework which provides out-of-the-box production quality
switch and router functionality. VPP is a high performance packet-processing
stack which can run on commodity CPUs. Enabling VPP with DPDK support can
Copy link
Member Author

Choose a reason for hiding this comment

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

ack

extensible framework which provides out-of-the-box production quality
switch and router functionality. VPP is a high performance packet-processing
stack which can run on commodity CPUs. Enabling VPP with DPDK support can
yield significant performance improvements over a Linux\*-bridge providing a
Copy link
Member Author

Choose a reason for hiding this comment

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

ack


In order to make use of vhost-user based interfaces, the container needs to be backed
by huge pages. After enabling huge-pages support on the host system, update the Kata configuration to
enable memory preallocation and huge page support:
Copy link
Member Author

Choose a reason for hiding this comment

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

ack

To install the plugin, you can follow the [plugin installation instructions](https://github.com/clearcontainers/vpp).

This VPP plugin allows the creation of a VPP network. Every container added
to this network will be connected via an L2 bridge-domain provided by VPP.
Copy link
Member Author

Choose a reason for hiding this comment

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

ack

use this branch's runtime:

```
$ sudo docker run --net=vpp_net --ip=192.168.1.2 --mac-address=CA:FE:CA:FE:01:02 -it debian bash -c "ip a; ip route; sleep 300"
Copy link
Member Author

Choose a reason for hiding this comment

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

ack

```

Test connectivity by launching two containers, assuming Docker is setup to
use this branch's runtime:
Copy link
Member Author

Choose a reason for hiding this comment

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

yes.

$ sudo docker rm $(sudo docker ps --no-trunc -aq)
$ sudo docker network rm vpp_net
$ sudo service vpp stop
$ sudo service vpp start
Copy link
Member Author

Choose a reason for hiding this comment

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

you're right - not necessary.

To create a network and connect Kata Containers easily to that network via
Docker, install a VPP Docker plugin.

To install the plugin, you can follow the [plugin installation instructions](https://github.com/clearcontainers/vpp).
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm fine either way - it isn't clear or kata specific really, though.

@egernst
Copy link
Member Author

egernst commented Aug 9, 2018

@klynnrif @amshinde PTAL?

@bergwolf
Copy link
Member

ping @klynnrif @amshinde @kata-containers/documentation

@amshinde
Copy link
Member

@egernst Have you pushed your changes? I dont see the previous review comments addressed.

@klynnrif
Copy link

@egernst I don't see any changes from my first review comments - are they pushed? Thanks!

@egernst
Copy link
Member Author

egernst commented Aug 17, 2018

smh. git commit -a --amend!

Pushed.

@egernst
Copy link
Member Author

egernst commented Aug 17, 2018

@klynnrif @amshinde PTAL.

Copy link

@devimc devimc left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

@klynnrif klynnrif left a comment

Choose a reason for hiding this comment

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

lgtm - thanks!

```

These commands setup two Kata Containers connected via a VPP L2 bridge
domain. The first of the the VMs displays the networking details and then
Copy link
Member

Choose a reason for hiding this comment

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

/the the/the two/?

Copy link
Member Author

Choose a reason for hiding this comment

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

ack

create a use-cases subdirectory and add an initial use case,
booting a kata container which makes use of vpp vhost-user interface.

Fixes: kata-containers#209

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
@amshinde amshinde merged commit b594fd3 into kata-containers:master Aug 21, 2018
@egernst egernst removed the review label Aug 21, 2018
devimc pushed a commit to devimc/kata-documentation that referenced this pull request Sep 2, 2019
Changed image-builder/image_builder.sh to
automatically calculate the size of the root disk

Fixes kata-containers#25.

Signed-off-by: Harshal Patil <harshal.patil@in.ibm.com>
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.

7 participants