Commit Graph

1861 Commits

Author SHA1 Message Date
Jose Carlos Venegas Munoz
2591a1fb65
Merge pull request #2102 from devimc/topic/virtcontainers/fcFixSocketPerm
virtcontainers: change firecracker socket permissions
2019-10-04 09:26:50 -05:00
Eric Ernst
ba3d4f77fe
Merge pull request #2081 from amshinde/custom_annotations
Add annotations to provide custom configs
2019-10-03 18:24:59 -07:00
Eric Ernst
94906c40c3
Merge pull request #2095 from devimc/topic/virtcontainers/fixCRIOwFC
Fix CRIO + Firecracker
2019-10-03 18:24:50 -07:00
Julio Montes
8f6b0a6a41 virtcontainers: change firecracker socket permissions
For security reasons, let's make sure 'others' don't have access to the
firecracker hybrid vsock

fixes #2101

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-10-03 21:23:19 +00:00
Archana Shinde
8f70643d57 tests: Remove hardcoded annotation value.
Fix test by removing hardcoded annotation key. Use the
annotation package instead.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-10-03 11:53:18 -07:00
Archana Shinde
e7b9c36b90 tests: Add tests for annotations.
Tests verify hypervisor, runtime and agent annotations.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-10-03 10:44:44 -07:00
Archana Shinde
09129c1c13 config: Define minimum memory requirement
Introduce a constant for minimum memory requirement
in virtcontainers package, that can be used in config.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-10-03 10:44:43 -07:00
Archana Shinde
8405b56e6f annotations: add Annotations for the agent.
The annotations handle the tracing config for the agent.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-10-03 10:42:52 -07:00
Archana Shinde
5b78a8a0f8 annotations: Add annotations for runtime config
Additional annotations added to customise runtime configuration.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-10-03 10:42:52 -07:00
Archana Shinde
afb91c2e02 annotations: Add annotations to support additional configurations
Add annotation to support all hypervisor configurations.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-10-03 10:42:52 -07:00
Archana Shinde
845bf73726 annotations: Support annotations to customise kata config
Add support for annotations that allow us to custimise a subset
of the configurations provided in kata conf toml file.
This initial commit adds support for customising vcpus, default max
vcpus, memory and the kernel command line passed as Hypervisor
config.

Replaces #1695
Fixes #1655

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-10-03 10:42:52 -07:00
Archana Shinde
30d0b7add7 annotations: Add missing firmware and hashes to asset annotations
These annotations were missing from the list of what are
considered as assets. Add these to existing list.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-10-03 10:42:52 -07:00
Archana Shinde
46b68157d1 annotations: Change existing annotations to fit a new format
Change the naming schema for existing annotations from
"com.github.containers.virtcontainers" to "io.kata-containers"
The hypervisor related annotations are changed to reflect this.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-10-03 10:42:52 -07:00
Julio Montes
312f3e7234 virtcontainers/fc: implement remove device
Unmount and unassign block device when it's required, that way the disk
can be unmounted and destroyed in the host.

fixes #1966

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-10-02 17:01:11 +00:00
Julio Montes
7e9cc5690d virtcontainers/fc: improve create disk pool process
Create a raw file and bind mount it to use it as disk is not needed,
instead a the raw file can be created at the jail path and use it directly
as disk, if a new container is added the real disk/device can be bind mounted
in the raw file.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-10-02 17:01:11 +00:00
Julio Montes
07932d59ab virtcontainers/fc: add logs and improve others to make debugging easier
add more logs and improve others to make firecracker debugging less painful

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-10-02 16:56:28 +00:00
Julio Montes
ed7240b40f virtcontainers: move device operations to a more generic place
move device operations to a more generic place where they can be used
in any hypervisor implementation.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-10-02 16:56:28 +00:00
Eric Ernst
46d1957e0f
Merge pull request #1875 from gabibeyer/rootlessLogic
rootless: add rootless to kata
2019-10-01 11:17:38 -07:00
Gabi Beyer
e93bf967d2 network: Add tuntap device
The tuntap network device is for tuntap interfaces to connect
to the container. A specific use case is the slirp4netns tap
interface for rootless kata-runtime.

