Commit Graph

5290 Commits

Author SHA1 Message Date
Salvador Fuentes
1efcd038ee
Merge pull request #2466 from dong-liuliu/xliu2/spell-typo
Fix typos in sandbox and persist/fs
2020-02-18 07:30:18 -06:00
Liu Xiaodong
0f720e6f37 virtcontainers: fix typo in sandbox
There is a typo 'emtpy' instead of 'empty' in a error message

Fixes: #2465

Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
2020-02-17 23:21:37 -05:00
Liu Xiaodong
78bb6c0f66 virtcontainers/persist: fix typo in fs
There is a typo 'writting' instead of 'writing' in a logger error.

Fixes: #2465

Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
2020-02-17 23:21:19 -05:00
Jose Carlos Venegas Munoz
901f9ba294
Merge pull request #925 from amshinde/config-5.4
Config changes for  5.4 kernel
2020-02-17 11:26:55 -06:00
Salvador Fuentes
ab260e4706
Merge pull request #2450 from Pennyzct/ubuntu_rootfs_on_aarch64
AArch64: change image rootfs from fedora to ubuntu
2020-02-17 07:25:46 -06:00
Penny
01bc98de57
Merge pull request #2456 from justin-he/ldflags
build: Add support to strip the binary
2020-02-17 17:15:15 +08:00
Penny Zheng
1c1e7cc137 unit-test: refine unit tests
we need to refine unit tests due to previous two commits and
add new test for new func checkVersionConsistencyInComponents.

Fixes: #2375

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-02-17 10:13:30 +08:00
Penny Zheng
1ad927d4e8 kata-check: use "--strict" to perform version consistency check
Use `kata-runtime kata-check --strict/-s` to perform version
consistency check.
Only if major version number, minor version number and Patch
number are all the same, we determine those two kata components
are version-consistent.

Fixes: #2375

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-02-17 10:13:19 +08:00
Penny Zheng
a4b3c65c16 kata-env: import new struct VersionInfo
We import new struct VersionInfo for better organizing version info of
kata components, in order to follow Semantic Versioning Specification.

Fixes: #2375

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-02-17 10:13:06 +08:00
Jose Carlos Venegas Munoz
0c3b2c0972
Merge pull request #2422 from amshinde/update-stable-kernel-version
kernel: Update kernel to latest stable 5.4.15
2020-02-14 16:36:21 -06:00
Sebastien Boeuf
a8ba86c965 vsock: Fix race condition happening in the virtio-vsock driver
There was a race condition between bind() and listen() that was hit very
rarely when using Kata Containers and Cloud-Hypervisor. It's been
identified the problem is really coming from the virtio-vsock driver,
which is fixed by those new kernel patches uploaded for each version of
the kernels used by Kata Containers.

Fixes #932

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2020-02-14 22:34:02 +00:00
Jose Carlos Venegas Munoz
cf1ae9e492
Merge pull request #937 from nitkon/kernel5.4
kernel: Enable new LTS 5.4.x on ppc64le arch
2020-02-14 09:32:27 -06:00
Julio Montes
efb975e4d0
Merge pull request #2443 from amshinde/disable-selinux
selinux: Disable selinux
2020-02-14 07:43:34 -06:00
Jia He
2c3b4657f5 build: Add support to strip the binary
This provides a flag "STRIP=yes" to strip the golang binary

After this patch, the binary size is reduced a lot:
19356680 containerd-shim-kata-v2*
25980728 containerd-shim-kata-v2.nostip*
 4021784 kata-netmon*
 5093992 kata-netmon.nostrip*
26339392 kata-runtime*
33097344 kata-runtime.nostrip*

Fixes: #2455
Signed-off-by: Jia He <justin.he@arm.com>
2020-02-14 16:10:49 +08:00
Nitesh Konkar
04386a66c8 kernel: Enable new LTS 5.4.x on ppc64le arch
Linux has embraced another LTS kernel version v5.4.x.
Update the kernel config for Power as well.

Fixes: #936

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2020-02-14 13:24:07 +05:30
Archana Shinde
e074df65c8
Merge pull request #935 from jcvenegas/fix-934
lib: yq: explode anchors to get real value of image values
2020-02-13 21:40:49 -08:00
Julio Montes
f8e52544bf
Merge pull request #2429 from devimc/topic/virtcontainers/rootlessStore
rootless: implement rootless fs and support --rootless option
2020-02-13 15:33:01 -06:00
Jose Carlos Venegas Munoz
ea8b7754ba lib: yq: explode anchors to get real value of image values
yq is not exploding anchors anymore and requiere an extra flag.

