-
Notifications
You must be signed in to change notification settings - Fork 85
Conversation
7ff21c1
to
b974c20
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I'd like to give this a try later on. +1 for creating a tests/test_config.sh
btw! ;)
/cc @jcvenegas.
tests/test_images.sh
Outdated
|
||
local rootfs_size=$(du -sb "${rootfs}" | awk '{print $1}') | ||
echo "will build with tgts: ${makeTargets[@]}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/tgts/targets/
tests/test_images.sh
Outdated
then | ||
# Images need systemd | ||
[ "$opt" = "init" ] && continue | ||
sudo -E make -j ${makeTargets[@]} ${makeVars[@]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will saturate the CI system nicely but could effectively DoS a dev system. It's extra logic, but could you add a check for the CI
variable:
- if it's set, use
-j
. - if it isn't set, use
"-j $cpus"
where$cpus
is the value of$(nproc) - 1
.
In other words, retain 1 core for the user to be able to use their system ;)
/cc @grahamwhaley.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 - we use nproc in other places as well etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually make
is run by two bash processes in background (to build in parallel with and without AGENT_INIT=yes
). So, to play it safe, should it be $(nproc) / 2 -1
?
4220 pts/2 S+ 0:00 \_ /bin/bash ./tests/test_images.sh
4455 pts/2 S+ 0:00 \_ /bin/bash ./tests/test_images.sh
4460 pts/2 S+ 0:00 | \_ sudo -E make -j image-fedora image-centos image-ubuntu image-clearlinux image-eu
4462 pts/2 S+ 0:00 | \_ make -j image-fedora image-centos image-ubuntu image-clearlinux image-eulero
4510 pts/2 S+ 0:00 | \_ /bin/bash /home/marco/go/src/github.com/kata-containers/osbuilder/rootfs
4656 pts/2 Sl+ 0:00 | | \_ docker run --env https_proxy= --env http_proxy= --env AGENT_VERSION=
4511 pts/2 S+ 0:00 | \_ /bin/bash /home/marco/go/src/github.com/kata-containers/osbuilder/rootfs
4683 pts/2 Sl+ 0:00 | | \_ docker run --env https_proxy= --env http_proxy= --env AGENT_VERSION=
4515 pts/2 S+ 0:00 | \_ /bin/bash /home/marco/go/src/github.com/kata-containers/osbuilder/rootfs
4634 pts/2 Sl+ 0:00 | | \_ docker run --env https_proxy= --env http_proxy= --env AGENT_VERSION=
4527 pts/2 S+ 0:00 | \_ /bin/bash /home/marco/go/src/github.com/kata-containers/osbuilder/rootfs
4559 pts/2 S+ 0:00 | | \_ /bin/bash /home/marco/go/src/github.com/kata-containers/osbuilder/ro
4561 pts/2 S+ 0:00 | | \_ curl -sL https://download.clearlinux.org/latest
4529 pts/2 S+ 0:00 | \_ /bin/bash /home/marco/go/src/github.com/kata-containers/osbuilder/rootfs
4671 pts/2 Sl+ 0:00 | \_ docker run --env https_proxy= --env http_proxy= --env AGENT_VERSION=
4456 pts/2 S+ 0:00 \_ /bin/bash ./tests/test_images.sh
4459 pts/2 S+ 0:00 \_ sudo -E make -j initrd-alpine USE_DOCKER=true ROOTFS_BUILD_DEST=/tmp/osbuilder-t
4461 pts/2 S+ 0:00 \_ make -j initrd-alpine USE_DOCKER=true ROOTFS_BUILD_DEST=/tmp/osbuilder-test.
4509 pts/2 S+ 0:00 \_ /bin/bash /home/marco/go/src/github.com/kata-containers/osbuilder/rootfs
4680 pts/2 Sl+ 0:00 \_ docker run --env https_proxy= --env http_proxy= --env AGENT_VERSION=
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this won't be so bad as I suspect most of the test is going to be network-bound but we just need to ensure we don't kill a developers box by running this test ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good thought @marcov Let's try nproc/2. Although... I have no idea how many procs our cloud test instances generally have - I can't see that info in a console log either. @chavafg - any ideas on that?
We might want to do some experimentation and monitor top
before we decide on a setting - if we are net bound like @jodh-intel says, then we can bump it up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also add the CI
variable definition to .travis.yml
to take full advantage of the parallel building.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we shouldn't need to do that:
rootfs-builder/rootfs.sh
Outdated
-h : Show this help message | ||
-a : agent version DEFAULT: ${AGENT_VERSION} ENV: AGENT_VERSION | ||
-h : show this help message | ||
-l : list the supported Linux distributions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you put this change into a separate commit as it's not strictly related to running the tests in parallel.
tests/test_images.sh
Outdated
makeVars=() | ||
makeTargets=() | ||
for t in $@; do | ||
if [[ "$t" =~ .+= ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, deep magic ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll reformat a bit to make it easier to read
I think the 2 build configurations in Do you agree? PS: looking at the current code on master and at the Travis build logs, I am not sure this split is actually done. |
Sounds good to me - is that ok with you @bergwolf? |
b974c20
to
e7afceb
Compare
/cc @chavafg for thoughts. |
beaa586
to
5b478ac
Compare
d7231be
to
aaa8c55
Compare
Hey, could any of the approvers kindly kick the CI ? 😛 |
/test |
/test |
I added
However I am kind of surprised that |
aaa8c55
to
0528dac
Compare
@marcov you were right, |
/test |
we are getting this error, when running the tests:
which I have seen lately in some bug reports from users. |
and found
on the fedora job. |
tests/test_images.sh
Outdated
|
||
source /etc/os-release | ||
|
||
if [[ "$ID_LIKE" =~ suse ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @chavafg noticed, you'll need to set this variable before sourcing /etc/os-release
for those distros that don't provide the variable in that file:
ID_LIKE=""
source /etc/os-release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chavafg @jodh-intel thanks.
About the DeadlineExceeded
: is this related: kata-containers/runtime#702?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @marcov - yep, I think so.
Hi @marcov - I spot a problem! If you look at the 16.04 log for example, and search for "INFO: osbuilder metadata file for", you'll see that multiple YAML files have been concatenated into |
@jodh-intel: no, that's actually the output of multiple files, but the spacing make it look like it's a single file :). I'll try to make it more readable.
|
0528dac
to
5b919bb
Compare
/test |
Ah - thanks, that would make it clearer ;) |
dc7fd27
to
a5f6b76
Compare
/test |
Let's wait for |
@marcov - 1.3.0 is out now! ;) |
...errm, well yes it is, but not on OBS yet... :) |
@jodh-intel, actually the The problem is that the installation instructions still points to a legacy repo path, e.g. for Ubuntu. And kata-manager is using those instructions to install Kata on Jenkins nodes. And maybe this is another thing to consider in kata-containers/documentation#234? |
@marcov - gah - I think I got browser-cached when checking OBS! :) Yep - we need more input on that thread - thanks for yours btw! |
PS: looks like including a comment with a URL containing |
@chavafg - ^ 😄 |
Heh - the CI trigger is done via a regexp. Maybe we need/are missing a |
And a |
... If I had a dollar for every caret... 😄 |
ouch. maybe something like |
/test |
All green with the |
Rework test_images.sh and Makefile to allow building artifacts in parallel for faster tests execution. Add new targets to Makefile ({rootfs,image,initrd}-<distro name>). Fixes: kata-containers#168 Signed-off-by: Marco Vedovati <mvedovati@suse.com>
Remove the AGENT_INIT = yes / no combinations from .travis.yml, as test_images.sh is now running both builds in parallel. Signed-off-by: Marco Vedovati <mvedovati@suse.com>
@marcov - nice work! :) |
/test |
Possible network related problem on 16.04 (or, could be our OBS). Giving it a nudge.
|
one more ack to go 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CIs are happy.
I'm going to presume @jcvenegas has read over this and has no issues.
lgtm
Rework test_image.sh and Makefile to allow building images in parallel
for faster test execution.
Add some new targets to Makefile ({rootfs,image,initrd}-all,
list-distros).
Fixes: #168