Commit Graph

6199 Commits

Author SHA1 Message Date
Archana Shinde
e96d3ef0d3 virtcontainers: Do not pass /dev/shm as 9p mount
All bind mounts are now passed to the guest with 9p.
We need to exclude /dev/shm, as this is passed as a bind mount
in the spec. We handle /dev/shm in the guest by allocating
memory for it on the guest side. Passing /dev/shm as a 9p mount
was causing it to be mounted twice.

Fixes #190

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-04-10 10:46:35 -07:00
Eric Ernst
be151cb589
Merge pull request #173 from bergwolf/proxy
runtime: add builtin proxy and shim capability
2018-04-10 08:08:01 -07:00
Peng Tao
b353e36373 test: delete pod in test cleanup
Otherwise there might be cached pod alive even if we remove
all the config dirs etc.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-10 17:27:57 +08:00
Peng Tao
81bb561467 proxy/shim: add unit tests
To test built-in proxy and shim types.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-10 13:17:19 +08:00
Peng Tao
f483d6f8da shim: add kata builtin shim type
When set, the kata shim will not be created.

Fixes: #172

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-10 13:17:19 +08:00
Peng Tao
1d291fc105 pod: add a in-memory pod list
It tracks all existing pods in the current runtime. If the runtime
calls multiple APIs, it can reuse existing pod data structure instead
of re-construct it in every API call.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-10 13:17:19 +08:00
Peng Tao
8ead054e25 vendor: udpate agent dependency
To include the grpc yamux dialer.

Included kata agent git log:
e37feac protocol: client: enable builtin yamux client support
a862fea agent: Fix container creation rollback
9602e11 vendor: Update libcontainer vendoring
92f87a1 agent: Rollback properly when container creation fails
128f87d mount: Correct error message with mount failure.
7a182a4 device: VmPath can be empty if an Id is provided
0275654 ci: lib: allow override of tests_repo
205a4d7 github: Add issue template
103aacd announce: Add total memory
e277ec6 announce: Add device and storage handlers
5d7463f announce: Add standard fields when running as PID 1
4655950 agent: Add announce function
5e6c385 CI: Require pullapprove ack for protocol changes
5d40027 tests: Skip more tests if non-root
4ba8499 tests: Use root skip function
9a2da30 tests: Move helper function
ae2be84 device: Add validation and debug
9e7b27c mount: Log params and validate

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-10 13:17:19 +08:00
Peng Tao
5a9ff3c235 proxy: add kataProxyBuiltin
When specified, it does not spawn a new process to proxy kata grpc
connections. Instead, the yamux multiplexing functionality is builtin
in the kata agent dialer.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-10 13:17:19 +08:00
Nitesh Konkar
d99af8fbe3 dev-guide: Conditionally add kata-runtime as suffix
If kata-runtime is already added as a runtime to
kata-containers.conf then you need not add it again.

Fixes: #49

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2018-04-10 09:26:58 +05:30
Sebastien Boeuf
5932803088
Merge pull request #193 from devimc/virtcontainers/fixUnitTests
virtcontainers: fix unit tests
2018-04-09 15:36:23 -07:00
Julio Montes
dacc175536 virtcontainers: mockcontainer: return a valid process
in order to make log-parser happy, mockcontainer must return
always a valid process with a fake PID, since log-parser checks
that PID value in the logs and it must be different to zero

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

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-04-09 15:49:33 -05:00
Archana Shinde
50fd76eb9a virtcontainers: block: Factorize checks for evaluating block support
Factorize configuration and hardware support for hotplugging block
devices into a single function and use that.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-04-09 15:49:17 -05:00
Peng Tao
988bbdec59 dev-guide: fix rootfs image rootfs dir notion
Set ROOTFS_DIR so that we do not create distro-specific dir names.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-09 22:13:01 +08:00
Peng Tao
d87be6c94a dev-guide: add guide to build and setup initrd image
Optionaly, one can build an initrd image and configure kata runtime
to use it.

Fixes: #44

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-09 22:12:58 +08:00
Julio Montes
cde11c36db virtcontainers: fix unit tests
Use noopAgent in unit tests to add online fake resources.
Fix unit tests according with new changes introduced recently.

fixes #192

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-04-05 14:11:50 -05:00
Eric Ernst
2b2b68d6fa
Merge pull request #63 from erick0z/erick0z/refactor_rootfs_script
rootfs-builder: Refactor rootfs.sh
2018-04-04 07:39:11 -07:00
James O. D. Hunt
1c45f4f666
Merge pull request #79 from nitkon/patch-1
initrd-builder: fix initrd image name
2018-04-04 13:51:15 +01:00
Nitesh Konkar
6930c24d14 initrd-builder: fix initrd image name
The initrd image name should be kata-containers-initrd.img,
as its referenced by this name later on.

Fixes #14

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2018-04-04 17:55:32 +05:30
James O. D. Hunt
bc83bf052d
Merge pull request #180 from caoruidong/delete-comment
cli: delete out-of-date comment
2018-04-04 09:25:27 +01:00
Ruidong
7b6d80adf7 cli: delete out-of-date comment
Function getContainerInfo dosen't expand container id from prefix now

Fixes #139

Signed-off-by: Ruidong Cao <caoruidong@huawei.com>
2018-04-04 21:43:33 +08:00
Peng Tao
0e8b6dc049
Merge pull request #133 from amshinde/scsi-data-plane
iothread support for virtio-scsi
2018-04-04 15:39:07 +08:00
Peng Tao
dda4a4494a
Merge pull request #179 from sboeuf/fix_rollback
virtcontainers: Fix container creation rollback
2018-04-04 13:37:46 +08:00
Sebastien Boeuf
1404928c05 virtcontainers: Fix container creation rollback
The rollback does not work as expected because the error has to be
checked from the defer itself.

Fixes #178

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-04-03 16:13:45 -07:00
Sebastien Boeuf
e75713fffb
Merge pull request #136 from sboeuf/fix_rollback
virtcontainers: Properly rollback mounts and hotplugs when container creation failed
2018-04-03 12:52:38 -07:00
Sebastien Boeuf
e98f9305ad virtcontainers: kata_agent: Rollback when createContainer fails
In case the container creation fails, we need a proper rollback
regarding the mounts previously performed.

Fixes #135

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-04-03 11:41:45 -07:00
James O. D. Hunt
dcfc74471c scripts: Quote variables in hypervisor script
Double-quote the qemu version variables in the hypervisor configuration
script.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-03 17:35:51 +01:00
James O. D. Hunt
90ce6d888a scripts: Add extra hypervisor config script option check
Add a check on the element (configure option).

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-03 17:35:51 +01:00
James O. D. Hunt
491780d6c2 scripts: extra hypervisor config script entry checks
Add more checks for each entry.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-03 17:35:49 +01:00
Sebastien Boeuf
788664809f virtcontainers: container: Rollback when createContainer fails
In case the container creation fails, we need a proper rollback
regarding the mounts and hotplugs previously performed.

This patch also rework the hotplugDrive() function in order to
prevent createContainer() function complexity to exceed 15.

Fixes #135

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-04-03 09:28:34 -07:00
James O. D. Hunt
8cd0d9f0db scripts: Add hypervisor config script comment
Add an explanatory comment to the hypervisor configuration script.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-03 15:35:39 +01:00
James O. D. Hunt
a082b9ee24 scripts: Add extra check to hypervisor config script
Check the specified tag in `check_tag()` to ensure it is not blank
(which is invalid).

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-03 15:35:39 +01:00
James O. D. Hunt
ef16fd26e0 scripts: Re-add tags for hypervisor config script
PR #12 inadvertently removed the required tags for two of the qemu
config options.

Fixes #13.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-03 15:35:36 +01:00
James O. D. Hunt
99a97f74ca scripts: Add qemu version details to hypervisor script
Set the qemu major and minor version variables in the hypervisor
configuration script.

Partially fixes #13.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-03 15:35:30 +01:00
Eric Ernst
75235a8ae4
Merge pull request #141 from WeiZhang555/remove-legacy-go-imports
virtcontainers: remove legacy dependencies
2018-04-02 10:47:13 -07:00
Archana Shinde
204e40297c cli: Add configuration option for io-threads.
Add option to configure if IO needs to be in a separate IO thread.
Add tests to verify option is correctly parsed. The default value
is set to false for now.
This should be considered to be enabled by default in the future.

Fixes #132

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-04-02 10:14:04 -07:00
Zhang Wei
f0690e4c70 virtcontainers: remove legacy dependencies
Fixes #140

`virtcontainers` had been moved from `github.com/containers/virtcontainers` to
`github.com/kata-containers/runtime/virtcontainers`, so we should remove legacy dependencies
of `github.com/containers/virtcontainers` from go imports and vendors.

Also some documents need to be modified.

Note: vendor is updated with `dep` tool with following command:
`$ dep ensure -update github.com/containers/virtcontainers`

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2018-04-02 18:58:06 +08:00
Archana Shinde
82e42b5dc5 qemu: iothreads: Add iothread support for scsi
Add a hypervisor configuration to specify if IO should
be handled in a separate thread. Add support for iothreads for
virtio-scsi for now. Since we attach all scsi drives to the
same scsi controller, all the drives will be handled in a separate
IO thread which would still give better performance.

Going forward we need to assess if adding more controllers and
attaching iothreasds to each of them with distributing drives
among teh scsi controllers should be done, based on more performance
analysis.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-03-30 17:52:20 -07:00
Archana Shinde
09c5bbd2dc vendor: Vendor github.com/intel/govmm
Vendor package for pulling in changes related to support
for iothreads with virtio-scsi.

Shortlog for govmm:

9130f37 scsi: Allow scsi controller to associate with an IO thread.
a54de18 iothread: Add ability to configure iothreads

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-03-29 10:47:56 -07:00
Graham Whaley
6ac1958c90
Merge pull request #121 from sboeuf/exec_process
exec: Allow to exec a process on a ready container
2018-03-29 17:56:59 +01:00
Sebastien Boeuf
aa469f4573 exec: Allow to exec a process on a ready container
If a container is not running, but created/ready instead, this means
a container process exists and that we can actually exec another
process inside this container. The container does not have to be
in running state.

Fixes #120

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-03-29 08:40:44 -07:00
Eric Ernst
9a7813e9ea
Merge pull request #126 from jodh-intel/run-central-go-test-script
CI: Use central go test script
2018-03-29 08:37:01 -07:00
Eric Ernst
a69c49398a
Merge pull request #131 from sboeuf/fix_crio_err
virtcontainers: Do not rollback by deleting container or pod
2018-03-29 08:36:05 -07:00
Graham Whaley
d2835557a1
Merge pull request #119 from chavafg/topic/qemu2-11
qemu: Move to qemu 2.11
2018-03-29 09:42:09 +01:00
Sebastien Boeuf
5a57b52c64 virtcontainers: Do not rollback by deleting container or pod
In case a consumer of virtcontainers tries to start/stop a container,
or stop a pod, and for some reasons, this fails, virtcontainers always
tries to delete everything related to the container or the pod before
it returns the error.

The caller of the runtime is the one responsible for cleaning things
up if something goes wrong, that's why this cleanup call is never
needed.

A real example of that is the case of cc-runtime and CRI-O, where this
cleanup prevented CRI-O from retrieving proper state of the container
after the failure, leading to the inability to stop and remove the
container and the VM afterwards.

Fixes #87

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-03-28 17:12:12 -07:00
Salvador Fuentes
10c38aeebf qemu: Move to qemu 2.11
This commit modifies version.yaml to now point to the qemu
2.11 stable version.
It modifies the default QEMU_CMD to be qemu-system-x86_64
instead of qemu-lite-system-x86_64.
And modifies virtcontainers unit tests to now point to the
correct QEMU_CMD.

Fixes: #118.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2018-03-28 17:23:05 -06:00
Julio Montes
2079f90290
Merge pull request #12 from chavafg/topic/remove-static-option
qemu: does not use --disable-static for qemu 2.11
2018-03-28 17:28:47 -05:00
Salvador Fuentes
fb59a2b966 qemu: does not use unsupported flags for qemu 2.11
Qemu 2.11 does not support --disable-static flag and
--enable-strip flag, this patch adds a condition
to only use it for qemu 2.7 or older.

Fixes: #11.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2018-03-28 16:23:38 -06:00
Salvador Fuentes
c4f922dc2c
Merge pull request #123 from sboeuf/fix_k8s
virtcontainers: Don't ignore container mounts based on their path
2018-03-28 13:20:11 -06:00
Sebastien Boeuf
2118e5f74b
Merge pull request #10 from chavafg/topic/qemu-config
qemu: Add script to generate hypervisor configure options.
2018-03-28 12:05:56 -07:00
Eric Ernst
2ac900f2d8
Merge pull request #41 from jodh-intel/fix-dev-guide-runtime-link
docs: Fix runtime link in dev guide
2018-03-28 11:07:39 -07:00