Commit Graph

311 Commits

Author SHA1 Message Date
James O. D. Hunt
31b9a23da0
Merge pull request #279 from jodh-intel/fix-markdown
docs: Fix markdown
2019-05-02 18:06:14 +01:00
James O. D. Hunt
c5a17f7f4f docs: Fix markdown
Resolve issues with markdown in this repo.

Fixes #278.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-05-01 15:46:40 +01:00
James O. D. Hunt
ac6d19aba1
Merge pull request #284 from marcov/install-nsdax
make: add nsdax source to install-scripts target
2019-05-01 15:43:01 +01:00
James O. D. Hunt
24dbcbe88a
Merge pull request #273 from devimc/topic/removeLogs
rootfs-builder: remove /var/log
2019-04-29 09:29:47 +01:00
Marco Vedovati
7cfe5b4dd2 image-builder: set default value of AGENT_INIT
Set as default AGENT_INIT=no when not explicitly set, to make it
consistent with the other scripts in osbuilder

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-04-26 15:22:50 +02:00
Marco Vedovati
0013352d9b make: add nsdax source to install-scripts target
nsdax.gpl.c is required by image_builder.sh

Fixes: #283

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-04-26 15:20:18 +02:00
Eric Ernst
d5fbd1c25f
Merge pull request #277 from katacontainersbot/1.7.0-alpha1-branch-bump
# Kata Containers 1.7.0-alpha1
2019-04-17 13:23:54 -07:00
katacontainers bot
7465fde308 release: Kata Containers 1.7.0-alpha1
- image-builder: share the mkfs configuration file
- rootfs-builder: add rootfs.sh DOCKER_RUNTIME env var
- rootfs-builder: SELinux relabel container volumes
- image-builder: add fs type
- image-builder: re-implement image builder script
- builder: Pass the DEBUG flag when using docker
- Add chrony to image
- Print attempt number after max check

88b8523 image-builder: share the mkfs configuration file
77fb808 image-builder: check format_loop return code
8debe95 image-builder: add fs type
c72c954 rootfs-builder: add rootfs.sh DOCKER_RUNTIME env var
c1d9510 rootfs-builder: SELinux relabel container volumes
d8cdd88 image-builder: re-implement image builder script
f32ae14 tests: remove DAX env variable
f355c02 tests: enable DEBUG
6c7f307 image-builder: add xfsprogs to Dockerfile
ad6e1a9 scripts: implement error function
0d2ba47 builder: Pass the DEBUG flag when using docker
e16ff37 chrony: Comment out any NTP sources for chrony
3df19ff chrony: Add virtual PTP as source for chrony
ad5d879 rootfs: Print attempt number after max check
8fe6405 rootfs: Include chrony in the Dockerfile images
0b33519 rootfs: add PACKAGE var to debian config
510ddd2 rootfs: Add chrony service to rootfs

Signed-off-by: katacontainers bot <katacontainersbot@katacontainers.io>
2019-04-17 17:38:46 +00:00
Julio Montes
c00849b0bc rootfs-builder: remove /var/log
/var/log is not required in the rootfs

fixes #254

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-04-02 11:48:19 -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
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
a17d2bbb40
Merge pull request #271 from devimc/topic/fixWrongFS
image-builder: add fs type
2019-03-29 10:10:55 -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
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
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
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
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
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
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
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
Matt Fischer
ad5d879f8c rootfs: Print attempt number after max check
With the old code it was possible to see odd messages like:
"INFO: Create root disk image. Attempt 6 out of 5."

Move the attempt number print to after we check against the max

Fixes #251

Signed-off-by: Matt Fischer <matt@mattfischer.com>
2019-03-19 21:04:40 -06:00
Archana Shinde
8fe64058aa rootfs: Include chrony in the Dockerfile images
Add chrony to distro Dockerfile.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-19 14:34:14 -07:00
Archana Shinde
0b33519709 rootfs: add PACKAGE var to debian config
debian config seems to be missing PACKAGE variable altogether.
Add it along with appending chrony to the list.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-19 14:30:10 -07:00
Archana Shinde
510ddd28c8 rootfs: Add chrony service to rootfs
chrony will be used to schronize guest clock with host
using kvm_ptp kernel driver.
This does add another active component to the rootfs
but keeping time scychorized is crucial.

