Commit Graph

13214 Commits

Author SHA1 Message Date
Stefan Hajnoczi
a7bafc53c9 initrd-builder: make initrd_builder.sh idempotent
If initrd_builder.sh fails partway through it may not be possible to run
it again without creating a new rootfs.

This happens because initrd_builder.sh checks for the presence of
/sbin/init and refuses to run if it is missing.  Later on, the script
moves /sbin/init to /init, where the kernel expects to find it in an
initramfs.  After this step initrd_builder.sh will refuse to run again
since /sbin/init is now missing.

Create a symlink from /init to /sbin/init instead of moving the file.
This allows initrd_builder.sh to be run repeatedly on the same rootfs.

Fixes: #130
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2018-06-29 15:08:56 +01:00
James O. D. Hunt
4064a4ccb7
Merge pull request #128 from stefanha/image-builder-early-root-check
image-builder: require root earlier for better error messages
2018-06-29 08:38:17 +01:00
Jose Carlos Venegas Munoz
89f7b5eca0 tag_repos: Make sure osbuilder is updated.
Make sure the osbuilder VERSION file is updated before tag

Also, sort repos alphabetically.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-06-28 20:37:47 -05:00
Mark Ryan
4ca232ecdf qmp_test: Fix Warning and Error level logs
This commit fixes an issue with the log handlers defined by qmp_test.
The issue was picked up by the latest version of go vet on go tip.

qemu/qmp_test.go:56::error: missing ... in args forwarded to printf-like function (vet)
qemu/qmp_test.go:60::error: missing ... in args forwarded to printf-like function (vet)

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2018-06-28 16:05:00 +01:00
Mark Ryan
430e72c63b qemu,qmp: Enable gas security checker
This commit enables the gas security checker on govmm builds.  The
security checker has signalled 4 issues all of which I've checked
and have determined to be non issues.  These issues are disabled
by this commit.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2018-06-28 15:56:27 +01:00
Mark Ryan
ffc06e6bc4 qemu,qmp: Add staticcheck to travis and fix errors
This commit enables staticcheck in the travis builds and fixes the existing
errors detected by staticcheck.  There was one type of error repeated in
qemu.go in which the type of some constants was not explicitly specified.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2018-06-28 15:11:13 +01:00
Stefan Hajnoczi
7b1bbac600 image-builder: require root earlier for better error messages
The image_builder.sh script must be run as root.  The following check is
performed before the script checks for root:

  [ "${AGENT_INIT}" == "yes" ] || [ -x "${ROOTFS}/usr/bin/${AGENT_BIN}" ] || \
      die "/usr/bin/${AGENT_BIN} is not installed in ${ROOTFS}
      use AGENT_BIN env variable to change the expected agent binary name"

The -x test is "True if the file is executable by you".  It may evaluate
to true as root and false as non-root, depending on the file
permissions.

