Commit Graph

7471 Commits

Author SHA1 Message Date
zhanghj
d1bc409d57 osbuilder: avoid to copy versions.txt which already deprecated
Currently the versions.txt in rootfs-builder dir is already removed,
so avoid to copy it in list of helper files.

Fixes: #3267

Signed-off-by: zhanghj <zhanghj.lc@inspur.com>
2021-12-17 17:23:05 +08:00
Steve Horsman
39cf2b27c1
Merge pull request #3261 from stevenhorsman/native-agent-config-opt
agent: Add config file option to cli
2021-12-16 10:00:56 +00:00
Eric Ernst
3865a1bcf6
Merge pull request #2918 from egernst/update-container-type-handling
update container type handling
2021-12-15 10:41:23 -08:00
Eric Ernst
32d62c85c2
Merge pull request #3195 from jodh-intel/docs-update-architecture
docs: Update architecture document
2021-12-15 09:25:20 -08:00
James O. D. Hunt
51bf98073d docs: Update architecture document
Refresh the content and formatting of the architecture document.

Out of scope of these changes:

- Diagram updates.
- Updates to the Networking section.

Fixes: #3190.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-12-15 10:46:46 +00:00
Jakob Naucke
a40e4877e9
Merge pull request #3266 from liubin/fix/3265-update-golang-to-1.16-and-remove-ioutil
runtime: update golang to 1.16 and remove ioutil package
2021-12-15 10:09:23 +01:00
Eric Ernst
7a989a8333 runtime: api-test: fixup
not clear why this was commented out before -- ensure that we set
approprate annotation on the sandbox container's annotations to indicate
this is a sandbox.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2021-12-14 18:55:18 -08:00
Eric Ernst
52f79aef91 utils: update container type handling
Today we assume that if the CRI/upper layer doesn't provide a container
type annotation, it should be treated as a sandbox. Up to this point, a
sandbox with a pause container in CRI context and a single container
(ala ctr run) are treated the same.

For VM sizing and container constraining, it'll be useful to know if
this is a sandbox or if this is a single container.

In updating this, we cleanup the type handling tests and we update the
containerd annotations vendoring.

Fixes: #2926

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2021-12-14 17:59:19 -08:00
bin
5b002f3c88 docs: change io/ioutil to io/os packages
Change io/ioutil to io/os packages because io/ioutil package
is deprecated from 1.16:

TempDir => os.MkdirTemp

Details: https://go.dev/doc/go1.16#ioutil

Fixes: #3265

Signed-off-by: bin <bin@hyper.sh>
2021-12-15 07:31:57 +08:00
bin
03546f75a6 runtime: change io/ioutil to io/os packages
Change io/ioutil to io/os packages because io/ioutil package
is deprecated from 1.16:

Discard => io.Discard
NopCloser => io.NopCloser
ReadAll => io.ReadAll
ReadDir => os.ReadDir
ReadFile => os.ReadFile
TempDir => os.MkdirTemp
TempFile => os.CreateTemp
WriteFile => os.WriteFile

Details: https://go.dev/doc/go1.16#ioutil

Fixes: #3265

Signed-off-by: bin <bin@hyper.sh>
2021-12-15 07:31:48 +08:00
Jakob Naucke
70274b9d39
Merge pull request #3258 from fidencio/wip/kata-deploy-count-with-a-non-existend-containerd-config-file
kata-deploy: Deal with empty containerd conf file
2021-12-14 20:14:41 +01:00
Bin Liu
6c34446f49
Merge pull request #3244 from bergwolf/reorg-code
src: reorg source code directory
2021-12-14 21:57:07 +08:00
bin
24a530ced1 versions: bump minimum golang version to 1.16.10
According to https://endoflife.date/go golang 1.11.10 is not supported
anymore, 1.16.10 is the minimum supported version.

Fixes: #3265

Signed-off-by: bin <bin@hyper.sh>
2021-12-14 17:03:53 +08:00
Tim Zhang
4f96ea4e2b
Merge pull request #3257 from liubin/fix/3256-show-usage-if-no-arguments-specified
osbuilder: show usage if no options/arguments specified
2021-12-14 11:41:06 +08:00
Peng Tao
7c4263b3e1 src: reorg source directories
To make the code directory structure more clear:

└── src
    ├── agent
    ├── libs
    │   └── logging
    ├── runtime
    ├── runtime-rs (to be added)
    └── tools
        ├── agent-ctl
        └── trace-forwarder

Fixes: #3204
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2021-12-14 10:30:08 +08:00
stevenhorsman
1a34fbcdbd agent: Add config file option to cli
- Add option to pass in config with -c/--config