Add flag to fix CI.

Fixes: #934

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-02-13 20:53:32 +00:00
Graham Whaley
cd6d364fba kata-deploy: improve logic for crio.conf runtime additions
Now crio.conf has some kata entries in by default, but commented
out and without the runtime_path elements to them, our deploy
script gets a little confused and fails to add the kata-qemu
elements to the config.

This is because the grep spots the commented out lines, and tries
to, unsuccessfully, update the matching runtime_path elements, that
don't actually exist.

Improve this by matching only uncommented config lines, so now the
script sees that the runtime is not really configured already, and
instead of trying to edit/update it, will place a entry at the
end of the file.

Fixes: #928

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-02-13 14:00:25 +00:00
Julio Montes
a45cf62e75 virtcontainers/pkg/rootless: fix comment on exported var
Fix comment on exported var `IsRootless` should be of the form
`IsRootless ...` (golint)

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-02-12 19:09:32 +00:00
Julio Montes
c36c667b10 cli: implement --rootless option
By default virtcontainer auto-detects if the current process is running
rootless or not, but this behavior can change from commandline with the
--rootless option

fixes #2417

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-02-12 19:09:32 +00:00
Julio Montes
11bd456a89 virtcontainers: support new persist API
Fix API, container and kata implementations and unit tests to support
the new persist API

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-02-12 19:09:32 +00:00
Julio Montes
9585bc929a virtcontainers/hypervisors: support new persist API
Fix hypervisor implementations and unit tests to support the new persist API

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-02-12 19:09:32 +00:00
Julio Montes
00307a70ee virtcontainers/sandbox: support new persist API
Fix sandbox implementation and unit tests to support the new persist API

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-02-12 19:09:32 +00:00
Julio Montes
4b9ab557c8 virtcontainers/factory: support new persist API
Fix factory implementation and unit tests to support the new persist API

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-02-12 19:09:32 +00:00
Julio Montes
71f48a3364 virtcontainers/persist: update GetDriver to support rootless fs
GetDriver returns new PersistDriver according to current needs, a mock fs
driver is returned when mockTesting is enabled, a rootless fs is returned when
rootless is detected, otherwise a fs driver is used.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-02-12 19:09:32 +00:00
Julio Montes
dd2762fdad virtcontainers/persist: introduce mock fs driver
Mock FS driver can be used in unit testing to allow

Mock fs driver inherits from FS and may overwrite its methods. All files
and directories created by this driver are under a path accessible for all
users, this path is created under the system temporal directory.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-02-12 19:09:32 +00:00
Julio Montes
ea8fb96c3e virtcontainers/persist: introduce rootless fs driver
Rootless fs driver inherits from FS and may overwrite its methods. All files
and directories created by this driver are under a path accessible for the
current user, typically this path is defined by the environment variable
`XDG_RUNTIME_DIR`, if this variable is not defined, the default path
`/run/user/$UID` is used instead, where $UID is the current user ID.

fixes #2416

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-02-12 19:09:32 +00:00
Julio Montes
768db1bdc4 virtcontainers/persist: update API and interface
Update persist FS API and interface to support rootless and mock filesystem
implementations. `RunStoragePath` and `RunVMStoragePath` are part of FS
object and may change their path depending on the driver (rootless/mock/fs)

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-02-12 19:09:32 +00:00
Julio Montes
6be74811dc virtcontainers: remove getVMPath method from agent
`agent.getVMPath()` is an almost useless method that can be easily replaced
with `filepath.Join()`

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-02-12 19:09:32 +00:00
Julio Montes
658f77979c rootless: move pkg/rootless to virtcontainers
rootless is used in katautils, cli and virtcontainers. It makes more sense
if it's part of virtcontainer, this way virtcontainers won't depend on other
runtime subpackages

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-02-12 19:09:32 +00:00
GabyCT
645dfc81f6
Merge pull request #2452 from GabyCT/topic/skipvirtcontainers
ci: Do not setup virtcontainers while using podman
2020-02-11 16:14:56 -06:00
Gabriela Cervantes
83561c4ce3 ci: Do not setup virtcontainers while using podman
Skip the setup and installation of virtcontainers as it is using docker,
when we try to setup podman CI.

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

