Commit Graph

15384 Commits

Author SHA1 Message Date
Peng Tao
03f2459388 cli: support factory status command
It checks vm factory status and prints the result.

Fixes: #545

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-08-03 00:26:55 +08:00
Julio Montes
03f1a1c3a8 qemu/qmp: implement getfd
`getfd` receives a file descriptor via SCM rights and assign it a name,
this command is useful to send file descriptors from the host, and then
hot plug devices that needs file descriptors like vhost-vsock-pci devices.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-08-02 11:07:16 -05:00
Julio Montes
84b212f1b8 qemu: add vhostfd and disable-modern to vsock hotplug
`vhostfd` is used to specify the vhost-vsock device fd, and it holds
the context ID previously opened.

`disable-modern` is to disable the use of "modern" devices, by using virtio 0.9
instead of virtio 1.0. Particularly, this is useful when running the VM in a
nested environment.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-08-02 11:07:16 -05:00
Sebastien Boeuf
131c8d0caa
Merge branch 'master' into static-checks 2018-08-02 08:27:54 -07:00
Sebastien Boeuf
16600efc1d
Merge pull request #531 from WeiZhang555/bugfix
re-add: refactor device manager
2018-08-02 07:32:02 -07:00
James O. D. Hunt
b1c3c58def
Merge pull request #203 from grahamwhaley/20180728_debug_console
Fix debug console socket docs
2018-08-02 13:59:07 +01:00
James O. D. Hunt
04fa125e95
Merge pull request #544 from lifupan/master
virtcontainers: fix the issue of cleanup the vm's path
2018-08-02 11:29:50 +01:00
Graham Whaley
c871a90b4d
Merge pull request #539 from bergwolf/crng
Reseed guest random number generator after booting from vm factory
2018-08-02 11:18:34 +01:00
James O. D. Hunt
47a0d6affc
Merge pull request #205 from jodh-intel/add-initcall-debug-to-debug-info
docs: Add initcall_debug to dev guide debug section
2018-08-02 10:05:02 +01:00
Fupan Li
15860185d9 virtcontainers: fix the issue of cleanup the vm's path
To use the filepath.Join() instead of the simple
string append method to form the file path, otherwise
it will lose the "/" between the two parts.

Fixes #543.

Signed-off-by: Fupan Li <lifupan@gmail.com>
2018-08-02 16:21:55 +08:00
Peng Tao
47835a8fd3
Merge pull request #104 from devimc/topic/fixMemConstraints
kernel/configs: enable swap extension (CONFIG_MEMCG_SWAP)
2018-08-02 10:09:15 +08:00
Peng Tao
6156341904 factory: reseed guest RNG device after resuming
So that shared memory guests can still generate different
random numbers.

Fixes: #538

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-08-02 09:43:10 +08:00
Peng Tao
d43a4350a6 vendor: update agent dependency
To include ReseedRandomDev grpc.

Full commits:
e398fd4 agent: add ReseedRandomDev rpc
8a51909 codecov: remove codecov.yml

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-08-02 09:26:04 +08:00
Julio Montes
3b18544a99 kernel/configs: enable swap extension (CONFIG_MEMCG_SWAP)
libcontainer limits the memory+swap usage by writing the limit at
/sys/fs/cgroup/memory/docker/$CONTID/memory.memsw.limit_in_bytes, this path
doesn't exist if CONFIG_MEMCG_SWAP and CONFIG_MEMCG_SWAP_ENABLED are not
enabled.

fixes #103

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-08-01 11:42:53 -05:00
Julio Montes
4af56db0ea
Merge pull request #114 from nitkon/master
ppc64le: Use powerpc as prefix for kernel config file
2018-08-01 07:07:18 -05:00
James O. D. Hunt
fc0142ec8e
Merge pull request #527 from jodh-intel/remove-initcall-debug-kernel-option
kernel: Remove initcall_debug boot option
2018-08-01 12:50:52 +01:00
Nitesh Konkar
65c00dc29a ppc64le: Use powerpc as prefix for kernel config file
Post Fix #111, the kernel config name is
expected is to be prefixed with powerpc instead
of ppc64le. Just rename the file to suit the scripts.

Fixes: #113

Signed-off-by: Nitesh Konkar niteshkonkar@in.ibm.com
2018-08-01 14:46:10 +05:30
Graham Whaley
02ef1a64ff
Merge pull request #541 from bergwolf/codecov
codecov: remove codecov.yml
2018-08-01 09:55:51 +01:00
James O. D. Hunt
a8f5e2becf kernel: Remove initcall_debug boot option
Remove the `initcall_debug` boot option from the kernel command-line as
we don't need it any more and it generates a ton of boot messages that
may well be impacting performance.

