Commit Graph

452 Commits

Author SHA1 Message Date
Penny Zheng
41aaa36e6f ubuntu/debian: create aarch64-specific Dockerfile.in
The musl package in ubuntu/debian could not provide everything we need
on aarch64.
e.g. we need `aarch64-linux-musl-gcc` as linker, and it's not provided
in package.

Fixes: #411

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-03-10 21:20:43 +08:00
Penny Zheng
9cba8c4c27 musl: install musl on aarch64
The original musl-installing method is only for x86_64 and i386(see
musl config.mak template file).
musl.cc provides small and reliable pre-built musl toolchains
for many architectures.
Static so they run on supported platforms without dependencies.

Fixes: #411

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-03-10 21:20:38 +08:00
Julio Montes
be273aa43d
Merge pull request #416 from crobinso/tests-dev-mode
tests: Improve running test_images.sh locally
2020-03-09 09:33:49 -06:00
Cole Robinson
134175bb9b tests: Document the changed KATA_DEV_MODE behavior
Document the KATA_DEV_MODE changes explained in the previous commits

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 18:56:11 -05:00
Cole Robinson
0f4eac434b tests: Skip initrd/image launch if KATA_DEV_MODE
The script points kata-runtime at the generated initrd/image by
editing the host config file, which we aren't doing when
KATA_DEV_MODE=1 is set, so this won't work.

Fixes: #415

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 18:09:57 -05:00
Cole Robinson
762ec28a6b tests: Drop kata-runtime env validation if KATA_DEV_MODE is set
If KATA_DEV_MODE is set, test_images.sh attempts to validate that
docker has kata-runtime as a configured --runtime value. This gives
a nicer and earlier error, but it also complicates using
/usr/bin/docker as provided by podman, which has a different 'info'
topology.

Let's drop the check and let the tests fail naturally if the host
isn't configured properly

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 18:09:57 -05:00
Cole Robinson
6f17b9cb48 tests: Skip set_runtime if KATA_DEV_MODE is set
set_runtime attempts to overwrite the host docker configuration to
default to DOCKER_RUNTIME instead of kata-runtime, which does not
work for 'docker build'.

Since this is a host altering step, skip it if KATA_DEV_MODE is set.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 18:09:57 -05:00
Cole Robinson
17a8fb13a1 tests: Skip all kata-manager usage if KATA_DEV_MODE is set
kata-manager.sh makes host config changes. KATA_DEV_MODE is meant to
avoid such changes.

Add a helper run_mgr function which stubs out kata-manager.sh usage
if KATA_DEV_MODE is set.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 18:09:57 -05:00
Cole Robinson
e787bb0da5 tests: Define KATA_DEV_MODE
Define KATA_DEV_MODE at the top of the file, so code doesn't need
to conditionally compare against it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 18:09:57 -05:00
Cole Robinson
cef25917a4 tests: Rework dracut docker bind mounts
The current setup leaves images/ and rootfs-osbuilder/ dirs stranded
in the $project_dir when run locally. This simplifies things by only
passing through the project_dir and the tmp_dir that all our output
is relative to

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 18:09:57 -05:00
Cole Robinson
f3ab6d2666 tests: Don't run commands with chronic if DEBUG is set
Don't suppress output with `chronic` when the user sets DEBUG

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 18:09:36 -05:00
Cole Robinson
7a8e816ded tests: Specify DRACUT_OVERLAY_DIR
Otherwise it defaults to using the $project_dir/dracut_overlay, which
leaves junk hanging around when running the tests locally

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 14:55:53 -05:00
Cole Robinson
7dd99c022b tests: Add project_dir helper variable
Rather than use ${script_dir}/.. in multiple places

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 14:55:53 -05:00
Cole Robinson
1ae392285e tests: Have DEBUG=1 set bash xtrace
This is similarly used in image_builder.sh and can be handy to
determine what is happening. Unfold the 'set' short options while
we are at it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 14:55:53 -05:00
Cole Robinson
555ddf331a tests: Remove unused USE_DOCKER export
We now explicitly pass this to every make target we invoke, so
this is redundant

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 14:55:53 -05:00
Cole Robinson
0e6a12ce3c tests: Pass DOCKER_RUNTIME to osbuilder scripts
The rootfs and image builder scripts are wired up to handle the
DOCKER_RUNTIME, so pass our value down to those scripts

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 14:55:53 -05:00
Cole Robinson
e8624d89d9 tests: Rename docker_build_runtime -> DOCKER_RUNTIME
DOCKER_RUNTIME is the naming used in the actual osbuilder scripts
for this value. Change the test code to match

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 14:55:53 -05:00
Cole Robinson
cd46d09e0c tests: Remove hardcoded 'runc' reference
Replace it with docker_build_runtime which serves a similar purpose

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 14:55:53 -05:00
Cole Robinson
c574ec0528 tests: Remove dead unset images_dir check
This value is set globally, so this condition will never trigger.
`mkdir -p` would error anyways if it was unspecified

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 14:55:53 -05:00
Cole Robinson
44f29318dd tests: Remove unused test_func_prefix
This has been unused since 562be909

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-02 14:55:53 -05:00
Archana Shinde
8a9aa41247
Merge pull request #410 from amshinde/1.11.0-alpha0-branch-bump
# Kata Containers 1.11.0-alpha0
2020-02-19 17:46:28 -08:00
Archana Shinde
c54e5caf37 release: Kata Containers 1.11.0-alpha0
- Rootfs builder: build rust agent using osbuilder
- image-builder: make docker runtime configurable
- image_builder: Remove nsdax binary after its usage

