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

ci/openshift-ci: Enable openshift-ci #2891

Merged
merged 1 commit into from Sep 25, 2020

Conversation

wainersm
Copy link
Contributor

@wainersm wainersm commented Aug 19, 2020

Enable openshift-ci on runtime repository.

Fixes: github.com/kata-containers/tests#2527
Depends-on: github.com/kata-containers/tests#2802

Signed-off-by: Wainer dos Santos Moschetta wainersm@redhat.com

@wainersm wainersm requested a review from a team as a code owner August 19, 2020 23:34
@devimc
Copy link

devimc commented Aug 20, 2020

thanks @wainersm - but I think openshit-ci is not the best name for a CI

@fidencio fidencio changed the title ci/openshit-ci: Enable openshift-ci ci/openshift-ci: Enable openshift-ci Aug 24, 2020
# By using it in an openshift daemonset it should spin forever until an
# orchestrator kills it.
#
while true; do sleep 600; done
Copy link
Contributor

Choose a reason for hiding this comment

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

We tend to prefer tail -f /dev/null to a loop like this.

#
# Synchronize the kata-containers installation with in the host filesystem.
#
set -x
Copy link
Contributor

Choose a reason for hiding this comment

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

set -e (too)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This script is going to execute in a k8s DaemonSet. If set -e and the script fails then the pod will end up on a "unpredictable state". The mechanism I employ to verify the installation succeeded (or not) is to write the return code of kata-runtime kata-check to /tmp/kata_install_status then put the pod to "sleep" (tail -f /dev/null). One control script will check the value of /tmp/kata_install_status on each pod, if all of them was done then the daemonSet is retired.

Let me know if I am missing something here, or if you think there is a better way to implement it.

@@ -0,0 +1,3 @@
# OpenShift CI files