Fixes #526.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-08-01 09:52:13 +01:00
James O. D. Hunt
487f9efa57
Merge pull request #536 from bergwolf/qmp_clear
qemu: clear qmp state before wait for qemu process
2018-08-01 09:51:43 +01:00
Sebastien Boeuf
1dae056012
Merge pull request #524 from bergwolf/agent_log
do not append sandbox is to kernel parameters
2018-07-31 21:52:23 -07:00
Peng Tao
b200163de9 kata_agent: send sandbox id in CreateSandbox request
And do not append sandbox id to kernel arguments since that
would fail qemu args comparison in vm factory.

Fixes: #523

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-08-01 11:18:44 +08:00
Peng Tao
e69ebe5add vendor: update agent grpc
To include SandboxId in CreateSandboxRequest.

Included commits:
745fa71 (origin/pr/309) agent: set sandbox id log field in CreateSandbox
a3321f4 (origin/pr/304) vendor: Revendor netlink to fix PID 1 segfault
a9ade15 (origin/pr/293) agent: Add sandbox level reference counter for sandbox storage
5f89c07 (origin/pr/263) yamux: disable yamux keep alive in server channel
815f831 (origin/pr/303) agent: do not quit on grpc serve errors
8abefd1 (origin/pr/301) protocols/client: close yamux session when closing the stream
67643cf (origin/pr/297) agent: Fix CPU tests for both initrd and rootfs image
cf8d3c8 (origin/pr/295) agent: disable yamux keep alive
ed656df (origin/pr/284) grpc: Ignore WriteStdin after the standard input has been closed
1a52204 grpc: Don't close the terminal on CloseStdin() call
04457e3 (origin/pr/292) logging: Add sandbox field
ba2a32a (origin/pr/286) create: Reduce cyclomatic complexity of CreateContainer
bce5f78 (origin/pr/289) logging: Redirect yamux warnings/errors to logger
23311ea namespace: Add check to make sure PID namespace is not received
7fe2eba (origin/pr/273) release: Kata Containers 1.1.0
4ef4971 (origin/pr/277) travis: Enable travis ci for ppc64le
57bf4e6 (origin/pr/279) namespace: do not create path using rand.
a589bdb (origin/pr/275) CI: update static-checks.sh in travis.yml
1372df2 (origin/pr/271) logging: Fix handling of non-string fields when PID 1
4018add (origin/pr/269) agent: honour CPU constraints when agent is the init process
1cff660 (origin/pr/268) mount: Remove redundant mkdir
cc74b5d (origin/pr/266) network: Setup localhost when running as init
dc06ec7 network: Add extra sanity checks
b580ae7 network: Check all function parameters
ee106e9 main: Exit(1) on error
5bf3909 network: Reduce cyclomatic complexity
cdf9bce namespace: Simplify code
0d7f36f (origin/pr/260) agent: update container cpuset cgroup parents
4cf1809 (origin/pr/258) agent: update container cpuset cgroup before setting the new configuration
d70e5bb agent: don't modify container's config
a30395a (origin/pr/253) grpc: signal frozen containers

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-08-01 11:18:44 +08:00
Peng Tao
0541a5fc77 cli: fix factory assignment
A stupid typo...

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-08-01 11:17:56 +08:00
Peng Tao
476f21f22c codecov: remove codecov.yml
Now that we have a global team yaml, let's use it.

Fixes: #540

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-08-01 11:08:13 +08:00
Peng Tao
fc45d2e3d1
Merge pull request #497 from jcvenegas/vsock-runtime5
Use VSOCK when is available in the host.
2018-08-01 09:55:05 +08:00
Julio Montes
33643797ad virtcontainers: Use vsock if host support it
When the hypervisor option `use_vsock` is true the runtime will check for vsock
support. If vsock is supported, not proxy will be used and the shims
will connect to the VM using VSOCKS. This flag is true by default, so will use
VSOCK when possible and no proxy will be started.

fixes #383

Signed-off-by: Jose Carlos Venegas Munoz jose.carlos.venegas.munoz@intel.com
Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-07-31 15:38:45 -05:00
Julio Montes
edda8cc68a
Merge pull request #117 from jcvenegas/fix-ci
ci: Fix ci when tmp_dir is not set.
2018-07-31 15:37:40 -05:00
Jose Carlos Venegas Munoz
b4a6303b14 ci: Fix ci when tmp_dir is not set.
When tmp_dir is not set and lib.sh is sourced
could lead to fail.

