Commit Graph

363 Commits

Author SHA1 Message Date
Marco Vedovati
8ebaac02d1 rootfs: move code from rootfs.sh to lib.sh
Move some of the functions in rootfs.sh (generate_dockerfile,
detect_go_version) in scripts/lib.sh, to make those functions reusable
outside of rootfs.sh.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-07-20 09:01:03 +02:00
Marco Vedovati
39370c2aea rootfs-builder: support provisioning existing rootfs
Add the use case of provisioning an existing rootfs directory with the
components / configurations needed to generate a Kata compatible images.
This supports use cases such as using a rootfs built outside of
osbuilder, and providing a overlay for dracut built initrds.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-07-17 19:47:14 +02:00
GabyCT
7d38b84203
Merge pull request #329 from amshinde/make-sure-etc-exists-for-chrony
rootfs: Make sure etc exists.
2019-07-16 16:38:56 -05:00
Jose Carlos Venegas Munoz
33434894ba
Merge pull request #325 from katabuilder/1.8.0-rc0-branch-bump
# Kata Containers 1.8.0-rc0
2019-07-03 08:46:10 -05:00
James O. D. Hunt
c74f9a2bfb
Merge pull request #327 from jcvenegas/fix-go-version-detect
rootfs: fix golang version detection
2019-07-03 08:41:01 +01:00
Jose Carlos Venegas Munoz
4ade7e5853 rootfs: fix golang version detection
When the rootfs creation is used for PRs there is
not a match with a kata runtime version, in this
case lets clone the runtime repository and checkout
to the kata branch target. If is already cloned
this mean this was set by depens-on script or the user.

Fixes: #326

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-07-02 18:05:10 -05:00
Archana Shinde
27dddf0a25 rootfs: Make sure etc exists.
We are seeing sporadic failures in the rootfs creation as listed here:
https://github.com/kata-containers/tests/issues/1744

While this cannot be reproduced locally, there is no reason
for the failure to write to $ROOTFS_DIR/etc/chrony.conf unless the upper
directories are missing as this file should be created if it did not
exist earier.
So just create the etc directory to test out if we see these sporadic
failures in the CI.

Fixes #328

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-07-02 12:02:54 -07:00
katacontainersbot
b199ae01b4 release: Kata Containers 1.8.0-rc0
- rootfs: configure chronyc service with makestep
- agent: detect required Go version from versions.yaml
- rootfs-builder: exclude unsupported archs from euleros and clearlinux
- tests: reduce the amount of log displayed
- chrony: Configure chrony to start only when /dev/ptp0 exists.
- rootfs: install systemd tmp.mount if needed

5a5ffa4 rootfs-builder: exclude unsupported archs from euleros
7dc15c2 rootfs-builder: exclude unsupported archs from clearlinux
d2e80f5 chrony: Configure chrony to start only when /dev/ptp0 exists.
6969c7f rootfs: install systemd tmp.mount if needed
add0d44 rootfs: configure chronyc service with makestep
cc5df05 travis: do not set -x when running test
25d75e5 tests: reduce the amount of log displayed
acc9c7f tests: identify the distros with build failures
68f2090 make: add ability to silent recipe commands with chronic
cbb8c01 make: add print-% target printing variable value
e770e2a rootfs: enforce minimum Go version when building locally
92b42c7 agent: detect required Go version from versions.yaml

