Commit Graph

1358 Commits

Author SHA1 Message Date
James O. D. Hunt
ea74b981d9 shim: Add trace config option
Add a new `enable_tracing` option to `configuration.toml` to enable
shim tracing.

Fixes #934.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-12-05 15:20:13 +00:00
Hui Zhu
7d0be360bd versions: refactor configuration of qemu in version.yaml
Include info such as commit number,tag number, etc for building
nvdimm-supported qemu on aarch64 from source code.

Fixes: #974

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2018-12-05 10:27:43 +08:00
Salvador Fuentes
2af240bd18 versions: Add nemu
Since Kata Containers work with NEMU, add an entry
of the supported nemu version and its OVMF firmware.

Fixes: #970.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2018-12-03 11:13:12 -06:00
Graham Whaley
0a7a4379dc
Merge pull request #967 from jodh-intel/add-containerd-shim-to-git-ignore
git: Add containerd-shim-kata-v2 to .gitignore
2018-12-03 09:28:48 +00:00
James O. D. Hunt
7093eec9c4 git: Add containerd-shim-kata-v2 to .gitignore
Hide the `containerd-shim-kata-v2` binary from `git status`.

Fixes: #966.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-12-03 08:57:46 +00:00
James O. D. Hunt
96ed6c59ee git: Sort .gitignore entries
Sort the contents of `.gitignore` into two groups: globs and actual
paths. This is more intuitive than a purely sorted list.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-12-03 08:56:21 +00:00
Frank Cao
6edb3618f6
Merge pull request #952 from alicefr/utils_linux_fix
virtcontainers: change uint32 to uint64 for ioctl
2018-11-30 09:56:39 +08:00
James O. D. Hunt
58575231bd
Merge pull request #950 from sboeuf/sboeuf/fix_docker_18_09
virtcontainers: Return the appropriate container status
2018-11-29 17:11:36 +00:00
Alice Frosi
04ce4c05df virtcontainers: change uint32 to uint64 for ioctl
The PR changes the parameter args from uint32 to uint64 for ioctl function.
That leads to an endianess bug.

Fixes: #947

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2018-11-29 14:51:06 +00:00
James O. D. Hunt
fa19fd0c15
Merge pull request #949 from jodh-intel/check-factory-config
config: Check factory config
2018-11-29 10:46:51 +00:00
James O. D. Hunt
0bf29c8207 config: Check factory config
If VM factory templating is enabled (`enable_template=true`), error if
the configured image is not an `initrd=` one.

Also add a note to the config file explaining that a normal image cannot
be used - only initrd images are supported.

Fixes #948.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-11-29 08:33:15 +00:00
James O. D. Hunt
fe784c1e36 config: Create function to check config options
Moved the checking routines in `LoadConfiguration()` to a new
`checkConfig()` function for clarity.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-11-29 08:28:14 +00:00
James O. D. Hunt
70e4dc550a config: Move check code to end of LoadConfiguration
Move the VSOCK handling code higher up so that all the checking code is
gathered together at the end of `LoadConfiguration()`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-11-29 08:19:33 +00:00
Sebastien Boeuf
fa9b15dafe virtcontainers: Return the appropriate container status
When our runtime is asked for the container status, we also handle
the scenario where the container is stopped if the shim process for
that container on the host has terminated.

In the current implementation, we retrieve the container status
before stopping the container, causing a wrong status to be returned.
The wait for the original go-routine's completion was done in a defer
within the caller of statusContainers(), resulting in the
statusContainer()'s values to return the pre-stopped value.

This bug is first observed when updating to docker v18.09/containerd
v1.2.0. With the current implementation, containerd-shim receives the
TaskExit when it detects kata-shim is terminating. When checking the
container state, however, it does not get the expected "stopped" value.

The following commit resolves the described issue by simplifying the
locking used around the status container calls. Originally
StatusContainer would request a read lock. If we needed to update the
container status in statusContainer, we'd start a go-routine which
would request a read-write lock, waiting for the original read lock to
be released.  Can't imagine a bug could linger in this logic. We now
just request a read-write lock in the caller (StatusContainer),
skipping the need for a separate go-routine and defer. This greatly
simplifies the logic, and removes the original bug.

