Commit Graph

6713 Commits

Author SHA1 Message Date
Fupan Li
eda55195fb
Merge pull request #2373 from teawater/fix_swap2
Container: Add initConfigResourcesMemory and call it in newContainer
2021-08-03 10:58:48 +08:00
Hui Zhu
e6408fe670 Container: Add initConfigResourcesMemory and call it in newContainer
The swappiness is not right if just set
io.katacontainers.container.resource.swappiness:
$ pod_yaml=pod.yaml
$ container_yaml=container.yaml
$ image="quay.io/prometheus/busybox:latest"
$ cat << EOF > "${pod_yaml}"
metadata:
  name: busybox-sandbox1
EOF
$ cat << EOF > "${container_yaml}"
metadata:
  name: busybox-killed-vmm
annotations:
  io.katacontainers.container.resource.swappiness: "100"
image:
  image: "$image"
command:
- top
EOF
$ sudo crictl pull $image
$ podid=$(sudo crictl runp $pod_yaml)
$ cid=$(sudo crictl create $podid $container_yaml $pod_yaml)
$ sudo crictl start $cid
crictl exec $cid cat /sys/fs/cgroup/memory/memory.swappiness
60

The cause of this issue is there are two elements store the resources
infomation.  They are c.config.Resources for calculateSandboxMemory and
c.GetPatchedOCISpec() for agent.
This add initConfigResourcesMemory to Container and call it in
newContainer to handle the issue.

Fixes: #2372

Signed-off-by: Hui Zhu <teawater@antfin.com>
2021-08-02 16:02:12 +08:00
Fupan Li
fdc42ca7ff
Merge pull request #2324 from jongwu/ro_nv
qemu/arm: remove nvdimm/"ReadOnly" option on arm64
2021-08-02 14:14:06 +08:00
Fupan Li
186a02593a
Merge pull request #2368 from teawater/fix_swap
Fix issue container start fail if io.katacontainers.container.resource.swap_in_bytes and memory_limit_in_bytes are not set
2021-08-02 10:08:30 +08:00
Hui Zhu
ee90affc18 newContainer: Initialize c.config.Resources.Memory if it is nil
container start fail if
io.katacontainers.container.resource.swap_in_bytes and
memory_limit_in_bytes are not set.
$ pod_yaml=pod.yaml
$ container_yaml=container.yaml
$ image="quay.io/prometheus/busybox:latest"
$ cat << EOF > "${pod_yaml}"
metadata:
  name: busybox-sandbox1
EOF
$ cat << EOF > "${container_yaml}"
metadata:
  name: busybox-killed-vmm
annotations:
  io.katacontainers.container.resource.swappiness: "60"
image:
  image: "$image"
command:
- top
EOF
$ sudo crictl pull $image
$ podid=$(sudo crictl runp $pod_yaml)
$ cid=$(sudo crictl create $podid $container_yaml $pod_yaml)
$ sudo crictl start $cid
DEBU[0000] get runtime connection
DEBU[0000] connect using endpoint
'unix:///var/run/containerd/containerd.sock' with '10s' timeout
DEBU[0000] connected successfully using endpoint:
unix:///var/run/containerd/containerd.sock
DEBU[0000] StartContainerRequest:
&StartContainerRequest{ContainerId:4fea91d16f661931fe33acd247efe831ef9e571588ba18b5a16f04c278fd61b8,}
DEBU[0000] StartContainerResponse: nil
FATA[0000] starting the container
"4fea91d16f661931fe33acd247efe831ef9e571588ba18b5a16f04c278fd61b8": rpc
error: code = Unknown desc = failed to create containerd task: failed to
create shim: ttrpc: closed: unknown

The cause of fail if if c.config.Resources.Memory is nil, values of
io.katacontainers.container.resource.swappiness and
io.katacontainers.container.resource.swap_in_bytes will be store in
newContainer.

This commit initialize c.config.Resources.Memory if it is nil in
newContainer.

Fixes: #2367

Signed-off-by: Hui Zhu <teawater@antfin.com>
2021-08-01 10:03:27 +08:00
Hui Zhu
767a41ce56 updateResources: Log result after calculateSandboxMemory
Log result after calculateSandboxMemory in updateResources.

Fixes: #2367

