Commit Graph

363 Commits

Author SHA1 Message Date
Graham Whaley
86d2ab1938
Merge pull request #129 from nitkon/master
travis: Enable travis ci for ppc64le
2018-07-04 15:47:25 +01:00
Graham Whaley
49ac33ec5c
Merge pull request #137 from nitkon/comp-matrix
docs: Add Platform-Compatibility matrix
2018-07-04 13:11:07 +01:00
Nitesh Konkar
1e5e915f5a docs: Add Platform-Compatibility matrix
Fixes: #136

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2018-07-04 15:51:07 +05:30
Graham Whaley
67e7ba3584
Merge pull request #126 from jcvenegas/run-not-add-go
rootfs: docker: Reduce build time by not reinstalling go
2018-07-04 09:17:08 +01:00
Jose Carlos Venegas Munoz
25e9f01fb2 rootfs: docker: Reduce build time by not reinstalling go
Using docker we always add (ADD) the go tarball. But we can avoid do it
all the time if we install Go using RUN dockerfile instruction.

Use RUN to avoid repeat steps already done in dockerfile.

Fixes: #125

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-03 13:30:04 -05:00
Jose Carlos Venegas Munoz
b9b9410b83
Merge pull request #135 from jodh-intel/ci-add-make-for-ubuntu
CI: Install make on Ubuntu
2018-07-03 10:38:42 -05:00
James O. D. Hunt
abb559d52c CI: Install make on Ubuntu
Fix CI build failures on Ubuntu 16.04 due to `make` not being installed
before the static check script runs by:

- Installing make explicitly on Ubuntu.
- Moving the static-check script after the package install setup phase.

Fixes #134.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-07-03 14:30:52 +01:00
Julio Montes
7a88a7c887
Merge pull request #119 from jcvenegas/1.1.0-branch-bump
# Kata Containers 1.1.0
2018-07-02 11:05:16 -05:00
Jose Carlos Venegas Munoz
e31149077f release: Kata Containers 1.1.0
- image-builder: require root earlier for better error messages
- builder: support proxy in distros based on yum or dnf
- tests: Update kata-manager command
- CI: Fix static-checks script invocation
- Support building centos-rootfs on Arm64
- rootfs: add '-rm' to delete intermediate container
- Update README: Fix a minor space issue
- rootfs: correct rootfs script deference var value
- CI: use yum for resolving centos dependencies
- tests: Test generated images and initrd's (+ cleanups)
- rootfs: Default to host architecture
- Image require systemd
- rootfs: copy kernel modules to correct location
- rootfs: Add extra packages to summary file
- rootfs.sh: Add "${AGENT_VERSION}"/"-a" functionality
- kata/osbuilder: Add support for multiple GOPATH directories
- image-builder: fix "paratition" typo
- docs: Add a Usage section
- refactor and create a summary file inside the image

7b1bbac image-builder: require root earlier for better error messages
52d015e builder: support proxy in distros based on yum or dnf
43a2ea4 tests: Run EulerOS tests last
7b581c2 tests: Convert bats test to shell script
5b9b69a tests: Update kata-manager command
547c477 CI: Fix static-checks script invocation
0451db9 rootfs-builder: Support building centos-rootfs on Arm64
e86380a rootfs: add '-rm' to delete intermediate container
11d1d07 docs: Update README, Fix a minor space issue
7015535 CI: Install epel-repositories for centos
9f84cc8 CI: Install bats from sources
6c8c60d CI: use yum for resolving centos dependencies
a81e771 rootfs: correct rootfs script deference var value
4ae6d31 tests: Test generated images and initrd's
340d7b2 tests: Rename function for brevity
3a8da5f tests: Pass parameters to functions
c8e7f42 tests: Remove stale rootfs tree
1c251bd tests: Move osbuilder metadata var to top
c69eb00 tests: Make all globals readonly
aeb5947 tests: Don't pass size option to image builder
60e1e7b tests: cleanup bats tests
c1d22f9 rootfs: Default to host architecture
aca45c5 image: Require systemd
171eceb image: Use variable for referring to init
fd8d9bd rootfs: copy kernel modules to correct location
7732e04 rootfs: Fix incorrect getopts call
f7f2672 rootfs:  Add "${AGENT_VERSION}"/"-a" functionality
3151f35 rootfs: Add extra packages to summary file
c3ac718 rootfs: Add support for multiple GOPATH directories
32aee00 image-builder: fix "paratition" typo
3c19ea4 docs: Add a Usage section
3e0e112 docs: Move TOC to top
f90f652 rootfs: Create a summary file inside the image
93b632c lib: Check rootfs parameter
b14d117 image-builder: Fix incorrect error message
ddb71e8 initrd: Remove mention of USE_DOCKER
f17b5c2 scripts/lib: Fix whitespace
5b6ced5 rootfs/clearlinux: Resolve version
a2a6562 rootfs: Simplify code
b8f1a68 rootfs: Simplify code
f09d4c4 rootfs: Check function parameters
2751de0 rootfs: Reformat functions
48b1dda rootfs: Fix comments
019a80f refactor: Move more functions to script library
a18753b refactor: Remove duplicate variable
f3e89d3 refactor: Simplify enabling debug

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-02 09:37:19 -05:00
Nitesh Konkar
22f04db80d travis: Enable travis ci for ppc64le
Fixes: #122

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2018-06-29 21:15:43 +05:30
Stefan Hajnoczi
a7bafc53c9 initrd-builder: make initrd_builder.sh idempotent
If initrd_builder.sh fails partway through it may not be possible to run
it again without creating a new rootfs.

This happens because initrd_builder.sh checks for the presence of
/sbin/init and refuses to run if it is missing.  Later on, the script
moves /sbin/init to /init, where the kernel expects to find it in an
initramfs.  After this step initrd_builder.sh will refuse to run again
since /sbin/init is now missing.

Create a symlink from /init to /sbin/init instead of moving the file.
This allows initrd_builder.sh to be run repeatedly on the same rootfs.

Fixes: #130
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2018-06-29 15:08:56 +01:00
James O. D. Hunt
4064a4ccb7
Merge pull request #128 from stefanha/image-builder-early-root-check
image-builder: require root earlier for better error messages
2018-06-29 08:38:17 +01:00
Stefan Hajnoczi
7b1bbac600 image-builder: require root earlier for better error messages
The image_builder.sh script must be run as root.  The following check is
performed before the script checks for root:

  [ "${AGENT_INIT}" == "yes" ] || [ -x "${ROOTFS}/usr/bin/${AGENT_BIN}" ] || \
      die "/usr/bin/${AGENT_BIN} is not installed in ${ROOTFS}
      use AGENT_BIN env variable to change the expected agent binary name"

The -x test is "True if the file is executable by you".  It may evaluate
to true as root and false as non-root, depending on the file
permissions.

The permissions for kata-agent given in the Developer Guide are 0550
(https://github.com/kata-containers/documentation/blob/master/Developer-Guide.md#add-a-custom-agent-to-the-image---optional).

Therefore image_builder.sh fails with "/usr/bin/${AGENT_BIN} is not
installed" when run as non-root.  This is confusing since the agent
binary is really installed!

Move the root check to the beginning of the script.  This solves the
confusing error and prevents similar problems where the script doesn't
take into account that the user may be non-root.

Fixes: #127
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2018-06-28 14:16:26 +01:00
Jose Carlos Venegas Munoz
ac0c29012f
Merge pull request #124 from devimc/dockerfile/supportProxy
builder: support proxy in distros based on yum or dnf
2018-06-26 10:52:43 -05:00
Julio Montes
52d015e283 builder: support proxy in distros based on yum or dnf
proxy server must be specified in configuration file
of the package manager, /etc/yum.conf for yum or
/etc/dnf/dnf.conf for dnf

fixes #123

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-06-26 10:17:07 -05:00
Salvador Fuentes
ae5b40ab88
Merge pull request #114 from jodh-intel/kata-manager-update
tests: Update kata-manager command
2018-06-25 17:49:58 -05:00
James O. D. Hunt
43a2ea4155 tests: Run EulerOS tests last
The EulerOS repository servers can be a little slower to respond than
others. This can lead to timeout issues so move the EulerOS tests to
the end to give the other tests a chance to run.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-06-25 15:06:52 +01:00
James O. D. Hunt
7b581c25d8 tests: Convert bats test to shell script
The tests perform a lot of configuration and call other commands. Since
the tests are running under BATS, any "stdout pollution" results in the
test failing. This is too rigid for current purposes so convert the
BATS test into a `set -e` test. This will still fail if any command
fails, but does not impose the output pollution restriction. It also
makes debugging easier.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-06-25 15:06:49 +01:00
James O. D. Hunt
5b9b69a4b7 tests: Update kata-manager command
The `kata-manger.sh` utility is changing its behaviour so that
`install-packages` *only* installs packages (no container manager).
Update the command to both install Docker and the packages.

Fixes #113.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-06-25 14:03:56 +01:00
Graham Whaley
8e577c19d6
Merge pull request #121 from jodh-intel/fix-static-checks
CI: Fix static-checks script invocation
2018-06-25 13:56:03 +01:00
James O. D. Hunt
547c477f4e CI: Fix static-checks script invocation
The `static-checks.sh` script now requires the repo as an argument.

Fixes #120.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-06-25 11:51:02 +01:00
Jose Carlos Venegas Munoz
72dca93263
Merge pull request #112 from Pennyzct/centos-rootfs
Support building centos-rootfs on Arm64
2018-06-13 09:48:11 -05:00
Penny Zheng
0451db9f4e rootfs-builder: Support building centos-rootfs on Arm64
For now, mirrorlist doesn't support non-x86_64 arch, so we need
create baseurl for arm64. Furthermore, we also need to offer
arm64-specific gpg keys along with the regular key.

Fixes: #111

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2018-06-13 07:21:17 +00:00
James O. D. Hunt
3375e736c9
Merge pull request #117 from Pennyzct/rm
rootfs: add '-rm' to delete intermediate container
2018-06-12 09:55:59 +01:00
Penny Zheng
e86380aab7 rootfs: add '-rm' to delete intermediate container
If we set env USE_DOCKER true, we will use container as development
environment. After docker run command, this temporary container
would be no use. we could add -rm flag to automatically delete
intermediate container.

Fixes: #115

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2018-06-12 08:16:56 +00:00
Jose Carlos Venegas Munoz
bdb776d073
Merge pull request #109 from nitkon/patch-1
Update README: Fix a minor space issue
2018-06-07 14:22:14 -05:00
Nitesh Konkar
11d1d07c04 docs: Update README, Fix a minor space issue
Fixes: #108

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2018-06-07 19:45:08 +05:30
Julio Montes
6e3ed1b649
Merge pull request #103 from JerryOpenix/develop
rootfs: correct rootfs script deference var value
2018-06-07 09:11:14 -05:00
Salvador Fuentes
15a5b3c3f7
Merge pull request #105 from chavafg/topic/fix-centos-setup
CI: use yum for resolving centos dependencies
2018-06-06 14:00:21 -05:00
Salvador Fuentes
70155353a1 CI: Install epel-repositories for centos
yamllint and moreutils packages are available in the
epel repositories from centos.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2018-06-06 10:42:10 -05:00
Salvador Fuentes
9f84cc8f1c CI: Install bats from sources
CentOS and some versions of Ubuntu do not provide
bats in their default repository. This change installs
bats from sources.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2018-06-06 09:30:19 -05:00
Salvador Fuentes
6c8c60db8a CI: use yum for resolving centos dependencies
`.ci/setup.sh` is using dnf instead of yum to install
centos dependencies. This fixes it to use yum.

Fixes: #104.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2018-06-06 08:00:02 -05:00
Liu Changcheng
a81e771573 rootfs: correct rootfs script deference var value
shell usage function use wrong way to get AGENT_BIN value

Fixes #103

Signed-off-by: Liu Changcheng <changcheng.liu@intel.com>
2018-06-06 14:05:03 +08:00
Jose Carlos Venegas Munoz
343c0b4299
Merge pull request #102 from jodh-intel/test-create-container
tests: Test generated images and initrd's (+ cleanups)
2018-06-05 12:12:55 -05:00
James O. D. Hunt
4ae6d31d3e tests: Test generated images and initrd's
After building the images, perform a very basic test by configuring
the runtime to use them and creating a container.

Fixes #97.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-06-04 10:04:30 +01:00
James O. D. Hunt
340d7b2ad5 tests: Rename function for brevity
Renamed the `build_rootfs_image_initrd` function to `create_images`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-05-30 16:29:10 +01:00
James O. D. Hunt
3a8da5f108 tests: Pass parameters to functions
Try to minimise the use of globals by passing parameters to the
remaining functions.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-05-30 16:29:09 +01:00
James O. D. Hunt
c8e7f4253e tests: Remove stale rootfs tree
Remove the rootfs tree before attempting to generate one to avoid
picking up any stale information if the function is run multiple times.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-05-30 16:29:09 +01:00
James O. D. Hunt
1c251bdf05 tests: Move osbuilder metadata var to top
Moved the variable specifying the path to the osbuilder metadata file
to the top of the script and made it readonly.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-05-30 16:29:09 +01:00
James O. D. Hunt
c69eb00f9b tests: Make all globals readonly
Some of the globals were set as read-only variables whilst others
weren't. However, they can all be read-only.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-05-30 16:29:09 +01:00
James O. D. Hunt
aeb59479cb tests: Don't pass size option to image builder
As the comment in the code showed, now that
https://github.com/kata-containers/osbuilder/issues/25 is fixed, it is
no longer necessary to specify an image size to the image builder as it
will auto-calculate it.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-05-30 16:29:09 +01:00
James O. D. Hunt
60e1e7bc31 tests: cleanup bats tests
Removed redundant `function` keyword and extraneous blank lines.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-05-30 16:29:08 +01:00
Graham Whaley
2569cfa34c
Merge pull request #101 from jodh-intel/default-to-host-arch
rootfs: Default to host architecture
2018-05-25 11:26:50 +01:00
James O. D. Hunt
c1d22f98f6 rootfs: Default to host architecture
Don't default to a hard-coded Intel architecture - default to the host
architecture.

This requires the `coreutils` package to be installed both inside each
docker image (for `USE_DOCKER=true`) and in the host environments.

Added missing SPDX headers to `Dockerfile` templates to pacify the CI checks.

Fixes #100.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-05-25 10:09:28 +01:00
James O. D. Hunt
a12618811d
Merge pull request #99 from jodh-intel/image-require-systemd
Image require systemd
2018-05-18 15:54:55 +01:00
James O. D. Hunt
aca45c5820 image: Require systemd
Building an image requires systemd to be installed in the rootfs as the
init daemon, so assert that systemd is available.

Updated tests so that alpine is only tested as an initrd (it cannot be
an image as it doesn't use systemd).

Added warning note about alpine to the docs.

Fixes #98.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-05-18 13:01:08 +01:00
James O. D. Hunt
171eceb426 image: Use variable for referring to init
Use a variable rather than hard-coding the expected init daemon path.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-05-18 11:04:14 +01:00
James O. D. Hunt
d25a591def
Merge pull request #95 from stefanha/fix-copy_kernel_modules-dest_dir
rootfs: copy kernel modules to correct location
2018-05-17 07:08:46 +01:00
Stefan Hajnoczi
fd8d9bdc2c rootfs: copy kernel modules to correct location
Commit b8f1a68834 ("rootfs: Simplify
code") introduced a variable called destdir but accidentally used
dest_dir with cp(1) instead.  This causes kernel modules to be copied to
the wrong location.

Rename the variable to dest_dir to be consistent with module_dir and
rootfs_dir variables used in this function.

Fixes: #94
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2018-05-16 17:41:29 +01:00
Julio Montes
8de92c03c9
Merge pull request #93 from jodh-intel/add-extra-pkgs-to-summary
rootfs: Add extra packages to summary file
2018-05-16 10:28:11 -05:00