Commit Graph

462 Commits

Author SHA1 Message Date
Peng Tao
65717ba6d0 release: Kata Containers 1.11.0-alpha1
- scripts: set a default path to the yq binary
- AArch64: Build rust image on aarch64
- image-builder: Add NSDAX_BIN for passing in compiled nsdax tool
- rootfs: Don't overwrite /sbin/init if it already exists
- tests: Improve running test_images.sh locally

1c063af scripts: set a default path to the yq binary
67343a1 rust-agent: Separate the build up of rust-agent and go-agent
a390a36 rootfs: remove RUST_SRC_PATH
41aaa36 ubuntu/debian: create aarch64-specific Dockerfile.in
9cba8c4 musl: install musl on aarch64
87a5d5c rootfs: Don't overwrite /sbin/init if it already exists
4004bd8 image-builder: Add NSDAX_BIN for passing in compiled nsdax tool
134175b tests: Document the changed KATA_DEV_MODE behavior
0f4eac4 tests: Skip initrd/image launch if KATA_DEV_MODE
762ec28 tests: Drop kata-runtime env validation if KATA_DEV_MODE is set
6f17b9c tests: Skip set_runtime if KATA_DEV_MODE is set
17a8fb1 tests: Skip all kata-manager usage if KATA_DEV_MODE is set
e787bb0 tests: Define KATA_DEV_MODE
cef2591 tests: Rework dracut docker bind mounts
f3ab6d2 tests: Don't run commands with `chronic` if DEBUG is set
7a8e816 tests: Specify DRACUT_OVERLAY_DIR
7dd99c0 tests: Add project_dir helper variable
1ae3922 tests: Have DEBUG=1 set bash xtrace
555ddf3 tests: Remove unused USE_DOCKER export
0e6a12c tests: Pass DOCKER_RUNTIME to osbuilder scripts
e8624d8 tests: Rename docker_build_runtime -> DOCKER_RUNTIME
cd46d09 tests: Remove hardcoded 'runc' reference
c574ec0 tests: Remove dead unset images_dir check
44f2931 tests: Remove unused test_func_prefix

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-03-16 12:39:05 +00:00
Salvador Fuentes
9e0807a7f5
Merge pull request #430 from devimc/topic/scripts/fixYqNotFound
scripts: set a default path to the yq binary
2020-03-12 12:30:00 -06:00
Julio Montes
1c063afc5f scripts: set a default path to the yq binary
Use the path where `install-yq.sh` installs `yq` as the default path to the
`yq` binary in `lib.sh`.
Install `yq` in the default path if it doesn't exist.

fixes #429

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-03-12 15:25:24 +00:00
Graham Whaley
397ce26948
Merge pull request #412 from Pennyzct/build_rust_image_on_aarch64
AArch64: Build rust image on aarch64
2020-03-11 09:37:02 +00:00
Julio Montes
400fed8a0f
Merge pull request #418 from crobinso/nsdax-bin
image-builder: Add NSDAX_BIN for passing in compiled nsdax tool
2020-03-10 16:08:43 -06:00
Julio Montes
fc6db0b8f2
Merge pull request #420 from crobinso/init-no-overwrite
rootfs: Don't overwrite /sbin/init if it already exists
2020-03-10 16:07:38 -06:00
Penny Zheng
67343a178c rust-agent: Separate the build up of rust-agent and go-agent
Separate the build up of rust-agent and go-agent, hence you only
select one as kata-agent.
I've added the generation of rust-agent systemd service files into
rust-agent Makefile.
Therefore, we could use same `make` commands to build go-agent and
rust-agent.

Fixes: #411

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-03-10 21:20:53 +08:00
Penny Zheng
a390a360db rootfs: remove RUST_SRC_PATH
If user wants to use customized rust-agent, they could use
AGENT_SOURCE_BIN to pass the static binary.
The rust-agent is always statically linked with musl.

Fixes: #411

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-03-10 21:20:48 +08:00
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
87a5d5c8d7 rootfs: Don't overwrite /sbin/init if it already exists
The prepare_overlay() code path is called when rootfs.sh is invoked
with no passed in distro string. This is used for the dracut case
from the Makefile for example. In that particular case, the starting
root directory is empty.

It's also valid to pass a prepopulated directory to rootfs.sh, which
is essentially a request for the script to just make the necessary
kata changes. Currently though prepare_overlay() makes some changes
that could wipe out pre-arranged /sbin/init setup.

Check first to see if /sbin/init exists in the rootfs dir, and if so,
skip the symlink changes

Fixes: #419

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-06 13:29:28 -05:00
Cole Robinson
4004bd8fbe image-builder: Add NSDAX_BIN for passing in compiled nsdax tool
In Fedora we are running the osbuilder scripts on the client machine,
to generate an initrd for the running host kernel. In this setup,
there's currently a runtime dependency on gcc for compiling the nsdax
tool, which is suboptimal.

Add NSDAX_BIN environment variable; if specified, image-builder.sh
will use that path as the nsdax tool. This let's ship a compiled
nsdax tool to users and drop the runtime gcc dependency

Fixes: #417

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-05 14:47:03 -05: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