Commit Graph

6963 Commits

Author SHA1 Message Date
Peng Tao
dca7a6f98b config: validate proxy path
Like shim, we should validate the proxy path if it is provided.

Fixes: #1424

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-03-26 03:46:36 -07:00
Wei Zhang
dd6e8eb82c tests: do cleanUp() always in the end
Fixes: #1422

Detect failing test case:

```
....
=== RUN   TestEnterContainerFailingContNotStarted
--- PASS: TestEnterContainerFailingContNotStarted (0.01s)
=== RUN   TestEnterContainer
--- FAIL: TestEnterContainer (0.00s)
 Error Trace: sandbox_test.go:1154
 Error:      	Expected value not to be nil.
 Messages:   	Entering non-running container should fail
 Error Trace: sandbox_test.go:1157
 Error:      	Expected nil, but got: &errors.errorString{s:"Can not
move from running to running"}
 Messages:   	Failed to start sandbox: Can not move from running to
running
FAIL
```

`TestEnterContainerFailingContNotStarted` calls `cleanUp` at function
begging but it doesn't clean its garbage after it ends.
`TestEnterContainer` only call `cleanUp` in the end but it doesn't do
cleanUp in the begging, that gives first test case a chance to impact
latter one.

This commit modifies all the test cases, let them all do the cleanUp()
in the end.

The policy here is: "everyone needs to take their garbage away when they
leave" :)

Signed-off-by: Wei Zhang <zhangwei555@huawei.com>
2019-03-26 16:29:39 +08:00
Hui Zhu
c6804c8e2b
Merge pull request #1372 from ganeshmaharaj/go-linter-change
lint: Change go linter from gometalinter to golangci-lint
2019-03-26 12:32:38 +08:00
Wei Zhang
ad7d9b7bab cgroups: remove duplicate fields from state
Fixes: #1415

Container resources have been saved to ContainerConfig so there's no
need to save it again in state.json.

Signed-off-by: Wei Zhang <zhangwei555@huawei.com>
2019-03-26 10:34:03 +08:00
Archana Shinde
228d1512d9 mount: Add check for k8s host empty directory
k8s host empty-dir is equivalent to docker volumes.
For this case, we should just use the host directory even
for system directories.

Move the isEphemeral function to virtcontainers to not
introduce cyclic dependency.

Fixes #1417

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-25 14:06:23 -07:00
Archana Shinde
70c193132d mounts: Add check for system volumes
We handle system directories differently, if its a bind mount
we mount the guest system directory to the container mount and
skip the 9p share mount.
However, we should not do this for docker volumes which are directories
created by Docker.

This introduces a Docker specific check, but that is the only
information available to us at the OCI layer.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-25 10:49:27 -07:00
Graham Whaley
f56d26105b
Merge pull request #37 from ttx/packagecloud
Credit packagecloud for package hosting
2019-03-25 16:47:41 +00:00
Ganesh Maharaj Mahalingam
f4428761cb lint: Update go linter from gometalinter to golangci-lint.
gometalinter is deprecated and will be archived April '19. The
suggestion is to switch to golangci-lint which is apparently 5x faster
than gometalinter.

