Commit Graph

327 Commits

Author SHA1 Message Date
Julio Montes
030cd4d41f
Merge pull request #301 from amshinde/retain-tmp-mount-unit
tmp: Do not remove tmp.mount unit file from the rootfs
2019-05-31 11:40:52 -05:00
Archana Shinde
6f294f43d4 tmp: Do not remove tmp.mount unit file from the rootfs
We should start this unit so that systemd can mount /tmp as
tmpfs.

Fixes #300

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-05-30 15:12:05 -07:00
GabyCT
148b6d7485
Merge pull request #299 from jodh-intel/doc-fixes
docs: Fix spelling and formatting
2019-05-27 10:59:02 -05:00
Salvador Fuentes
3fea550a4d
Merge pull request #297 from devimc/topic/image/fix-machine-id
image-builder: create /etc/machine-id
2019-05-24 16:03:07 -05:00
James O. D. Hunt
14534717c7 docs: Fix spelling and formatting
Correct spelling mistakes and resolve formatting issues.

Fixes: #298.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-05-24 17:09:13 +01:00
Julio Montes
a438d086b2 image-builder: create /etc/machine-id
systemd complains if `/etc/machine-id` does not exist. Create the `machine-id`
file to make systemd happy, it'll bind-mount that file to write the machine id.

fixes #296
fixes github.com/kata-containers/runtime#1537

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-05-23 07:38:12 -05:00
GabyCT
67b66c4d95
Merge pull request #295 from devimc/topic/rootfs/fixChrony
rootfs-builder: fix chrony service
2019-05-22 11:33:23 -05:00
Julio Montes
456be67094 rootfs-builder: fix chrony service
Chrony service is not started because it requires a private temporal directory,
these directories can't be created in read-only filesystems. Create a symlink
to /tmp in /var allowing systemd to create private temporal directories.

fixes #280

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-05-21 12:15:34 -05:00
James O. D. Hunt
1afb7e5685
Merge pull request #294 from jodh-intel/golang-use-latest-alpine
rootfs: Don't hardcode alpine version for golang images
2019-05-21 13:58:29 +01:00
James O. D. Hunt
d8c5706cff rootfs: Don't hardcode alpine version for golang images
Remove the version of alpine used when pulling golang docker images.
This ensures the latest version of alpine is used and resolves the
maintenance issue when old versions of alpine are dropped.

Fixes: #293.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-05-21 10:51:05 +01:00
James O. D. Hunt
a800a5dee6
Merge pull request #290 from devimc/topic/image/removeSystemdUnits
image-builder/boot time: remove unneeded systemd units and files
2019-05-17 09:59:59 +01:00
Julio Montes
02b3b3b977 image-builder: remove unneeded systemd units and files
Remove systemd units and files that are not needed in Kata Containers.
Removing this files we can improve the boot time.

fixes #289

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-05-16 13:19:55 -05:00
James O. D. Hunt
4a2fa6875d
Merge pull request #287 from marcov/no-create-1
rootfs: use command vs which, avoid "1" file creation
2019-05-10 16:18:50 +01:00
Eric Ernst
c8e20e2a18
Merge pull request #288 from katabuilder/1.7.0-rc1-branch-bump
# Kata Containers 1.7.0-rc1
2019-05-10 07:58:27 -07:00
katacontainersbot
b9d9009cd9 release: Kata Containers 1.7.0-rc1
- docs: Fix markdown
- make: add nsdax source to install-scripts target
- rootfs-builder: remove /var/log

c5a17f7 docs: Fix markdown
7cfe5b4 image-builder: set default value of AGENT_INIT
0013352 make: add nsdax source to install-scripts target
c00849b rootfs-builder: remove /var/log

Signed-off-by: katacontainersbot <katacontainersbot@gmail.com>
2019-05-09 00:23:56 +00:00
Marco Vedovati
9a8f1688d5 rootfs: use command vs which, avoid "1" file creation
Replace "which" with "command", that's a bash built-in and should
not generate any stderr messages. This also fixex the spurious creating
of "1" file in the repo root because of a typo in stderr redirect.

Fixes: #286

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-05-07 12:29:51 +02:00
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