Fixes: #1878

Signed-off-by: Gabi Beyer <gabrielle.n.beyer@intel.com>
2019-09-26 16:17:16 +02:00
Gabi Beyer
c8dd92d5aa dep: update vendor packages for netlink commit
The netlink dep needs to be updated to get logic for the tuntap
link. It is fixing a bug that uses a generic link instead.
This also requires the golang/x/sys package to be updated
for the IFLA_* constraints.

Commits for github.com/vishvananda/netlink
    c8c507c fix: fix ip rule goto bug
    db99c04 tuntap: Return TunTapLink instead of GenericLink
    e993616 Fix unit test failure: TestNeighAddDelLLIPAddr
    fb5fbae Mirred and connmark clobber their ActionAttrs
    1187dc9 Fix tests
    00009fb Add support for TC_ACT_CONNMARK
    fafc1e7 support vlan protocol
    fd97bf4 Add command to set devlink device switchdev mode
    bcb80b2 Add devlink command by to get specific device name
    f504738 Fix function comments based on best practices from Effective Go
    e281812 Fix typos
    adb577d Add support for IFLA_GSO_*
    aa950f2 travis: run tests with Go 1.12.x
    b64d7bc travis: specify go_import_path
    b9cafe4 remove redundant type assertions in type switch
    1e2e7ab Add Support for Virtual XFRM Interfaces
    48a75e0 Fix Race Condition in TestXfrmMonitorExpire
    e37f4b4 Avoid 64K allocation on the heap with each Receive
    332a698 Add devlink commands for devlink device information
    cb78b18 neigh_linux: Fix failure on deleted link neighs updates
    2bc5004 Replace redundant copied u32 types with type aliases
    093e80f Pass Ndmsg to NeighListExecute
    78a3099 Make test suite more deterministic
    2529893 genetlink: Add missing error check
    91b013f code simplification
    023a6da Make go vet happier
    aa5b058 Simplify code
    e137ed6 Replace nl.NewRtAttrChild with method on struct
    3b1c596 Run TravisCI with Go 1.10 and 1.11
    d741264 Reduce allocations
    b48eed5 Add an API to rename rdma device name
    02a3831 Adjust conntrack filters
    d3a23fd Make AddChild more generic
    1404979 Add support for hoplimit metric in routes
    6d53654 Add support for neighbor subscription
    531df7a Avoid serializing empty TCA_OPTIONS in qdisc messages
    56b1bd2 fix: BRIDGE_FLAGS_* constants off-by-one
    8aa85bf Add support for action and ifindex in XFRM policy
    9eab419 Netlink: Fix Darwin build
    2cbcf73 Add a test for Vlan filtering support for bridges.
    0bbc55b Initial support for vlan aware bridges.
    3ac69fd Add network namespace ID management.
    d68dce4 Ingress qdisc add/del Test case
    1006cf4 Implementation of HFSC
    d85e18e Allow Tuntap non-persist, allow empty tuntap name
    d77c86a protinfo: Check if object is nil
    a06dabf Increase size of receive buffer
    3e48e44 Revert "RTEXT_FILTER_VF doesn't always work with dump request, fixes #354"
    028453c RTEXT_FILTER_VF doesn't always work with dump request, fixes #354
    ee06b1d add vti6 support
    b1cc70d fix prefixlen/local IP, incl. PtP addresses
    7c0b594 Implemented String() for netem, fq and fq_codel in qdisc
    769bb84 Adjust flags values
    5f662e0 Add info about VFs on link
    985ab95 Add support for link flag allmulticast
    16769db Support LWTUNNEL_ENCAP_SEG6_LOCAL (including tests)
    b7f0669 Add test to Add/Del IPv6 route.
    55d3a80 Added tests for Gretap/Gretun devices
    f07d9d5 Run both Inline/Encap mode in TestSEG6RouteAddDel
    1970aef Add RDMA netlink socket for RDMA device information
    dc00cf9 Add Hash to U32
    23a36f2 Add Divisor to U32
    85aa3b7 Add statistics to class attributes
    aa0edbe Add support for setting InfininBand Node and Port GUID of a VF
    41009d5 Read conntrack flow statistics
    a2ad57a Add changelog file, initial release tagging
    5236321 Use IFLA_* constants from x/sys/unix
    25d2c79 Use IFF_MULTI_QUEUE from x/sys/unix to define TUNTAP_MULTI_QUEUE
    d35d6b5 Clarify ESN bitmap length construction logic
    a2af46a Add FQ Codel
    465b5fe Add Fq Qdisc support
    c27b7f7 Run gofmt -s -w on the project
    5f5d5cd Add a 'ListExisting' option to get the existing entries in the route/addr/link tables as part of RouteSubscribeWithOptions, AddrSubscribeWithOptions, and LinkSubscribeWithOptions.
    5a988e8 Support IPv6 GRE Tun and Tap
    7291c36 addr_linux: Implement CacheInfo installation
    422ffe6 addr_linux: Skip BROADCAST and LABEL for non-ipv4
    1882fa9 Add Matchall filter
    7b4c063 Update bpf_linux.go
    ad19ca1 netlink: allow non linux builds to pass.
    3ff4c21 Don't overwrite the XDP file descriptor with flags
    d4235bf Eliminate cgo from netlink.
    54ad9e3 Two new functions: LinkSetBondSlave and VethPeerIndex
    f67b75e Properly tear down netns at the end of test
    016ba6f Add support for managing source MACVLANs
    6e7bb56 Run TestSocketGet in dedicated netns
    a5d066d Fix LinkAdd for sit tunnel on 3.10 kernel
    8bead6f Add requirements to conntrack tests
    9ce265f Retrieve VLAN and VNI when listing neighbour
    fad79cb Fix go build issue for fou code

Commits for golang/x/sys
    88d2dcc unix: add IFLA_* constants for Linux 4.15
    c1138c8 unix: update to Linux 4.15, glibc 2.27 and Go 1.10
    37707fd unix: move gccgo redeclared *SyscallNoError functions to a separate file
    8f27ce8 unix: fix cpuset size argument in sched_affinity syscall
    3dbebcf unix: use SyscallNoError and RawSyscallNoError on Linux only
    ff2a66f unix: fix godoc comment for clen
    0346725 unix: add godoc for Sockaddr* types
    90f0fdc plan9: add arm support
    ef80224 unix: add sockaddr_l2 definitions
    af9a212 unix: don't export padding fields on all platforms
    af50095 unix: use ParseDirent from syscall
    2c42eef unix: adjust replacement regex for removed struct fields for linux/s390x
    fff93fa unix: add Statx on Linux
    52ba35d unix: check error return of os.Symlink in tests on Linux
    810d700 unix: match seek argument size to signature on linux/arm
    b9cf5f9 unix: add cgroupstats type and constants
    d38bf78 unix: restore gccgo support
    2493af8 plan9: move Unsetenv into env_plan9.go
    3ca7571 windows: move Unsetenv into env_windows.go
    1792d66 unix: move Unsetenv into env_unix.go
    dd9ec17 unix: fix build on Go 1.8
    12d9d5b unix: add SchedGetaffinity and SchedSetaffinity on Linux
    a3f2cbd unix: fix typo in unix/asm_linux_arm64.s made in 28a7276
    28a7276 unix: add SyscallNoError and RawSyscallNoError on Linux
    8380141 unix: simplify error handling in *listxattr on FreeBSD
    df29b91 unix: add TestSelect for *BSD
    801364e unix: add Select on Solaris
    d818ba1 unix: remove syscall constants on Solaris
    236baca unix: add timeout tests for Select and Pselect on Linux
    571f7bb unix: simplify TestGetwd
    d5840ad unix: add GetsockoptString for Darwin, *BSD and Solaris

Signed-off-by: Gabi Beyer <gabrielle.n.beyer@intel.com>
2019-09-26 16:17:16 +02:00
Gabi Beyer
41407cfbed vc: make cgroup usage configurable if rootless
rootless execution does not yet support cgroups, so if running
rootlessly skip the cgroup creation and deletion.

Fixes: 1877

