Commit Graph

14950 Commits

Author SHA1 Message Date
James O. D. Hunt
a521c33537 scripts: Add data collection script
Add a data collection script that can be run by users and its output
pasted directly into a github issue.

The script is designed to make diagnosing issues as easy as possible
and its output provides a summary of a Kata Containers system
including:

- Versions of all components.
- Details of container managers.
- Errors found in the system journal.

Fixes #80.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-22 13:56:40 +00:00
Peng Tao
1961d724cf
Merge pull request #89 from jodh-intel/restructure-build-system
build: Move CLI makefile to top level
2018-03-22 20:19:22 +08:00
James O. D. Hunt
ea4050ee2d git: Add runtime to gitignore
Hide `kata-runtime` from `git status` by adding to `.gitignore`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-22 11:16:08 +00:00
James O. D. Hunt
3c7318dbbd build: Move CLI makefile to top level
Merge `cli/Makefile` with the top level `Makefile`.

Also includes a Travis config update.

Fixes #88.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-22 11:16:06 +00:00
Lai Jiangshan
1923361bcd
Merge pull request #65 from sboeuf/remove_submodules
submodules: Remove cc-runtime and runv
2018-03-22 11:04:38 +08:00
Sebastien Boeuf
1a9ceb1278 submodules: Remove cc-runtime and runv
Both cc-runtime and runv git submodules can now be removed since
the new folder cli defines the OCI wrapper, and the kata API is
defined and implemented through the virtcontainers package in this
same repository.

Fixes #64

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-03-21 12:10:15 -07:00
Eric Ernst
893d9d1bb1
Merge pull request #30 from jodh-intel/add-dev-guide
docs: Add developer guide
2018-03-21 09:59:40 -07:00
James O. D. Hunt
2ab1a3f260 docs: Add developer guide
Move the developer guide from the wiki "in-tree".

Fixes #29.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-21 16:57:51 +00:00
Peng Tao
6d05197625
Merge pull request #68 from devimc/agent/onlineCPUs
virtcontainers: agent: use onlineCPUMem to online vCPUs
2018-03-21 10:42:25 +08:00
Julio Montes
397905f4ca
Merge pull request #83 from amshinde/remove-device-from-bridge
virtcontainers: qemu: Call removeDeviceFromBridge for virtio-blk
2018-03-20 13:38:39 -05:00
Sebastien Boeuf
0619b0e110
Merge pull request #79 from jodh-intel/simplify-toplevel-makefile
Simplify toplevel makefile
2018-03-20 11:03:45 -07:00
Archana Shinde
5f1bc49263 virtcontainers: qemu: Call removeDeviceFromBridge for virtio-blk
In case of virtio-block, we hotplug devices to a bridge.
We need to remove device from bridge while stopping a
container.

Fixes #82

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-03-20 10:47:02 -07:00
Sebastien Boeuf
c8e0c2cc85
Merge pull request #72 from jodh-intel/fix-lint-errors
Fix lint errors & get virtcontainers tests running
2018-03-20 10:38:04 -07:00
Sebastien Boeuf
4e86f5886b
Merge pull request #77 from jodh-intel/simplify-cli-makefile
build: Simplify CLI makefile
2018-03-20 08:35:47 -07:00
Julio Montes
0916bb6fe3 virtcontainers: agent: use onlineCPUMem to online vCPUs
After hot adding vCPUs in the POD, agent's funtion `onlineCPUMem`
must be called to request the agent to online the vCPUs

fixes #67

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-03-20 09:05:25 -06:00
Julio Montes
0736e06193
Merge pull request #66 from jodh-intel/ci-fix-setup
CI: Make setup script fail on error
2018-03-20 09:36:13 -05:00
James O. D. Hunt
2a564c4f4b build: Add a clean rule
Add missing `clean` rule.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-20 11:23:08 +00:00
James O. D. Hunt
661a6ae85a build: Simplify top-level makefile
Use `make -C $dir` for simplicity.

