Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

CI: Fix tests #40

Merged
merged 5 commits into from
Jan 27, 2018
Merged

CI: Fix tests #40

merged 5 commits into from
Jan 27, 2018

Conversation

jcvenegas
Copy link
Member

@jcvenegas jcvenegas commented Jan 22, 2018

This PR adds some fixes to make work travis.

  1. The tests were only running for fedora image creation
  2. centos and euler os need golang to allow build agent
  3. Minor changes after scripts: Arch dependent repo url for fedora #22 to use fedora version defined in config.sh and not the version in host.
    /cc @harche

Not all the distros were executed due to typo

Signed-off-by: Jose Carlos Venegas Munoz <[email protected]>
Signed-off-by: Jose Carlos Venegas Munoz <[email protected]>
Use OS_VERSION provided by user configuration and not use host version.

Also add retries before fail on a request.

Signed-off-by: Jose Carlos Venegas Munoz <[email protected]>
@harche
Copy link
Contributor

harche commented Jan 23, 2018

lgtm.

@@ -1 +1,7 @@
FROM centos:7

ADD https://storage.googleapis.com/golang/go1.9.2.linux-amd64.tar.gz /tmp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine, but we're hard-coding more into these Dockerfile's which is going to make them more difficult to maintain.

I'd rather we fix #31 first (maybe as one of the commits on this PR) to avoid this. These 2 chunks of code are identical too which lends weight to doing that as you could add something like:

FROM centos:@centos_version@

@centos_install_go@

And,

from euleros:@euleros_version@

# EulerOS is similar enough to CentOS to re-use this code.
@centos_install_go@

Lastly, there is the issue of the version of golang. The CI systems for the various code repos are using go 1.8.3 so we're in danger of repeating clearcontainers/packaging#257.

Could you create a top-level ./versions.txt containing a go_version= so that it's defined in a single location? It maybe be best to default to 1.8.3 for now and raise an issue to discuss go version support separately.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is a good point, let me add Dockerfile templates.

@jcvenegas
Copy link
Member Author

@jodh-intel please take a look now dockerfile generations is done rootfs. I will send a follow up PR for image-builder dockerfile.

@@ -0,0 +1,6 @@
From fedora:27
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is a bit of a problem. If we leave it like this, it'll probably break at some future date.

We could add one extra variable to each config.sh that specifies the version for that particular distro. For example, fedora/config.sh would become something like:

FEDORA_OS_VERSION=27
OS_VERSION=${OS_VERSION:-${FEDORA_OS_VERSION}}

But we'd then need to do some rework to allow the clearlinux rootfs build to use $FEDORA_OS_VERSION so that the clearlinux Dockerfile could specify:

From @FEDORA_OS_VERSION@

But this all seems rather odd. Clear Linux is the only distro that currently requires a different distro to build its rootfs. So why can't we just build a clearlinux rootfs using... clearlinux:

From clearlinux:@OS_VERSION@

Where @OS_VERSION@ would probably be just "latest"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue raised as #48.

@@ -0,0 +1,4 @@
From centos:@OS_VERSION@
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Can you rename these files Dockerfile.in though (as the .am extension implies they are in automake format).

dir="$1"

readonly install_go="
ADD https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz /tmp

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to make the golang URL configurable

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed - similar to kata-containers/agent#112.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be handled by a follow-on PR though as it would be great to get this PR landed today. WDYT @jcvenegas ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liangchenye @jodh-intel yes, I prefer to have this PR merged today, and then fix the URL and clearlinux container usage.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Captured at #47 if someone wants to pick that up.

@bergwolf
Copy link
Member

travis still fails

@jodh-intel
Copy link
Contributor

Yep. It made me laugh actually seeing these two lines:

Step 2/6 : RUN yum -y update && dnf install -y yum git make gcc
   :
/bin/sh: dnf: command not found

To simplify maintaince, create dockerfiles based on templates.

This way when golang version is updated it will be done in one place
versions.txt.

This also allow to allways intall the same version of golang in any
dockerfile.

Signed-off-by: Jose Carlos Venegas Munoz <[email protected]>
@jcvenegas
Copy link
Member Author

@jodh-intel @bergwolf @liyingjun , travis passing.

@jodh-intel
Copy link
Contributor

jodh-intel commented Jan 25, 2018

lgtm

Approved with PullApprove

@jodh-intel
Copy link
Contributor

@devimc - could you review please?

@@ -45,5 +45,9 @@ function build_image()
}

@test "Can create euleros image" {
if [ "$TRAVIS" = true ]
then
skip "travis timout, see: https://github.com/kata-containers/osbuilder/issues/46"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked a colleague from our company, we don't have a fast server. It is embarrassing.
I have tried the host server of our isula (a containerOS) community. It works good.
I'll use that repo URL instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liangchenye I check in travis docuementation, I added travis_wait now seems all is OK.

Use travis configuration to wait more than 10 min

Signed-off-by: Jose Carlos Venegas Munoz <[email protected]>
@jodh-intel
Copy link
Contributor

Still...

lgtm

@jcvenegas
Copy link
Member Author

@devimc @bergwolf @sameo ready to merge, can you review it and merge it

@bergwolf
Copy link
Member

bergwolf commented Jan 27, 2018

lgtm, thanks!

Approved with PullApprove

@bergwolf bergwolf merged commit 1295bd5 into kata-containers:master Jan 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants