Commit Graph

5222 Commits

Author SHA1 Message Date
Jose Carlos Venegas Munoz
42061f6c39 clh: cleanup VM dir
remove dirtory created for VM. This should be refactored in all
hypervisors

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-12-06 21:26:26 +00:00
Jose Carlos Venegas Munoz
c688a1504c version: CH bump to master
test with recent API changes of CH.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-12-06 21:26:26 +00:00
Jose Carlos Venegas Munoz
9f15dd2da3 clh: remove cli builder
Remove cli builder code as now that we use http client

Signed-off-by: Bo Chen <chen.bo@intel.com>
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-12-06 21:26:26 +00:00
Jose Carlos Venegas Munoz
f73723a23f clh: use http client
Instead of build a command, use Cloud Hypervisor http API.

Fixes: #2165

Signed-off-by: Bo Chen <chen.bo@intel.com>
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-12-06 21:26:26 +00:00
Erich Cordoba
92301a6382 agent: Add unit tests for sandbox.rs
These are the unit tests for the sandbox struct. This is the summary
of the most important changes:

  - To test containers it was needed to create a `LinuxContainer` type
    and this requires root privileges. So, some tests now requires root
    user to be run.
  - There was a bug in the `unset_sandbox_storage` method. The return
    type was wrapped in a `Result` to avoid this problem.

Fixes: #50

Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
2019-12-06 13:11:07 -06:00
Jose Carlos Venegas Munoz
ab2088f7d5 makefile: honor virtiofs config for default config
Fix config used when qemu-virtiofs is set as default.

Fixes: #2327

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-12-06 06:26:31 +00:00
Ted Yu
9a15457064 vc: Check error return from storeState
Fixes #2324

This achieves parity with the check on line 293.

Signed-off-by: Ted Yu yuzhihong@gmail.com
2019-12-05 18:55:57 -08:00
Jose Carlos Venegas Munoz
dc05d7dbbf
Merge pull request #2322 from amshinde/disable-vhost-net-for-rootless
rootless: Disable vhost-net for rootless
2019-12-05 17:39:35 -06:00
Archana Shinde
0babd38de0 rootless: Disable vhost-net for rootless
Since the /dev/vhost-net device is owned by root, we cannot used
vhost-net networking in rootless mode. Instead of having to
do this manually in the toml, disable vhost-net when the runtime
detects it is running rootless.

Fixes #2321

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-12-05 13:22:57 -08:00
Jose Carlos Venegas Munoz
60102188cd clh: Implement check()
Implement check hypervisor interface method, using VmmPing

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-12-05 20:03:09 +00:00
Jose Carlos Venegas Munoz
a10da3efbf vendor: update openapi deps
dep ensure to update new deps from openapi client

golang.org/x/oauth2

Signed-off-by: Bo Chen <chen.bo@intel.com>
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-12-05 15:36:26 +00:00
Jose Carlos Venegas Munoz
183622652a clh: generate client code
Generated using OpenAPITools/openapi-generator.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-12-05 15:36:26 +00:00
Jose Carlos Venegas Munoz
dcac021637 clh: Add Generation tools for API client
cloud-hypervisor provides an API server to send commands
in a qmp and Firecracker style over an Unix socket.

The API is defined via OpenAPI, this commit adds
scripts to help to generate a client using:

https://github.com/OpenAPITools/openapi-generator

This will make easy to update any change related with the API
in the future.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-12-05 15:36:26 +00:00
Peng Tao
00ff99bcb6
Merge pull request #2306 from jodh-intel/fix-compatoci-logger
compatoci: Add a SetLogger call
2019-12-05 13:57:38 +08:00
Fupan Li
e025ba7d08
Merge pull request #99 from jiangliu/v2
Fix bug #98 and improve code readability
2019-12-05 10:01:29 +08:00
Fupan Li
84e4d68b13
Merge pull request #2316 from eryugey/dev
virtiofs: stop sandbox when virtiofsd quits
2019-12-05 09:06:44 +08:00
Eric Ernst
e3ba17123a
Merge pull request #2296 from tedyu/rm-dev-when-err
vc: Remove device when AddDevice encounters error
2019-12-04 14:23:49 -08:00
Eric Ernst
62d9bf2ed0
Merge pull request #832 from amshinde/fix-version-bug-GH
release: Fix bug in how version is determined for actions
2019-12-04 10:10:20 -08:00
Salvador Fuentes
df7982b95f
Merge pull request #385 from shiloong/master
make: use `cd` instead of '--directory' option of `cpio`
2019-12-04 06:34:59 -06:00
Eryu Guan
abbb536cc4 virtiofs: stop sandbox when virtiofsd quits
Commit 89e0dfae11 ("qemu: stop qemu process when virtiofsd quits")
stops sandbox when virtiofsd quits so that virtiofs mount inside guest
won't hang. But commit d5a3d0a61c ("virtiofs: use virtiofsd
--fd=FDNUM") deleted this monitor logic.