Fixes #2451

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2020-02-11 13:15:09 -06:00
GabyCT
4d443056bf
Merge pull request #2448 from chavafg/topic/update-yq
CI: update yq to 3.1.0
2020-02-11 13:09:03 -06:00
Salvador Fuentes
22c486aa62 CI: update yq to 3.1.0
To match the version used in the tests repo.
Related: https://github.com/kata-containers/tests/issues/2290

Fixes: #2447.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2020-02-11 07:25:08 -06:00
Jia He
005c62a871 image_builder: Reduce the boundary mb for reducing image size on arm64
Qemu merely limits the memory-backend-file size to be aligned to page_size
instead of section size(arm64 1GB). Please see file_ram_alloc() in qemu
exec.c. If we use 1024MB, the generated image size will be 3-4 times bigger
than the original one.

After relaxing it, the image size will be changed from 1G to 300M+ on arm64
with Fedora 29 rootfs's default configuration.

I do see there are some different limitation for ram_block on other arches
(e.g. s390x). So gracefully keep other arches unchanged here.

Fixes #404
Signed-off-by: Jia He <justin.he@arm.com>
2020-02-11 16:28:38 +08:00
Penny Zheng
a8dcff5b4e AArch64: change image rootfs from fedora to ubuntu
Ubuntu distribution is the most suitable one for AArch64 to build
image rootfs.
I think the size of rootfs is the key point we should consider most
and first.
And ubuntu has the smallest rootfs, only approximately 100MB.

Fixes: #2449

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-02-11 11:19:45 +08:00
fupan.lfp
289d61730c grpc: fix the issue of crash agent when didn't find the process
It's better to catch the  error of couldn't find the process
in tty_win_resize service, other wise, an invalid process id
could crash the agent.

Fixes: #137

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-02-11 10:04:19 +08:00
Archana Shinde
de7383b2d1 kernel: Update kernel to latest stable 5.4.15
Depends-on: github.com/kata-containers/packaging#925

Fixes: #2421

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-02-10 16:31:39 -08:00
Archana Shinde
d142bf73e6
Merge pull request #2446 from amshinde/fix-dep
dep: Fix dep check
2020-02-10 15:15:05 -08:00
Archana Shinde
5c3bcd884c dep: Fix dep check
Gopkg.lock has gone out of sync.
Ran dep ensure to fix it.

Fixes #2445

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-02-10 13:46:54 -08:00
Archana Shinde
b66fb4389f kernel: Remove CONFIG_INET6 options from fragments
Dont think these are options are required at all.
Remove them from fragments and whitelist.

Fixes #924

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-02-10 12:14:39 -08:00
Archana Shinde
17d86c3c14 kernel: Always apply whitelist
The whitelist contains options that we dont really care.
Always apply it, irrespective of if we are using an
experimental kernel.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-02-10 12:09:51 -08:00
Yang Bo
e2c9426ebf Merge pull request #134 from liubin/master
should ignore  invalid a key-value pair as an env
2020-02-10 11:14:36 +08:00
Yang Bo
11a1cf53c2
Merge pull request #361 from yyyeerbo/wip
Rootfs builder: build rust agent using osbuilder
2020-02-10 10:57:19 +08:00
Fupan Li
31a97031f8
Merge pull request #136 from yyyeerbo/wip
Revert: "Makefile: Fix rust agent build using "--release"."
2020-02-10 09:17:11 +08:00
Kant
40b5a56688 agent: ignore invalid a key-value pair as an env
Fixes #135

Signed-off-by: Kant <lb203159@antfin.com>
2020-02-08 13:51:28 +08:00
Yang Bo
269daa94ef Revert: "Makefile: Fix rust agent build using "--release"."
This reverts commit a3e46a369f.

There is still problem with static link, built binary will
segmentfault on clearlinux. So revert this patch for now.

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

Fixes: #69

Signed-off-by: Yang Bo <bo@hyper.sh>
2020-02-08 12:56:34 +08:00
Bo Chen
1fa10fea78
Merge pull request #2440 from jcvenegas/clh-fixes-integration
Update Cloud Hypervisor to v0.5.0
2020-02-07 14:03:09 -08:00
Archana Shinde
12996ca1db
Merge pull request #2414 from grahamwhaley/20200128_readme_updates
docs: README: Minor grammatical updates
2020-02-07 13:57:23 -08:00