Commit Graph

15384 Commits

Author SHA1 Message Date
Julio Montes
c0aedeb7ee virtcontainers: firecracker: disable ACPI
Disable ACPI to fix ACPI BIOS error in the guest kernel

fixes #1454

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-04-01 14:23:49 -06:00
GabyCT
edd7d9ccd3
Merge pull request #272 from devimc/topic/fsFeatures
image-builder: share the mkfs configuration file
2019-04-01 13:03:23 -06:00
Julio Montes
22d1bc50db
Merge pull request #269 from stefanha/rootfs-DOCKER_RUNTIME-env-var
rootfs-builder: add rootfs.sh DOCKER_RUNTIME env var
2019-04-01 10:38:50 -06:00
Julio Montes
e8bb3bcf23
Merge pull request #267 from stefanha/rootfs.sh-selinux-relabel
rootfs-builder: SELinux relabel container volumes
2019-04-01 10:38:42 -06:00
Alice Frosi
49be8ee21c s390x: not set socketID and threadID
For cpu hotplug, the options socketID and threadID are not used.

Fixes: #1448

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2019-04-01 17:29:24 +02:00
Julio Montes
88b85231ca image-builder: share the mkfs configuration file
Share with the container the mkfs configuration file to use only the
filesystem features supported in the host.

fixes #270

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-04-01 09:18:28 -06:00
GabyCT
b09a469097
Merge pull request #418 from egernst/docs-cleanup
Docs cleanup
2019-03-29 16:13:24 -06:00
Eric Ernst
152330a4fd docs: Use relative paths for URLs which are part of this repo
Let's make our static testers happy.

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-03-29 14:17:54 -07:00
Eric Ernst
51f12efae9 arch: fix dead link
api.proto moved, resulting in a broken link. The original link wasn't
very useful in the first place, so simply remove.

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-03-29 14:03:59 -07:00
Eric Ernst
daef1791ff arch: move architecture.md to the design directory
Fixes: #417

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-03-29 11:04:34 -07:00
Eric Ernst
c0d63796a2 constraints: add as part of design documents
Let's keep all design documents in the same logical location. Updating
the file to be called 'cpu-constraints', though we may want to expand to
resource constraints going forward.

Fixes: #417

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-03-29 10:16:49 -07:00
Eric Ernst
353b2ecf9f vsocks: move to design directory
Let's keep all design documents in the design directory

Fixes: #417

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-03-29 10:11:04 -07:00
Eric Ernst
8e3db7f3df zun: move to use-cases, utilize images dir
Fixes: #417

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-03-29 10:10:10 -07:00
GabyCT
a17d2bbb40
Merge pull request #271 from devimc/topic/fixWrongFS
image-builder: add fs type
2019-03-29 10:10:55 -06:00
Jose Carlos Venegas Munoz
bb0a5635eb
Merge pull request #411 from kata-containers/snap-next
snap: release 1.6.0
2019-03-29 08:41:22 -06:00
Julio Montes
77fb8085f4 image-builder: check format_loop return code
check format_loop return code and die if it fails

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-29 07:47:22 -06:00
Graham Whaley
af74d18014 kata-deploy: crio.conf: Add some whitespace and comments
When writing our runtime configs to crio.conf, let's add some
whitespace and comments to make it clearer, and fit in with the
rest of the crio.conf file.

Fixes: #412

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2019-03-29 11:50:09 +00:00
Julio Montes
8debe95b61 image-builder: add fs type
Add filesystem type to format the loop device.

fixes #270

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-28 15:10:16 -06:00
Julio Montes
3464f8e6a3 snap: release 1.6.0
bump snap version to 1.6.0

fixes #410

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-28 14:52:06 -06:00
Stefan Hajnoczi
c72c95496e rootfs-builder: add rootfs.sh DOCKER_RUNTIME env var
On some systems the "runc" runtime isn't available or has a different
name.  Allow the user to override the Docker runtime.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Fixes: #268
2019-03-28 15:48:15 +00:00
Stefan Hajnoczi
c1d9510cb3 rootfs-builder: SELinux relabel container volumes
rootfs.sh fails on machines with SELinux in enforcing mode if the
volumes aren't labelled.