Fixes #926

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-11-28 20:10:34 -08:00
Sebastien Boeuf
e06c8aafdc
Merge pull request #572 from hyperhq/shimv2
Implement containerd shim v2 API for Kata Containers
2018-11-28 16:37:10 +00:00
James O. D. Hunt
c2eea35b18
Merge pull request #865 from nitkon/kata-env
ppc64le: kata-env fails due to missing vendor field
2018-11-28 09:22:47 +00:00
fupan
02f8b29837 containerd-shim-kata-v2: add building of shimv2 into Makefile
Add the Makefile target of building shimv2.

Fixes: #485

Signed-off-by: fupan <lifupan@gmail.com>
2018-11-28 14:32:25 +08:00
fupan
8199d10742 containerd-shim-kata: add unit test cases
Add unit test cases.

Signed-off-by: fupan <lifupan@gmail.com>
2018-11-28 14:32:25 +08:00
ZeroMagic
7951041eb0 containerd-shim-kata-v2: add the service Stats support
Add the Stats api support to get the container's
resouces statistic.

Signed-off-by: ZeroMagic <anthonyliu@zju.edu.cn>
2018-11-28 14:32:25 +08:00
ZeroMagic
5cc016c8a2 containerd-shim-kata-v2: add the service Kill support
Add the Kill api support to send signal to a given
container process.

Signed-off-by: ZeroMagic <anthonyliu@zju.edu.cn>
Signed-off-by: fupan.li <lifupan@gmail.com>
2018-11-28 14:32:25 +08:00
ZeroMagic
9ee53be986 containerd-shim-kata-v2: add the service Resume support
Add the Resume api support to resume a paused container.

Signed-off-by: ZeroMagic <anthonyliu@zju.edu.cn>
2018-11-28 14:32:25 +08:00
ZeroMagic
8df33d34e8 containerd-shim-kata-v2: add the service Pause support
Add the Pause api support to pause a container running
in the pod.

Signed-off-by: ZeroMagic <anthonyliu@zju.edu.cn>
2018-11-28 14:32:25 +08:00
ZeroMagic
cd321a3e6e containerd-shim-kata-v2: add the service ResizePty support
Add the ResizePty api support to resize the console.

Signed-off-by: ZeroMagic <anthonyliu@zju.edu.cn>
2018-11-28 14:32:25 +08:00
fupan
47326f566c containerd-shim-kata-v2: add the service Update support
Add the Update api support to update a running
process's resouce.

Signed-off-by: fupan <lifupan@gmail.com>
2018-11-28 14:32:25 +08:00
fupan
642231ba25 containerd-shim-kata-v2: add the service Shutdown support
Add the Shutdown api support to shutdown the shim.

Signed-off-by: fupan <lifupan@gmail.com>
2018-11-28 14:32:25 +08:00
fupan
87f591a697 containerd-shim-kata-v2: add the service Connect support
Add the Connect api to get the shim's info.

Signed-off-by: fupan <lifupan@gmail.com>
2018-11-28 14:32:25 +08:00
fupan
ec4f27b4c6 containerd-shim-kata-v2: add the service CloseIO support
Add the CloseIO api support to close a process's
input stream.

Signed-off-by: fupan <lifupan@gmail.com>
2018-11-28 14:32:25 +08:00
fupan
8c95b7569d containerd-shim-kata-v2: add the service Pids support
Add the Pids api support to get the processes
pids running in the pod.

Signed-off-by: fupan <lifupan@gmail.com>
2018-11-28 14:32:25 +08:00
fupan
709bc9aa12 containerd-shim-kata-v2: add the service Cleanup support
Add the Cleanup api support to cleanup the pod and
containers running in it when the pod's corresponding
shim died.

Signed-off-by: fupan <lifupan@gmail.com>
2018-11-28 14:32:25 +08:00
fupan
a0e6456455 containerd-shim-kata-v2: add the service Delete support
Add the Delete api support to delete a stopped
container or pod.

Signed-off-by: fupan <lifupan@gmail.com>
2018-11-28 14:32:25 +08:00
fupan
fd18b2289d containerd-shim-kata-v2: add the service State support
Add the State api support to get a container
or exec process's states.

Signed-off-by: fupan <lifupan@gmail.com>
2018-11-28 14:32:25 +08:00
fupan
fbaefc9af1 containerd-shim-kata-v2: add the service wait support
Add the Wait api to wait on a started container
or exec process.

Signed-off-by: fupan <lifupan@gmail.com>
2018-11-28 14:32:25 +08:00
fupan
269c940edc containerd-shim-kata-v2: add the exec service support
Add the Exec api support for exec an process in
a running container.

Signed-off-by: fupan <lifupan@gmail.com>
2018-11-28 14:32:25 +08:00
fupan
4c5b29647b containerd-shim-kata-v2: add the start service support
Add the Start api support of start a pod or
container created before.

Signed-off-by: fupan <lifupan@gmail.com>
2018-11-28 14:32:03 +08:00
fupan
72fd6e0c7d containerd-shim-kata-v2: add the create service support
Add the "Create" api support for creating a pod
or container.

Signed-off-by: fupan <lifupan@gmail.com>
2018-11-28 14:29:35 +08:00
Nitesh Konkar
ca58bb4ca1 ppc64le: kata-env fails due to missing vendor field
There is no vendor field in /proc/cpuinfo contents
on ppc64le. Make sure to return "" for vendor field
for ppc64le and fix all the corresponding testcases
as well.

Fixes: #864

Signed-off-by: Nitesh Konkar niteshkonkar@in.ibm.com
2018-11-27 15:26:33 +05:30
fupan
d6c4ca5fe5 container-shim-kata-v2: The init containerd shim v2 support
This patch is the init codes of the shimv2 for
containerd.

Signed-off-by: fupan <lifupan@gmail.com>
2018-11-27 17:17:43 +08:00
fupan
5e6cd0090f containerd-shim-v2: add the shim v2 required vendors
Add the vendors required by containerd shim v2.

Signed-off-by: fupan <lifupan@gmail.com>
2018-11-27 17:17:43 +08:00
fupan
f0cb0c7ef7 cli: refactor to align with katautils package
refactor the cli codes which can be shared with shimv2.

Signed-off-by: fupan <lifupan@gmail.com>
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2018-11-27 17:17:31 +08:00
James O. D. Hunt
2931f8db08
Merge pull request #819 from bergwolf/nested
kata-check: do not require nested vt
2018-11-27 08:16:29 +00:00
Frank Cao
c55e73da24
Merge pull request #937 from jodh-intel/kata-env-show-tracing
kata-env: Show runtime trace setting
2018-11-27 10:51:36 +08:00
James O. D. Hunt
9984636f5a kata-env: Show runtime trace setting
Show whether runtime tracing is enabled in the output of `kata-env`.

