Commit Graph

5325 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
Eric Ernst
949d7631d8
Merge pull request #743 from chavafg/topic/virtiofsd-time-patch
static-build: Add patch that adds time to virtiofsd seccomp
2019-10-03 16:59:39 -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
Salvador Fuentes
f3ff9c76a8 static-build: patch virtiofsd
Apply qemu/patches/virtiofsd/0001-add-time-to-seccomp.patch
to be able to build virtiofsd statically.

Fixes: #742.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2019-10-03 15:59:51 -05: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
Salvador Fuentes
494272b0ac
Merge pull request #371 from nitkon/master
osbuilder: Add USE_PODMAN as an alternate for USE_DOCKER
2019-10-02 13:51:57 -05: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
Nitesh Konkar
15996014db osbuilder: Update README about USE_PODMAN variable
`USE_PODMAN` variable needs to be set for the osbuilder
scripts to use podman as a containerization engine to
build initrd/rootfs images. If both are set, `USE_DOCKER`
would take precedence over `USE_PODMAN`

Fixes: #370

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2019-10-02 21:58:41 +05:30
Nitesh Konkar
d1751a35e1 osbuilder: Add USE_PODMAN as an alternate for USE_DOCKER
In case a user wants to use podman instead of
docker to build initrd/rootfs images, facilitate
it by setting the variable `USE_PODMAN=true`.

Fixes: #370

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2019-10-02 21:58:02 +05:30
Jose Carlos Venegas Munoz
29d0ea9e81
Merge pull request #740 from chavafg/topic/fix-fc-install
static-build: Fix build for Firecracker v0.18
2019-10-01 18:06:22 -05:00
Salvador Fuentes
f10d48ced1 virtiofs: Add virtiofsd patch that adds time to seccomp
time syscall on seccomp is needed to be able to build
virtiofsd successfully.
This patch is currently not availabe upstream, so lets
add it until it becomes available.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2019-10-01 16:18:05 -05:00
Eric Ernst
46d1957e0f
Merge pull request #1875 from gabibeyer/rootlessLogic
rootless: add rootless to kata
2019-10-01 11:17:38 -07:00
Salvador Fuentes
c350abb3d9
Merge pull request #737 from Pennyzct/FC_SERIAL_PORT_CONFIG
Kernel: Support Firecracker on aarch64
2019-10-01 12:56:43 -05:00
Salvador Fuentes
4b8ba67607 static-build: Fix build for Firecracker v0.18
Removes `--vsock` flag when building Firecracker since
the flag was removed as vsock is enabled by default.

Also update the path where the binaries are placed.

Fixes: #739.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2019-10-01 11:50:08 -05:00
Julio Montes
d1fdf4083e
Merge pull request #369 from nitkon/patch-2
README: Update how to use DEBUG variable
2019-10-01 09:11:38 -05:00
GabyCT
9a9a8978f5
Merge pull request #364 from nitkon/fix_yq
Fix yq
2019-09-30 12:32:34 -05:00
nitkon
d2d029ce47
README: Update how to use DEBUG variable
Update osbuilder README to use DEBUG
environment variable for executing scripts in
debug mode.

Fixes:  #368

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2019-09-28 23:12:20 +05:30
Salvador Fuentes
3f57e8d64b
Merge pull request #730 from Kvasscn/dev
kernel: avoid to download sha256sums.asc file repeatedly
2019-09-26 16:20:59 -05:00
Salvador Fuentes
3e4b381248
Merge pull request #366 from nitkon/dns_initrd
initrd_builder: Create empty resolv.conf in rootfs
2019-09-26 12:04:39 -05:00
Nitesh Konkar
9e10b341d6 rootfs_builder: Create /etc/resolv.conf in rootfs
Create an empty /etc/resolv.conf in rootfs if
it does not already exists else preserve it if
not a symlink. This would allow the agent to bind
mount it for DNS in kata VM.

Fixes: #365

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2019-09-26 20:17:41 +05:30
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
zhanghj.lc
86e75b7ef2 kernel: avoid to download sha256sums.asc file repeatedly
If sha256sums.asc already downloaded, avoid to download again.

Fixes: #729

Signed-off-by: zhanghj.lc <zhanghj.lc@inspur.com>
2019-09-25 07:15:12 -04:00
Frank Cao
bfc8836f62
Merge pull request #557 from Kvasscn/doc-fixs-rootfsbuild
Developer-Guide.md: update rootfs build description
2019-09-25 17:23:07 +08: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
Penny Zheng
d74a600083 FC: Support serial device on aarch64
Serial device was finally fully supported with firecracker on aarch64,
see details here(https://github.com/firecracker-microvm/firecracker/pull/1233).
A set of kernel configs related with 8250 compatible serial ports
should be turn on.

Fixes: #736

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Signed-off-by: Haibo Xu <haibo.xu@arm.com>
2019-09-25 13:36:36 +08:00
Penny Zheng
da1b291d64 config: update kernel config on aarch64
Since kernel version updated to v4.19.73, kernel config file should
also been updated accorindly.

Fixes: #736

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Signed-off-by: Haibo Xu <haibo.xu@arm.com>
2019-09-25 13:36:13 +08: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
Nitesh Konkar
5982e48774 lib.sh: Fix curl error when using curl+yq
When you curl versions.yaml file and pipe into
yq, sometimes the piped program
closes the read pipe before the previous program
is finished leading to "curl: (23) Failed writing
body (1337 != 1371)". As a workaround we pipe the
stream through double "tac", an intermediary program
that always reads the whole page before feeding it
to the next program.

Fixes: #363

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2019-09-24 23:32:21 +05:30