Commit Graph

5116 Commits

Author SHA1 Message Date
Jia He
711eae642c scripts: Set --enable-pie on aarch64 arch
PIE (position-independent executables) does good to security.

For some historical reason(compliation failure), it was disabled. But it
can be supported now on aarch64.

Fixes #926
Signed-off-by: Jia He <justin.he@arm.com>
2020-03-10 09:23:24 +08:00
Jia He
7cdf113cf0 scripts: Relax the version limitation for qemu
Currently arm64 kata uses 3.0 qemu version. Hence aarch64 can't use some
--disable configure options between [3.1, 4.0].

Besides, due to upstream qemu bug about --disable-replication, still
enable the replication on aarch64 for qemu 3.0. Please refer to the
commit 3ebb9c4f52 ("migration/colo.c: Fix compilation issue when disable
replication")

Fixes #926
Signed-off-by: Jia He <justin.he@arm.com>
2020-03-10 09:23:24 +08:00
Jia He
0871391efa scripts: Remove obsoleted --disable-uuid
Qemu commit 315d318 uses built-in UUID implementation, hence we can't
disable uuid. This option is for generic arch, not only for aarch64.

Otherwise there is a warning during configure:
configure: --disable-uuid is obsolete, UUID support is always built

Fixes #926
Signed-off-by: Jia He <justin.he@arm.com>
2020-03-10 09:23:24 +08:00
Jia He
878a223827 scripts: Disable xen when builing qemu on generic architectures
Previously, it misses to add the --disable-xen for reducing qemu size
on aarch64. This patch add disable-xen on all arches, hence the case
switch is removed.

Fixes #926
Signed-off-by: Jia He <justin.he@arm.com>
2020-03-10 09:23:24 +08:00
Li Yuxuan
ed43117554 vc: Remove container share dir when stopping
Remove the rootfs bind dest and finally remove the created share
directory when stopping the container.

Fixes #2516
Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
2020-03-10 01:12:30 +08:00
Julio Montes
be273aa43d
Merge pull request #416 from crobinso/tests-dev-mode
tests: Improve running test_images.sh locally
2020-03-09 09:33:49 -06:00
Jose Carlos Venegas Munoz
2656d1da22
Merge pull request #2509 from likebreath/hotplug_cpu
clh: enable CPU hotplug
2020-03-09 09:01:55 -06:00
Jia He
f599c8e009 kernel: Install uncompressed kernel by Image instead of
vmlinux on arm64

arm64 does not use vmlinux to boot, Image is used instead.

Otherwise, kata can't boot from vmlinux.container

Besides, given that firecracker only supports booting from Image,
don't set vmlinux for firecracker target

Fixes #930
Signed-off-by: Jia He <justin.he@arm.com>
2020-03-09 12:05:27 +08:00
Julio Montes
b99f8f7855
Merge pull request #968 from likebreath/enable-acpi-ged
ACPI: Always build evged in for experimental kernel
2020-03-06 15:27:13 -06:00
Bo Chen
17b9de140f clh: enable CPU hotplug
With the HTTP API 'vm.resize()', the CPU hotplug with CLH is much simpler
comparing with QEMU. This is because we don't need to distinguish adding from
removing CPUs.

Fixes: #2495

Depends-on: github.com/kata-containers/packaging#968
Depends-on: github.com/kata-containers/tests#2364

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-03-06 11:26:58 -08:00
Cole Robinson
87a5d5c8d7 rootfs: Don't overwrite /sbin/init if it already exists
The prepare_overlay() code path is called when rootfs.sh is invoked
with no passed in distro string. This is used for the dracut case
from the Makefile for example. In that particular case, the starting
root directory is empty.

It's also valid to pass a prepopulated directory to rootfs.sh, which
is essentially a request for the script to just make the necessary
kata changes. Currently though prepare_overlay() makes some changes
that could wipe out pre-arranged /sbin/init setup.

Check first to see if /sbin/init exists in the rootfs dir, and if so,
skip the symlink changes

Fixes: #419

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-06 13:29:28 -05:00
GabyCT
2391118363
Merge pull request #607 from grahamwhaley/20200305_v2_debug
Dev: shimv2 logs: Elaborate on shimv2 log enabling
2020-03-06 10:57:41 -06:00
Graham Whaley
e92f3db1ff actions: change trigger phrase for kata-deploy action
Let's change the kata-deploy github action trigger from:
  '/test kata-deploy'
to
 '/test-kata-deploy'

which will hopefully reduce the number of false triggers caused when
we issue the 'normal' CI runs that are triggered by other
'/test xxxx' phrases.

Fixes: #971

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-03-06 15:37:23 +00:00
Cole Robinson
6cae294e83 initrd-builder: Don't error if run as non-root
Nothing inherently requires root here. If the ROOTFS_DIR is only
root accessible then the operation may fail, but better IMO to let
that fail naturally

Fixes: #422

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-05 16:11:39 -05:00
Cole Robinson
4004bd8fbe image-builder: Add NSDAX_BIN for passing in compiled nsdax tool
In Fedora we are running the osbuilder scripts on the client machine,
to generate an initrd for the running host kernel. In this setup,
there's currently a runtime dependency on gcc for compiling the nsdax
tool, which is suboptimal.

Add NSDAX_BIN environment variable; if specified, image-builder.sh
will use that path as the nsdax tool. This let's ship a compiled
nsdax tool to users and drop the runtime gcc dependency

Fixes: #417

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-05 14:47:03 -05:00
Bo Chen
c3949fdd60 ACPI: Always build evged in for experimental kernel
This is required to support hotplug CPU/memory with cloud-hypervisor.

Fixes: #967

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-03-05 06:12:30 -08:00
Graham Whaley
bce991b505 Dev: shimv2 logs: Elaborate on shimv2 log enabling
There are two 'debug' settings in the containerd config file that
affect the shimv2 runtime log output. Add the other method to the
existing documentation, and also note that enabling full containerd
debug also affects all of containerd.

The commit also re-generates the TOC, which seems to correct a
few anomolies there.

Fixes: #596

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-03-05 14:05:49 +00:00
Jose Carlos Venegas Munoz
8cffbde514
Merge pull request #2507 from likebreath/fix-persist-clh
clh: add 'APIsocket' to persist HypervisorState
2020-03-04 16:45:09 -06:00
GabyCT
22afde1850
Merge pull request #158 from jcvenegas/fix-157
actions: Add verbose information
2020-03-04 15:15:42 -06:00
GabyCT
844f21ce5a
Merge pull request #964 from GabyCT/topic/removeoldf
obs: Update obs packages for ppc64le
2020-03-04 11:41:36 -06:00
Bo Chen
63c7ac5bbe clh: add 'APIsocket' to persist HypervisorState
The 'apiSocket' member in the CloudHypervisorState struct needs to be kept
across different executions of kata-runtime with persist HypervisorState, so
that kata-runtime can talk with the same running cloud-hypervisor through
HTTP/REST API calls.

Fixes: #2506

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-03-04 09:15:36 -08:00
Jose Carlos Venegas Munoz
cd233c047a actions: Add verbose information
Add a logs to debug actions easily

Fixes: #157

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-03-04 16:02:06 +00:00
Julio Montes
83eef430bd
Merge pull request #2008 from darfux/use_block_index_map_instead
vc: Use BlockIndexMap instead of BlockIndex
2020-03-04 09:34:35 -06:00
Julio Montes
5ec99d8c2b
Merge pull request #966 from devimc/topic/qemu/enableLibpmem
scripts: enable libpmem only for x86_64
2020-03-04 08:10:19 -06:00
Alex Price
204edf0e51 agent: add configurable container pipe size cmdline option
Adds a cmdline option to configure the stdout/stderr pipe sizes.
Uses `F_SETPIPE_SZ` to resize the write side of the pipe after
creation.

Example Cmdline option: `agent.container_pipe_size=2097152`

fixes #152

Signed-off-by: Alex Price <aprice@atlassian.com>
2020-03-04 15:31:59 +11:00
Julio Montes
83a69de4a2 scripts: enable libpmem only for x86_64
Not all architectures have support for libpmem.
Enable libpmem only for x86_64

fixes #965

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-03-03 21:24:59 +00:00
GabyCT
35c33bba47
Merge pull request #145 from Pennyzct/build_service_for_rust_agent
systemd-service: build rust-agent systemd services
2020-03-03 13:17:27 -06:00
Gabriela Cervantes
aad1e0e965 obs: Update obs packages for ppc64le
Fedora versions 28 and 29 has come EOL, we should update the generation
of obs packages but now for Fedora 30.

Fixes #963

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2020-03-03 11:56:25 -06:00
Salvador Fuentes
6671386dd0
Merge pull request #959 from devimc/topic/qemu/enableLibpmem
scripts/qemu: enable libpmem
2020-03-03 08:49:40 -06:00
Salvador Fuentes
afaf7cd6e6
Merge pull request #961 from amshinde/remove-release-doc
release: Remove release docs
2020-03-03 08:48:05 -06:00
Penny
e94cf0f135
Merge pull request #2454 from jcvenegas/fix-2453
vendor: update agent client
2020-03-03 17:11:17 +08:00
Penny
e0a4515609
Merge pull request #2458 from Pennyzct/netns_leak_on_crio
cri-o: fix netns mount point leaking from cri-o
2020-03-03 13:06:11 +08:00
Li Yuxuan
e9a46580b1 vc: Use BlockIndexMap instead of BlockIndex
This allows to reuse detached block index and ensures that the
index will not reach the limit of device(such as `maxSCSIDevices`)
after restarting containers many times in one pod.

Fixes: #2007
Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
2020-03-03 10:30:18 +08:00
Penny Zheng
f0eaeac3be path-absolutize: version update
The latest tag version v1.2.0 fixes the error of inapporiately using
mutable static.

Fixes: #144

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-03-03 09:24:13 +08:00
Penny Zheng
3136712d8e systemd-service: build rust-agent systemd services
I add another sub-command `build-service` in Makefile to
generate rust-agent-related systemd service files, which
are necessary for building guest rootfs image.
The whole design is following the one in go-agent.

Fixes: #144

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-03-03 09:24:02 +08:00
Cole Robinson
134175bb9b tests: Document the changed KATA_DEV_MODE behavior
Document the KATA_DEV_MODE changes explained in the previous commits

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 18:56:11 -05:00
Cole Robinson
0f4eac434b tests: Skip initrd/image launch if KATA_DEV_MODE
The script points kata-runtime at the generated initrd/image by
editing the host config file, which we aren't doing when
KATA_DEV_MODE=1 is set, so this won't work.

Fixes: #415

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 18:09:57 -05:00
Cole Robinson
762ec28a6b tests: Drop kata-runtime env validation if KATA_DEV_MODE is set
If KATA_DEV_MODE is set, test_images.sh attempts to validate that
docker has kata-runtime as a configured --runtime value. This gives
a nicer and earlier error, but it also complicates using
/usr/bin/docker as provided by podman, which has a different 'info'
topology.

Let's drop the check and let the tests fail naturally if the host
isn't configured properly

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 18:09:57 -05:00
Cole Robinson
6f17b9cb48 tests: Skip set_runtime if KATA_DEV_MODE is set
set_runtime attempts to overwrite the host docker configuration to
default to DOCKER_RUNTIME instead of kata-runtime, which does not
work for 'docker build'.

Since this is a host altering step, skip it if KATA_DEV_MODE is set.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 18:09:57 -05:00
Cole Robinson
17a8fb13a1 tests: Skip all kata-manager usage if KATA_DEV_MODE is set
kata-manager.sh makes host config changes. KATA_DEV_MODE is meant to
avoid such changes.

Add a helper run_mgr function which stubs out kata-manager.sh usage
if KATA_DEV_MODE is set.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 18:09:57 -05:00
Cole Robinson
e787bb0da5 tests: Define KATA_DEV_MODE
Define KATA_DEV_MODE at the top of the file, so code doesn't need
to conditionally compare against it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 18:09:57 -05:00
Cole Robinson
cef25917a4 tests: Rework dracut docker bind mounts
The current setup leaves images/ and rootfs-osbuilder/ dirs stranded
in the $project_dir when run locally. This simplifies things by only
passing through the project_dir and the tmp_dir that all our output
is relative to

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 18:09:57 -05:00
Cole Robinson
f3ab6d2666 tests: Don't run commands with chronic if DEBUG is set
Don't suppress output with `chronic` when the user sets DEBUG

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 18:09:36 -05:00
GabyCT
cc2583abdb
Merge pull request #605 from amshinde/update-releases-doc
Update releases documents
2020-03-02 16:29:44 -06:00
Julio Montes
c0d45d8ace scripts/qemu: enable libpmem
Enable libpmem to support PMEM when running under Kubernetes.

see https://github.com/kata-containers/runtime/issues/2262

According to QEMU's nvdimm documentation: When 'pmem' is 'on' and QEMU is
built with libpmem support, QEMU will take necessary operations to guarantee
the persistence of its own writes to the vNVDIMM backend.

fixes #958

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-03-02 21:52:39 +00:00
Cole Robinson
7a8e816ded tests: Specify DRACUT_OVERLAY_DIR
Otherwise it defaults to using the $project_dir/dracut_overlay, which
leaves junk hanging around when running the tests locally

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 14:55:53 -05:00
Cole Robinson
7dd99c022b tests: Add project_dir helper variable
Rather than use ${script_dir}/.. in multiple places

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 14:55:53 -05:00
Cole Robinson
1ae392285e tests: Have DEBUG=1 set bash xtrace
This is similarly used in image_builder.sh and can be handy to
determine what is happening. Unfold the 'set' short options while
we are at it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 14:55:53 -05:00
Cole Robinson
555ddf331a tests: Remove unused USE_DOCKER export
We now explicitly pass this to every make target we invoke, so
this is redundant

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 14:55:53 -05:00
Cole Robinson
0e6a12ce3c tests: Pass DOCKER_RUNTIME to osbuilder scripts
The rootfs and image builder scripts are wired up to handle the
DOCKER_RUNTIME, so pass our value down to those scripts

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 14:55:53 -05:00