This directory contain scripts and files used by the openshift-ci operator to test kata. For further details read this [README](https://github.com/kata-containers/tests/tree/master/.ci/openshift-ci/README.md) file.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: very long line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I deleted the README.md so not need to this. :)

fi

# Copy the installation over the host filesystem.
rsync -a * $HOST_MOUNT
Copy link
Contributor

Choose a reason for hiding this comment

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

Should that be . rather than * in case of hidden files?

Copy link
Member

Choose a reason for hiding this comment

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

Probably better, although installing hidden files on the host is a bad idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I am not expecting hidden files but I changed as suggested in the v4 of this PR.

@wainersm
Copy link
Contributor Author

thanks @wainersm - but I think openshit-ci is not the best name for a CI

@devimc you got eagles eyes! 👍

@devimc
Copy link

devimc commented Aug 24, 2020

@wainersm thanks, but I still see the same word in your commit message

@wainersm
Copy link
Contributor Author

Changes v1 -> v2:

  • Fixed the typo in the commit message

@devimc
Copy link

devimc commented Aug 24, 2020

please add a reference to openshift-ci/README.md in the main README.md

source=check-markdown version=0.0.1
	"virtcontainers/experimental/README.md"
	"CONTRIBUTING.md"
	"virtcontainers/documentation/api/1.0/api.md"
	"virtcontainers/documentation/Developers.md"
	"virtcontainers/pkg/cloud-hypervisor/README.md"
	"virtcontainers/persist/plugin/README.md"
ERROR: Document .ci/openshift-ci/README.md is not referenced
The command ".ci/static-checks.sh" failed and exited with 1 during .

Copy link

@devimc devimc left a comment

Choose a reason for hiding this comment

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

thanks @wainersm

mount -o remount,rw $HOST_MOUNT/usr

# The host's '/opt' and '/usr/local' are symlinks to, respectively, '/var/opt'
# and '/var/usrlocal'. Adjust the installation files accordingly.
Copy link

Choose a reason for hiding this comment

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

typo: usrlocal -> usr/local

Copy link
Member

Choose a reason for hiding this comment

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

Actually not.

[core@worker-0-0 /]$ ls -lha var/
...
drwxr-xr-x. 12 root root  126 Aug 10 20:23 usrlocal
...

That's the structure used by Red Hat CoreOS, which is used by OpenShift.


if [ -d "usr/local" ]; then
mkdir -p var
mv usr/local var/usrlocal
Copy link

Choose a reason for hiding this comment

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

usrlocal -> usr/local

Copy link
Member

Choose a reason for hiding this comment

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

... and the same here.

# get copied.
mount -o remount,rw $HOST_MOUNT/usr

# The host's '/opt' and '/usr/local' are symlinks to, respectively, '/var/opt'
Copy link

Choose a reason for hiding this comment

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

what about here '/usr/local' ?

Copy link
Member

Choose a reason for hiding this comment

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

So, the whole idea about Red Hat CoreOS is to provide the user an immutable system, quite similar to Fedora Silverblue (https://silverblue.fedoraproject.org/) or Fedora CoreOS (https://github.com/coreos/fedora-coreos-tracker).

Those systems do have /usr being mounted as read-only. Apart from a few "workarounds" where wouldn't be to problematic for users to override, such as /opt or /usr/local ... those workarounds consist in having those directories being symlinks to directories under /var, which is not read-only.

@wainersm
Copy link
Contributor Author

please add a reference to openshift-ci/README.md in the main README.md

@devimc , I think I will remove the openshift-ci/README.md file completely if you agree. And the rationale is:

  1. The parent .ci folder doesn't have a readme, and so just adding an entry on the main readme seems weird
  2. This readme is only a mere pointer to github.com/kata-containers/tests/.ci/openshift-ci 's readme

@wainersm
Copy link
Contributor Author

wainersm commented Sep 1, 2020

v2 -> v3:

  • .ci/openshift-ci/images/entrypoint.sh:
    • linking all binaries to /usr/local/bin
    • sleep infinity with tail -f /dev/null
  • Deleted .ci/openshift-ci/README.md

pushd "${tests_repo_dir}"
# Resolve the kata-container repositories. It relies on branch and
# kata_repo variables.
export branch=master
Copy link

Choose a reason for hiding this comment

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

I still don't understand the tests scripts very well, with this you will be testing master and not the pr, is that correct ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes @devimc . For kata-1.x I will run these scripts in a nightly job, so not dealing with PRs. I will need to adapt this to kata-2.x because in this case I plan to leverage the openshift CI to test PRs as well.

#
FROM centos:8

RUN yum install -y rsync
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: dnf 😄

Copy link
Member

Choose a reason for hiding this comment

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

Not on centos image.

[root@f5018106fe91 /]# yum
Loaded plugins: fastestmirror, ovl
You need to give some command
Usage: yum [options] COMMAND

[root@f5018106fe91 /]# dnf
bash: dnf: command not found

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks good to me. Maybe wait for @jodh-intel to ack the replies we gave. I think that @devimc is not available this week.

Thanks @c3d ! I am about to send another version with two small changes as suggested by @jodh-intel . Then we will be ready to go :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah - you get it by default, but clearly not with your image ;)

Copy link
Contributor Author

@wainersm wainersm Sep 14, 2020

Choose a reason for hiding this comment

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

Not on centos image.

[root@f5018106fe91 /]# yum
Loaded plugins: fastestmirror, ovl
You need to give some command
Usage: yum [options] COMMAND

[root@f5018106fe91 /]# dnf
bash: dnf: command not found

hmm... interesting.

On v4 of this PR I changed to centos:7 and the reason is: this image will be built in a OpenShift Build process which usually replaces the FROM to whatever the user choose. In the case of this CI, it will use RHEL-7 so the closest we got (for the sake of debugging/development in your workstation) is centos-7.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah - right. I'd missed the downgrade to centos 7 ;)

Copy link

@devimc devimc left a comment

Choose a reason for hiding this comment

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

thanks @wainersm

Copy link
Member

@c3d c3d left a comment

Choose a reason for hiding this comment

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

Looks good to me. Maybe wait for @jodh-intel to ack the replies we gave. I think that @devimc is not available this week.

Copy link
Contributor

@jodh-intel jodh-intel left a comment

Choose a reason for hiding this comment

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

Thanks @wainersm.

lgtm

@jodh-intel
Copy link
Contributor

/test

Enable openshift-ci on runtime repository.

Fixes: github.com/kata-containers/tests#2527
Depends-on: github.com/kata-containers/tests#2802

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
@wainersm
Copy link
Contributor Author

v3 -> v4:

  • .ci/openshift-ci/images/entrypoint.sh:
    • Replaced rsync -a * with rsync -a .
  • .ci/openshift-ci/images/Dockerfile:
    • Using CentOS-7 instead of 8

@wainersm
Copy link
Contributor Author

/test

@codecov
Copy link

codecov bot commented Sep 14, 2020

Codecov Report

Merging #2891 into master will increase coverage by 0.22%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #2891      +/-   ##
==========================================
+ Coverage   51.44%   51.67%   +0.22%     
==========================================
  Files         118      118              
  Lines       17428    17438      +10     
==========================================
+ Hits         8966     9011      +45     
+ Misses       7379     7342      -37     
- Partials     1083     1085       +2     

@wainersm
Copy link
Contributor Author

The failure on the jobs aren't related with my changes.

@wainersm
Copy link
Contributor Author

/test jenkins-metrics-ubuntu-18-04

@jodh-intel
Copy link
Contributor

Hi @GabyCT - it looks like Jenkins has "stalled" - could you tal please?

@wainersm
Copy link
Contributor Author

/test-ubuntu

@wainersm
Copy link
Contributor Author

/test

@wainersm
Copy link
Contributor Author

/retest-ubuntu

@wainersm
Copy link
Contributor Author

/retest-qemu-metrics

@wainersm
Copy link
Contributor Author

Hi @jodh-intel , this metrics job failing seems not related with this PR. What should I do to get this merged?

@c3d c3d added the blocked-by-metrics Temporary flag to indicate PRs that are blocked by #2983. This will allow us to focus on others. label Sep 24, 2020
@amshinde
Copy link
Member

/test-ubuntu-qemu-metrics

@amshinde
Copy link
Member

@wainersm Rerunning the metrics CI, since we have fixed that now.

@c3d c3d merged commit cf5d190 into kata-containers:master Sep 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked-by-metrics Temporary flag to indicate PRs that are blocked by #2983. This will allow us to focus on others.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants