Commit Graph

1760 Commits

Author SHA1 Message Date
Hui Zhu
a1ddf53df4 Makefile: Change "GOPATH not set" to "No GO command or GOPATH not set"
The cause that make "sudo make install" fail is not "GOPATH not set",
but no go command in path.
But the commit still keep the "GOPATH not set" because
execute "unset GOPATH; make" will fail because "go build" cannot work
without GOPATH.

Fixes: #1285

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-03-01 22:47:37 +08:00
Julio Montes
d37061bf46
Merge pull request #1301 from GabyCT/topic/updateurl
doc: Fix invalid URLs
2019-03-01 08:32:01 -06:00
Penny Zheng
35672b5896 unit-test: fix undefined struct field SupportVSocks on arm64
Since arch-specific func getExpectedHostDetails holds undefined struct
field SupportVSocks on arm64, unit test TestEnvGetEnvInfoSetsCPUType,
TestEnvGetHostInfo and so on failed.
I'm trying to use generic func genericgetExpectedHostDetails on arm64
to avoid similar issues.

Fixes: #1287

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-03-01 15:13:15 +08:00
Jose Carlos Venegas Munoz
6f2597ed11
Merge pull request #1294 from egernst/vCPU-calculations-fix
virtcontainers: fix vCPU calculation errors
2019-02-28 15:53:20 -06:00
Archana Shinde
9b624d5b9b
Merge pull request #1255 from caoruidong/ipvlan-ep
Network: add ipvlan unmarshal
2019-02-28 12:18:31 -08:00
Eric Ernst
dc2650889c virtcontainers: fix vCPU calculation errors
We were grabbing a running total of quota and period for each container
and then calculating the number of resulting vCPUs. Summing period
doesn't make sense.  To simplify, let's just calculate mCPU per
container, keep a running total of mCPUs requested, and then translate
to sandbox vCPUs after.