Signed-off-by: Hui Zhu <teawater@antfin.com>
2021-08-01 09:57:44 +08:00
GabyCT
b94252a5fa
Merge pull request #2062 from jodh-intel/add-tracing-design-proposals
docs: Add tracing proposals doc
2021-07-30 09:37:38 -05:00
Fabiano Fidêncio
0c913040b6
Merge pull request #2023 from jodh-intel/docs-rm-tocs
docs: Remove table of contents
2021-07-30 15:44:50 +02:00
Jakob Naucke
d9359440e2
Merge pull request #2361 from fidencio/wip/workflows-fix-skip-ci
static-checks: Check for the `force-skip-ci` label on each step
2021-07-30 15:07:25 +02:00
Fabiano Fidêncio
3fe6695b0a static-checks: Check for the force-skip-ci label on each step
This is not the most beautiful solution, but when do the check on every
single step we ensure the test at least started, and consequently will
succeed.

Without this the tests wouldn't even start, making any PR using the
`force-skip-ci` label not mergeable.

Fixes: #2362

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-07-30 13:51:56 +02:00
James O. D. Hunt
57b696a5ec docs: Removed mention of 1.x
All users should be running 2.x releases so remove the legacy details
since it's arguably confusing to have two sets of details.

Reworked the components listed in the main README so that rather than
being sorted alphabetically, they are now sorted in semi-order of
importance and split into two tables to make the point more clearly.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-07-30 10:58:22 +01:00
James O. D. Hunt
4f0726bc49 docs: Remove table of contents
Removed all TOCs now that GitHub auto-generates them.

Also updated the documentation requirements doc removing the requirement
to add a TOC.

