Giter Site home page Giter Site logo

clearcontainers / runtime Goto Github PK

View Code? Open in Web Editor NEW
590.0 43.0 70.0 13.89 MB

OCI (Open Containers Initiative) compatible runtime using Virtual Machines

License: Apache License 2.0

Shell 11.39% Makefile 4.88% Go 83.73%
docker oci containers virtualization security qemu-kvm container kvm virtual-machine cri-o

runtime's Introduction

runtime's People

Contributors

ace-tang avatar allencloud avatar amshinde avatar chavafg avatar dvoytik avatar gabyct avatar gorozco1 avatar grahamwhaley avatar guangxuli avatar gvancuts avatar jcvenegas avatar jodh-intel avatar mcastelino avatar warmchang avatar wcwxyz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

runtime's Issues

Evaluate use of capabilities in executables

We should probably do a review of our executables 'capabilities', and start to remove any that are not needed (to reduce attack surface).
On the host side we should check what we can do for:

  • the runtime
  • the shim
  • the proxy

and on the guest side we probably need to set or remove the capabilities around the workload according to the configuration (from the OCI file for instance) that is passed in/requested of us.

Enable and tune KSM

Problem Statement

All Clear Containers share the same kernel and guest OS image, and thus the hypervisor will allocate anonymous pages for both of those components. For many of them, those pages could be shared and deduplicated through the Kernel Same Page Merging (KSM) technology. Unfortunately, we are currently not taking full advantage of it for the following reasons:

  1. Many distribution OSes do not enable KSM by default
  2. Enabling KSM is only the first step. We need to also tune KSM to efficiently reduce our per-container memory consumption

Solution

Both our runtime and proxy components can gather pieces of information about the current number of running/started/starting Clear Containers, the number of started containers during the last N seconds, etc...
By combining this data with at least the host available memory and CPU utilization, we should implement a ksm tuning loop that will:

  1. Trigger KSM scans, depending on the number of started Clear Containers since the last scan and the number of already running containers.
  2. Dynamically set the KSM scan period, depending on the system available memory, the CPU utilization and the rate of Clear Containers start (how many CC do we start per minute). We can even decide to disable periodic scanning (if possible) and control it fully.

Minimizing KSM impact

Running KSM frequently can have a significant impact on the overall system performance. We need to take advantage of KSM memory overhead reduction while at the same time minimizing the number of pages the KSM kernel thread wants and can scan:

  • Enhance the KSM kernel interface to trigger it only on specific PIDs.
  • Do not systematically marge all QEMU allocated pages as mergeable and be a little smarter about it.

cc @jtkukunas

Kernel 4.9 crashes inside the VM when used with Semaphore CI

For some unknown reasons, we cannot use the latest kernels for Clear Containers guest kernel when using Semaphore CI. Indeed, using some 4.9 kernels (maybe something changed in the config and it is not related to the kernel version), makes the kernel crashing inside the VM, while it works perfectly with kernel 4.5-50. This was the kernel released just before we switch to 4.9.4-53.

Network support

Implement Clear Containers networking support:

  • Create container networking namespace.
  • Run networking pre-hooks.
  • Discover the created network interfaces.
  • Add the related tap interfaces.
  • Build the integration bridge.
  • Add the pre-hook created interfaces and the tap ones to the integration bridge.

Should this be done from virtcontainers ?

Switch to an initrd image for the guest VM

Compare a full OS image vs an uncompressed intrd/initramfs one for:

  • Memory consumption
  • Boot time
  • CPU utilization

We may be ready to accept slight boot time degradation for significant memory consumption reduction.

cc @jtkukunas

Add networking benchmarks

With Clear Containers we are pushing all network packets between the container and the host through a Linux bridge, with or without SRIOV.
Having basic networking benchmarks (iperf based ?) for Clear Containers with and without SRIOV would be needed.

cc @jtkukunas

Use a basic VM as part of our memory baseline

We want to measure the overall Clear Containers (QEMU, guest VM, runtime, shim, proxy) memory overhead, but we should also measure our memory overhead compared to a very basic QEMU instance.
This will give us the runtime+shim+proxy+guest VM overhead.

Our basic QEMU VM should not even boot a kernel, but stop at the firmware level.

Add I/O benchmarks

We should add I/O tests for measuring disk/volumes and filesystem throughput.
We know 9pfs is slow and we hope to be able to improve it over time, and thus we need to include benchmarks for it to our PnP suite.

cc @jtkukunas

Modify Travis build to make use of docker

From @jodh-intel on September 29, 2016 9:32

Travis is an excellent facility, but the fact that the newest environment they support is Ubuntu Trusty (14.04) is problematic given the old versions of tooling and libraries.

We should use Travis to trigger a build and test run inside a docker image since that way we can use any environment we wish (even multiple).

Related: #255, #295, #114, #155.

Copied from original issue: intel/cc-oci-runtime#305

Define, document and publish reference workloads for our benchmarks

We should define and publish a short set of custom workloads for our benchmarks.

Define

For example:

  • A minimal workload: A busybox container that sleeps for one hour
  • An I/O specific workload
  • A networking workload

Document and publish

Each of those workloads should:

Host networking is not supported

From @sameo on January 24, 2017 15:44

We do not support running Clear Containers within the host network (docker --net=host run foo).
Although this sounds like a corner case, it seems that Kubernetes starts at least one such container per node (for kube-proxy) in order to mess with the host iptables and routes.

Copied from original issue: intel/cc-oci-runtime#617

Add more memory consumption benchmarks

cc @jtkukunas

To be completed with more tests

Memory consumption exponential scaling

Does our memory consumption scale with the number of started containers ? With KSM enabled the average memory consumption per container should decrease with the number of containers.

We should measure the total average memory consumption per container for 1, 10, 100, 500 and 1000 running containers.

Memory density

We want to be able to measure Clear Containers memory density.
For a given machine (Available RAM, distro, etc...), we should measure how many Clear Containers can be started before we crash or before docker refuses to launch more.
This benchmark should be run with at least 2 parameters:

  • How many containers do we launch at the same time (container batch) ?
  • How long do we wait between each container batch ?

Enhance PnP memory footprint data

Besides the raw memory consumption in KBytes, we should measure more fine grained data:

  • Total shared pages
  • Total anonymous (private) pages

We would also need to get how those pages are distributed between the process mappings. For example how many anonymous pages are used by glibc for a given QEMU process. This will allow us to understand where e.g. our QEMU processes are consuming the most pages:

  • Per mapping shared memory
  • Per mapping private pages

Finally, we need to add huge pages consumption to that data.

Implement default config generation command

We should have a runtime command (runtime config) for generating a default configuration with all options set to reasonable values. For binary paths (shim, proxy), we should use the default Clear Containers values.

Add more boot time benchmarks

cc @jtkukunas

To be completed with more tests

Measure boot time scalability

On a given system running N containers, how does our boot time per container increase when starting a single container? N=[10, 50, 100]

clearcontainers vs clear-containers in paths

We currently use both, sometimes it's /var/run/clearcontainers and other times /var/lib/clear-containers. Pick one and stick with it. A quick git grep suggest we like clear-containers better.

CRI-O integration

Integrate with Kubernetes at the CRI level, through the CRI-O project.

Enable I/O PnP tests

We'd like to be able to run the I/O (storage) metrics on CC3.x like we did for CC2.x.
We'd like to be able to run for local and remote volumes and rootfs.

Use atime on mounts if appropriate

We should check if we have 'atime' set (or more correctly, noatime not set) on our mount points. Currently we believe it is not, and timestamp updates may be trickling down to layers that really don't need any updates, and the data is lost on container quit anyhow.
@mcastelino , as he was involved in the original discussion - so please add thoughts as appropriate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.