Signed-off-by: katacontainersbot <katacontainersbot@gmail.com>
2019-07-01 19:37:39 +00:00
James O. D. Hunt
0c48630395
Merge pull request #318 from xs3c/chronyc-with-makestep
rootfs: configure chronyc service with makestep
2019-06-25 07:49:37 +01:00
James O. D. Hunt
a84fcf296d
Merge pull request #292 from marcov/versions.yaml
agent: detect required Go version from versions.yaml
2019-06-24 17:12:24 +01:00
Marco Vedovati
5318edb8f2
Merge pull request #321 from Pennyzct/exclude_aarch64_from_clearlinux_and_euleros
rootfs-builder: exclude unsupported archs from euleros and clearlinux
2019-06-24 14:58:19 +02:00
Penny Zheng
5a5ffa4493 rootfs-builder: exclude unsupported archs from euleros
For euleros, it has supported aarch64 starting from v2.3,
but here is the sad part, there existed bugs in their 2.3.x image,
this bug existed in both x86_64 and aarch64 image.
related issue euleros/euleros-docker-images/#13
(https://github.com/euleros/euleros-docker-images/issues/13) has been raised.

Fixes: #320

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-06-24 17:01:18 +08:00
Penny Zheng
7dc15c28f8 rootfs-builder: exclude unsupported archs from clearlinux
For clearlinux, for now, it is only designed for amd64.

Fixes: #320

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-06-24 17:01:07 +08:00
James O. D. Hunt
a118a60efc
Merge pull request #314 from marcov/silent-logs
tests: reduce the amount of log displayed
2019-06-24 08:27:39 +01:00
Jose Carlos Venegas Munoz
0e0e74b8bb
Merge pull request #265 from amshinde/configure-chrony-systemd
chrony: Configure chrony to start only when /dev/ptp0 exists.
2019-06-21 11:20:31 -05:00
Archana Shinde
d2e80f54b1 chrony: Configure chrony to start only when /dev/ptp0 exists.
Hypercall to implement virtual PTP was introduced in kernel 4.10
Have chrony run only if the device created by kvm-ptp exists.
Add this as a ConditionExists in the systemd service file.

This service if named as chrony.service in deb based distributions
rather than chronyd.service, although a systemd alias exists.
However it is not possible to come up with a generic `PATH` systemd
unit relying on the alias.

Fixes #308

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-06-20 15:29:07 -07:00
Jose Carlos Venegas Munoz
434418c27b
Merge pull request #319 from marcov/debian-tmp.mount
rootfs: install systemd tmp.mount if needed
2019-06-20 14:57:57 -05:00
Marco Vedovati
6969c7fc18 rootfs: install systemd tmp.mount if needed
On some distros (Debian, Ubuntu, openSUSE), tmp.mount is not
installed by default in /[etc|usr/lib]/systemd/system, but
just in /usr/shared/systemd, so it needs to be manually copied
there to have /tmp mounted as tmpfs.

Fixes: #317

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-06-20 17:30:50 +02:00
Yang, Wei
add0d445e8 rootfs: configure chronyc service with makestep
The current chrony service does not step the system clock,
so add the modification to do this if the adjustment is
larger than one second

Fixes: #316

Signed-off-by: Yang, Wei <wei.yang1@linux.alibaba.com>
2019-06-20 18:26:37 +08:00
Xu Wang
d9782606bb
Merge pull request #313 from bergwolf/1.8.0-alpha2-branch-bump
# Kata Containers 1.8.0-alpha2
2019-06-19 15:09:50 +08:00
Marco Vedovati
cc5df055bc travis: do not set -x when running test
Do not `set -x` when running tests with Travis: tests are alreadyu doing
it, and with chronic logs are shown only if the commands executed fails.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-06-18 18:23:13 +02:00
Marco Vedovati
25d75e5b1c tests: reduce the amount of log displayed
Reduce the amount of logs displayed when running test. This is achieved
calling commands using chronic, and printing extra information about
the Kata / Docker configuration only if a test fails to start a
container.

Fixes: #145

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-06-18 18:23:13 +02:00
Marco Vedovati
acc9c7fe0d tests: identify the distros with build failures
Make more obvious what distros failed to build printing out for each
distro the success / failure build state.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-06-18 16:24:09 +02:00
Marco Vedovati
68f2090bab make: add ability to silent recipe commands with chronic
Add the ability to silent recipe commands with chronic.
When OSBUILDER_USE_CHRONIC is set, the target recipe command is run
using chronic, and the output is muted unless the command fails.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-06-18 13:36:03 +02:00
Marco Vedovati
cbb8c01412 make: add print-% target printing variable value
Add a print-% make target, to be able to retrieve the value of make
variables.
E.g. "make print-MY_MAKE_VAR MY_MAKE_VAR=1" will print "1"

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-06-18 13:25:27 +02:00
Peng Tao
840778788c release: Kata Containers 1.8.0-alpha2
- docs: Fix typo

7437ce8 docs: Fix typo

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-06-17 16:31:20 +08:00
Graham Whaley
3718af5f9f
Merge pull request #310 from jodh-intel/fix-typo
docs: Fix typo
2019-06-13 10:52:24 +01:00
James O. D. Hunt
7437ce8442 docs: Fix typo
Correct a spelling mistake.

Fixes: #309.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-06-13 10:04:28 +01:00
Ganesh Maharaj Mahalingam
07146a0934
Merge pull request #307 from katabuilder/1.8.0-alpha1-branch-bump
# Kata Containers 1.8.0-alpha1
2019-06-11 14:32:34 -07:00
katacontainersbot
3f45d5e17e release: Kata Containers 1.8.0-alpha1
Version bump no changes

Signed-off-by: katacontainersbot <katacontainersbot@gmail.com>
2019-06-10 20:56:15 +00:00
Ganesh Maharaj Mahalingam
a1581e3c67
Merge pull request #306 from katabuilder/1.8.0-alpha0-branch-bump
# Kata Containers 1.8.0-alpha0
2019-06-05 18:50:35 -07:00
katacontainersbot
8c51e4d916 release: Kata Containers 1.8.0-alpha0
- clear: Add util-linux-bin package to Clearlinux rootfs
- tmp: Do not remove tmp.mount unit file from the rootfs
- docs: Fix spelling and formatting
- image-builder: create /etc/machine-id
- rootfs-builder: fix chrony service
- rootfs: Don't hardcode alpine version for golang images
- image-builder/boot time: remove unneeded systemd units and files

adee8b0 clear: Add util-linux-bin package to Clearlinux rootfs
6f294f4 tmp: Do not remove tmp.mount unit file from the rootfs
1453471 docs: Fix spelling and formatting
a438d08 image-builder: create /etc/machine-id
456be67 rootfs-builder: fix chrony service
d8c5706 rootfs: Don't hardcode alpine version for golang images
02b3b3b image-builder: remove unneeded systemd units and files

Signed-off-by: katacontainersbot <katacontainersbot@gmail.com>
2019-06-05 19:15:58 +00:00
Marco Vedovati
e770e2ad1b rootfs: enforce minimum Go version when building locally
When building locally (without Docker), the Go version installed on the
system, needed to build the agent, must satisfy the minimum Go version
requirement specified in runtime/versions.yaml.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-06-05 11:02:57 +02:00
Marco Vedovati
92b42c7f6d agent: detect required Go version from versions.yaml
Detect the Go version required to build the agent from the versions.yaml
file in the runtime repository.

Fixes: #291

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-06-05 11:02:57 +02:00
GabyCT
2f22a5681d
Merge pull request #303 from amshinde/add-util-linux-bin
clear: Add util-linux-bin package to Clearlinux rootfs
2019-06-03 09:45:31 -05:00
Archana Shinde
adee8b0e35 clear: Add util-linux-bin package to Clearlinux rootfs
This package contains mount command among several other commands.
Unlike other distros, this package is not auto-pulled with systemd.
Add this package explicitly.

Fixes #302

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-05-31 14:35:20 -07:00
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