Commit Graph

5934 Commits

Author SHA1 Message Date
David Gibson
7e92831c7a protocols: Update PCI path names / terminology in agent protocol def
Now that we have types to represent PCI paths on both the agent and
runtime sides, we can update the protocol definitionto use clearer
terminology.

Note that this doesn't actually change the agent protocol, because it just
renames a field without changing its field ID or type.

While we're there fix a trivial rustfmt error in
src/agent/protocols/build.rs

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-02-19 09:56:08 +11:00
David Gibson
8e5fd8ee84 runtime: Introduce PciSlot and PciPath types
This is a dedicated data type for representing PCI paths, that is, PCI
devices described by the slot numbers of the bridges we need to reach
them.

There are a number of places that uses strings with that structure for
things.  The plan is to use this data type to consolidate their
handling.  These are essentially Go equivalents of the pci::Slot and
pci::Path types introduced in the Rust agent.

Forward port of
185b3ab044

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-02-19 09:56:05 +11:00
David Gibson
7464d055a7 agent: PCI path type
Introduce a Rust type to represent a "PCI path" - that is a way of
locating a PCI device from a given root by listing the slots of all
the bridges leading to it and finally the slot of the device itself.

It's implemented as a vector of the previously added pci::Slot type,
and includes the necessary validation and conversions to/from strings.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-02-19 09:54:53 +11:00
David Gibson
b22259ad9b agent: PCI slot type
Add a Rust type for representing a PCI slot on a single bus.  This is
essentially just an integer from 0..31 (inclusive), but includes the
code for converting from integers with appropriate validation and
formatting back to a string.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-02-19 09:54:53 +11:00
David Gibson
8c2f9e6949 gitignore: Ignore *~ editor backup files
We ignore some other formats for backup files, but add this one, used by
emacs.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-02-19 09:54:53 +11:00
James O. D. Hunt
a4e367506d
Merge pull request #1428 from cmaf/fix-shimv2-configpath
runtime: Create tracer later in shimv2
2021-02-18 16:04:36 +00:00
Chelsea Mafrica
a44b27291c runtime: Create tracer later in shimv2
Remove loading of configuration from New() because we do not know the
correct configuration file for the runtime until Create() and so that it
is not loaded more than once. Start tracer in create() so that it is
created after the runtime config is loaded in its original location.

Fixes #1411

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-02-17 19:45:48 -08:00
Fupan Li
6eba265734
Merge pull request #1407 from mxpv/json
Agent: OCI hooks return malformed json
2021-02-18 11:36:49 +08:00
Eric Ernst
0a9cc357c6
Merge pull request #1394 from egernst/custom-registry
osbuilder: Allow image registry to be customizable
2021-02-17 17:48:02 -08:00
Eric Ernst
49bdbac606 osbuilder: Allow image registry to be customizable
Give the user chance to specify their own registry in event the default
provided are not accessible, desirable.

Fixes: #1393

Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
2021-02-17 16:49:58 -08:00
GabyCT
be83b739df
Merge pull request #1414 from GabyCT/topic/updatelicensing
docs: Update licensing strategy to use kata 2.0 repository
2021-02-17 14:50:58 -06:00
Eric Ernst
78a5958a81
Merge pull request #1402 from egernst/clh-hooks
runtime: clh-config: add runtime hooks to the clh toml
2021-02-17 12:49:58 -08:00
Gabriela Cervantes
fdc573d500 docs: Update licensing strategy to use kata 2.0 repository
This PR updates the licensing strategy document to use the proper
tests repository for kata 2.0

Fixes #1413

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2021-02-15 11:10:01 -06:00
Eric Ernst
2e2749ad3f runtime: clh-config: add runtime hooks to the clh toml
Today hooks are only described in the QEMU toml. This shouldn't be VMM
specific -- let's make sure these are advertised for Cloud Hypervisor as
well.

Fixes: #1401

Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
2021-02-14 20:26:02 -08:00
Julio Montes
e830192fca
Merge pull request #1387 from devimc/2021-02-09/FixSnapCI
Fix Snap CI
2021-02-12 10:27:28 -06:00
Julio Montes
ef72926beb ci: snap: run snap CI on every pull request
Make sure a pull request doesn't break the snap packages,
run snap CI on every pull request.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2021-02-12 09:18:45 -06:00
Julio Montes
919d51274d snap: fix kernel setup
kernel setup fails when `yes "n"` is used and `make oldconfig` doesn't
read anything from STDIN, `yes "n"` was added in the past as a
workaround to fix incomplete kernel configs.
Enable `build-kernel.sh` debug.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2021-02-12 09:16:09 -06:00
Julio Montes
d054841430 ci: snap: build targets that not need sudo first
`sudo` is required to build the image, once the image has been built
the permission of some directories may change, let's build first the
targerts that not need `sudo`

Signed-off-by: Julio Montes <julio.montes@intel.com>
2021-02-12 09:05:42 -06:00
Julio Montes
a115338ddd ci: snap: define proxy variables
define proxy variables before using them to fix `unbound variable`
error

fixes #1386

Signed-off-by: Julio Montes <julio.montes@intel.com>
2021-02-12 09:05:42 -06:00
Bo Chen
14bb24e4ca
Merge pull request #1406 from egernst/fix-ctr-cpuset
runtime: cpuset: when creating container, don't pass cpuset details
2021-02-11 22:31:44 -08:00
Maksym Pavlenko
df14d386a5 Agent: OCI hooks return malformed json
This PR fixes wrong serialization of OCI state object.
OCI hooks end up with a JSON string with double quotes in `state` field.

This happens because of confusion `Debug` and `Display` traits. Debug trait
returns a string representation with double quotes.

Ideally we should not use Debug as a part of serialization process, so a bit
more safer fix would be to move container states to `oci` crate and simply
disallow wrong values in that field.

`ContainerState` in go spec: https://github.com/opencontainers/runtime-spec/blob/master/specs-go/state.go#L4

Fixes: #1404

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-02-11 19:02:41 -08:00
Eric Ernst
3721351324 runtime: cpuset: when creating container, don't pass cpuset details
Today we only clear out the cpuset details when doing an update call on
existing container/pods. This works in the case of Kubernetes, but not
in the case where we are explicitly setting the cpuset details at boot
time. For example, if you are running a single container via docker ala:

docker run --cpuset-cpus 0-3 -it alpine sh

What would happen is the cpuset info would be passed in with the
container spec for create container request to the agent. At that point
in time, there'd only be the defualt number of CPUs available in the
guest (1), so you'd be left with cpusets set to 0. Next, we'd hotplug
the vCPUs, providing 0-4 CPUs in the guest, but the cpuset would never
be updated, leaving the application tied to CPU 0.

Ouch.

Until the day we support cpusets in the guest, let's make sure that we
start off clearing the cpuset fields.

Fixes: #1405

Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
2021-02-11 17:38:15 -08:00
Fabiano Fidêncio
96196e102e
Merge pull request #1396 from dgibson/pointtopoint
agent: Remove bogus check from list_interfaces() unit test
2021-02-11 09:06:01 +01:00
David Gibson
c9c7c12440 agent: Remove bogus check from list_interfaces() unit test
The unit test for list_interfaces() checks that the hardware address
returned for each interface has non-zero length.  However, that need not be
the case.  Point-to-point devices, such as ppp, or tun devices in certain
configurations may not have a hardware address, which is represented as
a zero length address here.

This happens on my machine with a tun0 device created by OpenVPN.

fixes #1377

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-02-11 15:09:10 +11:00
Eric Ernst
cb6d2f3c40 osbuilder: alphabetize fields
Let's go ahead and list the usage info / fields in alphabetical order!

Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
2021-02-10 12:39:10 -08:00
Fabiano Fidêncio
e2c8c7e603
Merge pull request #1031 from knittl/feature/kata-option-aliases
cli: Add aliases for `kata-` options
2021-02-10 16:22:13 +01:00
Fabiano Fidêncio
2009ef4872
Merge pull request #1364 from fidencio/wip/only-run-kata-deploy-test-on-pull-requests
github: Only run kata-deploy-test on pull-requests
2021-02-10 13:59:30 +01:00
Daniel Knittl-Frank
056d742c17 docs: Update documentation with new prefixless config options
Remove the old config options from the documentation and replace them
with the new form (without the redundant `kata-` prefix).

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
2021-02-10 07:55:18 +01:00
Daniel Knittl-Frank
fdcde7968a cli: use new prefixless config options in tools scripts
Update all tools/packaging scripts to prefer the new options over the
old ones (e.g. `--config` instead of `--kata-config`).

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
2021-02-10 07:55:18 +01:00
Daniel Knittl-Frank
02ee8b0b8a cli: Add aliases for kata- options
Remove `kata-` prefix from options `kata-config` and
`kata-show-default-config-paths`.

Fixes #1011

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
2021-02-10 07:55:18 +01:00
Daniel Knittl-Frank
c6bc43b697 docs: Fix broken link to fluentbit.io docs
Fix link to external website in fluentd how-to.

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
2021-02-10 07:55:18 +01:00
Julio Montes
61b448c7fb
Merge pull request #1385 from ManaSugi/change_virtiofsd_dir
docs: Fix the installation directory of virtiofsd
2021-02-09 10:49:33 -06:00
Manabu Sugimoto
20b27a16c9 docs: Fix the installation directory of virtiofsd
Change the installation directory of virtiofsd to kata-qemu.

Fixes: #1379

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2021-02-09 22:47:27 +09:00
Fabiano Fidêncio
f4fe97411e
Merge pull request #1267 from Jakob-Naucke/s390x-fix-docker-rootfs-build
osbuilder: Fix USE_DOCKER on s390x
2021-02-09 14:13:35 +01:00
Jakob-Naucke
11fe6a3552
osbuilder: Fix USE_DOCKER on s390x
- Install the required protobuf-compiler on Ubuntu
- Install correct libc Rust target (glibc on s390x)
- Do not skip Rust installation on s390x

Fixes: #1266

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-02-09 12:37:24 +01:00
bin
10f1c30f3d kata-runtime: use filepath.Join() to compose file path
Use filepath.Join() will be safer than format string directly.

Signed-off-by: bin <bin@hyper.sh>
2021-02-09 19:37:20 +08:00
Bin Liu
f4ae9c8476 docs: Update Developer-Guide.md
Add description for difference of namespace in containerd and Kuberenetes.

Co-authored-by: Eric Ernst <eric.g.ernst@gmail.com>
Signed-off-by: bin <bin@hyper.sh>
2021-02-09 19:37:14 +08:00
bin
9963428a4d docs: update document for using debug console
Delete using `kata-monitor` to use `kata-runtime exec`

Fixes: #1329

Signed-off-by: bin <bin@hyper.sh>
2021-02-09 19:37:06 +08:00
bin
44cde6e464 runtime: connect guest debug console bypass kata-monitor
Parse agent socket address by conversation to improve usability of
using guest debug console.

Fixes: #1329

Signed-off-by: bin <bin@hyper.sh>
2021-02-09 19:36:48 +08:00
Fabiano Fidêncio
d4c506f270
Merge pull request #1184 from zanetworker/add-e2e-arch-image
Add katacontainers end-to-end arch image
2021-02-09 12:26:23 +01:00
Fabiano Fidêncio
6dbc648c54
Merge pull request #1263 from Jakob-Naucke/s390x-glibc-agent
Build for glibc on s390x
2021-02-09 12:26:02 +01:00
Fabiano Fidêncio
9e2ac11086
Merge pull request #1265 from Jakob-Naucke/s390x-fix-vmlinux
packaging: Fix vmlinux kernel install on s390x
2021-02-09 11:24:04 +01:00
Fabiano Fidêncio
d6682e3168
Merge pull request #1261 from Jakob-Naucke/update-yq
ci: Upgrade to yq 3.4.1
2021-02-09 10:21:14 +01:00
Fabiano Fidêncio
548c459066
Merge pull request #1375 from fidencio/wip/fix-build-kernel
kernel: Don't fail if "experimental" dir doesn't exist
2021-02-09 10:05:54 +01:00
Bin Liu
4e6a39cd25
Merge pull request #1366 from fidencio/wip/kata-deploy-remove-mention-to-docker
kata-deploy: Remove kata-deploy-docker.sh
2021-02-09 16:11:44 +08:00
Fupan Li
5d1432210c
Merge pull request #1352 from liubin/fix/migrate-opentracing-to-opentelemetry
runtime: migrate from opentracing to opentelemetry
2021-02-09 10:18:10 +08:00
bin
3406502706 runtime: add jaeger configuration items
add configuration items in Kata Containers
configuration file to let users specify jaeger
collector address, and user/password.

Signed-off-by: bin <bin@hyper.sh>
2021-02-09 08:02:05 +08:00
Fabiano Fidêncio
fbab262f2d kernel: Don't fail if "experimental" dir doesn't exist
This directory has been automatically removed as there's no files inside
it, as part of d3c9862059

Let's improve the logic in the scripts to avoid failing in case the
"experimental" dir is not present.

Fixes: #1328

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-02-08 21:52:53 +01:00
Fupan Li
f3e9d4e7e3
Merge pull request #1373 from ManaSugi/use-rlimit-crate
rustjail: use rlimit crate
2021-02-08 23:15:37 +08:00
Manabu Sugimoto
e1dce3a369 rustjail: use rlimit crate
The current implementation of rustjail uses the specific setrlimit.
This patch uses rlimit crate for maintainability.

Fixes: #1372

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2021-02-08 18:43:56 +09:00