Commit Graph

4947 Commits

Author SHA1 Message Date
梁显龙10206246
6c997474a3 Merge remote-tracking branch 'upstream/2.0-dev' into 2.0-dev 2020-07-27 10:59:30 +08:00
Hui Zhu
2fef265701
Merge pull request #443 from bergwolf/fix-ci
ci: checkout TRAVIS_BRANCH
2020-07-27 10:07:13 +08:00
Peng Tao
322d85c48f
Merge pull request #434 from evanfoster/add-container-creation-cleanup
sandbox: Stop and clean up containers that fail to create
2020-07-27 10:00:01 +08:00
Peng Tao
8d3f758716
Merge pull request #450 from cmaf/unit-virtcontainers-sandbox
virtcontainers: Move unit tests for types/sandbox.go
2020-07-27 09:55:10 +08:00
Archana Shinde
ba251df68d
Merge pull request #427 from amshinde/ease-rootfs-access
device: Ease device access for rootfs device to allow node creation
2020-07-24 17:14:50 -07:00
Evan Foster
e5910c9b88 sandbox: Stop and clean up containers that fail to create
A container that is created and added to a sandbox can still fail
the final creation steps. In this case, the container must be stopped
and have its resources cleaned up to prevent leaking sandbox mounts.

Forward port of https://github.com/kata-containers/runtime/pull/2826

Fixes #2816

Signed-off-by: Evan Foster <efoster@adobe.com>
2020-07-24 09:25:47 -06:00
Peng Tao
1283febdd6 ci: checkout TRAVIS_BRANCH
So that we use 2.0-dev branch for tests.

Fixes: kata-containers/tests#2732
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-07-24 20:06:02 +08:00
Chelsea Mafrica
0b3cbee815 virtcontainers: Add additional unit tests for sandbox
Add tests for state change, empty string failures for Volumes and
Sockets. Change two function names to accurately reflect tests.

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2020-07-24 02:57:41 +00:00
Chelsea Mafrica
07a307b4b1 virtcontainers: Remove duplicate unit tests
Remove tests from virtcontainers/sandbox_test.go which were moved to
virtcontainers/types/sandbox_test.go.

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2020-07-24 01:36:12 +00:00
Chelsea Mafrica
d914f01829 virtcontainers: Move unit tests for types/sandbox.go
Move unit tests that were in virtcontainers/sandbox_test.go relating
to Socket, Volume, and SandboxState to types/sandbox_test.go.

Change testSandboxStateTransition function to use SandboxState only
instead of Sandbox from virtcontainers/sandbox.go.

Fixes #435

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2020-07-24 01:36:00 +00:00
Archana Shinde
9377c162a1
Merge pull request #448 from amshinde/2.0-actions
Backport actions from master
2020-07-23 12:33:23 -07:00
Archana Shinde
33b1865e6e actions: Pin to a particular sha for actions
Since actions can access the github token, lets use a
particular version of sha rather than using master.

Fixes: #437

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
(cherry picked from commit 57b64f35e0)
2020-07-23 12:06:04 -07:00
Archana Shinde
8564c99eae actions: Add github actions to perform DCO check
Action performs a check to verify PR raised has commits
that are signed-off.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
(cherry picked from commit 1b157e5015)
2020-07-23 12:05:41 -07:00
Archana Shinde
c5081624c5 actions: Add action to perform WIP check for pull requests
Use github actions for performing WIP checks on PRs.
The action checks for keywords in subject line
as well labels.

Fixes: #437

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
(cherry picked from commit 0d96145c29)
2020-07-23 12:05:17 -07:00
liangxianlong
7bbb9e8122 rootfs-builder: Don't modify /sbin/init on the build host
Don't modify /sbin/init on the build host when using command `AGENT_INIT="yes" ./rootfs.sh centos` to build rootfs.

Fixes: #430

Signed-off-by: liangxianlong <liang.xianlong@zte.com.cn>
2020-07-18 14:19:06 +08:00
Archana Shinde
3d46750596 device: Ease device access for rootfs device to allow node creation
For docker in docker scenario, the nested container created
has entry "b *:* m" in the list of devices it is allowed to access
under /sys/fs/cgroup/devices/docker/{ctrid}/devices.list.

This entry was causing issues while starting a nested container
as we were denying "m" access to the rootfs block devices.
With this change we add back "m" access, the container would be
allowed to create a device node for the rootfs device but will
not have read-write access to the created device node.

This fixes the docker in docker use case while still making sure
the container is not allowed read/write access to the rootfs.
Note, this could also be fixed by simply skipping {"Type : "b"}
while creating the device cgroup with libcontainer.
But this seems to be undocumented behaviour at this point,
hence refrained from taking this approach.

Fixes #426

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-07-17 15:33:41 -07:00
Peng Tao
c5c3f5c31d
Merge pull request #423 from cmaf/unit-virtcontainers-bridges
virtcontainers: Add to bridges unit test
2020-07-17 20:07:08 +08:00
Chelsea Mafrica
f554cdec2c virtcontainers: Add to bridges unit test
Add function that creates new bridges to increase unit test coverage
for virtcontainers/types/bridges. Also adds test for address formats.

Fixes #422

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2020-07-16 16:34:49 +00:00
James O. D. Hunt
6263d2635b
Merge pull request #390 from Pennyzct/remove_use_vsock_option
kata 2.0: delete use_vsock option and proxy abstraction
2020-07-16 14:49:01 +01:00
Penny Zheng
1d7d944f2c fc: refactor --daemonize option
Option --daemonize is invalid to firecarcker, and only valid to
jailer.

Fixes: #389

Signed-off-by: Penny Zheng penny.zheng@arm.com
2020-07-16 05:26:28 +00:00
Penny Zheng
7f3e8959c5 console-watcher: use console watcher to monitor guest console outputs
Import new console watcher to monitor guest console outputs, and will be
only effective when we turn on enable_debug option.
Guest console outputs may include guest kernel debug info, agent debug info,
etc.

Fixes: #389

Signed-off-by: Penny Zheng penny.zheng@arm.com
2020-07-16 05:26:19 +00:00
Penny Zheng
1099a28830 kata 2.0: delete use_vsock option and proxy abstraction
With kata containers moving to 2.0, (hybrid-)vsock will be the only
way to directly communicate between host and agent.
And kata-proxy as additional component to handle the multiplexing on
serial port is also no longer needed.
Cleaning up related unit tests, and also add another mock socket type
`MockHybridVSock` to deal with ttrpc-based hybrid-vsock mock server.

Fixes: #389

Signed-off-by: Penny Zheng penny.zheng@arm.com
2020-07-16 04:20:02 +00:00
Xu Wang
c052e46c66
Merge pull request #416 from bergwolf/cleanup
runtime: consolidate network types definition
2020-07-15 22:46:21 +08:00
Yang Bo
dacb2fded1
Merge pull request #414 from lifupan/2.0-fix
cgroup: fix the issue of crashed when meet unsupported cgroup
2020-07-15 22:22:06 +08:00
fupan.lfp
73bf9329ca cgroup: fix the issue of crashed when meet unsupported cgroup
Fix the issue of applying/set to unsupported cgroups.

Fixes: #408

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-07-15 20:54:00 +08:00
James O. D. Hunt
102068f891
Merge pull request #417 from Nordix/annotations-containerd-version-2.x
docs: Clarifying minimum version of containerd for annotations
2020-07-15 13:35:04 +01:00
Georg Kunz
ab7afae6d3 docs: Clarifying minimum version of containerd for annotations
Using pod annotations requires a minimum version of v1.3.0 of containerd
to pass annotations down to kata. This is already somewhat mentioned in
the corresponding how-to, however, it can be mis-read as the minimum
version of kata-containers instead of containerd. This can cause
extended and futile troubleshooting on older distributions such as
Ubuntu 16.04 which ship a version of 1.2.x of containerd. This patch
attempts to clarify this.

Fixes: #690

Signed-off-by: Georg Kunz <georg.kunz@est.tech>
2020-07-15 12:53:02 +02:00
Peng Tao
5b15e9ef4f runtime: consolidate types definition
We do not need the vc types translation for network data structures.
Just use the protocol buffer definitions.

Fixes: #415
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-07-15 17:48:31 +08:00
James O. D. Hunt
d88f8910ab
Merge pull request #402 from sameo/2.0-dev
runtime: virtcontainers: vhost-user-blk/scsi are block device nodes
2020-07-15 09:25:26 +01:00
Hui Zhu
b0e5e12a08
Merge pull request #407 from lifupan/2.0-dev
add rust agent sandbox shared pid namespace support
2020-07-15 09:51:39 +08:00
Peng Tao
fbc6c52625
Merge pull request #406 from liubin/docs/add-link-to-setup-cri-pod-annotations
docs: add link to CRI Configuration for pods
2020-07-13 21:46:49 +08:00
Peng Tao
872ee35ca6
Merge pull request #404 from liubin/bugfix/403-add-monitor_address-to-gitignore
runtime: add monitor_address to .gitignore
2020-07-13 21:46:31 +08:00
fupan.lfp
c6e4d092d6 agent: sandbox shared pid namespace support
Add support shareProcessNamespace.
BTW, this commit only support shared pid namespace by
sharing the infrastructure pause container's pid namespace
with other containers, instead of creating a new pid
namespace different from pause container.

Fixes: #342

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-07-13 19:09:35 +08:00
fupan.lfp
afcf269c9b rustjail: fix the issue of missing join pid namespace
It shouldn't skip joining an container existed
pid namespace.

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-07-13 18:44:49 +08:00
bin liu
f3da6900c2 docs: add link to CRI Configuration for pods
To pass annotations from CRI to Kata containers, user must configure containerd if containerd is used.

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-13 18:37:56 +08:00
bin liu
4291eb17fb runtime: add monitor_address to .gitignore
monitor_address may be committed to repo by accident

Fixes: #403

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-13 16:24:21 +08:00
Peng Tao
2bff7a16f5
Merge pull request #363 from liubin/feature/delete-sub-commands-332
runtime: delete unused sub-commands.
2020-07-13 11:06:27 +08:00
Peng Tao
dc0fa512b4
Merge pull request #398 from liubin/wip/add-pprof-interface
runtime: add pprof interface for shim
2020-07-13 11:03:07 +08:00
Peng Tao
866bc2f01d
Merge pull request #400 from liubin/wip/add-pod-overhead
runtime: add pod overhead metrics
2020-07-13 11:02:12 +08:00
Samuel Ortiz
1c56abb761 runtime: virtcontainers: vhost-user-blk/scsi are block device nodes
When checking if a device is an emulated vhost-user-blk or
vhost-user-scsi one, we should not only check for their major number but
also their device node type. They must be block devices.

Fixes: #401

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2020-07-11 01:28:17 +02:00
bin liu
bbf8517050 runtime: add pprof interface for shim
Add new http interfaces to support pprof:

- /sandboxes
- /debug/vars
- /debug/pprof/
- /debug/pprof/cmdline
- /debug/pprof/profile
- /debug/pprof/symbol
- /debug/pprof/trace

Fixes: #397

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-10 13:05:25 +08:00
bin liu
0790ca4933 runtime: add pod overhead metrics
Add pod overhead metrics for CPU and memory to help with calculating sandbox overhead.

Fixes: #399

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-10 11:33:52 +08:00
Fabiano Fidêncio
b9f0f57f1a
Merge pull request #396 from abdasgupta/ppc64le-support
PPC64LE Support
2020-07-09 16:07:29 +02:00
Abhishek Dasgupta
ae83c96da9 Modifie to proper CPU architecture name for ppc64le.
Rust core::arch understand ppc64le as powerpc64 architecture
instead of powerpc64le architecture.

Signed-off-by: Abhishek Dasgupta <abdasgupta@in.ibm.com>
2020-07-09 06:05:33 -04:00
Abhishek Dasgupta
f404f4d959 Modified Makefile to pick up correct architecture name for ppc64le.
Makefile is determining the architecture by running uname command
which gives ppc64le as output. But rust toolchain target is available
with the name powerpc64le for ppc64le arch. So this change took care of that.

Signed-off-by: Abhishek Dasgupta <abdasgupta@in.ibm.com>
2020-07-09 06:05:33 -04:00
Fabiano Fidêncio
cdbba6ac4b agent: Make LIBC configurable
Currently the default LIBC used to build the agent is "musl". However,
"musl" is not preset in a big portion of the distros *and* "gnu" libc
just works as expected.

Knowing that, let's add the option to the one building the project to
simply do `make LIBC=gnu` instead of expected the person to go through
the Makefile and replace musl by gnu there.

Fixes: #369

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-07-09 03:30:34 -04:00
Julio Montes
5a68e3490e
Merge pull request #360 from devimc/2020-06-29/forwardport/fixVFIOHotplug
[forwardport 2.0] create cgroup manager after creating the network
2020-07-08 13:26:39 -05:00
Julio Montes
2afbfcab99 virtcontainers: print a warning when the device to append is not supported
Print a warning message when the device to append to a QEMU VM is not
supported. This change is just to improve debuggability.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-07-08 09:36:36 -05:00
Julio Montes
919fc4cde5 virtcontainer/cgroup: create cgroup manager after creating the network
Create the cgroup manager once the network has been created, this way the
list of device will include the network VFIO devices attached to the sandbox,
when the physical enpoint is the network driver.

fixes #2774

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-07-08 09:36:28 -05:00
Julio Montes
a134c2e083 virtcontainers/network: Change signature of Enpoint Attach method
In order to use the device manager and receiver from the network enpoints,
the signature of the Attach method must change to revice a Sandbox instead of
a Hypervisor, this way devices can be added through the device manager API.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-07-08 09:32:49 -05:00