Fixes #78.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-20 11:21:21 +00:00
James O. D. Hunt
81795a9879 build: Fix whitespace
Remove extraneous whitespace and format `Makefile` more consistently.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-20 11:20:35 +00:00
Mark Ryan
82c67ab9b2
Merge pull request #12 from bergwolf/initrd
qemu: add initrd support
2018-03-20 11:02:07 +00:00
James O. D. Hunt
092940ee8b build: Simplify CLI makefile
Now that the only build project is Kata, remove the remaining code to
support other projects and simplify.

Fixes #76.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-20 09:17:50 +00:00
Peng Tao
0c0ec8f3c9 qemu: add initrd support
Append initrd image to qemu arguments if configured.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-03-20 16:42:39 +08:00
James O. D. Hunt
734c387f4e CI: Add virtcontainers setup
Update the CI setup script to handle virtcontainers CI setup too.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-20 08:31:41 +00:00
James O. D. Hunt
bfd497fdf9 virtcontainers/tests: Disable selected tests for uid != 0
Skip a number of virtcontainers tests if not running as `root.`

Fixes #70.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-20 08:28:16 +00:00
James O. D. Hunt
ce37ac146d lint: Rename vcMock to vcmock
As recommended by `golint`, renamed the `vcMock` package to `vcmock`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-20 08:28:16 +00:00
James O. D. Hunt
b1628639e8 lint: Fix virtcontainers staticcheck errors
Correct `staticcheck` linter issues.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-20 08:28:16 +00:00
James O. D. Hunt
d51a5e303d lint: Fix virtcontainers unused errors
Remove unused variables and functions identified by the `varcheck` and
`unused` linters.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-20 08:28:16 +00:00
James O. D. Hunt
97d2ef2712 lint: Annotate unused virtcontainers iota consts
Added magic tags for `gometalinter` to ignore two unused `const`s that
form part of an `iota` sequence.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-20 08:28:16 +00:00
James O. D. Hunt
9b98c26a80 lint: Fix virtcontainers maligned errors
Correct `maligned` linter issues.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-20 08:28:16 +00:00
James O. D. Hunt
cc09b01ab2 lint: Fix virtcontainers structcheck errors
Correct `structcheck` linter issues.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-20 08:28:16 +00:00
James O. D. Hunt
c4e85905db lint: Fix virtcontainers unconvert errors
Correct `unconvert` linter issues.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-20 08:28:14 +00:00
James O. D. Hunt
bd8b585c79 lint: Fix virtcontainers golint errors
Correct `golint` linter issues.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-20 08:28:05 +00:00
James O. D. Hunt
3aad4f40c6 lint: Fix virtcontainers gofmt errors
Correct `gofmt` formatting for virtcontainers files.

Partially fixes #70.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-20 08:28:05 +00:00
James O. D. Hunt
7464e97a57 CI: Use central static checks script
Remove the duplicate static checker script and use the central script
defined in the `tests` repo like all the other components.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-20 08:28:05 +00:00
Eric Ernst
cd146dfeed
Merge pull request #73 from amshinde/vendor-upstream-ethtool
vendor: Vendor github.com/safchain/ethtool
2018-03-19 15:10:11 -07:00
Archana Shinde
d5b066152b vendor: Vendor github.com/safchain/ethtool
We were using code copied from github.com/safchain/ethtool.
Vendor in upstream package instead to use additional
functionality added in.

Fixes #71

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-03-19 14:30:29 -07:00
Sebastien Boeuf
65012d08b4
Merge pull request #62 from markdryan/gopath-setup
utils: Use go env to discover the GOPATH
2018-03-16 10:35:10 -07:00
Sebastien Boeuf
d1bdf80f56
Merge pull request #57 from amshinde/skip-ipv6-gateway
Skip routes with ipv6 gateway
2018-03-16 10:33:55 -07:00
Mark Ryan
96c49775c0 utils: Use go env to discover the GOPATH
Since Go 1.8 users no longer need to have GOPATH set in their environment
for the Go tool chain to work.  If GOPATH is set, Go will use it.  Otherwise
it defaults to ~/go on linux.  As most users store their code in ~/go, they
don't bother setting GOPATH any more.  virtcontainers-setup.sh, in its
current form, fails for those users, as it requires GOPATH to be set.
This commit fixes the issue by calling go env "GOPATH" to determine the
correct location of the user's go code.  go env "GOPATH" will always
return the correct location, whether GOPATH is set, or not.