Fixes: #1292

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-02-28 08:13:04 -08:00
Julio Montes
dbfd96583a
Merge pull request #1298 from jodh-intel/store-pkg-add-SetLogger
store: Add SetLogger API
2019-02-28 08:52:50 -06:00
James O. D. Hunt
f540a80354 store: Add SetLogger API
Add a `store.SetLogger()` API to allow the store package to log with the
standard set of fields (as expected by the log parser [1].

Fixes #1297.

---

[1] - https://github.com/kata-containers/tests/tree/master/cmd/log-parser#logfile-requirements

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-02-28 10:56:26 +00:00
Gabriela Cervantes
4357e851bf doc: Fix invalid URLs
Now that we have been moved the CI to ubuntu 18.04, we need to update the
README.

Fixes #1300

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2019-02-28 01:41:18 -06:00
Graham Whaley
975157d75b versions.yaml: add uscan annotations
Adds uscan key/values for all items with a Version field that are pulled
from a repo with version info (such as github) so we can perform
automated upstream version update checks.

Fixes: #1250

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2019-02-26 16:41:09 +00:00
Graham Whaley
e8a8e0db79
Merge pull request #1111 from sboeuf/bump_kernel
versions: Bump to kernel 4.19.24
2019-02-22 17:32:35 +00:00
Ruidong Cao
36141d27fc Network: add ipvlan unmarshal
We have 7 types of endpoints, but forget ipvlan in unmarshal funciton.
So add it and refactor for cyclomatic complexity reason.

Fixes #1254

Signed-off-by: Ruidong Cao <caoruidong@huawei.com>
2019-02-23 01:25:26 +08:00
Julio Montes
16bd983387
Merge pull request #1264 from Ace-Tang/master
cgroups: fix failed to remove sandbox cgroup
2019-02-21 13:46:06 -06:00
James O. D. Hunt
b96ca2237f
Merge pull request #1260 from stefanha/fix-vhost-user-blk-detach
devices: fix attach count for vhost-user-blk
2019-02-21 16:57:11 +00:00
Ace-Tang
454775fb97 cgroups: fix failed to remove sandbox cgroup
sandbox cgroup use V1NoConstraints, this only create memory subsystem,
but when delete, load parent cgroup always use `cgroups.V1`, so other
subsystem path can not be find, sandbox cgroup can not be deleted.

Fixes: #1263

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-02-21 17:34:34 +08:00
Peng Tao
1d79338a1a
Merge pull request #1247 from nitkon/leakyPods
qemu: Cleanup Vm paths irrespective of Sandbox stop pass/fail
2019-02-21 11:56:57 +08:00
Sebastien Boeuf
768658f61b versions: Update kernel version to 4.19.24
We need to bump the kernel version from 4.14.67 to 4.19.24 in order
to follow the recent kernel config bump.

Fixes #618
Fixes #1029

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2019-02-20 14:44:41 -08:00
GabyCT
60f7c4f401
Merge pull request #1189 from devimc/topic/fixCpuCgroup
virtcontainers: reimplement sandbox cgroup
2019-02-20 10:18:56 -06:00
Stefan Hajnoczi
46e2f885af devices: fix attach count for vhost-user-blk
Commit affd6e3216 ("devices: add reference
count for devices.") introduced an attach count for devices.  The
vhost-user-blk device increments the counter instead of decrementing it
when detaching.

Fixes: #1259
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-02-20 14:58:45 +00:00
Nitesh Konkar
6daefdb177 qemu: Cleanup Vm paths irrespective of Sandbox stop pass/fail
Sometimes qemu/qmp commands error out and VM files
get left behind on the host filesystem. Clen them up
irrespective of `stopSandbox` succeeds or fails.

Fixes: #1246

Signed-off-by: Nitesh Konkar niteshkonkar@in.ibm.com
2019-02-20 16:02:48 +05:30
Julio Montes
58d278560e virtcontainers: don't try to talk with the proxy when it's not running
To avoid long timeouts, the runtime shouldn't try to talk with the proxy
when it's not running.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-02-19 13:13:45 -06:00
Julio Montes
62c393c119 virtcontainers: change container's state to stop asap
container is killed by force, container's state MUST change its state to stop
immediately to avoid leaving it in a bad state.

fixes #1088

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-02-19 13:13:44 -06:00
Julio Montes
5201860bb0 virtcontainers: reimplement sandbox cgroup
All containers run in different cgroups even the sandbox, with this new
implementation the sandbox cpu cgroup wil be equal to the sum of all its
containers and the hypervisor process will be placed there impacting to the
containers running in the sandbox (VM). The default number of vcpus is
used when the sandbox has no constraints. For example, if default_vcpus
is 2, then quota will be 200000 and period 100000.

**c-ray test**
http://www.futuretech.blinkenlights.nl/c-ray.html

```
+=============================================+
|         | 6 threads 6cpus | 1 thread 1 cpu  |
+=============================================+
| current |   40 seconds    |   122 seconds   |
+==============================================
|   new   |   37 seconds    |   124 seconds   |
+==============================================
```

current = current cgroups implementation
new = new cgroups implementation

**workload**

```yaml
apiVersion: v1
kind: Pod
metadata:
  name: c-ray
  annotations:
    io.kubernetes.cri.untrusted-workload: "true"
spec:
  restartPolicy: Never
  containers:
  - name: c-ray-1
    image: docker.io/devimc/c-ray:latest
    imagePullPolicy: IfNotPresent
    args: ["-t", "6", "-s", "1600x1200", "-r", "8", "-i",
          "/c-ray-1.1/sphfract", "-o", "/tmp/output.ppm"]
    resources:
      limits:
        cpu: 6
  - name: c-ray-2
    image: docker.io/devimc/c-ray:latest
    imagePullPolicy: IfNotPresent
    args: ["-t", "1", "-s", "1600x1200", "-r", "8", "-i",
          "/c-ray-1.1/sphfract", "-o", "/tmp/output.ppm"]
    resources:
      limits:
        cpu: 1
```

fixes #1153

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-02-19 13:13:44 -06:00
Julio Montes
9758cdba7c virtcontainers: move cpu cgroup implementation
cpu cgroups are container's specific hence all containers even the sandbox
should be able o create, delete and update their cgroups. The cgroup crated
matches with the cgroup path passed by the containers manager.

fixes #1117
fixes #1118
fixes #1021

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-02-19 13:13:44 -06:00
Peng Tao
22cee2d0cd
Merge pull request #1220 from jcvenegas/delete-force-not-fail-non-container
delete: force: Do not fail on non exiting container
2019-02-19 12:23:51 +08:00
Jose Carlos Venegas Munoz
c78d6b057e delete: force: Do not fail on non exiting container
When a container does not exist, runc does not fail.  Lets mimic this
behavior, sometimes kuberentes will try to force delete containers that
could not be created and gets confused if delete --force fails.

Fixes: #1219

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-02-18 11:39:25 -06:00
Li Wei
731ff7b13f
Merge pull request #1242 from teawater/golock
vendor: add missing comma to Gopkg.lock
2019-02-18 20:57:47 +08:00
Hui Zhu
a136999258 vendor: Add missing comma to Gopkg.lock and dep ensure
$ dep ensure
error while parsing /home/teawater/gopath/src/github.com/kata-containers/runtime/Gopkg.lock: Unable to parse the lock as TOML: (697, 6): missing comma

Add missing comma to Gopkg.lock and dep ensure to handle the issue.

Fixes: #1241

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-02-16 22:55:39 +08:00
Graham Whaley
816ea42840
Merge pull request #1202 from Pennyzct/unit-test
Unit test: fix bugs on a few unit tests on aarch64
2019-02-15 10:26:03 +00:00
Graham Whaley
7f2b2da7f7
Merge pull request #1239 from chavafg/topic/update-k8s
versions: update k8s, cri-o and containerd
2019-02-15 09:56:03 +00:00
Salvador Fuentes
409a8a5fbb versions: update k8s, cri-o and containerd
Update:
- k8s to version 1.13.3
- cri-o to version 1.13.0
- containerd to version 1.2.4, which
  according to its release notes, uses
  cri plugin version da0c016c830b2ea97fd1d737c49a568a816bf964

Fixes: #1238.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2019-02-14 16:09:12 -06:00
Julio Montes
268ddc595f
Merge pull request #1237 from chavafg/topic/update-qemu-lite-hash
versions: Update qemu-lite hash
2019-02-14 08:17:06 -06:00
Penny Zheng
23c554ee96 unit-test: refine func TestGetCPUDetails
refine struct testData in func TestGetCPUDetails to remove redundant
/unused struct field expectedVendor and expectedModel

Fixes: #1200

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-02-14 15:14:27 +08:00
Penny Zheng
1b967a4a6a unit-test: add nolint comment to avoid unused warning
since all generic* could bring unused linter warnings, which lead to
CI crash, we add nolint comment to avoid them.

Fixes: #1200

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-02-14 14:56:42 +08:00
Penny Zheng
3ec56eaf9f runtime: add appendBridges for arm64
since generic func genericAppendBridges and genericBridges
is also applied for machine type QemuVirt, we use it as implementation
for appendBridges and bridges on aarch64.
since const defaultPCBridgeBus is used in generic func
genericAppendBridges for pc machine, we should define it once
in generic file, instead of redefining it in different
arch-specific files.

Fixes: #1200

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-02-14 14:56:42 +08:00
Penny Zheng
e93fb0b3a0 unit-test: test func for RunningOnVMM should be arch-dependent
original tests for func RunningOnVMM are sort of amd64-specific,
since all other archs don't support nested VMM for now.

Fixes: #1200

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-02-14 14:56:30 +08:00
Penny Zheng
0679f6fa59 unit-test: refine qemu_arm64_test.go
refine a set of test functions under qemu_arm64_test.go. e.g. test
func for memoryTopology shouldn't be the same one on amd64, since
for now, we don't support nvdimm on arm64.

Fixes: #1200

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-02-14 11:34:05 +08:00
Penny Zheng
44e2b9aa0a unit-test: struct TestDataa should be included in arch-indenpedent .go file
argument struct TestDataa in generic func genericTestGetCPUDetails is repeatedly
defined in almost all arch-dependent .go file, cli/kata-check_amd64_test.go,
cli/kata-check_ppc64le_test.go, etcm, except arm64. let's only declare it once in
cli/kata-check_test.go. change its name to testCPUDetail for better understanding.

Fixes: #1200

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-02-14 11:34:05 +08:00
Julio Montes
a1c85902f6 virtcontainers: add method to get hypervisor PID
hypervisor PID can be used to move the whole process and its
threads into a new cgroup.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-02-13 18:01:14 -06:00
Salvador Fuentes
c17dd11e01 versions: Update qemu-lite hash
We are using a newer hash for the packaged qemu-lite.
Update our record in versions.yaml to use the same version
in our CI.

Fixes: #1236.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2019-02-13 16:01:46 -06:00
Graham Whaley
136b188fd4
Merge pull request #1235 from nitkon/debug
virtcontainers: Improve debug messages when deleting files
2019-02-13 17:53:48 +00:00
Nitesh Konkar
a614273af5 virtcontainers: Improve debug when create/delete files
Adding debug messages which state which files
are being created/deleted could be helpful in
analyzing situations like leaky pod issues.

Fixes: #1234

Signed-off-by: Nitesh Konkar niteshkonkar@in.ibm.com
2019-02-13 20:51:33 +05:30
Graham Whaley
d07297c197
Merge pull request #1232 from jcvenegas/clear-rootfs-latest
versions: use clear linux latest rootfs.
2019-02-13 09:36:07 +00:00
Jose Carlos Venegas Munoz
84b7165e90 versions: use clear linux latest rootfs.
Update Clear Linux rootfs to latest.

Fixes: #1230

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-02-12 12:21:33 -06:00
Hui Zhu
d7b6b25059
Merge pull request #1205 from lifupan/asyncevents
shimv2: Send async task events to containerd/cri
2019-02-12 17:12:27 +08:00
Peng Tao
1c27ab79d9
Merge pull request #1225 from teawater/fixmakeinstall
Makefile: Set ARCH in GOPATH not set mode
2019-02-12 09:14:54 +08:00
Eric Ernst
6431f1f288
Merge pull request #1066 from sameo/topic/state-storage
Virtcontainers store
2019-02-11 14:42:20 -08:00
Graham Whaley
319a98fdf8
Merge pull request #1175 from nitkon/master
runtime: Do not error if only initrd/rootfs image installed
2019-02-11 17:48:49 +00:00
James O. D. Hunt
a3a3d1a53e
Merge pull request #1216 from grahamwhaley/20190206_remove_pullapprove
pullapprove: remove it
2019-02-11 10:55:07 +00:00
Hui Zhu
81c7a968ed Makefile: Set ARCH in GOPATH not set mode
In GOPATH not set mode got:
make: go: Command not found
Makefile:38: arch/-options.mk: No such file or directory
make: go: Command not found
Makefile:237: *** "ERROR: No hypervisors known for architecture  (looked for: firecracker qemu)".  Stop.

The root cause is GOPATH not set mode is not set ARCH.
Set it to fix the issue.

Fixes: #1224

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-02-11 17:06:16 +08:00