Signed-off-by: Gabi Beyer <gabrielle.n.beyer@intel.com>
2019-09-26 16:17:16 +02:00
Gabi Beyer
5f0799f1b7 vc: add rootless dir to path variables
Modify some path variables to be functions that return the path
with the rootless directory prefix if running rootlessly.

Fixes: #1827

Signed-off-by: Gabi Beyer <gabrielle.n.beyer@intel.com>
2019-09-26 16:17:16 +02:00
Gabi Beyer
cdd6f7e4d5 katautils: update paths to be configurable for rootless execution
Before using the default ctrsMapTrePath, check whether the runtime
is being ran rootlessly, and if so set the ctrsMapTreePath to the
rootlessRuntimeDir configured by the libpod rootless library.

Fixes: #1827

Signed-off-by: Gabi Beyer <gabrielle.n.beyer@intel.com>
2019-09-26 16:17:16 +02:00
Gabi Beyer
2d8b278c09 rootless: add rootless logic
Add the ability to check whether kata is running rootlessly or
not. Add the setup of the rootless directory located in the dir
/run/user/<UID> directory.

Fixes: #1874

Signed-off-by: Gabi Beyer <gabrielle.n.beyer@intel.com>
Co-developed-by: Marco Vedovati <mvedovati@suse.com>
Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-09-26 16:17:16 +02:00
Marco Vedovati
801a9a8fd0
Merge pull request #2089 from marcov/arm-initrd
QEMU: do not require nvdimm machine option with initrd
2019-09-26 08:57:29 +02:00
Archana Shinde
36626c13c8
Merge pull request #2087 from jschintag/fix_s390x_vsock
s390x: Fix runtime build for s390x
2019-09-25 10:35:04 -07:00
GabyCT
b4bc00951a
Merge pull request #2083 from chavafg/topic/update-kernel
versions: Update kernel to 4.19.75
2019-09-25 09:36:21 -05:00
Marco Vedovati
8b843c5229 QEMU: do not require nvdimm machine option with initrd
Do not add the "nvdimm" machine option to QEMU when the config specifies
a initrd file.
For arm64, this allows using a vanilla QEMU, where "virt" machine does
not support the "nvdimm" option.

Fixes: #2088

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-09-25 13:26:09 +02:00
Jan Schintag
c152ebf356 s390x: Fix runtime build for s390x
Add the missing migration from kataVSOCK to types.VSock (see #2050) for s390x.

Fixes: #2086
Signed-off-by: Jan Schintag <jan.schintag@de.ibm.com>
2019-09-25 11:12:06 +02:00
Salvador Fuentes
bc3c07b7d5 versions: Update kernel to 4.19.75
Include patches that fixes overlay2 issues.

Fixes: #2082

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2019-09-24 15:42:25 -05:00
GabyCT
d3f480dc4c
Merge pull request #2080 from chavafg/master
config: honor DEFSHAREDFS_QEMU_VIRTIOFS and CONFIG_QEMU_VIRTIOFS_IN
2019-09-23 09:25:30 -05:00
Eric Ernst
22a3ca1c36
Merge pull request #2050 from devimc/topic/virtcontainers/fixFC018
Support Firecracker 0.18
2019-09-23 06:52:29 -07:00
Salvador Fuentes
b1909e8ea2 config: fix virtiofsd name
virtiofsd binary built using our packaging scripts
is named `virtiofsd` and not `virtiofsd-x86_64`

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2019-09-20 15:33:50 -05:00
Salvador Fuentes
84ead984d2 config: add configuration-qemu-virtio-fs.toml to gitignore
add generated configuration file to gitignore.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2019-09-20 15:30:00 -05:00
Salvador Fuentes
443e657750 config: honor DEFSHAREDFS_QEMU_VIRTIOFS and CONFIG_QEMU_VIRTIOFS_IN
replace `DEFSHAREDFS_QEMU_VIRTIOFS` and `CONFIG_QEMU_VIRTIOFS_IN`
with their values on the generated `configuration-qemu-virtiofs.toml`

Fixes: #2079

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2019-09-20 15:17:42 -05:00
Julio Montes
3d0949d60d virtcontainers: check minimum supported version of firecracker
Check minimum supported version of firecracker to make sure it's compatible
with kata containers

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-09-20 13:55:19 +00:00
Julio Montes
948dd3303a
Merge pull request #2055 from lifupan/fix_missingqemulog
virtcontainers: fix the issue of missing qemu error logs
2019-09-20 07:41:47 -05:00
Julio Montes
95c9880bca
Merge pull request #2078 from GabyCT/topic/fixclic
config: Fix the qemu-virtiofs.toml
2019-09-20 07:40:54 -05:00
lifupan
1f93cffd5a virtcontainers: fix the issue of missing qemu error logs
When 'debug' is enabled, qemu's debug info is output
into qemu's log file. When lauching qemu failed, it's
better to log these debug info and return it directly
for debugging.

Fixes:#2042

Signed-off-by: lifupan <lifupan@gmail.com>
2019-09-20 09:10:53 +08:00
Julio Montes
8680db6071 versions: update firecracker to the version 0.18.0
update firecracker to the version 0.18.0

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

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-09-19 21:30:00 +00:00
Julio Montes
f776e8f217
Merge pull request #2057 from jschintag/qemu-img-sharing
s390x: Share image between qemu instances
2019-09-19 15:11:07 -05:00
Julio Montes
123ba13928 vendor: update kata agent
bring support for hybrid vsocks

shortlog:
4a34395 docs:  Fix incorrect script reference in TRACING.md
8d682c4 release: Kata Containers 1.9.0-alpha2
b900a3f CI: Make Travis call common setup
bd0f562 protocols/client: support hybrid vsocks
a63ad12 release: Kata Containers 1.9.0-alpha1
545a411 mount: ensure local directory storage types have the correct permissions
006fdfe device: fix the issue of failed waiting on device appeared in /dev
b1a4284 travis: Fix golang version
f454d98 s390s: fix rootBusPath
b86f0de test: Add test to check for route-setup for interfaces from same subnet
2537235 network: While updating routes, do not delete routes with proto "kernel"

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-09-19 19:39:07 +00:00
Julio Montes
5ac6e9a897 virtcontainers: make socket generation hypervisor specific
Kata support several hypervisor and not all hypervisor support the
same type of sockets, for example QEMU support vsock and unix sockets, while
firecracker only support hybrid vsocks, hence sockets generations should be
hypervisor specific

fixes #2027

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-09-19 19:39:07 +00:00
Archana Shinde
74d54b0deb
Merge pull request #2069 from fuxiao511/fix-bug
The unit of newMemory is MB
2019-09-19 11:24:09 -07:00
Julio Montes
f2f09230ee virtcontainers: rename kataVSOCK type and move it into the types package
Rename kataVSOCK to VSock and move it into the types package, this way it can
be accessible by other subpackages. This change is required because in next
commits the socket address and type (socket, vsock, hybrid vsock) will be
hypervisor specific.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-09-19 11:25:11 -05:00
Julio Montes
f42dd7d115 virtcontainers/fc: Add support for hybrid vsocks
Currently only firecracker supports hybrid vsocks, change the implementation
to use hybrid vsocks in firecracker.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-09-19 11:25:11 -05:00
Julio Montes
2c4cf392f7 virtcontainers/fc: bump firecracker experimental version
bump to version 0.18.0

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-09-19 11:25:11 -05:00
Julio Montes
bb87b44b30 virtcontainers/fc: Add logger to the http transport
Add logger to the http transport to log the requests that the runtime writes
in the firecracker's socket. Enable debug it's enabled.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-09-19 11:25:11 -05:00
Julio Montes
880bb2b7b8 virtcontainers: introducing HybridVSock type
This new socket type is currently supported only by the firecracker hypervisor.
For more details about its internal implementation see:
https://github.com/firecracker-microvm/firecracker/blob/master/docs/vsock.md

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-09-19 11:25:11 -05:00
Sebastien Boeuf
2a8af23de6 virtcontainers: Make fc.go fit the new API
Make fc.go fit the new API

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2019-09-19 11:25:11 -05:00