This patch labels volumes so the container is able to access them.

In order to do this rootfs directory creation must be moved before the
Docker container is started.  Previously docker-run(1) would create the
rootfs directory in the USE_DOCKER case.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Fixes: #266
2019-03-28 15:39:35 +00:00
Sebastien Boeuf
20b087e3d2
Merge pull request #264 from devimc/topic/supportDAXandFC
image-builder: re-implement image builder script
2019-03-28 06:56:02 -07:00
Ace-Tang
096fa046f8 qemu: fix qemu leak when failed to start container
do cleanup inside startVM() if start vm get error

Fixes: #1426

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-03-28 19:38:56 +08:00
Ace-Tang
1b6affe498 config: fix panic in type assertion
when use shim v2 interface to run container, no need to use kata-proxy
and kata-shim, remove kata-proxy and kata-shim in config file will cause
panic since type assertion. add check to avoid panic

Fixes: #1440

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-03-28 19:28:51 +08:00
Graham Whaley
ff1698d915 kata-deploy: remove Trusted annotations from examples
We no longer use the TrustedSandbox style annotations now we
have moved to the RuntimeClass method of choosing a runtime.
Drop the remaining Trusted items from the examples.

Fixes: #403

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2019-03-28 11:17:43 +00:00
Xie Yongji
2d422a845b agent: pass correct mount type to agent for ephemeral volumes
The "ephemeral" is just used to indicate ephemeral volumes in
runtime. We should not pass it to agent. Instead, "bind" should be
the correct mount type to be passed.

Fixes: #1438

Signed-off-by: Xie Yongji <xieyongji@baidu.com>
2019-03-28 18:40:59 +08:00
Penny Zheng
2e5194e279 linter: remove deadcode linter check for generic item
After we switched golang linter to golangci-lint, we has extra 'deadcode'
linter check, and we need to remove this linter check for all
generic items.

Fixes: #1432

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-03-28 14:05:38 +08:00
zhangwei_cs
c89eb81dec
Merge pull request #1425 from bergwolf/proxy-path
config: validate proxy path
2019-03-27 11:31:39 +08:00
Julio Montes
d8cdd88ace image-builder: re-implement image builder script
Re-implement image builder script to generate an image with a double MBR +
a DAX metadata. The DAX metadata is read by the NVDIMM driver to know the
beginning of the data in the pmem device.
This new image format is required to enable DAX in the kernels and hypervisors
that support NVDIMM, without breaking the compatibility with the kernels and
hypervisors that don't support it.

Following diagram shows how the resulting image will look like

```
	.-----------.----------.---------------.-----------.
	| 0 - 512 B | 4 - 8 Kb |  2M - 2M+512B |    3M     |
	|-----------+----------+---------------+-----------+
	|   MBR #1  |   DAX    |    MBR #2     |  Rootfs   |
	'-----------'----------'---------------'-----------+
	      |          |      ^      |        ^
	      |          '-data-'      '--------'
	      |                                 |
	      '--------rootfs-partition---------'
```

MBR: Master boot record.
DAX: Metadata required by the NVDIMM driver to enable DAX in the guest [1][2]
(struct nd_pfn_sb).
Rootfs: partition that contains the root filesystem (/usr, /bin, etc).

Kernels and hypervisors that support DAX/NVDIMM read the MBR #2,
otherwise MBR #1 is read.

[1] - https://github.com/kata-containers/osbuilder/blob/master/image-builder/\
nsdax.gpl.c
[2] - https://github.com/torvalds/linux/blob/master/drivers/nvdimm/pfn.h

fixes #263

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-26 09:02:45 -06:00
Julio Montes
f32ae14883 tests: remove DAX env variable
DAX envar is no more required to generate images with support for DAX

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-26 09:02:45 -06:00
Julio Montes
f355c026c0 tests: enable DEBUG
run tests with debug enabled to detect errors easier

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-26 09:02:45 -06:00
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