Fixes #255

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-19 14:12:21 -07:00
Gabriela Cervantes
523405e62d test: Modify test_images script to handle FC
We need to modify this test in order to handle firecracker.

Fixes #248

Depends-on:github.com/kata-containers/osbuilder#247

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2019-03-19 13:42:00 -06:00
Jose Carlos Venegas Munoz
d67aad893f
Merge pull request #247 from devimc/topic/fixFCNoDax
image-builder: make DAX support optional
2019-03-19 11:51:19 -06:00
Julio Montes
6217689cc0
Merge pull request #253 from bergwolf/1.6.0-rc2-branch-bump
# Kata Containers 1.6.0-rc2
2019-03-19 09:50:19 -06:00
Peng Tao
6570944b67 release: Kata Containers 1.6.0-rc2
- image-builder: fill out device namespace information into kata image
- tests: install kata components from master
- tests: skip euleros
- arch: Remove calls to arch command
- pullapprove: remove it
- memory_hotplug: MEM_BOUNDARY_MB should be arch-dependent

726f798 image-builder: fill out device namespace information into kata image
cbe5642 image-builder: add gcc as dependecy to generate the image
7620066 image-builder: sync rootfs data after copying it into the image
dc5bc07 image-builder: fix mem boundary recalculation
71ccc0a mage-builder: remove -s option and IMG_SIZE envar
8065bb6 rootfs-builder: delete dnf and rmp data
35588dd tests: install kata containers components from master
519bbe8 tests: remove docker before installing the newer version
b4de168 tests: skip euleros
f38c67d arch: Remove calls to arch command
8963b8e pullapprove: remove it
e4d5c1b memory_hotplug: MEM_BOUNDARY_MB should be arch-dependent

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2019-03-18 22:14:31 +08:00
Julio Montes
02fa22bbdd image-builder: make DAX support optional
Not all hypervisor support NVDIMM hence DAX support MUST BE enabled explicitly
setting the DAX environment variable to 'yes'

fixes #246

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-15 13:14:52 -06:00
James O. D. Hunt
ecd072430f
Merge pull request #236 from devimc/topic/fixDAX
image-builder: fill out device namespace information into kata image
2019-03-14 08:35:50 +00:00
Julio Montes
726f798ff7 image-builder: fill out device namespace information into kata image
The new NVDIMM driver implementation (kernel >= 4.16) needs to know the device
namespace information to map pages, this metadata is read from the nvdimm
namespace at 4k offset.

fixes #235

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-13 13:05:06 -06:00
Julio Montes
cbe5642b9d image-builder: add gcc as dependecy to generate the image
gcc is required to build the binary in charge to fill out the device
namespace information (matadata) into the kata containers image.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-13 13:05:06 -06:00
Julio Montes
7620066c8a image-builder: sync rootfs data after copying it into the image
Rootfs data must be sync'd after copying it into the image to avoid
data corruption

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-13 13:05:06 -06:00
Julio Montes
dc5bc07825 image-builder: fix mem boundary recalculation
$/${} is unnecessary on arithmetic variables. [SC2004]

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-13 13:05:06 -06:00
Julio Montes
71ccc0a6ea mage-builder: remove -s option and IMG_SIZE envar
guest kernel needs 64 bytes of DRAM per 4K page of emulated PMEM, hence the
image size should be as small as possible to reduce the container's memory
footprint. The image size is recalculated automatically if it's too small
to contain the rootfs.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-13 13:05:06 -06:00
Julio Montes
8065bb615a rootfs-builder: delete dnf and rmp data
dnf and rmp data are not needed in the final rootfs, removing them we save
2MB of disk

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-13 13:05:06 -06:00
Salvador Fuentes
da8101a2aa
Merge pull request #243 from devimc/topic/testMaster
tests: install kata components from master
2019-03-13 13:04:41 -06:00