The permissions for kata-agent given in the Developer Guide are 0550
(https://github.com/kata-containers/documentation/blob/master/Developer-Guide.md#add-a-custom-agent-to-the-image---optional).

Therefore image_builder.sh fails with "/usr/bin/${AGENT_BIN} is not
installed" when run as non-root.  This is confusing since the agent
binary is really installed!

Move the root check to the beginning of the script.  This solves the
confusing error and prevents similar problems where the script doesn't
take into account that the user may be non-root.

Fixes: #127
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2018-06-28 14:16:26 +01:00
James O. D. Hunt
a3ce12179f logging: Add containerID and sandboxID to all log calls
Adding cid+sid fields to the log entries generated by most of the CLI
commands will make debugging across the system easier.

Fixes #452.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-06-28 10:37:51 +01:00
Sebastien Boeuf
93775487c8
Merge pull request #421 from jcvenegas/kernel-4.14.50
versions: Update kernel to version 4.14.51
2018-06-27 11:00:14 -07:00
James O. D. Hunt
4f1519ec64
Merge pull request #447 from amshinde/use-pointer-vhost-user-net
network: Use pointer for VhostUserNetDevice for Attach
2018-06-27 10:01:38 +01:00
Archana Shinde
510b3338d4 network: Use pointer for VhostUserNetDevice for Attach
Use pointer here since api.VhostUserDevice interface is implemented
by VhostUserNetDevice pointer.

Fixes #446

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-06-26 23:39:53 -07:00
Archana Shinde
2b27ddc738
Merge pull request #402 from jcvenegas/destdir
[RFC] makefile: honor DESTDIR flag.
2018-06-26 15:45:27 -07:00
Jose Carlos Venegas Munoz
44c890176c versions: Update kernel to version 4.14.51
Update to kernel to get latest fixes.

Depends-on: github.com/kata-containers/agent#279

Fixes: #420

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-06-26 16:14:46 -05:00
Jose Carlos Venegas Munoz
ac0c29012f
Merge pull request #124 from devimc/dockerfile/supportProxy
builder: support proxy in distros based on yum or dnf
2018-06-26 10:52:43 -05:00
Julio Montes
52d015e283 builder: support proxy in distros based on yum or dnf
proxy server must be specified in configuration file
of the package manager, /etc/yum.conf for yum or
/etc/dnf/dnf.conf for dnf

fixes #123

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-06-26 10:17:07 -05:00
Graham Whaley
5a6b541caf
Merge pull request #398 from nitkon/master
cli: kata-check if SMT is off on POWER8 systems
2018-06-26 09:05:30 +01:00
zhangwei_cs
2f1bf58b08
Merge pull request #424 from jiulongzaitian/const
virtcontainer : sconstification of constifiable vars
2018-06-26 15:30:38 +08:00
fupan
9155412b24 api: To watch the vm console in FetchSandbox api
When do sandbox release, the kataBuiltInProxy will
be closed, and it will stop the watch of vm's console;
Thus it needs to restart the proxy to monitor the vm
console once to restore the sandbox.

Fixes: #441

Signed-off-by: fupan <lifupan@gmail.com>
2018-06-26 08:04:33 +08:00
Salvador Fuentes
ae5b40ab88
Merge pull request #114 from jodh-intel/kata-manager-update
tests: Update kata-manager command
2018-06-25 17:49:58 -05:00
Sebastien Boeuf
ff2401825e
Merge pull request #18 from bergwolf/templating
Add APIs to enable vm templating
2018-06-25 07:58:45 -07:00
Nitesh Konkar
f890ffdaf7 cli: kata-check if SMT is off on POWER8 systems
SMT must be turned off on Power8 for KVM to work. Put
this as a check for kata-runtime kata-check.

Fixes: #397

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2018-06-25 19:40:05 +05:30
James O. D. Hunt
43a2ea4155 tests: Run EulerOS tests last
The EulerOS repository servers can be a little slower to respond than
others. This can lead to timeout issues so move the EulerOS tests to
the end to give the other tests a chance to run.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-06-25 15:06:52 +01:00
James O. D. Hunt
7b581c25d8 tests: Convert bats test to shell script
The tests perform a lot of configuration and call other commands. Since
the tests are running under BATS, any "stdout pollution" results in the
test failing. This is too rigid for current purposes so convert the
BATS test into a `set -e` test. This will still fail if any command
fails, but does not impose the output pollution restriction. It also
makes debugging easier.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-06-25 15:06:49 +01:00
James O. D. Hunt
5b9b69a4b7 tests: Update kata-manager command
The `kata-manger.sh` utility is changing its behaviour so that
`install-packages` *only* installs packages (no container manager).
Update the command to both install Docker and the packages.

Fixes #113.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-06-25 14:03:56 +01:00
Graham Whaley
8e577c19d6
Merge pull request #121 from jodh-intel/fix-static-checks
CI: Fix static-checks script invocation
2018-06-25 13:56:03 +01:00
James O. D. Hunt
547c477f4e CI: Fix static-checks script invocation
The `static-checks.sh` script now requires the repo as an argument.

Fixes #120.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-06-25 11:51:02 +01:00
Peng Tao
54caf7810b qmp: add hotplug memory
It adds size of MiB memory to the guest.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-06-23 11:39:28 +08:00
Peng Tao
e66a9b481b qemu: add appendMemoryKnobs helper
To fix travis failure about cyclomatic complexity in appendKnobs().

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-06-23 11:39:28 +08:00
Peng Tao
8aeca15388 qmp: add migrate set arguments
It allows to set migration arguments so that callers can control how
migration is done.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-06-23 11:39:28 +08:00
Peng Tao
a03d4968e1 qmp: add set migration capabilities
It allows to set guest migration capabilities.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-06-23 11:39:28 +08:00
Peng Tao
0ace4176b4 qemu: allow to set migration incoming
It is useful when we want to specify migration incoming source.
Supported source are fd and exec right now.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-06-23 11:39:23 +08:00
Sebastien Boeuf
e0c6702790
Merge pull request #172 from sboeuf/update_docs
docs: svc-mesh: Create some documentation about service mesh
2018-06-22 16:06:05 -07:00
Salvador Fuentes
47caba8370
Merge pull request #439 from jcvenegas/ci-static-fix
ci: Fix static checks call.
2018-06-22 17:41:37 -05:00
Sebastien Boeuf
daac13b1d5 docs: svc-mesh: Create some documentation about service mesh
This commit introduces the instructions to be able to run trendy
service mesh Istio and Conduit with Kata Containers. It provides
a bit of feedback on how they actually work to give the reader a
quick overview. After this introduction, it provides restrictions
and instructions to enable them with Kata Containers.

Fixes #171

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-06-22 15:41:01 -07:00
GabyCT
2f2be68d1e
Merge pull request #180 from chavafg/topic/static-checks
CI: update static-checks.sh call
2018-06-22 15:47:20 -05:00
Jose Carlos Venegas Munoz
9d709cd726 ci: Fix static checks call.
The script now has new options.

Add options to make CI work.

Fixes: #438

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-06-22 15:42:10 -05:00
Salvador Fuentes
7adbfa935e CI: update static-checks.sh call
Now static-checks.sh needs to have the
repository name as arguments.

Fixes #179.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2018-06-22 15:20:27 -05:00
James O. D. Hunt
bc6d9970f6
Merge pull request #164 from nitkon/patch-2
docs: Add relevant URLs and fix grammar
2018-06-22 10:31:41 +01:00
James O. D. Hunt
baf66c743d docs: Remove double "the" in README
Excised an extraneous definite article in the install README.

How did we miss this in the review phase I wonder?

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-06-21 15:22:24 +01:00
James O. D. Hunt
84e2622f94 docs: Add TOC to GCE guide
Add a table of contents to the Google Compute Engine install guide.

Fixes #173.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-06-21 15:22:24 +01:00
James O. D. Hunt
062fef460d docs: Add GCE install guide to install README
Add the new Google Compute Engine installation guide to the
installation README, reworking this doc to add in a table of contents
and a new "Cloud services" section.

Fixes #173.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-06-21 15:22:22 +01:00
James O. D. Hunt
f96f7ea2d3 docs: Use relative links in install README
Simplify the installation README by using relative URLs - let github
expand them automatically for readers.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-06-21 15:22:22 +01:00
James O. D. Hunt
b50b512872
Merge pull request #176 from jodh-intel/docker-rm-terminal-option
docs: Remove "-ti" from docker invocations
2018-06-21 15:21:43 +01:00
James O. D. Hunt
81c7f9ec01 docs: Remove "-ti" from docker invocations
The docker install guides end with a call to `docker run`. However, they
all specify `-ti` which is causing our CI to fail.

Remove the `-ti` so that the command works both under the CI and as
expected for the user.

Fixes #175.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-06-21 14:44:21 +01:00
James O. D. Hunt
9e09f54e7c CI: Make install guide check less specific
Simplify the CI check that looks for modified install guides to catch
any modified document below `install/`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-06-21 14:44:20 +01:00
Nitesh Konkar
62800fa271 docs: Add relevant URLs and fix grammar
Fixes:  #163

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2018-06-21 17:59:14 +05:30
zhangwei_cs
62d819c907
Merge pull request #432 from bergwolf/connection
kata_agent: fix connection race
2018-06-21 17:48:49 +08:00
James O. D. Hunt
b67e3c3e01
Merge pull request #154 from jon/master
docs: Add GCE installation guide.
2018-06-21 10:02:29 +01:00
Peng Tao
ee33245d95 kata_agent: fix connection race
If we send multiple grpcs at once before a client is created, we end up
creating multiple connections to the agent and that breaks when using builtin
proxy since only one connection is allowed.

Fixes: #431

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-06-21 16:34:49 +08:00
James O. D. Hunt
8e581f4d72
Merge pull request #414 from Pennyzct/kata-test
test: supplement test cases for kata-check and kata-env in Arm64
2018-06-21 09:28:04 +01:00