Fixes: #3252

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-12-13 21:57:23 +00:00
Bo Chen
9d13d1b208
Merge pull request #3263 from likebreath/1213/clh_v20.1
Upgrade to Cloud Hypervisor v20.1
2021-12-13 12:51:27 -08:00
Bo Chen
bbfb10e169 versions: Upgrade to Cloud Hypervisor v20.1
This is a bug release from Cloud Hypervisor addressing the following
issues: 1) Networking performance regression with virtio-net; 2) Limit
file descriptors sent in vfio-user support; 3) Fully advertise PCI MMIO
config regions in ACPI tables; 4) Set the TSS and KVM identity maps so
they don't overlap with firmware RAM; 5) Correctly update the DeviceTree
on restore.

Details can be found: https://github.com/cloud-hypervisor/cloud-hypervisor/releases/tag/v20.1

Fixes: #3262

Signed-off-by: Bo Chen <chen.bo@intel.com>
2021-12-13 10:09:44 -08:00
Fabiano Fidêncio
8457150684 kata-deploy: Deal with empty containerd conf file
As containerd can properly run without having a existent
`/etc/containerd/config.toml` file (it'd run using the default
cobnfiguration), let's explicitly create the file in those cases.

This will avoid issues on ammending runtime classes to a non-existent
file.

Fixes: #3229

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Tested-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-12-13 11:20:22 +01:00
bin
3f7cf7ae67 osbuilder: show usage if no options/arguments specified
Now if no options/arguments specified, the shell scripts will return an error:

ERROR: Invalid rootfs directory: ''

This commit will show usage if no options/arguments specified.

Fixes: #3256

Signed-off-by: bin <bin@hyper.sh>
2021-12-13 16:10:55 +08:00
Bin Liu
978b13c9e8
Merge pull request #3235 from Kvasscn/kata_dev_image_builer_help
image_build: add help info for '-f' option and 'BLOCK_SIZE' env.
2021-12-09 22:55:24 +08:00
Julio Montes
70062e1563
Merge pull request #3238 from snir911/wip/build_with_runtime
osbuilder: be runtime consistent with podman build
2021-12-09 08:06:00 -06:00
Fabiano Fidêncio
c868172510
Merge pull request #3222 from Jakob-Naucke/apk-static
osbuilder: Revert to using apk.static for Alpine
2021-12-09 13:33:35 +01:00
Fabiano Fidêncio
602d87295b
Merge pull request #3226 from liubin/fix/3193-fill-hypervisorconfig
runtime/template: Handling new attributes for hypervisor config
2021-12-09 13:29:23 +01:00
Snir Sheriber
2ebaaac73d osbuilder: be runtime consistent also with podman build
Use the same runtime used for podman run also for the podman build cmd
Additionally remove "docker" from the docker_run_args variable

Fixes: #3239
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
2021-12-09 11:28:16 +02:00
Fabiano Fidêncio
251be90dc0
Merge pull request #3241 from devimc/2021-12-06/fixCheckMarkdown
docs: fix check-markdown test
2021-12-09 08:16:57 +01:00
Julio Montes
f310369698 docs: fix check-markdown test
Unit-Test-Advice.md was moved to kata-containers repo but URLs pointing
to that document were not updated. This patch updates these URLs.

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

fixes #3240

Signed-off-by: Julio Montes <julio.montes@intel.com>
2021-12-08 14:38:12 -06:00
Jakob Naucke
2204ecac39
versions: Upgrade Alpine, using minor version
- Upgrade Alpine guest rootfs to 3.15
- Specify a minor version rather than patch level as the Alpine
  repositories use that.

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-12-08 15:18:44 +01:00
Jakob Naucke
dfd0732ff9
osbuilder: Revert to using apk.static for Alpine
#2399 partially reverted #418, missing on returning to bootstrapping a
rootfs with `apk.static` instead of copying the entire root, which can
result in drastically larger (more than 10x) images. Revert this as well
(requires some updates to URL building).

Fixes: #3216
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-12-08 15:18:43 +01:00
zhanghj
6b3e4c212c image_build: add help info for '-f' option and 'BLOCK_SIZE' env.
The help information of '-f' option is missing, and same issue
with 'BLOCK_SIZE' env variables, fix it in usage() function.

Fixes: #3231

Signed-off-by: zhanghj <zhanghj.lc@inspur.com>
2021-12-08 17:33:07 +08:00
Chelsea Mafrica
7522109abc
Merge pull request #3218 from liubin/fix/3217-fix-span-name
runtime: correct span name for stopSandbox function
2021-12-07 16:36:14 -08:00
Julio Montes
712c5ac6ba
Merge pull request #3220 from liubin/fix/3219-stop-virtiofsd-when-needed
runtime: only call stopVirtiofsd when shared_fs is virtio-fs
2021-12-07 07:51:08 -06:00
bin
b92babf91b runtime/template: Handling new attributes for hypervisor config
Some new attributes are added to hypervisor config:
- VMStorePath
- RunStorePath
- SharedPath