1a7b735 rootfs-builder: build rust agent using osbuilder
c407421 image-builder: make docker runtime configurable
98ac62d image_builder: Remove nsdax binary after its usage

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-02-18 19:37:05 +00:00
Yang Bo
11a1cf53c2
Merge pull request #361 from yyyeerbo/wip
Rootfs builder: build rust agent using osbuilder
2020-02-10 10:57:19 +08:00
Yang Bo
1a7b735c3c rootfs-builder: build rust agent using osbuilder
Build rust agent and go agent using the same rootfs bulder image.
When building rust agent, just add RUST_AGENT=yes before command line.
The documentation will be updated later

Depends-on: github.com/kata-containers/tests#2287

Fixes: #360

Signed-off-by: Yang Bo <bo@hyper.sh>
2020-02-07 21:47:33 +08:00
Julio Montes
7526f4957d
Merge pull request #398 from devimc/topic/imagebuilder/configureDockerRuntime
image-builder: make docker runtime configurable
2020-01-20 16:19:37 -06:00
Julio Montes
c407421a26 image-builder: make docker runtime configurable
Add DOCKER_RUNTIME variable to change container runtime depending on the
CI/environment.

fixes #397

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-01-20 20:39:04 +00:00
Julio Montes
0e4c497c68
Merge pull request #395 from fidencio/wip/cleanup_nsdax
image_builder: Remove nsdax binary after its usage
2020-01-17 10:33:28 -06:00
Fabiano Fidêncio
98ac62dec9 image_builder: Remove nsdax binary after its usage
Leaving nsdax behind may create some isses for the distro packages
of kata-osbuilder, as every package would have to take care of purging
the file on each distro.

Knowing that, we better remove the file as part of the script, mainly
because the file is already regenerated everytime in any case.

Fixes: #394

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-01-17 13:30:11 +01:00
GabyCT
dbbf16082d
Merge pull request #389 from katabuilder/1.10.0-rc0-branch-bump
# Kata Containers 1.10.0-rc0
2019-12-09 13:01:21 -06:00
katacontainersbot
640fee2e2a release: Kata Containers 1.10.0-rc0
- make: use `cd` instead of '--directory' option of `cpio`

38d0be3 make: use `cd` instead of '--directory' option of `cpio`

Signed-off-by: katacontainersbot <katacontainersbot@gmail.com>
2019-12-09 17:18:03 +00:00
Salvador Fuentes
df7982b95f
Merge pull request #385 from shiloong/master
make: use `cd` instead of '--directory' option of `cpio`
2019-12-04 06:34:59 -06:00
Shile Zhang
38d0be3824 make: use cd instead of '--directory' option of cpio
Due to the option '--directory' just added from 'cpio' v2.12, so the
osbuilder will failed with old version 'cpio' before v2.12, such as in
Centos 7 with v2.11.
Fix it by replacing this option with '(cd ...; cat ...)'.

Fixes: #384

Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com>
2019-12-04 09:27:07 +08:00
Archana Shinde
36a9dc5c72
Merge pull request #381 from amshinde/1.10.0-alpha1-branch-bump
# Kata Containers 1.10.0-alpha1
2019-11-19 20:06:18 -08:00
Archana Shinde
75392a744f release: Kata Containers 1.10.0-alpha1
- rootfs-builder/alpine: use latest stable

50c9378 rootfs-builder/alpine: use latest stable

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-11-20 00:12:51 +00:00
James O. D. Hunt
4ec9dd3593
Merge pull request #380 from devimc/topic/initrd/fixAlpineCVEs
rootfs-builder/alpine: use latest stable
2019-11-11 11:11:03 +00:00
Julio Montes
50c9378659 rootfs-builder/alpine: use latest stable
use latest stable to fix CVEs

fixes #379

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-11-08 14:27:50 +00:00
Eric Ernst
5f6e642bb7
Merge pull request #377 from egernst/1.10.0-alpha0-branch-bump
# Kata Containers 1.10.0-alpha0
2019-10-31 15:41:13 -07:00
Eric Ernst
f2e4edc068 release: Kata Containers 1.10.0-alpha0
Version bump no changes

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-10-31 12:58:23 -07:00
Archana Shinde
bf8793adad
Merge pull request #373 from katabuilder/1.9.0-rc0-branch-bump
# Kata Containers 1.9.0-rc0
2019-10-08 18:48:30 -07:00
katacontainersbot
6fa3063e68 release: Kata Containers 1.9.0-rc0
- osbuilder: Add USE_PODMAN as an alternate for USE_DOCKER
- README: Update how to use DEBUG variable
- Fix yq
- initrd_builder: Create empty resolv.conf in rootfs
- rootfs: update fedora to 29 for arm64.

1599601 osbuilder: Update README about `USE_PODMAN` variable
d1751a3 osbuilder: Add USE_PODMAN as an alternate for USE_DOCKER
d2d029c README: Update how to use DEBUG variable
9e10b34 rootfs_builder: Create /etc/resolv.conf in rootfs
5982e48 lib.sh: Fix curl error when using curl+yq
05428a6 rootfs: Install yq if not found instead of error
1eec032 rootfs: update fedora to 29 for arm64.

Signed-off-by: katacontainersbot <katacontainersbot@gmail.com>
2019-10-08 21:38:20 +00:00
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