diff --git a/.zuul.d/jobs.yaml b/.zuul.d/jobs.yaml index 4dcddc34..65c828b4 100644 --- a/.zuul.d/jobs.yaml +++ b/.zuul.d/jobs.yaml @@ -17,11 +17,13 @@ description: | This is the base set of stable tests parent: dib-functests-base - nodeset: ubuntu-bionic + nodeset: debian-bullseye vars: dib_functests: - containerfile/focal-build-succeeds - - openeuler-minimal/20.03-LTS-SP2-build-succeeds + # NOTE(ianw) 2021-10-15 : this currently segfaults + # yum... + #- openeuler-minimal/20.03-LTS-SP2-build-succeeds # Image based tests - centos/8-build-succeeds - centos/8-stream-build-succeeds diff --git a/diskimage_builder/elements/containerfile/README.rst b/diskimage_builder/elements/containerfile/README.rst index 5fa878c3..ec6d24c8 100644 --- a/diskimage_builder/elements/containerfile/README.rst +++ b/diskimage_builder/elements/containerfile/README.rst @@ -11,4 +11,8 @@ will search active elements for a container file located in `containerfiles/${DIB_RELEASE}`. Alternatively, to use this element directly supply the path to a -container file in the environment variable `DIB_CONTAINER_FILE`. +container file in the environment variable +`DIB_CONTAINERFILE_DOCKERFILE`. + +Set ``DIB_CONTAINERFILE_PODMAN_ROOT`` to ``1`` to run `podman` as +`root`. diff --git a/diskimage_builder/elements/containerfile/root.d/08-containerfile b/diskimage_builder/elements/containerfile/root.d/08-containerfile index 47de3a34..46d4b4af 100755 --- a/diskimage_builder/elements/containerfile/root.d/08-containerfile +++ b/diskimage_builder/elements/containerfile/root.d/08-containerfile @@ -25,7 +25,7 @@ if [ -f ${TARGET_ROOT}/.extra_settings ] ; then . ${TARGET_ROOT}/.extra_settings fi -if [ -z "${DIB_CONTAINER_FILE:-}" ]; then +if [ -z "${DIB_CONTAINERFILE_DOCKERFILE:-}" ]; then _xtrace=$(set +o | grep xtrace) set +o xtrace @@ -38,7 +38,7 @@ if [ -z "${DIB_CONTAINER_FILE:-}" ]; then containerfile="${element_dir}/containerfiles/${DIB_RELEASE}" if [ -f "${containerfile}" ]; then echo "Found container file ${containerfile}" - DIB_CONTAINER_FILE="${containerfile}" + DIB_CONTAINERFILE_DOCKERFILE="${containerfile}" break fi done @@ -52,10 +52,16 @@ DIB_CONTAINER_CONTEXT=${DIB_CONTAINER_CONTEXT:-${DIB_IMAGE_CACHE}/containerfile} mkdir -p $DIB_CONTAINER_CONTEXT -podman build -t dib-work-image -f $DIB_CONTAINER_FILE $DIB_CONTAINER_CONTEXT -container=$(podman run -d dib-work-image /bin/sh) -podman export $container | sudo tar -C $TARGET_ROOT --numeric-owner -xf - -podman rm $container -podman rmi dib-work-image +if [[ ${DIB_CONTAINERFILE_PODMAN_ROOT:-0} -gt 0 ]]; then + _sudo="sudo" +else + _sudo="" +fi + +${_sudo} podman build -t dib-work-image -f $DIB_CONTAINERFILE_DOCKERFILE $DIB_CONTAINER_CONTEXT +container=$(${_sudo} podman run -d dib-work-image /bin/sh) +${_sudo} podman export $container | ${_sudo} tar -C $TARGET_ROOT --numeric-owner -xf - +${_sudo} podman rm $container +${_sudo} podman rmi dib-work-image sudo rm -f ${TARGET_ROOT}/.extra_settings diff --git a/diskimage_builder/elements/containerfile/test-elements/focal-build-succeeds/environment.d/10-set-file.bash b/diskimage_builder/elements/containerfile/test-elements/focal-build-succeeds/environment.d/10-set-file.bash index 4fc3bdfa..d1df8206 100644 --- a/diskimage_builder/elements/containerfile/test-elements/focal-build-succeeds/environment.d/10-set-file.bash +++ b/diskimage_builder/elements/containerfile/test-elements/focal-build-succeeds/environment.d/10-set-file.bash @@ -1,3 +1,3 @@ path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" path="$( dirname $path)" -export DIB_CONTAINER_FILE="$path/files/Dockerfile" +export DIB_CONTAINERFILE_DOCKERFILE="$path/files/Dockerfile" diff --git a/roles/dib-functests/tasks/main.yaml b/roles/dib-functests/tasks/main.yaml index fecbf889..44ac97b6 100644 --- a/roles/dib-functests/tasks/main.yaml +++ b/roles/dib-functests/tasks/main.yaml @@ -34,6 +34,22 @@ state: directory mode: ugo+rw +# NOTE(ianw) 2021-10-15 : at this point dnf-plugins-core is stuck in +# the NEW queue. Use that when it is available over this hack, +# obviously. +- name: Install dnf download + shell: | + set -x + git clone https://github.com/rpm-software-management/dnf-plugins-core + mkdir /usr/lib/python3/dist-packages/dnf-plugins + cp -r dnf-plugins-core/plugins/dnfpluginscore /usr/lib/python3/dist-packages + cp dnf-plugins-core/plugins/download.py /usr/lib/python3/dist-packages/dnf-plugins + rm -rf dnf-plugins-core + echo 'pluginpath=/usr/lib/python3/dist-packages/dnf-plugins' >> /etc/dnf/dnf.conf + args: + executable: /bin/bash + become: yes + - name: Run dib functional tests shell: cmd: | @@ -47,3 +63,6 @@ DIB_NO_TMPFS: 1 TMPDIR: /opt/dib_cache DIB_OS_CI_YUM_REPOS: "{{ dib_gate_mirror_repos|default(omit) }}" + # NOTE(ianw) 2021-10-15 : this might be our bullseye images + # having issues with non-root podman. This works for now. + DIB_CONTAINERFILE_PODMAN_ROOT: 1