Add the Scanner back to monitor virtiofsd's stderr and stop sandbox if
Scanner returns error.

Note that we don't monitor the virtiofsd process itself is because
virtiofsd may be live-upgraded (when available) and the original
process may quit, but virtiofs service is still running.

Fixes: #2315
Signed-off-by: Eryu Guan <eguan@linux.alibaba.com>
2019-12-04 19:54:41 +08:00
James O. D. Hunt
e2aff807ff
Merge pull request #847 from egernst/cleanup-timeout
kata-deploy: improve debug message, longer cleanup timeout
2019-12-04 09:05:29 +00:00
Penny Zheng
8f6d0ab165 FC: introduce --config-file to replace API configure request
New command-line parameter for firecracker v0.19.0, named `--config-file`,
which represents the path to a file that contains a JSON which can be
used for configuring and starting a microVM without sending any API
requests.

Fixes: #2199

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-12-03 23:46:29 -08:00
Penny Zheng
f2d8d715d3 FC: func checkVersion should be more independent
func checkVersion could be called anywhere, not always after
DescribeInstance `\` API request, so it should be more independent.
We could also get version number from `firecracker --version` command.

Fixes: #2199

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-12-03 23:46:24 -08:00
Penny Zheng
9ce2113535 FC: remove API Ready state
Since we decide to adopt config file to configure, we could bypass
API Ready state.
Here, we also create a new config ready state: `cfReady`, to represent
configuration part is done.

Fixes: #2199

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-12-03 23:46:19 -08:00
Archana Shinde
ff20f2008b release: Checkout right version of kernel patches
Checkout tag for packaging repo based on env variable NEW_VERSION
or kata_version with kata_version taking precedence.
With this, we checkout to the right version of packaging repo before
applying kernel patches.

Fixes #849

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-12-03 18:08:08 -08:00
Archana Shinde
9377c5d5ca release: Fix bug in how version is determined for actions
Althought, we changed the script "gen_versions_txt.sh" to accept a tag
rather than a branch, this change is not sufficient.
This script generates the right version file based on a tag, but
function `get_from_kata_deps` does not use this, and ends up using the
master branch instead. This is because this function looks at an env
variable called $BRANCH and ends up using master branch if the variable
is not defined.

Pass the tag/new version to the build scripts, so that this tag is
passed along to `get_from_kata_dep`.
With this change, the correct version information is consumed by the
build scripts for the various hypervisors and kernel.

Fixes #831

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-12-03 17:56:03 -08:00
Shile Zhang
38d0be3824 make: use cd instead of '--directory' option of cpio
Due to the option '--directory' just added from 'cpio' v2.12, so the
osbuilder will failed with old version 'cpio' before v2.12, such as in
Centos 7 with v2.11.
Fix it by replacing this option with '(cd ...; cat ...)'.

Fixes: #384

Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com>
2019-12-04 09:27:07 +08:00
Julio Montes
62f4536d46
Merge pull request #807 from Pennyzct/update_on_4.19.83
v4.19.86: patch update for v4.19.86 on AArch64
2019-12-03 17:14:28 -06:00
Penny Zheng
168709ca62 v4.19.86: patch update for v4.19.86 on AArch64
we need to do patch update for kernel bump to v4.19.86.

Fixes: #806
Depends-on: github.com/kata-containers/runtime#2185

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-12-03 13:29:05 -08:00
Eric Ernst
bbcffc32b5 kata-deploy: improve debug message, longer cleanup timeout
I am seeing tests fail at times waiting for label cleanup. Let's improve
the error message when this fails, and give the control plane a bit more
time, to improve stability of this test.

Fixes: #846

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-12-03 12:07:09 -08:00
Eric Ernst
6318f0a40b
Merge pull request #823 from wilsonianb/k3s
kata-deploy: add k3s support
2019-12-03 12:01:28 -08:00
GabyCT
07195c1eee
Merge pull request #836 from GabyCT/topic/addtests
ci: Add obs testing for packaging
2019-12-03 13:10:22 -06:00
Jose Carlos Venegas Munoz
62cd08044d
Merge pull request #2185 from egernst/kernel-bump
kernel: update to 4.19.83
2019-12-03 12:53:18 -06:00
GabyCT
ce32fb8689
Merge pull request #838 from GabyCT/topic/fixhelp
kernel: Fix that the help is not printed twice
2019-12-03 12:08:43 -06:00
Gabriela Cervantes
34ce361a40 ci: Add obs testing for packaging
This will test that is possible to install the obs packages in different
distributions.

Fixes #621

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2019-12-03 11:27:28 -06:00
Salvador Fuentes
8e23f2c114
Merge pull request #837 from GabyCT/topic/addbroken
obs: Check for broken packages
2019-12-03 11:23:48 -06:00
Gabriela Cervantes
0d840850ae kernel: Fix that the help is not printed twice
While running the build-kernel.sh script with no arguments, the help is
printed twice. This PR will fix that.

Fixes #433

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2019-12-03 10:12:38 -06:00
GabyCT
2462241c7a
Merge pull request #840 from amshinde/increase-aks-timeout
kata-deploy: Increase the wait timeout for control plane to come up
2019-12-03 09:48:46 -06:00
Ted Yu
9c0872dc7e vc: Remove device when AddDevice encounters error
Fixes #2295

Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2019-12-03 06:07:11 -08:00
Jianyong Wu
cc25216b11 virtiofs: add default value for virtioFsCache type.
If no virtioFsCache type set in configuration file, virtiofsd will
not starts, which makes kata-container start fail if virtio-fs
as its shared file system.

Fixes: #2279
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2019-12-03 14:01:29 +08:00
Archana Shinde
e9bb8e58ff kata-deploy: Increase the wait timeout for control plane to come up
Recent runs of setting up aks with github workflows shows that a timeout
of 5m is not always sufficent fot aks control plane to come up.
Increase this from 5m to 10m.

Fixes #839

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-12-02 13:38:11 -08:00
Gabriela Cervantes
37bce87661 obs: Check for broken packages
We need to check for broken packages at the obs-wait script.

Fixes #492

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2019-12-02 15:31:10 -06:00
Jose Carlos Venegas Munoz
d50eea66eb
Merge pull request #2274 from ericooper/ich-driver-002
Cloud Hypervisor: driver update number 2
2019-12-02 13:48:36 -06:00
Jose Carlos Venegas Munoz
9b2fc09982
Merge pull request #58 from egernst/master-workflow
Master workflow
2019-12-02 11:01:25 -06:00
Graham Whaley
1c27897ba2
Merge pull request #2300 from tedyu/map-ignored-mounts
vc: Use map to represent ignoredMounts
2019-12-02 16:41:48 +00:00
Eric Ernst
c384359209
Merge pull request #2278 from egernst/fc-comment
Fc comment
2019-12-02 07:53:27 -08:00
Liu Jiang
154c68eb93 agent: group Linux ABI constants into dedicated file
Group Linux ABI related constants into dedicated file for maintenance.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2019-12-02 22:19:33 +08:00
Liu Jiang
000bb8592d agent: refine device.rs for better maintenance
1) pass reference instead of value when possible.
2) simplify code.
3) rename get_device_pci_address() as get_pci_device_address() to keep
   consistency get_pci_device_name().
4) refine get_device_name() for maintenance.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2019-12-02 22:19:29 +08:00
Liu Jiang
94311e4997 agent: fix wrong return value of set_sandbox_storage()
Function set_sandbox_storage() is designed to return true when the
reference count drops from 1 to 0. But current implementation always
return true no matter the reference count is, which may cause removing
an in use mountpoint.

Fixes: #88

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2019-12-02 22:19:28 +08:00
Liu Jiang
b1748323f0 agent: refine namespace.rs/sandbox.rs for better maintenance
Refine namespace.rs for better maintenance:
1) avoid unnecessary clone
2) make NamespaceType::get() return &str instead of String
3) minor syntax changes
4) remove unused enable_grpc_trace

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2019-12-02 22:19:27 +08:00