#1279 Use image from Quay.io to run the tests
Merged 4 years ago by mprahl. Opened 4 years ago by csomh.
csomh/fm-orchestrator pull-test-image-from-quay  into  master

file modified
+5 -5
@@ -58,15 +58,15 @@ 

              }

          }

  

-         stage('Build Docker Images') {

-             onmyduffynode 'cd fm-orchestrator && docker build -t mbs/test -f docker/Dockerfile-tests .'

-             onmyduffynode 'cd fm-orchestrator && docker build -t mbs/test-py3 -f docker/Dockerfile-tests-py3 .'

+         stage('Pull Container Images') {

+             onmyduffynode 'docker pull quay.io/factory2/mbs-test-centos'

+             onmyduffynode 'docker pull quay.io/factory2/mbs-test-fedora'

          }

  

          stage('Run Test Suites') {

              timeout(20) {

-                 onmyduffynode 'docker run -v ~/fm-orchestrator:/src:Z mbs/test'

-                 onmyduffynode 'docker run -v ~/fm-orchestrator:/src:Z mbs/test-py3'

+                 onmyduffynode 'docker run -v ~/fm-orchestrator:/src:Z quay.io/factory2/mbs-test-centos'

+                 onmyduffynode 'docker run -v ~/fm-orchestrator:/src:Z quay.io/factory2/mbs-test-fedora'

              }

          }

  

file modified
+30 -8
@@ -2,20 +2,27 @@ 

  =============

  

  Since MBS requires Python dependencies that aren't available using PyPi (e.g. libsolv bindings),

- there is a Docker image that can be used to run the code analysis and unit tests.

+ there are container images (based on CentOS and Fedora) that can be used to run the code analysis and unit tests.

  

- To run the tests, you must first install and start Docker with::

+ To run the tests, you must first install `podman` with::

  

-     $ sudo dnf install docker

-     $ sudo systemctl start docker

+     $ sudo dnf install podman

  

- From the main git directory, build the Docker image with::

+ From the repo root, run the tests with::

  

-     $ sudo docker build -t mbs/test -f docker/Dockerfile-tests .

+     $ podman run -t --rm -v $PWD:/src:Z quay.io/factory2/mbs-test-centos

  

- Then run the tests with::

+ To run the tests with Python 3 use the image based on Fedora::

  

-     $ sudo docker run -t --rm -v $PWD:/src:Z mbs/test

+     $ podman run -t --rm -v $PWD:/src:Z quay.io/factory2/mbs-test-fedora

+ 

+ If you need to build the container image locally use::

+ 

+     $ podman build -t mbs-test-centos -f docker/Dockerfile-tests .

+ 

+ or::

+ 

+     $ podman build -t mbs-test-fedora -f docker/Dockerfile-tests-py3 .

  

  Style Guide

  ===========
@@ -173,3 +180,18 @@ 

  

  - Rida

  - The Orchestrator

+ 

+ Updating test images in Quay

+ ============================

+ 

+ The Quay web UI can be used to update the images used for testing:

+ 

+ * https://quay.io/repository/factory2/mbs-test-centos

+ * https://quay.io/repository/factory2/mbs-test-fedora

+ 

+ Members of `the factory2 Quay organization <https://quay.io/organization/factory2>`_ 

+ can start a new build from the *Builds* page of the above repositories. 

+ The `:latest` tags need to be applied to the new images on the *Tags* page 

+ after the builds complete.

+ 

+ We plan to automate the process above in the future.

  • Switch from docker to podman.
  • Update contribution doc to point to use images from Quay.io to run the tests.

@csomh looks good! Do you want to also edit the Jenkins job to use these images in the following file?
https://pagure.io/fm-orchestrator/blob/master/f/.cico-pr.pipeline

2 new commits added

  • Document using images from Quay.io for testing
  • Contributing: replace docker with podman
4 years ago

1 new commit added

  • Use images from Quay to run the tests on CentOS CI
4 years ago

Updated the Jenkins job and renamed the images to be able to set up separate triggers for each.

LGTM. Thanks. In addition, add some info into doc about images in quay.io? Maybe the section could have title "Manage images for testing".

Hi @csomh, I start the unit tests with podman but it is a little different with docker run to run a container. By docker run ... quay.io/factory2/mts-test-centos, it could start container from downloaded image, however with podmain ..., it pulls image again. Why this difference happens? Does podman run container in an isolated environment?

BTW, what would be the advantage by using podman than docker run directly?

Hi @csomh, I start the unit tests with podman but it is a little different with docker run to run a container. By docker run ... quay.io/factory2/mts-test-centos, it could start container from downloaded image, however with podmain ..., it pulls image again. Why this difference happens? Does podman run container in an isolated environment?

Is this happening all the time? Are you sure you had the :latest tag already pulled? podman run should only pull the image if it's not already available locally. Note that a pull will happen even if the image is already present, but with a different tag - although this pull will be fast, as all the layers are already available.

One of the benefits of podman is that it does not require a daemon running in the background in order to run containers. Without a daemon, there is no need to use sudo, so you can run containers without being root.

Afaik, podman is slowly becoming the default way to run containers in Fedora and soon in RHEL, too.

1 new commit added

  • Document updating the test images in Quay.io
4 years ago

@cqi I've update the doc with a part explaining how to update the images in Quay.

rebased onto 7db21b7

4 years ago

From this, it's not not clear that Fedora is running Python 3 tests. Could you add a note about that please?

It's a left-over from before I realized that this is rst and not markdown. I'll remove it. Thanks for catching it!

4 new commits added

  • Document updating the test images in Quay.io
  • Use images from Quay to run the tests on CentOS CI
  • Document using images from Quay.io for testing
  • Contributing: replace docker with podman
4 years ago

:thumbsup:
Thanks for the PR!

Commit eeecadd fixes this pull-request

Pull-Request has been merged by mprahl

4 years ago

Pull-Request has been merged by mprahl

4 years ago