Commit Graph

15384 Commits

Author SHA1 Message Date
Nitesh Konkar
727a16d468 dev-guide: Fix minor typos
Fix minor typos in the development guide.

Fixes #53.

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2018-04-16 20:58:22 +05:30
Eric Ernst
8088a62805
Merge pull request #209 from sboeuf/fix_unit_tests
virtcontainers: Fix unit tests
2018-04-16 07:24:40 -07:00
Eric Ernst
d03837fc9f
Merge pull request #45 from bergwolf/initrd
dev-guide: add guide to build and setup initrd image
2018-04-16 07:12:29 -07:00
Sebastien Boeuf
92577c635f virtcontainers: Properly end up go routines using channels
Those different files were all calling into a go routine that was
eventually reporting some result through a go channel. The problem
was the way those routine were implemented, as they were hanging
around forever. Indeed, nothing was actually listening to the channel
in some cases, and those routines never ended.

This was one of the problem detected by the fact that our unit tests
needed more time to pass because when they were all run in parallel,
the resources consumed by those routines were increasing the time
for other tests to complete.

Fixes #208

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-04-13 16:01:00 -07:00
Sebastien Boeuf
2c3cfed608 virtcontainers: mock: Properly end cc_proxy_mock goroutines
Because of the bad design of the cc_proxy_mock go routine, we were
leaving an infinite loop running into this go routine behind. This
was consuming a lot of resources and it was obviously slowing down
the tests being run in parallel. That's one of the reason we were
hitting the 10 seconds timeout when running go tests.

Fixes #208

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-04-13 15:58:08 -07:00
Sebastien Boeuf
feade98473 virtcontainers: Fix unit tests relying on noopShim
When using noopShim type from the unit tests, we were ending up
getting a PID 1000, and when checking if the shim was around, we
were always expecting the shim to be "not running", based on the
fact that the process was not there anymore. Unfortunately, this
was a very wrong assumption because we cannot control which PIDs
are running or not on the system. The way to simplify this is to
return a PID 0 in case of noopShim, processed as a special case
by the function waitForShim().

Fixes #208

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-04-13 15:22:22 -07:00
Archana Shinde
b4cd380293
Merge pull request #20 from jodh-intel/github-issue-template
github: Add issue template
2018-04-13 15:00:22 -07:00
Jose Carlos Venegas Munoz
d0085e8edf
Merge pull request #14 from jodh-intel/fix-config-hypervisor-script
scripts: Re-add tags for hypervisor config script
2018-04-13 12:03:34 -05:00
Eric Ernst
ad5669f781
Merge pull request #205 from devimc/constraints/CPU
virtcontainers: kata_agent: apply CPU constraints
2018-04-13 09:03:19 -07:00
Julio Montes
0f9defd6e2
Merge pull request #91 from devimc/cpu/fixRaceCondition
virtcontainers: agent: fix CPU hot plug race condition
2018-04-13 10:04:33 -05:00
Julio Montes
f88086fcfa
Merge pull request #183 from chavafg/topic/update-crio-version
versions: Update CRI-O version
2018-04-13 09:55:38 -05:00
Salvador Fuentes
0ae16176a4 versions: Update CRI-O version
This change updates to latest version from CRI-O
of the 1.9 branch.
This will allow us to unskip a test from the
CRI-O ctr.bats test file.

Fixes: #182.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2018-04-13 07:48:07 -05:00
Julio Montes
da6d284fbb vendor: update kata-containers agent
This new version of kata-containers agent includes
the fix for CPU hotplug race condition

Shortlog:
131554d network: specify netlink protocol
49f01ed protocols/grpc: fix CPU hotplug race condition
ee7850d mockreaper: implement mock reaper
9f60034 reaper: implement reaper interface

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-04-13 07:05:23 -05:00
Julio Montes
8c9c7ddef8 virtcontainers: agent: fix CPU hot plug race condition
Communicate to the agent the number of vCPUs that were hot added,
allowing to the agent wait for the creation of all vCPUs.

fixes #90

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-04-13 07:05:23 -05:00
Sebastien Boeuf
9db9b286e3
Merge pull request #200 from bergwolf/rename
runtime: rename pod to sandbox
2018-04-13 01:11:13 -07:00
Peng Tao
6107694930 runtime: rename pod to sandbox
As agreed in [the kata containers API
design](https://github.com/kata-containers/documentation/blob/master/design/kata-api-design.md),
we need to rename pod notion to sandbox. The patch is a bit big but the
actual change is done through the script:
```
sed -i -e 's/pod/sandbox/g' -e 's/Pod/Sandbox/g' -e 's/POD/SB/g'
```

The only expections are `pod_sandbox` and `pod_container` annotations,
since we already pushed them to cri shims, we have to use them unchanged.

Fixes: #199

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-13 09:32:51 +08:00
Julio Montes
a4c0827bea virtcontainers: kata_agent: apply CPU constraints
The runtime already hot added the number of vCPUs needed by each container,
in order to have a better control over those resources, CPU constraints
must be applied.

fixes #203

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-04-12 16:05:10 -05:00
Sebastien Boeuf
ca25177ac1
Merge pull request #138 from amshinde/block-volumes
volumes: Attach volumes that are block device files as block devices
2018-04-12 13:01:00 -07:00
Archana Shinde
ed1078c800 volumes: Attach volumes that are block device files as block devices
Check if a volume passed to the container with -v is a block device
file, and if so pass the block device by hotplugging it to the VM
instead of passing this as a 9pfs volume. This would give us
better performance.

Add block device associated with a volume to the list of
container devices, so that it is detached with all other devices
when the container is stopped with detachDevices()

Fixes #137

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-04-11 12:24:12 -07:00
Sebastien Boeuf
f74f61e8d1
Merge pull request #191 from amshinde/handle-shm-mount
virtcontainers: Do not pass /dev/shm as 9p mount
2018-04-10 14:38:41 -07:00
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
9cf8ce6c6d
Merge pull request #15 from amshinde/pass-addr-bridge
qemu: Add qemu parameter for PCI address for a bridge.
2018-04-03 12:21:35 -07:00
Archana Shinde
30aeacb89e qemu: Add qemu parameter for PCI address for a bridge.
We need to be able to specify the PCI slot for a bridge while
adding it.
Add test to verify bridge is correctly added.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-04-03 12:10:02 -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