Fixes: #2022.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-07-30 10:58:22 +01:00
James O. D. Hunt
f186c5e284 docs: Fix invalid URLs
Correct broken / stale URLs as detected by the CI URL checker.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-07-30 10:58:22 +01:00
James O. D. Hunt
7c610a6ff1 docs: Fix shell code
Correct the shell code in the packaging tools README to keep the CI
happy.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-07-30 10:58:22 +01:00
Fabiano Fidêncio
1d70523a59
Merge pull request #2356 from YchauWang/wyc-doc-bug-fix
docs: update the kata release url in the kata deploy document
2021-07-30 11:57:26 +02:00
wangyongchao.bj
5a0d3c4fac docs: update the kata release url in the kata deploy document
fixed the url error, updated the path to kata 2.x release
(https://github.com/kata-containers/kata-containers/releases) from kata 1.x release
(https://github.com/kata-containers/runtime/releases) in the kata-deploy README.md file.

Fixes: #2355.

Signed-off-by: wangyongchao.bj <wangyongchao.bj@inspur.com>
2021-07-30 09:50:30 +08:00
Fabiano Fidêncio
2d142bc92d
Merge pull request #2155 from jcvenegas/kata-deploy-2021-06-29
kata-deploy: Allow build  kata-deploy  tarball from HEAD
2021-07-29 22:50:03 +02:00
Fabiano Fidêncio
7ed6423dd8
Merge pull request #2347 from fidencio/wip/update-runc-and-containerd-deps
mod: unify runc and containerd dependencies
2021-07-29 22:29:06 +02:00
Peng Tao
9514dda52e mod: unity containerd dependency
The old ones are carrying CVEs, do not use them.

PS: In order to update the modules, we're running `make handle_vendor`
target from the runtime's Makefile.  This is now part of the CI and
ensures that the vendored code is up-to-date.  It's important to note
that older versions of golang may generate different results for those,
but those versions are not supported anymore, so we're good to go with
what we have in the CI (1.15 and 1.16).

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-07-29 20:51:02 +02:00
Peng Tao
6ffe37b949 mod: unify runc dependency
Since the old ones are carrying CVEs. Do not use them.

PS: In order to update the modules, we're running `make handle_vendor`
target from the runtime's Makefile.  This is now part of the CI and
ensures that the vendored code is up-to-date.  It's important to note
that older versions of golang may generate different results for those,
but those versions are not supported anymore, so we're good to go with
what we have in the CI (1.15 and 1.16).

Fixes: #2338

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-07-29 20:48:52 +02:00
GabyCT
8508e52fdc
Merge pull request #2349 from teawater/fix_vm_doc
how-to-use-virtio-mem-with-kata.md: Remove undefined ${REPORT_DIR}
2021-07-29 10:42:44 -05:00
James O. D. Hunt
5b514177b0 docs: Add tracing proposals doc
Create a document summarising the tracing design proposals
from PR #1937.

Fixes: #2061.

Signed-off-by: bin <bin@hyper.sh>
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-07-29 16:17:48 +01:00
Fabiano Fidêncio
6b2ad64aea
Merge pull request #2344 from fidencio/wip/run-static-checks-also-when-prs-are-edited-or-syncrhonized
ci: Run static checks when PRs are updated
2021-07-29 10:23:12 +02:00
Hui Zhu
b53e84054e how-to-use-virtio-mem-with-kata.md: Remove undefined ${REPORT_DIR}
Remove undefined ${REPORT_DIR} in how-to-use-virtio-mem-with-kata.md.

Fixes: #2348

Signed-off-by: Hui Zhu <teawater@antfin.com>
2021-07-29 14:50:08 +08:00
Fabiano Fidêncio
5957bc7d9c ci: Run static checks when PRs are updated
Looking at the changes that could cause the static-checks not to run
when a PR is updated I think 7db8a85a1f
could be the one that introduced such a regression.

Let's (try to) fix this by enforcing the workflow to run also when the
PR has been "edited" and "synchronized".

Fixes: #2343

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-07-28 22:26:55 +02:00
Carlos Venegas
81e6bf6f2c kata-deploy: Split shimv2 build in a separate container.
Instead of install golang in the base container, split the shimv2 build.

Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>
2021-07-28 19:45:35 +00:00
Carlos Venegas
d46ae3248e kernel: build: Add container build
Add script to build kernel in a container.

Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>
2021-07-28 19:45:35 +00:00
Carlos Venegas
b789a935cf actions: release: Use new kata-deploy scripts.
Update release action to build kata assets with new
scripts.

Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>
2021-07-28 19:45:35 +00:00
Carlos Venegas
85987c6d79 kata-deploy: Add Makefile
Add makefile to document possible options to run.

e.g
Default: Create a kata tarball, it will build assets concurrently.
```
$ make

```

Create a tarball build for cloud-hypervisor.
```
$ make cloud-hypervisor
```

Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>
2021-07-28 19:45:35 +00:00
Carlos Venegas
b9d2eea39b kata-deploy: Add script to merge kata tarballs.
After each asset is build it is needed to merge them all into one single
tarball.

Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>
2021-07-28 19:45:35 +00:00
Carlos Venegas
4895747f35 Rootfs: Add curl to alpine rootfs builder.
If alpine image is created inside a container,
it does not get any golang version data. It will try
to get it by installing yq. To install yq curl is used.

Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>
2021-07-28 19:45:35 +00:00
Carlos Venegas
fc90bb5314 Actions: Add new workflow to create static tarballs
Tarballs are generated on push and merge events.

push: Allows get a tarball from the PR and use locally.

merge: After a PR is merged we have a quick way to get latest
kata-tarball.

The tarball can be downloaded from github page only.

Fixes: #1710

Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>
2021-07-28 19:45:35 +00:00
Carlos Venegas
bbb06c4975 actions: Remove scripts from actions directory.
kata-deploy logic was moved to its own directory.

Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>
2021-07-28 19:45:35 +00:00
Carlos Venegas
2f9859ab2f build: Reuse firecracker directory on builds.
kata-deploy buider now reuses the build directory, this
makes faster rebuilds. Update firecracker builder to
not fail if is called twice.

Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>
2021-07-28 19:45:35 +00:00
Carlos Venegas
3533a5b61d Packaging: stop using GOPATH for yq.
Use the yq installed in the env.  Needed
to build kata from docker. The container builder
has not an initial Go env.

Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>
2021-07-28 19:45:35 +00:00
Carlos Venegas
0c5ded4bd7 kata-deploy: build kata only with docker in host
Add script to build kata using docker.

Allow build kata-deploy binaries using docker.
kata-deploy-binaries-in-docker.sh is a wrapper of
kata-deploy-binaries.sh it will call kata-deploy-binaries.sh in a
container with all the dependencies installed.

Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>
2021-07-28 19:45:35 +00:00
GabyCT
fe7e6a2dc1
Merge pull request #2336 from YchauWang/wyc-docs-test
docs: update url for log parser in how-to-import-kata-logs-with-fluen…
2021-07-28 10:19:56 -05:00
Julio Montes
e27733db94
Merge pull request #2334 from likebreath/0727/clh_v17.0
versions: Upgrade to Cloud Hypervisor v17.0
2021-07-28 10:18:38 -05:00
Fabiano Fidêncio
fff76d5e90
Merge pull request #2331 from Jakob-Naucke/snap-initrd-path
snap: Substitute image configuration with initrd
2021-07-28 09:44:06 +02:00
wangyongchao.bj
2ec310934a docs: update url for log parser in how-to-import-kata-logs-with-fluentd.md
fixed the log parser url to kata 2.x path
(https://github.com/kata-containers/tests/tree/main)
for the How to import Kata Containers logs into Fluentd Doc.

Fixes #2335

Signed-off-by: wangyongchao.bj <wangyongchao.bj@inspur.com>
2021-07-28 10:56:23 +08:00
GabyCT
5283f73b0c
Merge pull request #2329 from GabyCT/topic/udeveloperguide
docs: Update url for log parser in Developer guide
2021-07-27 14:00:33 -05:00
Bo Chen
cc0bb9aebc versions: Upgrade to Cloud Hypervisor v17.0
Highlights from the Cloud Hypervisor release v17.0: 1) ARM64 NUMA
support using ACPI; 2) `Seccomp` support for MSHV backend; 3) Hotplug of
macvtap devices; 4) Improved SGX support; 5) Inflight tracking for
`vhost-user` devices; 6) Bug fixes.