Fix: #116

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-31 15:21:20 -05:00
Julio Montes
3c15bc50d0 virtcontainers: remove parseVSOCKAddr function
parseVSOCKAddr function is no more needed since now agent config
contains a field to identify if vsocks should be used or not.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-07-31 13:52:44 -05:00
Julio Montes
052769196d virtcontainers: implement function to cold plug vsocks
`appendVSockPCI` function can be used to cold plug vocks, vhost file descriptor
holds the context ID and it's inherit by QEMU process, ID must be unique and
disable-modern prevents qemu from relying on fast MMIO.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-07-31 13:52:44 -05:00
Julio Montes
1515bd07a1 virtcontainers: update KataAgentConfig to support vsocks
add extra field in KataAgentConfig structure to specify if the
kata agent have to use a vsock instead of serial port.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-07-31 13:52:44 -05:00
Julio Montes
3adc8626e8 virtcontainers: log type of proxy started
In order to see what proxy was started or not, we should log
its type and the URL

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-07-31 13:52:44 -05:00
Julio Montes
4680e58e08 cli: add configuration option to enable/disable vsocks
Add `use_vsock` option to enable or disable the use of vsocks
for communication between host and guest.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-07-31 13:52:43 -05:00
Jose Carlos Venegas Munoz
6e69deba7f
Merge pull request #108 from jcvenegas/github-release
release: Create github release after create tag.
2018-07-31 12:30:59 -05:00
James O. D. Hunt
78c79ce138
Merge pull request #102 from nitkon/master
packaging: Get packaging for ppc64le
2018-07-31 16:56:35 +01:00
Jose Carlos Venegas Munoz
f389b94d8a kata-agent: Remove GRPCSock unused variable.
We already save the URL used to connect to the agent in the `state.URL` this
variable is the used to connect the shim to agnet independently the socket type
(VSOCK or serial)

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-31 10:30:05 -05:00
Julio Montes
9b283254c3 virtcontainers: Implement function to get a free context ID
FindContextID generates a random number between 3 and max uint32
and uses it as context ID.
Using ioctl findContextID checks if the context ID is free, if
the context ID is being used by other process, this function
iterates from over all valid context IDs until one is available.

`/dev/vhost-vsock` is used to check what context IDs are free,
we need it to ensure we are using a unique context ID to
create the vsocks.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-07-31 10:30:05 -05:00
Julio Montes
2339ac3f93 virtcontainers/utils: Implement function to check vsocks support
Implement function to check if the system has support for vsocks.
This function looks for vsock and vhost-vsock devices returning
true if those exist, otherwise false.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-07-31 10:29:11 -05:00
Jose Carlos Venegas Munoz
f65fd94583 tag_repos: Create github release.
After create a tag craete a github release.

Fixes: #107

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-31 10:23:55 -05:00
Jose Carlos Venegas Munoz
dfddde813d lib: move build_hub to lib
hub will be used by other script move it.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-31 10:22:52 -05:00
Nitesh Konkar
dae14ddefd packaging: Add packaging support for ppc64le
Fixes:  #74

Signed-off-by: Nitesh Konkar niteshkonkar@in.ibm.com
2018-07-31 19:58:21 +05:30
Julio Montes
8ae28888e0 vendor: update govmm
add vhostfd and disable-modern to vhost-vsock-pci

shortlog:
3830b44 qemu: add vhostfd and disable-modern to vhost-vsock-pci
f700a97 qemu/qmp: implement function to hotplug vsock-pci

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-07-31 08:42:50 -05:00
James O. D. Hunt
90fa9305e0
Merge pull request #112 from Weichen81/master
Kernel: Normalize target-arch for setup-kernel function
2018-07-31 13:33:31 +01:00
Peng Tao
44a3a441aa qemu: wait on disconnected channel in qmp shutdown
That is how govmm ensures us that the qmp channel has been cleaned
up entirely.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-07-31 18:34:37 +08:00
James O. D. Hunt
17a2fb886f
Merge pull request #528 from jodh-intel/fix-log-fields
Ensure containerID and sandboxID fields logged as early as possible
2018-07-31 09:09:29 +01:00
Wei Chen
0e64f2a8c6 kernel: Update kata_config_version to trace issue#111
Signed-off-by: Wei Chen <wei.chen@arm.com>
2018-07-31 06:48:16 +00:00
Wei Chen
6f4023f6e2 kernel: Remove redundant slash of default_kernel_config_dir
Run new script in arm server to build kernel, then find a minor
typo. An extra "/" in the end of default_kernel_config_dir will
cause error:
ERROR: failed to find default config
../src/github.com/kata-containers/packaging/kernel/configs//aarch64_kata_kvm_4.14.x

Signed-off-by: Wei Chen <wei.chen@arm.com>
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2018-07-31 06:48:14 +00:00
Wei Chen
195b5744ea kernel: Normalize target-arch for setup-kernel function
As we had dicussed in issue#140:
https://github.com/kata-containers/documentation/issues/140
We have normalized output for x86_64, arm64 and ppc64. And
James had implemented a kata-arch.sh in tests/.ci :
https://github.com/kata-containers/tests/blob/master/.ci/kata-arch.sh
But in build-kernel.sh the setup-kernel function had used the
"uname -m" output as target-arch directly, this will cause the
following scripts can't find kernel config files.

Fixed #111

Signed-off-by: Wei Chen <wei.chen@arm.com>
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2018-07-31 06:48:07 +00:00
Peng Tao
c8b4fabc37 qemu: clear qmp state before wait for qemu process
So that if there is any remaining state, we do not let it interfere
with the new one. This should fix the occasional vm factory hang.

Fixes: #535

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-07-31 11:48:40 +08:00