diff mbox series

[v3] gitlab-ci.yml: Add openSUSE Leap 15.2 for gitlab CI/CD

Message ID 20201224085931.20465-1-acho@suse.com (mailing list archive)
State New, archived
Headers show
Series [v3] gitlab-ci.yml: Add openSUSE Leap 15.2 for gitlab CI/CD | expand

Commit Message

Zhijian Li (Fujitsu)" via Dec. 24, 2020, 8:59 a.m. UTC
Add build-system-opensuse jobs and opensuse-leap.docker dockerfile.
Use openSUSE Leap 15.2 container image in the gitlab-CI.

Signed-off-by: Cho, Yu-Chen <acho@suse.com>
---
v3:
Drop the "acceptance-system-opensuse" job part of the
patch for now to get at least the basic compile-coverage

v2:
Drop some package from dockerfile to make docker image more light.

v1:
Add build-system-opensuse jobs and opensuse-leap.docker dockerfile.
Use openSUSE Leap 15.2 container image in the gitlab-CI.
---
 .gitlab-ci.d/containers.yml                   |  5 ++
 .gitlab-ci.yml                                | 20 +++++++
 tests/docker/dockerfiles/opensuse-leap.docker | 54 +++++++++++++++++++
 3 files changed, 79 insertions(+)
 create mode 100644 tests/docker/dockerfiles/opensuse-leap.docker

Comments

Wainer dos Santos Moschetta Dec. 28, 2020, 6:02 p.m. UTC | #1
Hi,

On 12/24/20 5:59 AM, Cho, Yu-Chen wrote:
> Add build-system-opensuse jobs and opensuse-leap.docker dockerfile.
> Use openSUSE Leap 15.2 container image in the gitlab-CI.
>
> Signed-off-by: Cho, Yu-Chen <acho@suse.com>
> ---
> v3:
> Drop the "acceptance-system-opensuse" job part of the
> patch for now to get at least the basic compile-coverage
>
> v2:
> Drop some package from dockerfile to make docker image more light.
>
> v1:
> Add build-system-opensuse jobs and opensuse-leap.docker dockerfile.
> Use openSUSE Leap 15.2 container image in the gitlab-CI.
> ---
>   .gitlab-ci.d/containers.yml                   |  5 ++
>   .gitlab-ci.yml                                | 20 +++++++
>   tests/docker/dockerfiles/opensuse-leap.docker | 54 +++++++++++++++++++
>   3 files changed, 79 insertions(+)
>   create mode 100644 tests/docker/dockerfiles/opensuse-leap.docker

On Gitlab CI this new docker file has no issues:

https://gitlab.com/wainersm/qemu/-/jobs/934243313

One test won't execute due to lack of hostname program:

https://gitlab.com/wainersm/qemu/-/jobs/934243313#L3698

Using it locally has some issues though. I can build the image as ...

$ make docker-image-opensuse-leap

... but I cannot run the test-build script as ...

$ make docker-test-build@opensuse-leap

.. and the reason is that it misses the tar program which is used to 
untar the QEMU sources inside the container.

Ensuring that tar is installed wasn't enough either, I had to adjust the 
path to python (/usr/bin/python3.8 doesn't exist).

So I did change:

diff --git a/tests/docker/dockerfiles/opensuse-leap.docker 
b/tests/docker/dockerfiles/opensuse-leap.docker
index 8b0d915bff..0e64893e4a 100644
--- a/tests/docker/dockerfiles/opensuse-leap.docker
+++ b/tests/docker/dockerfiles/opensuse-leap.docker
@@ -43,12 +43,13 @@ ENV PACKAGES \
      libspice-server-devel \
      systemd-devel \
      systemtap-sdt-devel \
+    tar \
      usbredir-devel \
      virglrenderer-devel \
      xen-devel \
      vte-devel \
      zlib-devel
-ENV QEMU_CONFIGURE_OPTS --python=/usr/bin/python3.8
+ENV QEMU_CONFIGURE_OPTS --python=/usr/bin/python3.6

  RUN zypper update -y && zypper --non-interactive install -y $PACKAGES
  RUN rpm -q $PACKAGES | sort > /packages.txt

>
> diff --git a/.gitlab-ci.d/containers.yml b/.gitlab-ci.d/containers.yml
> index 892ca8d838..910754a699 100644
> --- a/.gitlab-ci.d/containers.yml
> +++ b/.gitlab-ci.d/containers.yml
> @@ -246,3 +246,8 @@ amd64-ubuntu-container:
>     <<: *container_job_definition
>     variables:
>       NAME: ubuntu
> +
> +amd64-opensuse-leap-container:
> +  <<: *container_job_definition
> +  variables:
> +    NAME: opensuse-leap
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index 98bff03b47..a1df981c9a 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -195,6 +195,26 @@ acceptance-system-centos:
>       MAKE_CHECK_ARGS: check-acceptance
>     <<: *acceptance_definition
>   
> +build-system-opensuse:
> +  <<: *native_build_job_definition
> +  variables:
> +    IMAGE: opensuse-leap
> +    TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
> +    MAKE_CHECK_ARGS: check-build
> +  artifacts:
> +    expire_in: 2 days
> +    paths:
> +      - build
> +
> +check-system-opensuse:
> +  <<: *native_test_job_definition
> +  needs:
> +    - job: build-system-opensuse
> +      artifacts: true
> +  variables:
> +    IMAGE: opensuse-leap
> +    MAKE_CHECK_ARGS: check
> +
>   build-disabled:
>     <<: *native_build_job_definition
>     variables:
> diff --git a/tests/docker/dockerfiles/opensuse-leap.docker b/tests/docker/dockerfiles/opensuse-leap.docker
> new file mode 100644
> index 0000000000..8b0d915bff
> --- /dev/null
> +++ b/tests/docker/dockerfiles/opensuse-leap.docker
> @@ -0,0 +1,54 @@
> +FROM opensuse/leap:15.2
> +
> +# Please keep this list sorted alphabetically

The list of packages below isn't sorted.

Thanks for contributing this!

- Wainer

> +ENV PACKAGES \
> +    bc \
> +    brlapi-devel \
> +    bzip2 \
> +    cyrus-sasl-devel \
> +    gcc \
> +    gcc-c++ \
> +    mkisofs \
> +    gettext-runtime \
> +    git \
> +    glib2-devel \
> +    glusterfs-devel \
> +    libgnutls-devel \
> +    gtk3-devel \
> +    libaio-devel \
> +    libattr-devel \
> +    libcap-ng-devel \
> +    libepoxy-devel \
> +    libfdt-devel \
> +    libiscsi-devel \
> +    libjpeg8-devel \
> +    libpmem-devel \
> +    libpng16-devel \
> +    librbd-devel \
> +    libseccomp-devel \
> +    libssh-devel \
> +    lzo-devel \
> +    make \
> +    libSDL2_image-devel \
> +    ncurses-devel \
> +    ninja \
> +    libnuma-devel \
> +    perl \
> +    libpixman-1-0-devel \
> +    python3-base \
> +    python3-virtualenv \
> +    rdma-core-devel \
> +    libSDL2-devel \
> +    snappy-devel \
> +    libspice-server-devel \
> +    systemd-devel \
> +    systemtap-sdt-devel \
> +    usbredir-devel \
> +    virglrenderer-devel \
> +    xen-devel \
> +    vte-devel \
> +    zlib-devel
> +ENV QEMU_CONFIGURE_OPTS --python=/usr/bin/python3.8
> +
> +RUN zypper update -y && zypper --non-interactive install -y $PACKAGES
> +RUN rpm -q $PACKAGES | sort > /packages.txt
Al Cho Dec. 29, 2020, 8:50 a.m. UTC | #2
Hi Wainer,

On Mon, 2020-12-28 at 15:02 -0300, Wainer dos Santos Moschetta wrote:
> Hi,
> 
> On 12/24/20 5:59 AM, Cho, Yu-Chen wrote:
> > Add build-system-opensuse jobs and opensuse-leap.docker dockerfile.
> > Use openSUSE Leap 15.2 container image in the gitlab-CI.
> > 
> > Signed-off-by: Cho, Yu-Chen <acho@suse.com>
> > ---
> > v3:
> > Drop the "acceptance-system-opensuse" job part of the
> > patch for now to get at least the basic compile-coverage
> > 
> > v2:
> > Drop some package from dockerfile to make docker image more light.
> > 
> > v1:
> > Add build-system-opensuse jobs and opensuse-leap.docker dockerfile.
> > Use openSUSE Leap 15.2 container image in the gitlab-CI.
> > ---
> >   .gitlab-ci.d/containers.yml                   |  5 ++
> >   .gitlab-ci.yml                                | 20 +++++++
> >   tests/docker/dockerfiles/opensuse-leap.docker | 54
> > +++++++++++++++++++
> >   3 files changed, 79 insertions(+)
> >   create mode 100644 tests/docker/dockerfiles/opensuse-leap.docker
> 
> On Gitlab CI this new docker file has no issues:
> 
> https://gitlab.com/wainersm/qemu/-/jobs/934243313
> 
> One test won't execute due to lack of hostname program:
> 
> https://gitlab.com/wainersm/qemu/-/jobs/934243313#L3698
> 
> Using it locally has some issues though. I can build the image as ...
> 
> $ make docker-image-opensuse-leap
> 
> ... but I cannot run the test-build script as ...
> 
> $ make docker-test-build@opensuse-leap
> 
> .. and the reason is that it misses the tar program which is used to 
> untar the QEMU sources inside the container.
> 
> Ensuring that tar is installed wasn't enough either, I had to adjust
> the 
> path to python (/usr/bin/python3.8 doesn't exist).
> 

Yes, that's the key point.
Thanks a lot.
And that's why acceptance-system-opensuse failed.

I will submit v4 for it.

Thanks again.

Cheer,
     AL

> So I did change:
> 
> diff --git a/tests/docker/dockerfiles/opensuse-leap.docker 
> b/tests/docker/dockerfiles/opensuse-leap.docker
> index 8b0d915bff..0e64893e4a 100644
> --- a/tests/docker/dockerfiles/opensuse-leap.docker
> +++ b/tests/docker/dockerfiles/opensuse-leap.docker
> @@ -43,12 +43,13 @@ ENV PACKAGES \
>       libspice-server-devel \
>       systemd-devel \
>       systemtap-sdt-devel \
> +    tar \
>       usbredir-devel \
>       virglrenderer-devel \
>       xen-devel \
>       vte-devel \
>       zlib-devel
> -ENV QEMU_CONFIGURE_OPTS --python=/usr/bin/python3.8
> +ENV QEMU_CONFIGURE_OPTS --python=/usr/bin/python3.6
> 
>   RUN zypper update -y && zypper --non-interactive install -y
> $PACKAGES
>   RUN rpm -q $PACKAGES | sort > /packages.txt
> 
> > 
> > diff --git a/.gitlab-ci.d/containers.yml b/.gitlab-
> > ci.d/containers.yml
> > index 892ca8d838..910754a699 100644
> > --- a/.gitlab-ci.d/containers.yml
> > +++ b/.gitlab-ci.d/containers.yml
> > @@ -246,3 +246,8 @@ amd64-ubuntu-container:
> >     <<: *container_job_definition
> >     variables:
> >       NAME: ubuntu
> > +
> > +amd64-opensuse-leap-container:
> > +  <<: *container_job_definition
> > +  variables:
> > +    NAME: opensuse-leap
> > diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> > index 98bff03b47..a1df981c9a 100644
> > --- a/.gitlab-ci.yml
> > +++ b/.gitlab-ci.yml
> > @@ -195,6 +195,26 @@ acceptance-system-centos:
> >       MAKE_CHECK_ARGS: check-acceptance
> >     <<: *acceptance_definition
> >   
> > +build-system-opensuse:
> > +  <<: *native_build_job_definition
> > +  variables:
> > +    IMAGE: opensuse-leap
> > +    TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
> > +    MAKE_CHECK_ARGS: check-build
> > +  artifacts:
> > +    expire_in: 2 days
> > +    paths:
> > +      - build
> > +
> > +check-system-opensuse:
> > +  <<: *native_test_job_definition
> > +  needs:
> > +    - job: build-system-opensuse
> > +      artifacts: true
> > +  variables:
> > +    IMAGE: opensuse-leap
> > +    MAKE_CHECK_ARGS: check
> > +
> >   build-disabled:
> >     <<: *native_build_job_definition
> >     variables:
> > diff --git a/tests/docker/dockerfiles/opensuse-leap.docker
> > b/tests/docker/dockerfiles/opensuse-leap.docker
> > new file mode 100644
> > index 0000000000..8b0d915bff
> > --- /dev/null
> > +++ b/tests/docker/dockerfiles/opensuse-leap.docker
> > @@ -0,0 +1,54 @@
> > +FROM opensuse/leap:15.2
> > +
> > +# Please keep this list sorted alphabetically
> 
> The list of packages below isn't sorted.
> 
> Thanks for contributing this!
> 
> - Wainer
> 
> > +ENV PACKAGES \
> > +    bc \
> > +    brlapi-devel \
> > +    bzip2 \
> > +    cyrus-sasl-devel \
> > +    gcc \
> > +    gcc-c++ \
> > +    mkisofs \
> > +    gettext-runtime \
> > +    git \
> > +    glib2-devel \
> > +    glusterfs-devel \
> > +    libgnutls-devel \
> > +    gtk3-devel \
> > +    libaio-devel \
> > +    libattr-devel \
> > +    libcap-ng-devel \
> > +    libepoxy-devel \
> > +    libfdt-devel \
> > +    libiscsi-devel \
> > +    libjpeg8-devel \
> > +    libpmem-devel \
> > +    libpng16-devel \
> > +    librbd-devel \
> > +    libseccomp-devel \
> > +    libssh-devel \
> > +    lzo-devel \
> > +    make \
> > +    libSDL2_image-devel \
> > +    ncurses-devel \
> > +    ninja \
> > +    libnuma-devel \
> > +    perl \
> > +    libpixman-1-0-devel \
> > +    python3-base \
> > +    python3-virtualenv \
> > +    rdma-core-devel \
> > +    libSDL2-devel \
> > +    snappy-devel \
> > +    libspice-server-devel \
> > +    systemd-devel \
> > +    systemtap-sdt-devel \
> > +    usbredir-devel \
> > +    virglrenderer-devel \
> > +    xen-devel \
> > +    vte-devel \
> > +    zlib-devel
> > +ENV QEMU_CONFIGURE_OPTS --python=/usr/bin/python3.8
> > +
> > +RUN zypper update -y && zypper --non-interactive install -y
> > $PACKAGES
> > +RUN rpm -q $PACKAGES | sort > /packages.txt
>
diff mbox series

Patch

diff --git a/.gitlab-ci.d/containers.yml b/.gitlab-ci.d/containers.yml
index 892ca8d838..910754a699 100644
--- a/.gitlab-ci.d/containers.yml
+++ b/.gitlab-ci.d/containers.yml
@@ -246,3 +246,8 @@  amd64-ubuntu-container:
   <<: *container_job_definition
   variables:
     NAME: ubuntu
+
+amd64-opensuse-leap-container:
+  <<: *container_job_definition
+  variables:
+    NAME: opensuse-leap
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 98bff03b47..a1df981c9a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -195,6 +195,26 @@  acceptance-system-centos:
     MAKE_CHECK_ARGS: check-acceptance
   <<: *acceptance_definition
 
+build-system-opensuse:
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: opensuse-leap
+    TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
+    MAKE_CHECK_ARGS: check-build
+  artifacts:
+    expire_in: 2 days
+    paths:
+      - build
+
+check-system-opensuse:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-system-opensuse
+      artifacts: true
+  variables:
+    IMAGE: opensuse-leap
+    MAKE_CHECK_ARGS: check
+
 build-disabled:
   <<: *native_build_job_definition
   variables:
diff --git a/tests/docker/dockerfiles/opensuse-leap.docker b/tests/docker/dockerfiles/opensuse-leap.docker
new file mode 100644
index 0000000000..8b0d915bff
--- /dev/null
+++ b/tests/docker/dockerfiles/opensuse-leap.docker
@@ -0,0 +1,54 @@ 
+FROM opensuse/leap:15.2
+
+# Please keep this list sorted alphabetically
+ENV PACKAGES \
+    bc \
+    brlapi-devel \
+    bzip2 \
+    cyrus-sasl-devel \
+    gcc \
+    gcc-c++ \
+    mkisofs \
+    gettext-runtime \
+    git \
+    glib2-devel \
+    glusterfs-devel \
+    libgnutls-devel \
+    gtk3-devel \
+    libaio-devel \
+    libattr-devel \
+    libcap-ng-devel \
+    libepoxy-devel \
+    libfdt-devel \
+    libiscsi-devel \
+    libjpeg8-devel \
+    libpmem-devel \
+    libpng16-devel \
+    librbd-devel \
+    libseccomp-devel \
+    libssh-devel \
+    lzo-devel \
+    make \
+    libSDL2_image-devel \
+    ncurses-devel \
+    ninja \
+    libnuma-devel \
+    perl \
+    libpixman-1-0-devel \
+    python3-base \
+    python3-virtualenv \
+    rdma-core-devel \
+    libSDL2-devel \
+    snappy-devel \
+    libspice-server-devel \
+    systemd-devel \
+    systemtap-sdt-devel \
+    usbredir-devel \
+    virglrenderer-devel \
+    xen-devel \
+    vte-devel \
+    zlib-devel
+ENV QEMU_CONFIGURE_OPTS --python=/usr/bin/python3.8
+
+RUN zypper update -y && zypper --non-interactive install -y $PACKAGES
+RUN rpm -q $PACKAGES | sort > /packages.txt