Details can be found: https://github.com/cloud-hypervisor/cloud-hypervisor/releases/tag/v17.0

Note: The client code of cloud-hypervisor's OpenAPI is automatically
generated by `openapi-generator` [1-2]. As the API changes do not
impact usages in Kata, no additional changes in kata's runtime are
needed to work with the current version of cloud-hypervisor.

[1] https://github.com/OpenAPITools/openapi-generator
[2] https://github.com/kata-containers/kata-containers/blob/main/src/runtime/virtcontainers/pkg/cloud-hypervisor/README.md

Fixes: #2333

Signed-off-by: Bo Chen <chen.bo@intel.com>
2021-07-27 11:56:29 -07:00
Jakob Naucke
8e9ffe6f3a
snap: Substitute image configuration with initrd
rather than removing the other line because configuration only contains
the image line ever more and this is how we already do it in tests.

Fixes: #2330
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-07-27 18:39:14 +02:00
Fupan Li
838e169b9c
Merge pull request #2248 from lifupan/check_file_exist
mount: fix the issue of missing check file exists
2021-07-27 23:29:26 +08:00
Gabriela Cervantes
8b15eafa6a docs: Update url for log parser in Developer guide
This PR updates the proper url for log parser for kata 2.x for
the Developer Guide document.

Fixes #2328

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2021-07-27 15:19:06 +00:00
Jianyong Wu
77604de80b qemu/arm: remove nvdimm/"ReadOnly" option on arm64
There is a new "ReadOnly" option added to nvdimm device in qemu
and now added to kata. However, qemu used for arm64 is a little
old and has no this feature. Here we remove this feature for arm.

Fixes: #2320
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2021-07-27 20:32:55 +08:00
Fabiano Fidêncio
9806e88963
Merge pull request #2319 from kata-containers/dependabot/go_modules/src/runtime/github.com/containerd/containerd-1.5.4
build(deps): bump github.com/containerd/containerd from 1.5.2 to 1.5.4 in /src/runtime
2021-07-27 08:49:50 +02:00
Archana Shinde
d2c7b5e782
Merge pull request #2318 from GabyCT/topic/updateread
docs: Update experimental documentation
2021-07-26 23:00:41 -07:00
Gabriela Cervantes
4fbae549e4 docs: Update experimental documentation
This PR updates the experimental documentation with the proper reference
to kata 2.x

Fixes #2317

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2021-07-26 20:29:21 +00:00
Julio Montes
1fbfd99d37
Merge pull request #2314 from Jakob-Naucke/no-agent-version
snap: do not export agent version
2021-07-26 13:14:38 -05:00