Fixes: #63

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2018-03-16 09:39:58 +00:00
Archana Shinde
b6e6924a75 hyperstart_agent: ipv6: Skip ipv6 gateway for hyperstart agent
We ignore routes that have an ipv6 destination, since hyperstart agent
does not have support for ipv6 currently. We should do the same
for default route that has an ipv6 gateway address.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-03-15 13:47:14 -07:00
Archana Shinde
9f44729bd3 kata_agent: ipv6: Skip ipv6 gateway for kata agent
We ignore routes that have an ipv6 destination, since kata agent
does not have support for ipv6 currently. We should do the same
for default route that has an ipv6 gateway address. We need to
revisit this once we start adding support for ipv6.

Fixes #58

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-03-15 13:47:13 -07:00
Eric Ernst
de8506d8e5
Merge pull request #55 from sboeuf/scsi_support
virtcontainers: kata_agent: Add virtio-scsi support
2018-03-15 13:41:32 -07:00
Sebastien Boeuf
21f8911960 virtcontainers: kata_agent: Add virtio-scsi support
This commit enables the support of virtio-scsi for block devices
used as root filesystem or as devices passed through the VM to be
used directly from the container.

Fixes #56

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-03-15 12:20:32 -07:00
Sebastien Boeuf
7e85032aa7 virtcontainers: kata_agent: Use 9p2000.L version for 9p
There is a shared directory shared through virtio-9p between the
host and guest OS. The version of the driver used matters as it
may improve a few things. In this case, using the specific version
9p2000.L does not result in any regression, and it fixes failures
related to symlinks being passed through 9p.

Fixes #56

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-03-15 12:20:32 -07:00
Sebastien Boeuf
8152e15a61 virtcontainers: kata_agent: Factorize appending devices
This commit factorizes the code appending devices to the device list
provided to the Kata agent, in order to reduce the complexity of the
function createContainer().

Fixes #56

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-03-15 12:20:32 -07:00
Sebastien Boeuf
c2e9801a97 virtcontainers: kata_agent: Rely on Storage instead of Device for rootfs
The Kata agent has been reworked regarding Storage and Device
structures recently. It now expect that Storage is going to be
used for both volumes/mounts and rootfs, while Device will be
exclusive to devices passed through the VM that should appear
inside the container.

This commit implements this new way of handling volumes and
devices.

Fixes #56

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-03-15 12:20:32 -07:00
Sebastien Boeuf
b111403c00
Merge pull request #59 from jcvenegas/cli-runtime
cli: Initial runtime cli implementation.
2018-03-15 12:09:06 -07:00
Jose Carlos Venegas Munoz
4e370a5c72 vendor: re-vendor agent to fix mount error
The agent gRPC protocol has changed meaning the order of the gRPC
`Storage` message members has changed. This manifested itself with the
following error:

```
"OCI runtime create failed: rpc error: code = Internal desc = Could not
resolve symlink for source 9p: unknown."
```

This was caused by the agent attempting to mount a 9p FS with a blank
mountpoint - in fact due to the change in ordering, the mountpoint was
in the mount options!

Changes:

9760c10 device: Add SCSI block device support
15e851f storage: Rework the way Storage and Device are handled
4683745 lint: Remove unnecessary conversions
058182d lint: Fix vet error
ebcb3af reaper: removed unused type
902b82c device: Use standard functions to get device Major and Minor
6e262da main: Display full stacktrace on internal error

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-03-15 12:13:22 -06:00
Jose Carlos Venegas Munoz
6dde7b8548 Makefile: Update makefile to build runtime
Change default runtime to build cli.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-03-15 12:10:52 -06:00
Jose Carlos Venegas Munoz
3e4fdbbe6f travis: fix runtime build
Runtime command now is built on cli directory.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-03-15 12:10:52 -06:00