Commit Graph

412 Commits

Author SHA1 Message Date
Salvador Fuentes
494272b0ac
Merge pull request #371 from nitkon/master
osbuilder: Add USE_PODMAN as an alternate for USE_DOCKER
2019-10-02 13:51:57 -05:00
Nitesh Konkar
15996014db osbuilder: Update README about USE_PODMAN variable
`USE_PODMAN` variable needs to be set for the osbuilder
scripts to use podman as a containerization engine to
build initrd/rootfs images. If both are set, `USE_DOCKER`
would take precedence over `USE_PODMAN`

Fixes: #370

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2019-10-02 21:58:41 +05:30
Nitesh Konkar
d1751a35e1 osbuilder: Add USE_PODMAN as an alternate for USE_DOCKER
In case a user wants to use podman instead of
docker to build initrd/rootfs images, facilitate
it by setting the variable `USE_PODMAN=true`.

Fixes: #370

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2019-10-02 21:58:02 +05:30
Julio Montes
d1fdf4083e
Merge pull request #369 from nitkon/patch-2
README: Update how to use DEBUG variable
2019-10-01 09:11:38 -05:00
GabyCT
9a9a8978f5
Merge pull request #364 from nitkon/fix_yq
Fix yq
2019-09-30 12:32:34 -05:00
nitkon
d2d029ce47
README: Update how to use DEBUG variable
Update osbuilder README to use DEBUG
environment variable for executing scripts in
debug mode.

Fixes:  #368

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2019-09-28 23:12:20 +05:30
Salvador Fuentes
3e4b381248
Merge pull request #366 from nitkon/dns_initrd
initrd_builder: Create empty resolv.conf in rootfs
2019-09-26 12:04:39 -05:00
Nitesh Konkar
9e10b341d6 rootfs_builder: Create /etc/resolv.conf in rootfs
Create an empty /etc/resolv.conf in rootfs if
it does not already exists else preserve it if
not a symlink. This would allow the agent to bind
mount it for DNS in kata VM.

Fixes: #365

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2019-09-26 20:17:41 +05:30
Nitesh Konkar
5982e48774 lib.sh: Fix curl error when using curl+yq
When you curl versions.yaml file and pipe into
yq, sometimes the piped program
closes the read pipe before the previous program
is finished leading to "curl: (23) Failed writing
body (1337 != 1371)". As a workaround we pipe the
stream through double "tac", an intermediary program
that always reads the whole page before feeding it
to the next program.

Fixes: #363

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2019-09-24 23:32:21 +05:30
Nitesh Konkar
05428a6424 rootfs: Install yq if not found instead of error
When building rootfs, yq is needed to parse
the version from versions.yaml file. If yq
is not found, it fails. In this PR, we install
yq if not found.

Fixes: #363

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2019-09-24 23:31:45 +05:30
Julio Montes
c33068de10
Merge pull request #350 from jongwu/29
rootfs: update fedora to 29 for arm64.
2019-09-20 08:46:40 -05:00
Jianyong Wu
1eec032c63 rootfs: update fedora to 29 for arm64.
there is issue in fedora:28 when start systemd service.
update fedora to 29 will bypass this issue.

Fixes: #349
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2019-09-19 21:11:43 -04:00
Eric Ernst
46785d86cc
Merge pull request #358 from egernst/1.9.0-alpha2-branch-bump
# Kata Containers 1.9.0-alpha2
2019-09-17 07:48:20 -07:00
Eric Ernst
4287ba639b release: Kata Containers 1.9.0-alpha2
- dracut: increase base.conf priority from 00 to 05
- make: use bash to fetch dracut conf 'drivers' list

dec8013 make: use bash to fetch dracut conf 'drivers' list
6daec98 make: Move comment about dracut --no-kernel
2950b37 dracut: increase base.conf priority from 00 to 05

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-09-16 11:31:43 -07:00
GabyCT
83b89d8773
Merge pull request #355 from crobinso/dracut-conf-priority
dracut: increase base.conf priority from 00 to 05
2019-09-11 09:59:16 -05:00
GabyCT
c8e6054843
Merge pull request #357 from crobinso/dracut-drivers-parse
make: use bash to fetch dracut conf 'drivers' list
2019-09-10 09:10:30 -05:00
Cole Robinson
dec8013748 make: use bash to fetch dracut conf 'drivers' list
dracut will process conf files with bash, and in fact it's common to
use idioms like += in conf files for string concatenation. The current
grep usage in the Makefile won't catch all possible valid 'drivers'
variable cases.

Instead, use bash to parse and echo the 'drivers' content

Fixes: #356

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-09-09 13:17:58 -04:00
Cole Robinson
6daec98aaf make: Move comment about dracut --no-kernel
The current placement is confusing IMO, let's move it close to the
code it's describing

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-09-09 13:17:58 -04:00
Cole Robinson
2950b37028 dracut: increase base.conf priority from 00 to 05
The Makefile invokes dracut with a custom confdir. However dracut will
still pull site configuration from /usr/lib/dracut/dracut.conf.d/, which
on Fedora contains a 01-dist.conf that sets among other things
early_microcode="yes".

Because 01-dist.conf is processed after 00-base.conf, kata's
early_microcode="no" is overridden, which isn't intended.

Rename 00-base.conf to 05-base.conf to sidestep this

Fixes: #354

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-09-09 12:44:29 -04:00
Eric Ernst
48540146b6
Merge pull request #351 from katabuilder/1.9.0-alpha1-branch-bump
# Kata Containers 1.9.0-alpha1
2019-09-06 10:55:46 -07:00
Salvador Fuentes
2b785044a2 ci: travis: allow failures on ppc64le
travis ppc64le has been very unstable when running
apt-get commands and are not allowing us to run the
job successfully.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2019-09-06 09:19:12 -05:00
katacontainersbot
f9cfa172ab release: Kata Containers 1.9.0-alpha1
- image_builder: create /etc/resolv.conf
- Add kmod package
- dracut: improve host distro support
- Allow to override build date with SOURCE_DATE_EPOCH
- image-builder: check /sbin/init when AGENT_INIT=yes
- chrony-service: re-patch PR#265
- image-builder: get mount directory size with Mb format
- osbuilder: add dracut build method
- fedora-rootfs: using fedora 28 on aarch64

862b077 image_builder: create /etc/resolv.conf
ce20d72 dracut: improve host distro support
495a92d rootfs-builder: add kmod package
87af599 rootfs-builder/clearlinux: reduce image size when AGENT_INIT=yes
dacd2d3 scripts/lib: Allow to override build date
9afe931 chrony-service: re-patch PR#265
b1b8ce4 image-builder: check /sbin/init when AGENT_INIT=yes
934422f tests: fix background job failure detection
317bfba travis: use Ubuntu bionic distro version
a5a3343 ci: use .ci/setup.sh from tests repo
1e5746a tests: add dracut initrd and image tests
6d5aef5 osbuilder: Get mount directory size with Mb format
2f55017 osbuilder: add dracut build method
9bfc083 fedora-rootfs: using fedora 28 on aarch64
8ebaac0 rootfs: move code from rootfs.sh to lib.sh
39370c2 rootfs-builder: support provisioning existing rootfs

Signed-off-by: katacontainersbot <katacontainersbot@gmail.com>
2019-09-03 17:34:10 +00:00
Peng Tao
64caa3f4d3
Merge pull request #346 from nitkon/master
image_builder: create /etc/resolv.conf
2019-08-22 14:39:34 +08:00
Nitesh Konkar
862b077598 image_builder: create /etc/resolv.conf
Since the image rootfs is readonly, we
create an empty /etc/resolv.conf which
the agent would later bind-remount as
read-write.

Fixes: #345

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2019-08-12 19:15:32 +05:30
GabyCT
88f8216978
Merge pull request #342 from devimc/topic/rootfs/kmod
Add kmod package
2019-08-09 14:05:45 -05:00
Julio Montes
987fe3067e
Merge pull request #344 from marcov/dracut-improvements
dracut: improve host distro support
2019-08-09 11:39:23 -05:00
Julio Montes
7412b98774
Merge pull request #340 from bmwiedemann/date
Allow to override build date with SOURCE_DATE_EPOCH
2019-08-09 08:39:27 -05:00
Marco Vedovati
ce20d72593 dracut: improve host distro support
Detecting the host distro allows the rootfs setup to be correctly
carried out.

Fixes: #343

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-08-09 15:35:08 +02:00
Julio Montes
495a92d2c3 rootfs-builder: add kmod package
Support for loading kernel modules got merged. kmod package is needed for
loading kernel modules in the guest.

fixes #341

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-08-08 20:28:59 +00:00
Julio Montes
87af599dd0 rootfs-builder/clearlinux: reduce image size when AGENT_INIT=yes
Don't install chrony, iptables-bin and util-linux-bin when AGENT_INIT=yes,
these packages are only needed when the init process is systemd.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-08-08 20:12:03 +00:00
Bernhard M. Wiedemann
dacd2d34b9 scripts/lib: Allow to override build date
Allow to override build date with SOURCE_DATE_EPOCH
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Also use UTC to be independent of timezone.

This date call only works with GNU date.