Partially Fixes: #1377

Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
2019-03-25 08:48:13 -07:00
GabyCT
c67e7b78fa
Merge pull request #413 from jodh-intel/debug-console-needs-systemd
docs: Explain systemd needed for debug console
2019-03-25 09:41:30 -06:00
Julio Montes
6c7f3077c9 image-builder: add xfsprogs to Dockerfile
xfsprogs is a package required to generate xfs images.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-25 08:20:49 -06:00
Julio Montes
ad6e1a9d59 scripts: implement error function
Implement function to log errors without exit.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-25 08:19:13 -06:00
Julio Montes
e888ef5a60
Merge pull request #260 from darfux/pass_debug_to_docker
builder: Pass the DEBUG flag when using docker
2019-03-25 07:25:12 -06:00
James O. D. Hunt
dcadf2cbfb
Merge pull request #256 from kata-containers/add-chrony-to-image
Add chrony to image
2019-03-25 10:59:16 +00:00
James O. D. Hunt
0b7e456d47
Merge pull request #250 from matthewfischer/max_attempts
Print attempt number after max check
2019-03-25 10:32:49 +00:00
James O. D. Hunt
17cd8e84ed docs: Explain systemd needed for debug console
Add a note to the developer guide explaining that the debug console
requires systemd support (hence nominally you cannot use alpine linux
for example as that doesn't use systemd).

Fixes #412.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-25 09:39:53 +00:00
Li Yuxuan
0d2ba4766e builder: Pass the DEBUG flag when using docker
When using docker, pass the `DEBUG` flag to trace the commands as well.

Fixes: #261

Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
2019-03-25 17:36:38 +08:00
James O. D. Hunt
49b3cd0c56
Merge pull request #409 from jodh-intel/undo-docker-pin
Undo docker pin
2019-03-25 08:07:26 +00:00
Hui Zhu
814e5de224
Merge pull request #1334 from jongwu/factory
Factory: Fix fake return value issue on creating template
2019-03-25 11:58:30 +08:00
Xu Wang
de9c42e80f
Merge pull request #1227 from WeiZhang555/experimental-support
config: Add config flag "experimental"
2019-03-23 08:59:45 +08:00
Graham Whaley
6301fbe458
Merge pull request #408 from amshinde/remove-privileged-limitation
Limitations: Remove privileged flag limitation
2019-03-22 17:04:52 +00:00
Archana Shinde
bf0d680f56 Limitations: Remove privileged flag limitation
Kata does support privileged flag but within the guest,
so explain how this works in the Limitations docs.

Fixes #362

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-22 09:55:46 -07:00
Archana Shinde
71a4ba11b3
Merge pull request #411 from jodh-intel/fix-debug-console-example-on-ubuntu
docs: Fix debug console for ubuntu/debian
2019-03-22 09:49:10 -07:00
James O. D. Hunt
4c19083e01 docs: Fix debug console for ubuntu/debian
Change the debug console systemd job to specify the path to bash as
`/bin/bash`, *not* `/usr/bin/bash`. This unbreaks the debug console for
Ubuntu and Debian and also works for all other distros.

Fixes #410.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-22 13:13:47 +00:00
James O. D. Hunt
1f52f5e7bd
Merge pull request #1403 from jodh-intel/add-more-build-targets
Add more build targets
2019-03-22 11:52:32 +00:00
James O. D. Hunt
bfbd4edcca docker: Undo docker version 18.06 pin
Don't force Docker to be kept at version 18.06 (to ensure devicemapper
is available). This feature won't be re-added by Docker and remaining on
an old version of Docker is not good from a security perspective.

Replace the pinning with a note pointing users at an issue which
provides details of alternatives to devicemapper.

Fixes #407.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-22 10:59:54 +00:00
James O. D. Hunt
17acacbc47 docs: Capital letter at start and period at end of sentence
Fix two nits in the Debian install guide.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-22 10:57:36 +00:00
James O. D. Hunt
0d146738de
Merge pull request #1405 from jodh-intel/update-collect-script-for-dax-nvdimm-images
Update collect script for dax nvdimm images
2019-03-22 09:54:03 +00:00
James O. D. Hunt
36fce98517
Merge pull request #1387 from jodh-intel/allow-data-collection-to-be-hidden
Allow data collection to be hidden
2019-03-22 09:53:44 +00:00
James O. D. Hunt
072acea2a0
Merge pull request #358 from yyyeerbo/wip
install: VERSION_ID in buster/sid can be unset. default it to 9
2019-03-22 08:40:43 +00:00
Yang Bo
6ba8ae53dd install: Debian sid/buster has no VERSION_ID, error out.
Error out if debian has no VERSION_ID, point user to stable
packages.

Fixes: #357

