Commit Graph

15384 Commits

Author SHA1 Message Date
Jose Carlos Venegas Munoz
9830810684 vendor: update covertool.
Update covertool to allow run tests with go 1.10

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-04-26 11:38:15 -05:00
Sebastien Boeuf
644489b6e7 virtcontainers: Fix gofmt issues for Go 1.10
Now that our CI has moved to Go 1.10, we need to update one file
that is not formatted as the new gofmt (1.10) expects it to be
formatted.

Fixes #249

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-04-26 11:38:15 -05:00
Peng Tao
2d94e24c87 kernel-config: enable proper cgroups support
The kata-agent requires at least the blk/pids/net_prio cgroups.

Fixes: #24

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-26 23:53:22 +08:00
Julio Montes
902b1d32e5
Merge pull request #23 from jcvenegas/init-ci
ci: Add initial CI scripts
2018-04-26 09:56:04 -05:00
Jose Carlos Venegas Munoz
6f560c1c4d tag_repos: Clone using https
If ssh keys are not set ssh clone wont work.

Clone using https and push using ssh.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-04-26 09:42:46 -05:00
Jose Carlos Venegas Munoz
8ba7e3c72e release: Add tests for tag_repos.sh
- Add tests for release tool tag_repos.sh
- Toplevel makefile
- Add make test target for CI

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-04-26 09:42:46 -05:00
Jose Carlos Venegas Munoz
191089fa8f ci: Add scripts needed by CI
Add required files to execute CI.

Fixes: #21

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-04-26 09:42:46 -05:00
Julio Montes
31eb51ee7d
Merge pull request #244 from jodh-intel/backtrace-on-sigusr1
cli: Backtrace on SIGUSR1
2018-04-26 07:49:10 -05:00
James O. D. Hunt
6191ddffb3 cli: Backtrace on SIGUSR1
Rework the signal handling code so that if debug is enabled and a
`SIGUSR1` signal is received, backtrace to the system log but continue
to run.

Added some basic tests for the signal handling code.

Fixes #241.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-26 11:39:20 +01:00
Graham Whaley
35269d2db4
Merge pull request #88 from stefanha/fix-paratition-typo
image-builder: fix "paratition" typo
2018-04-26 11:15:36 +01:00
Stefan Hajnoczi
32aee00673 image-builder: fix "paratition" typo
Fixes: #89
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2018-04-26 10:26:06 +01:00
James O. D. Hunt
cc33986bef
Merge pull request #85 from jodh-intel/improve-top-README
docs: Add a Usage section
2018-04-26 08:52:28 +01:00
James O. D. Hunt
3c19ea413e docs: Add a Usage section
Add a new Usage section with basic examples of how to run the
builders from the `Makefile`.

Fixes #84.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-26 08:06:44 +01:00
Peng Tao
449dd27385
Merge pull request #18 from devimc/kernel/initial
kernel: add patch and config
2018-04-26 10:00:38 +08:00
Julio Montes
33195f8abd kernel: add patch and config
Add config file for x86 KVM.
Add 9p patch to always use cached inode.

fixes #17

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-04-25 12:11:39 -05:00
Sebastien Boeuf
07af4edea9 cli: Stop the sandbox on a KILL
The same way a caller of "kata-runtime kill 12345" expects
the container 12345 to be killed, the same call to a container
representing a sandbox should actually kill the sandbox, meaning
it would be stopped after the container has been killed.

This way, the caller knows the VM is stopped after kill returns.
This is an issue raised by Openshift and Kubernetes tests. They
call into delete way after the call to kill has been submitted,
and in the meantime they kill all processes related to the container,
meaning they do kill the VM before we could do it ourselves. In this
case, the delete responsible of stopping the VM comes too late and it
returns an error when trying to destroy the sandbox while trying to
communicate with the agent since the VM is not here anymore.

This commit addresses this issue by letting "kill" call into
StopSandbox() if the command relates to a sandbox instead of
a simple container.