These attributes should be handled in two places:

- reset when check the new hypervisor's config is suitable
  to the base config.
- copy from new hypervisor's config when create new VM

Fixes: #3193

Signed-off-by: bin <bin@hyper.sh>
2021-12-07 19:31:03 +08:00
Fabiano Fidêncio
1a7fcd0583
Merge pull request #3211 from devimc/2021-11-06/snap/readVerFromYaml
snap: read initrd and image distros from version.yaml
2021-12-07 09:07:10 +01:00
bin
40bd34caaf runtime: only call stopVirtiofsd when shared_fs is virtio-fs
If shared_fs is set to virtio-9p, the virtiofsd is not started,
so there is no need to stop it.

Fixes: #3219

Signed-off-by: bin <bin@hyper.sh>
2021-12-07 16:06:26 +08:00
bin
33f343ee08 runtime: correct span name for stopSandbox function
Normally the span name should be the same as function
name, so chagne `StopVM` to `stopSandbox`.

Fixes: #3217

Signed-off-by: bin <bin@hyper.sh>
2021-12-07 15:59:18 +08:00
Fabiano Fidêncio
e091409404
Merge pull request #3213 from Jakob-Naucke/ppc64le-s390x-ubuntu-initrd
versions: Use Ubuntu initrd for non-musl archs
2021-12-06 22:52:53 +01:00
Jakob Naucke
d7cc952cb1
versions: Use Ubuntu initrd for non-musl archs
ppc64le & s390x have no (well supported) musl target for Rust,
therefore, the agent must use glibc and cannot use Alpine. Specify
Ubuntu as the distribution to be used for initrd.

Fixes: #3212
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-12-06 17:13:38 +01:00
Julio Montes
ff929fc081 snap: read initrd and image distros from version.yaml
Build initrd or image rootfs using the distro name specified
in the versions.yaml

fixes #3208

Signed-off-by: Julio Montes <julio.montes@intel.com>
2021-12-06 08:42:07 -06:00
Bin Liu
ce75785d87
Merge pull request #3197 from Bevisy/main-3196
packaging: Fix missing commit message in building kata-runtime
2021-12-06 11:37:29 +08:00
Binbin Zhang
8fae263170 packaging: Fix missing commit message in building kata-runtime
add `git` package to the shim-v2 build image

Fixes: #3196

Signed-off-by: Binbin Zhang <binbin36520@gmail.com>
2021-12-04 11:59:59 +08:00
Eric Ernst
c14080fd08
Merge pull request #3200 from likebreath/1203/upgrade_openapi_generator
virtcontainers: clh: Upgrade to openapi-generator v5.3.0
2021-12-03 14:15:51 -08:00
Bo Chen
995300260e virtcontainers: clh: Upgrade to openapi-generator v5.3.0
The latest release of openapi-generator v5.3.0 contains the fix for
`dropping err` bug [1]. This patch also re-generated the client code of
Cloud Hypervisor to have the bug fixed.

[1] https://github.com/OpenAPITools/openapi-generator/pull/10275

Fixes: #3201

Signed-off-by: Bo Chen <chen.bo@intel.com>
2021-12-03 08:55:38 -08:00
Carlos Venegas
d02a0932d6
Merge pull request #3173 from liubin/fix/3172
agent: user container ID as watchable storage key for hashmap
2021-12-03 09:35:32 -06:00
Fabiano Fidêncio
3fdc97e110
Merge pull request #3183 from fengwang666/nonroot-vhost-bug-fix
runtime: enable vhost-net for rootless hypervisor
2021-12-03 10:42:50 +01:00
Bin Liu
86d9d2eed5
Merge pull request #3169 from Kvasscn/kata_dev_add_install_go_help
packaging: add help information for '-f' option in install_go.sh
2021-12-03 14:39:05 +08:00
Feng Wang
b3bcb7b251 runtime: enable vhost-net for rootless hypervisor
vhost-net is disabled in the rootless kata runtime feature, which has been abandoned since kata 2.0.
I reused the rootless flag for nonroot hypervisor and would like to enable vhost-net.

Fixes #3182

Signed-off-by: Feng Wang <feng.wang@databricks.com>
2021-12-02 21:55:31 -08:00
Bin Liu
4b57548838
Merge pull request #3181 from egernst/topic/clean-lint
Cleanup some unused variables, definitions
2021-12-03 11:06:42 +08:00
Eric Ernst
7cb7b9d5ba agent: remove unused field in mount handling
In our parsing of mountinfo, majority of the fields are unused.
Let's stop saving these.

Fixes: #3180

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2021-12-02 17:03:46 -08:00
Eric Ernst
f6ae15826e agent: drop unused fields from network
We don't utilize routes or inteface vectors. Let's drop them.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2021-12-02 17:03:41 -08:00