Without this patch, kata-containers-initrd.img contained
varying var/lib/osbuilder/osbuilder.yaml with
   version: "1.9.0-alpha0"
   -rootfs-creation-time: "2019-08-06T18:40:27.402493939+0000Z"
   +rootfs-creation-time: "2034-09-08T07:57:34.386990704+0000Z"

Fixes #340

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
2019-08-08 16:37:22 +02:00
Salvador Fuentes
269d31a9ac
Merge pull request #337 from devimc/topic/image-builder/fixMissingAgent
image-builder: check /sbin/init when AGENT_INIT=yes
2019-08-02 09:46:29 -05:00
Archana Shinde
dd40af2557
Merge pull request #339 from Pennyzct/chrony_only_on_x86-64
chrony-service: re-patch PR#265
2019-08-01 12:24:54 -07:00
Penny Zheng
9afe9310b1 chrony-service: re-patch PR#265
commit 39370c2(https://github.com/kata-containers/osbuilder/commit/
39370c2aea) has accidentally deleted the
content in PR#265(https://github.com/kata-containers/osbuilder/pull/265).
Here, I just re-patch PR#265 on the latest master code.

Fixes: #338

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-08-01 15:48:46 +08:00
Julio Montes
7a523c3782
Merge pull request #324 from clarklee92/master
image-builder: get mount directory size with Mb format
2019-07-30 08:24:15 -05:00
Julio Montes
b1b8ce427a image-builder: check /sbin/init when AGENT_INIT=yes
kata-agent is moved to /sbin/init when AGENT_INIT is yes. Check
/sbin/init exists and it's not systemd

fixes #322

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-07-30 13:23:11 +00:00
Jose Carlos Venegas Munoz
73cee17420
Merge pull request #312 from marcov/dracut
osbuilder: add dracut build method
2019-07-29 12:35:59 -05:00
Marco Vedovati
934422fc15 tests: fix background job failure detection
Distros with systemd / agent as init are not correctly enumerated.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-07-29 17:10:42 +02:00
Marco Vedovati
317bfba4b1 travis: use Ubuntu bionic distro version
Ubuntu bionic is a more recent LTS than trusty.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-07-29 17:10:42 +02:00
Marco Vedovati
a5a33436a6 ci: use .ci/setup.sh from tests repo
Use .ci/setup.sh from tests repo, to make sure spell check packages are
correctly installed for the OS under test.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-07-29 17:10:42 +02:00
Marco Vedovati
1e5746a4f2 tests: add dracut initrd and image tests
Build dracut initrd and images inside a reference container.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-07-29 17:10:42 +02:00
ClarkLee
6d5aef531a osbuilder: Get mount directory size with Mb format
While calculating directory size in imagebuild script, we shoul use
`df -BM` instead of `df -h` to keep Mb format.

Fixes #336

image-builder: get mount directory size with Mb format

Signed-off-by: ClarkLee <clarklee1992@hotmail.com>
2019-07-29 23:03:17 +08:00
Marco Vedovati
2f55017fea osbuilder: add dracut build method
Add the option to build image and initrd using dracut.

Fixes: #311

Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-07-29 12:58:24 +02:00
Salvador Fuentes
28b0ed9209
Merge pull request #335 from Pennyzct/fedora_28_on_aarch64
fedora-rootfs: using fedora 28 on aarch64
2019-07-23 10:40:23 -05:00
Penny Zheng
9bfc083ef5 fedora-rootfs: using fedora 28 on aarch64
For some reason, busybox image crashed on fedora 30 rootfs on aarch64.
For now, we will switch back to use fedora 28.

Fixes: #334

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-07-23 17:43:38 +08:00
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
Jose Carlos Venegas Munoz
cd9ab72636
Merge pull request #333 from egernst/1.9.0-alpha0-branch-bump
# Kata Containers 1.9.0-alpha0
2019-07-18 16:23:19 -05:00
Eric Ernst
bdbc806770 release: Kata Containers 1.9.0-alpha0
- rootfs: upgrade docker images for fedora
- rootfs: Make sure etc exists.

edb770e rootfs: upgrade docker images for fedora
27dddf0 rootfs: Make sure etc exists.

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-07-18 12:49:36 -07:00
James O. D. Hunt
fb454f87f7
Merge pull request #332 from jcvenegas/fedora-update
rootfs: upgrade docker images for fedora
2019-07-18 08:40:22 +01:00
Jose Carlos Venegas Munoz
edb770ee63 rootfs: upgrade docker images for fedora
Use fedora 30 in docker images.

Fixes: #331

Signed-off-by: Jose Carlos Venegas Munoz <jcvenega@jcvenega-nuc.zpn.intel.com>
2019-07-17 13:54:53 -05:00