Fixes #246

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-04-25 09:07:34 -07:00
Sebastien Boeuf
163a081776 cli: Check sandbox state before to issue a StopSandbox
The way a delete works, it was always trying to stop the sandbox, even
when the force flag was not enabled. Because we want to be able to stop
the sandbox from a kill command, this means a sandbox stop might be
called twice, and we don't want the second stop to fail, leading to the
failure of the delete command.

That's why this commit checks for the sandbox status before to try
stopping the sandbox.

Fixes #246

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-04-25 09:01:53 -07:00
James O. D. Hunt
fc8d913713 cli: Whitespace fix
Remove blank line.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-25 16:53:46 +01:00
James O. D. Hunt
7c6856f2a9 cli: Rename fatal.go to signals.go
The fatal file is going to also deal with non-fatal signals so rename
it.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-25 16:53:46 +01:00
Sebastien Boeuf
45e3f858f0
Merge pull request #255 from chavafg/topic/downgrade-go-version
versions: change newest supported go version
2018-04-24 14:39:56 -07:00
Salvador Fuentes
cf7491665b versions: change newest supported go version
change from go1.10 to 1.9.2.
Our static checks and unit tests fail when using
go 1.10. Since we use go 1.9.2 to test in our CI,
reflect this version in versions.yaml

By doing this, we will be able to remove the hardcoded version
from the jenkins scripts and instead install golang using
`.ci/install_go.sh` from the tests repository. And when moving
to go1.10 using a PR, the CI will test that the static checks
and unit tests pass correctly.

Fixes: #254.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2018-04-24 12:48:55 -05:00
Jose Carlos Venegas Munoz
7bb4e0470c
Merge pull request #240 from jcvenegas/versions-cri
versions: Add cri-containerd to versions file.
2018-04-24 10:32:34 -05:00
Eric Ernst
2b47961105
Merge pull request #56 from jodh-intel/add-release-process
docs: Add Release process docs
2018-04-24 08:14:37 -07:00
Sebastien Boeuf
d931d2902d
Merge pull request #218 from bergwolf/sandbox_api
api: add sandbox operation APIs
2018-04-24 07:21:36 -07:00
Peng Tao
29ce01fd11 api: add sandbox EnterContainer API
And make VC EnterContainer a wrapper of it.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-24 15:33:51 +08:00
Peng Tao
488c3ee353 api: add sandbox Status API
It returns the status of current sandbox.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-24 15:33:47 +08:00
Peng Tao
b3d9683743 api: add sandbox StatusContainer API
It retrieves container status from sandbox.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-24 15:32:54 +08:00
Peng Tao
4b30446217 api: add sandbox startcontainer API
And make VC.StartContainer a wrapper of it.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-24 15:30:53 +08:00
Peng Tao
d9144c8514 api: add sandbox DeleteContainer API
DeleteContainer in api.go is now a wrapper of it.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-24 15:30:53 +08:00
Peng Tao
f6aa8a23fc api: add sandbox CreateContainer API
And make CreateContainer in api.go a wrapper of it.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-24 15:30:53 +08:00
Peng Tao
ef89131b85 api: add sandbox Delete API
By exporting the existing sandbox delete() function.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-24 15:30:53 +08:00
Peng Tao
5165de0d76 api: add sandbox pause and resume API
By exporting the existing sandbox operations.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-24 15:30:53 +08:00
Peng Tao
eb23771d5a api: add sandbox release API
It disconnects the agent connection and removes the sandbox
from global sandbox list.

A new option `LongLiveConn` is also added to kata
agent's configuration. When set, the API caller is expected
to call sandbox.Release() to drop the agent connection explicitly.

`proxyBuiltIn` is moved out of agent state because we can always
retrieve it from sandbox config instead.

Fixes: #217

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-24 15:30:53 +08:00
Peng Tao
d189be8579 api: add FetchSandbox
It finds out and existing sandbox and returns it.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-04-24 15:30:53 +08:00
Jose Carlos Venegas Munoz
336aa93e6c versions: Add cri-containerd to versions file.
- Add latest release from cri-containerd.