Fixes #936.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-11-23 16:29:30 +00:00
Peng Tao
21f0059487
Merge pull request #929 from bergwolf/1.4.0-branch-bump
# Kata Containers 1.4.0
2018-11-23 14:35:04 +08:00
Peng Tao
7b63f210aa release: Kata Containers 1.4.0
- versions: Update Kubernetes, containerd and cri-o
- virtcontainers: fix sandbox store struct VFIODevice bug
- virtcontainers: Add function supportGuestMemoryHotplug
- make: add ability to skip go version check
- cli: Fix console for big endian architecture
- virtcontainers: fix not close socket with ethtool
- build: introduction of archConvertStatFs function
- network: support hotplug a nic several times
- sandbox: Extend sandbox API
- golang.mk: Check and install yq before use it
- cli: refactor the config into a separated package
- newContainer: Not attach device if it is a CDROM
- build: check golang version meets min req.
- network: Use constant string for "none" network model
- runtime,netmon: build as Position-Independent-Executable
- virtcontainers: Rely on new interface LinkType field
- enable default network endpoints hotplug for vm factory
- cli: fix the issue of using wrong path to get version
- cli: add guest hook path option (v2)
- factory: use customised deep compare
- qemu: query migrate status
- Add support for ipvlan network driver
- Add cgroup support
- vfio: Change the way the driver is fetched
- vendor: Rely on new agent package types
- network: Use tc filtering rules in bridge mode
- cli: add configuration option to use or not use host netns
- versions: Update golang to 1.10.4
- network: Marshal BridgedMacvlanEndpoint and MacvtapEndpoint
- device: fix the issue of passing wrong device address using virtio-blk
- create/run: Make bundle path default to cwd
- virtcontainers: Add missing API trace calls
- sandbox/virtcontainers: memory resource hotplug when create container.
- virtcontainers: Add missing API release calls
- qemu: Disable the default romfile used by virtio-pci
- Refactor network.go
- network: Sort endpoints by name
- virtcontainers: qemu: Add proper support for virt machine type
- network: Add support for macvlan and macvtap driver
- memory: update: Update state using the memory removed
- block: Advertise block support for q35
- vendor: fix govmm package

766f9ed versions: Update Kubernetes, containerd and cri-o
cba7a88 virtcontainers: fix sandbox store struct VFIODevice bug
0796f2e virtcontainers: Add function supportGuestMemoryHotplug
d73f27c test: set arch for test TestHotplugRemoveMemory
bf56858 cli: Fix console for big endian architecture
4b9a471 virtcontainers: fix not close socket with ethtool
58c1db5 make: notify user if yq is going to be installed
ab43e2a make: add ability to skip go version check
b185f31 build: introduction of archConvertStatFs function
982381b api: Cleanup StartContainer()
5777381 sandbox: Create and export Pause/ResumeContainer() to the API level
b298ec4 sandbox: Create and export ProcessListContainer() to the API level
3add296 sandbox: Create and export KillContainer() to the API level
7653726 sandbox: Create and export StopContainer() to the API level
109e12a sandbox: Export Stop() to the API level
6c3e266 sandbox: Export Start() to the API level
f5048b7 golang.mk: Check and install yq before use it
2f98b3e network: support hotplug a nic several times
842a00a cli: refactor the config into a separated package
193b324 newContainer: Not attach device if it is a CDROM
8ddc0ce network: Use constant string for "none" network model
5199777 virtcontainers: Rely on new interface LinkType field
45b2191 netmon: Rely on new interface field LinkType
7bf84d0 types: Replace agent/pkg/types with virtcontainers/pkg/types
39b95cc virtcontainers: Create a new package "types"
658bdb1 runtime,netmon: build as Position-Independent-Executable
e9aa870 network: enable network hotplug for vm factory
95f4fdb build: check golang version meets min req.
eaa5c7a CI: travis: call yq installer
cbf7fb2 CI: travis: add yq installer script
11c6753 cli: fix the issue of using wrong path to get version
21a671e network: set endpoint pci address when hotplug
33abb3e cli: add guest hook path option in the configuration file
34fe3b9 cgroups: add host cgroup support
523d49c vendor: add github.com/containerd/cgroups lib
38d56c9 netmon: Rely on agent/pkg/types instead of duplicating types
309dcf9 vendor: Update the agent vendoring based on pkg/types
0acbbf0 network: Add support for ipvlan
c38792e config: Add documentation for tcfilter in configuration.toml
17be8e3 network: Introduce constants for the network model strings
5da973d test: Add test to verify tc redirect
e20dbd0 network: Use tc redirect filter to redirect traffic to the VM
526d55b versions: Update golang to 1.10.4
62992f5 versions: Update cri containerd version for golang 1.10.2 fix
31cf6fb vfio: Change the way the driver is fetched
7a5a57d cli: test: add unit test for kata-env and kata-check
14e5437 cli: add configuration option to use or not use host netns
6935279 network: add new NetInterworkingModel "none" and endpoint type TapEndpoint
f8f2962 virtcontainers: refactor hotplug qmp functions
21d38e9 network: Marshal BridgedMacvlanEndpoint and MacvtapEndpoint
32ef29b factory: use customised deep compare
36306e2 sandbox/virtcontainers: modify tests relate to memory hotplug.
3f39d6e virtcontainers: Add missing API release calls
b72a3cd device: fix the issue of passing wrong device address using virtio-blk
ee9275f virtcontainers: Add missing API trace calls
8831245 create/run: Make bundle path default to cwd
0ae5b14 qemu: Disable the default romfile used by virtio-pci
6f0873a vendor: Update govmm vendoring
14f480a sandbox/virtcontainers: combine addResources and updateResources
8e2ee68 sandbox/virtcontainers: memory resource hotplug when create container.
b04691e network: Collapse log calls for endpoint Attach and Detach
ab15498 network: Explicitly check for veth type
3c590b0 network: Rename VirtualEndpoint to VethEndpoint
df8f21d network: Refactor network tests.
adcd910 network: Refactor network.go
8f1b28d network: Sort endpoints by name
eb77a41 qemu: make saveSandbox wait for migration completion
dffb4f9 virtcontainers: qemu: Add proper support for virt machine type
3c7cf58 tests: Add additional network tests to verifu link creation functions
378191a tests: Add tests for macvlan and macvtap endpoints
def070d golint: Refactor to reduce cyclomatic complexity
417c1f0 macvtap: Add support for macvtap
0de7572 vendor: Update govmm vendoring
581ff17 macvlan: Assign random MAC address
8847af8 network: Add support for macvlan driver
1f5792e test: fix unit test nil pointer.
4697cf3 memory: update: Update state using the memory removed.
0cab192 block: Advertise block support for q35
f4cf213 vendor: fix govmm package

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-11-23 10:07:36 +08:00
Peng Tao
766f9ed54e
Merge pull request #928 from chavafg/topic/k8s-1.12
versions: Update Kubernetes, containerd and cri-o
2018-11-23 09:56:20 +08:00
Salvador Fuentes
a2799bba09 versions: Update Kubernetes, containerd and cri-o
Update supported versions of Kubernetes with its
corresponding CRI implementations:

- Kubernetes from 1.10.5 to 1.12.2
- cri-o from 1.10 to 1.12.0, commit:
  fa540c8e806d28c2cbcd157bdf8acf2b20990ab6 as it is needed
  for fixing the devicemapper issues when removing a pod.
  More info on this issue, see:
  https://github.com/kubernetes-sigs/cri-o/issues/1883
- containerd from 1.1.3 to 1.2.0

Fixes: #927.

Depends-on: github.com/kata-containers/tests#926

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2018-11-22 11:51:45 -06:00
Sebastien Boeuf
780cd5f7b9
Merge pull request #925 from woshijpf/fix-remove-hotplug-vfio-devices
virtcontainers: fix sandbox store struct VFIODevice bug
2018-11-20 06:11:46 +00:00
j00444339
cba7a882aa virtcontainers: fix sandbox store struct VFIODevice bug
Since struct VFIODevice needed to be stored into disk by storeSandboxDevices() function,
however struct VFIODevice has a field named "vfioDevs", which is named begin with lower-case,
so it can't be written into file by json.Marshal.And this bug will will cause hotplug vfio
device can not been removed correctly while container exits.

Fixes: #924

Signed-off-by: flyflypeng <jiangpengfei9@huawei.com>
2018-11-20 08:40:19 -05:00
Sebastien Boeuf
ccc41d7363
Merge pull request #911 from alicefr/memory_hotplug
virtcontainers: Add function supportGuestMemoryHotplug
2018-11-19 20:17:32 +00:00
Sebastien Boeuf
aafc2a823d
Merge pull request #917 from marcov/gocheck
make: add ability to skip go version check
2018-11-19 17:24:53 +00:00