Signed-off-by: Yang Bo <bo@hyper.sh>
2019-03-21 21:01:11 -07:00
Xu Wang
4f712b0657
Merge pull request #1401 from teawater/vmcache_vsock
config: Make VMCache can work with vsock
2019-03-22 10:51:35 +08:00
Eric Ernst
30726d1dd7
Merge pull request #370 from jcvenegas/release-1.5.1
Release 1.5.1
2019-03-21 13:27:34 -07:00
Salvador Fuentes
a06c82a120
Merge pull request #257 from jcvenegas/release-1.6.0
release: 1.6.0
2019-03-21 13:28:49 -06:00
Jose Carlos Venegas Munoz
75f4338350 release: 1.6.0
Version bump to kata 1.6.0.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-03-21 13:00:15 -06:00
James O. D. Hunt
e1eb28836a
Merge pull request #249 from GabyCT/topic/modifytest
test: Modify test_images script to handle FC
2019-03-21 17:04:32 +00:00
GabyCT
2069a3d953
Merge pull request #406 from teawater/vmcache_vsock
howto: Remove vsock from VMCache howto
2019-03-21 10:06:38 -06:00
Julio Montes
a7ccc24c80
Merge pull request #1398 from teawater/curl
ci: check curl before use it
2019-03-21 08:17:38 -06:00
James O. D. Hunt
5d761cec76 scripts: Handle images with a DAX/NVDIMM header
osbuilder recently added the ability to create images with a DAX/NVDIMM
header [1], however this change broke the data collection script. Update
that script to handle images with and without this header.

The data collection script will now assume a header is present. However,
if it fails to find the required partition data, it will try again, this
time assuming the image does not have a DAX/NVDIMM header.

Fixes #1404.

[1] - https://github.com/kata-containers/osbuilder/pull/236

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-21 12:35:28 +00:00
James O. D. Hunt
bdf6b2d49d scripts: Handle missing partitions in collect script
Add an extra check in the data collection script to ensure partitions
are found in the image.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-21 12:28:58 +00:00
James O. D. Hunt
ad228e3c3b build: Add missing targets to show-usage
Add a number of useful build and install targets to the `show-usage`
target which are visible when the user runs `make help`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-21 11:30:19 +00:00
James O. D. Hunt
e6a7091981 build: Allow runtime to be built+installed without shim
Add `install-runtime` and `install-netmon` targets. This allows the
`install` target to be simplified and also allows the runtime to be
built without having to build the `containerd-shim-v2` binary which is
slow to build:

```
$ make runtime && sudo -E PATH=$PATH make install-runtime
```

Fixes #1402.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-21 11:30:12 +00:00
James O. D. Hunt
206ffc66aa build: Don't build the runtime when building shim binary
The `containerd-shim-v2` binary does not need the `kata-runtime` binary
to be built first, so remove the dependency.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-21 11:30:07 +00:00
Graham Whaley
c70ba4844f
Merge pull request #1390 from devimc/topic/roFS
virtcontainers: improve security and mount the rootfs as read-only fs
2019-03-21 09:33:04 +00:00
Hui Zhu
c3f082ccb8 howto: Remove vsock from VMCache howto
Remove vsock from VMCache howto because VMCache can work with vsock now.

Fixes: #405

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-03-21 17:24:57 +08:00
Hui Zhu
639e8271de config: Make VMCache can work with vsock
After code check and test, found VMCache can work with vsock.
Remove the code that prohibit them from working together.

Fixes: #1400

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-03-21 17:13:03 +08:00
Hui Zhu
aec0d263fa ci: check curl before use it
install-yq.sh use curl but not check if curl is available or not.
Add code to check curl before use it.

Fixes: #1379

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-03-21 10:52:33 +08:00
Archana Shinde
e16ff37f86 chrony: Comment out any NTP sources for chrony
Reference:  https://chrony.tuxfamily.org/doc/3.4/chrony.conf.html

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-20 16:05:33 -07:00
Archana Shinde
3df19ff984 chrony: Add virtual PTP as source for chrony
KVM virtual PTP in linux kernel allows guest to sync its
clock to the host clock with high precision. kvm-ptp has been
enabled in our kernel. Add this as a source for `chrony` so that
it can be used to sync the guest system clock.
`chrony` needs to be started in the guest for time sync.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-20 14:05:42 -07:00
Julio Montes
8c2190d3a3
Merge pull request #400 from Pennyzct/snap_aarch64
snap-aarch64: modify qemu-related info for arm64
2019-03-20 09:22:07 -06:00
Sebastien Boeuf
f1ef63e5c6
Merge pull request #1394 from WeiZhang555/improve-readability
refactor: improve readability of `bumpAttachCount`
2019-03-20 08:13:45 -07:00