Fixes: #239

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-04-23 20:06:54 -05:00
Sebastien Boeuf
76af465724
Merge pull request #243 from jodh-intel/fix-TestIsHostDevice-test
virtcontainers: Fix TestIsHostDevice test as non-root
2018-04-23 11:27:55 -07:00
James O. D. Hunt
53d73e56e0 virtcontainers: Fix TestIsHostDevice test as non-root
Don't Attempt to create file below `/dev` when running as non-`root`.

Move the logic into a new `TestIsHostDeviceCreateFile` test and skip
unless `root.`

Fixes #242.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-23 14:29:13 +01:00
James O. D. Hunt
3e0e112e2b docs: Move TOC to top
Move the table of contents to the top of the page.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-23 09:16:16 +01:00
James O. D. Hunt
a070f18c2e docs: Add Release process docs
Add a document providing an overview of releases along with the
all-important release checklist.

Fixes #32.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-23 09:04:03 +01:00
Eric Ernst
d3e8d9c0e4
Merge pull request #16 from jcvenegas/tag_repos
release: Add script to tag repos
2018-04-22 21:04:10 -07:00
Sebastien Boeuf
de32be7eed
Merge pull request #211 from amshinde/assign-bridge-addr
Assign address to a pci bridge while appending it
2018-04-20 14:52:31 -07:00
Jose Carlos Venegas Munoz
a099eafc60
Merge pull request #83 from jodh-intel/create-summary-file
refactor and create a summary file inside the image
2018-04-20 13:57:57 -05:00
Archana Shinde
c7ff8ccac7
Merge pull request #59 from jodh-intel/add-licensing-doc
docs: Add license strategy doc
2018-04-20 09:39:36 -07:00
Eric Ernst
9b36fa3cf5
Merge pull request #48 from jodh-intel/add-limitations-doc
Add limitations doc
2018-04-20 09:08:55 -07:00
James O. D. Hunt
9dceb3eed1 scripts: Added initrd support to collect script
The collect script is now able to extract the osbuilder metadata
from an initrd image.

Fixes #237.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-20 16:55:10 +01:00
James O. D. Hunt
72056eb89b scripts: Collect script now shows osbuilder file
Changed the collect script to display the contents of the
osbuilder metadata file which provides details of the image.

Partially fixes #237.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-20 16:55:01 +01:00
James O. D. Hunt
4281bc3543 scripts: Make collect script variable local
Added a missing `local` in `get_image_file()`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-20 16:46:45 +01:00
James O. D. Hunt
fbd28085d3 scripts: Make more collect script variables read only
Changed some important global variables to be read-only.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-20 16:44:00 +01:00
James O. D. Hunt
f90f65247e rootfs: Create a summary file inside the image
Create a YAML metadata file inside the rootfs image
containing information about the environment:

```
/var/lib/osbuilder/osbuilder.yaml
```

Example contents:

```
---
osbuilder:
  url: "https://github.com/kata-containers/osbuilder"
  version: "unknown"
rootfs-creation-time: "2018-04-19T16:19:30.254610305+0000Z"
description: "osbuilder rootfs"
file-format-version: "0.0.1"
architecture: "x86_64"
base-distro:
  name: "Centos"
  version: "7"
  packages:
    - "iptables"
    - "systemd"
agent:
  url: "https://github.com/kata-containers/agent"
  name: "kata-agent"
  version: "0.0.1-2ec0b9593845b9a5e0eab5a85b20d74c35a2ca52-dirty"
  agent-is-init-daemon: "no"
```

This change adds a new `-o` option to `rootfs.sh` for
specifying the version of osbuilder to the rootfs builder.

Fixes #35.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-20 11:46:55 +01:00
James O. D. Hunt
93b632c328 lib: Check rootfs parameter
Add a check on the rootfs parameter in `build_rootfs()`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-20 11:17:55 +01:00