Giter Site home page Giter Site logo

kata-containers / tests Goto Github PK

View Code? Open in Web Editor NEW
141.0 55.0 194.0 12.81 MB

Kata Containers tests, CI, and metrics

Home Page: https://katacontainers.io/

License: Apache License 2.0

Shell 79.70% Makefile 0.99% Go 13.56% Dockerfile 0.53% R 4.69% Smarty 0.07% Jupyter Notebook 0.10% Python 0.36%
kata-containers

tests's Introduction

CI | Publish Kata Containers payload Kata Containers Nightly CI

Kata Containers

Welcome to Kata Containers!

This repository is the home of the Kata Containers code for the 2.0 and newer releases.

If you want to learn about Kata Containers, visit the main Kata Containers website.

Introduction

Kata Containers is an open source project and community working to build a standard implementation of lightweight Virtual Machines (VMs) that feel and perform like containers, but provide the workload isolation and security advantages of VMs.

License

The code is licensed under the Apache 2.0 license. See the license file for further details.

Platform support

Kata Containers currently runs on 64-bit systems supporting the following technologies:

Architecture Virtualization technology
x86_64, amd64 Intel VT-x, AMD SVM
aarch64 ("arm64") ARM Hyp
ppc64le IBM Power
s390x IBM Z & LinuxONE SIE

Hardware requirements

The Kata Containers runtime provides a command to determine if your host system is capable of running and creating a Kata Container:

$ kata-runtime check

Notes:

  • This command runs a number of checks including connecting to the network to determine if a newer release of Kata Containers is available on GitHub. If you do not wish this to check to run, add the --no-network-checks option.

  • By default, only a brief success / failure message is printed. If more details are needed, the --verbose flag can be used to display the list of all the checks performed.

  • If the command is run as the root user additional checks are run (including checking if another incompatible hypervisor is running). When running as root, network checks are automatically disabled.

Getting started

See the installation documentation.

Documentation

See the official documentation including:

Configuration

Kata Containers uses a single configuration file which contains a number of sections for various parts of the Kata Containers system including the runtime, the agent and the hypervisor.

Hypervisors

See the hypervisors document and the Hypervisor specific configuration details.

Community

To learn more about the project, its community and governance, see the community repository. This is the first place to go if you wish to contribute to the project.

Getting help

See the community section for ways to contact us.

Raising issues

Please raise an issue in this repository.

Note: If you are reporting a security issue, please follow the vulnerability reporting process

Developers

See the developer guide.

Components

Main components

The table below lists the core parts of the project:

Component Type Description
runtime core Main component run by a container manager and providing a containerd shimv2 runtime implementation.
runtime-rs core The Rust version runtime.
agent core Management process running inside the virtual machine / POD that sets up the container environment.
dragonball core An optional built-in VMM brings out-of-the-box Kata Containers experience with optimizations on container workloads
documentation documentation Documentation common to all components (such as design and install documentation).
tests tests Excludes unit tests which live with the main code.

Additional components

The table below lists the remaining parts of the project:

Component Type Description
packaging infrastructure Scripts and metadata for producing packaged binaries
(components, hypervisors, kernel and rootfs).
kernel kernel Linux kernel used by the hypervisor to boot the guest image. Patches are stored here.
osbuilder infrastructure Tool to create "mini O/S" rootfs and initrd images and kernel for the hypervisor.
kata-debug infrastructure Utility tool to gather Kata Containers debug information from Kubernetes clusters.
agent-ctl utility Tool that provides low-level access for testing the agent.
kata-ctl utility Tool that provides advanced commands and debug facilities.
trace-forwarder utility Agent tracing helper.
runk utility Standard OCI container runtime based on the agent.
ci CI Continuous Integration configuration files and scripts.
ocp-ci CI Continuous Integration configuration for the OpenShift pipelines.
katacontainers.io Source for the katacontainers.io site.
Webhook utility Example of a simple admission controller webhook to annotate pods with the Kata runtime class

Packaging and releases

Kata Containers is now available natively for most distributions.

General tests

See the tests documentation.

Metrics tests

See the metrics documentation.

Glossary of Terms

See the glossary of terms related to Kata Containers.

tests's People

Contributors

amshinde avatar amulyam24 avatar bbolroc avatar bergwolf avatar chavafg avatar cmaf avatar dborquez avatar dgibson avatar egernst avatar fgiudici avatar fidencio avatar gabyct avatar gkurz avatar grahamwhaley avatar jakob-naucke avatar jcvenegas avatar jodh-intel avatar jongwu avatar lifupan avatar likebreath avatar littlejawa avatar liubin avatar marcel-apf avatar marcov avatar nitkon avatar pennyzct avatar snir911 avatar studychao avatar teawater avatar wainersm 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tests's Issues

Add developer variable for lenient linters

The static checks script currently only runs a subset of linters under the CI, but all linters by default otherwise.

Add a KATA_DEV_MODE variable that, if set, will run the same subset. This is useful and crucially does not require the developer to pretend to be running under a CI (which could be dangerous).

Provide ability to skip a test based on the runtime being used

Currently, some of the tests make use of Skip() (ginkgo). At some future point they will also be using skip (bats) too. These calls skip the tests unconditionally. However, we are likely to need ways to skip a test but only for particular runtime(s) [1]:

Something like:

if kata.Runtime("cc") {
    Skip("Issue: ...")
}

We should also support any:

if kata.Runtime("any") {
    Skip("Issue: ...")
}

... and maybe a regex like:

if kata.Runtime("cc|runv") {
    Skip("Issue: ...")
}

We'll need kata.Runtime(name string) to check to see which runtime the kata-runtime symlink actually points to. If the link name ends in -cc [2], it's a Clear Containers-based runtime, else runv.

We can then compare the fully resolved value of the Runtime path with the runtime type the test is requesting be skipped and return true/false as appropriate.


[1] - runtime names should be specified using the same syntax as used for the build. Namely cc or runv (or all). See kata-containers/runtime#16.
[2] - Or, run the runtime and check for a known string such as:

$ kata-runtime --help | grep -q clearcontainers

Add a README

This repo needs a README.md to explain various things including KATA_DEV_MODE.

Add extra linters

Add the following golang linters to the static checks tool for more stringent checks:

  • staticcheck
  • structcheck
  • unused

Create central static checks test

Add a script that will be the single source of all static tests used to build components.

Initially, it will simply run checkcommits, but will be extended later to run linters, etc.

All other repos should invoke this script to avoid a proliferation of (different) static check scripts.

Add linters to static checks

https://github.com/kata-containers/tests/blob/master/.ci/static-checks.sh needs to call the various golang linters to sanity check the code submissions.

Currently, the only kata repo using linters is the throttler:

I plan to remove that file entirely and add it into https://github.com/kata-containers/tests/blob/master/.ci/static-checks.sh, so that it will be invoked for all the kata repos.

Does that sound good to you @sameo, @gnawux, @grahamwhaley?

Can we check that stdout/stderr produce correct output

Relating to kata-containers/agent#125 and kata-containers/agent#124 - can we add a test that checks that what we get over stdout and stderr are in fact correct and whole.
@jodh-intel has suggested https://github.com/jamesodhunt/utfout (oh, look, it is written by @jodh-intel ;-) ) might be a good tool to use for this.
Other simpler thoughts from me are to:

  • just check we get the right size we expect to start with
  • we could do an md5sum compare to what we expect

/cc @chavafg

Enable checkcommits

Enable checkcommits which will requires that all PRs have:

  • a Signed-off-by: line.
  • a Fixes #XXX comment where XXX is a github issue number.
  • Requires all commits to have a "sub-system" followed by a colon, followed by a brief description.
  • Requires a blank line after the subsystem.
  • Requires all commits to have a fuller description after the sub-system that will contain the Fixes ### and Signed-off-by: comments.

Add jenkins_job_build.sh script

jenkins_job_build.sh script should be called in the Jenkins Jobs for all repos. This will minimize duplicated code in the jenkins job configuration

Don't call gometalinter unless the calling project contains go code

Currently, .ci/static-checks.sh unconditionally calls gometalinter. This is actually fine since gometalinter is clever enough to detect if there are any go packages to check and it will exit cleanly if not.

However, it's pointless installing gometalinter for those calling repositories that don't contain golang code, so add a check to speed up the CI in those scenarios.

Add a log parsing tool

Create a tool that can manipulate the structured logs the system components generate.

Initially the tool should be capable of accepting any number of log files which will then be:

  • Parsed, sorted by timestamp and displayed (in a variety of formats) along with time deltas (showing the time between log calls).
  • Checked for bogus/invalid log entries (or bogus/invalid log data).

Along with the above, I plan to add a check at the end of a CI run which will call this tool. If the tool fails, the PR will be failed. The rationale here being that all component logs should:

  • encode a common set of fields.
  • always be fully machine parseable.

Replaces: clearcontainers/tests#590

CI: Ignore vendor/ directories when running go test

go list in golang 1.9 is clever and prunes vendor packages by default:

$ (GOROOT=/usr/local/go/go1.9/go PATH=$GOROOT/bin:$PATH go list ./...)
github.com/kata-containers/proxy

However, we're using golang 1.8 with Travis and the behaviour is different:

$ (GOROOT=/usr/local/go/go1.8.1/go PATH=$GOROOT/bin:$PATH go list ./...)
github.com/kata-containers/proxy
github.com/kata-containers/proxy/vendor/github.com/davecgh/go-spew/spew
github.com/kata-containers/proxy/vendor/github.com/hashicorp/yamux
github.com/kata-containers/proxy/vendor/github.com/pmezard/go-difflib/difflib
github.com/kata-containers/proxy/vendor/github.com/sirupsen/logrus
github.com/kata-containers/proxy/vendor/github.com/sirupsen/logrus/hooks/syslog
github.com/kata-containers/proxy/vendor/github.com/stretchr/testify/assert
github.com/kata-containers/proxy/vendor/golang.org/x/crypto/ssh
github.com/kata-containers/proxy/vendor/golang.org/x/crypto/ssh/terminal
github.com/kata-containers/proxy/vendor/golang.org/x/sys/unix
github.com/kata-containers/proxy/vendor/golang.org/x/sys/windows

This behaviour is causing .ci/go-test.sh to try to run tests on vendor packages, which we don't want.

We could update all the .travis.yml files to only use versions of go >= 1.9 but we specify go 1.8 as our minimum version. Hence, simply filter vendor packages out of go list before running go test.

Enable tests for this repo

Currently, .travis.yml only runs the static tests on PRs raised for this repo.

As soon as possible, we need to add the following to .travis.yml (plus docker setup) so all PRs for this repo will trigger all tests to run:

script:
  - ".ci/go-test.sh"

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.