From b48322d44ed2235952e8f4e6d6591b77a1e28d9b Mon Sep 17 00:00:00 2001 From: Gabriela Cervantes Date: Fri, 7 Jan 2022 17:06:20 +0000 Subject: [PATCH] packaging: Remove obs packages testing for kata 2.0 This PR removes the scripts and the dockerfiles that were used in kata 1.x to test the different kata components for different distributions in OBS. Currently for kata 2.0 we are not generating packages in OBS so these scripts are not longer being used. Fixes #3404 Signed-off-by: Gabriela Cervantes --- .../packaging/tests/Dockerfile/Dockerfile.in | 19 ---- .../tests/Dockerfile/FedoraDockerfile.in | 27 ----- tools/packaging/tests/run_obs_testing.sh | 98 ------------------- tools/packaging/tests/run_packages_testing.sh | 61 ------------ 4 files changed, 205 deletions(-) delete mode 100644 tools/packaging/tests/Dockerfile/Dockerfile.in delete mode 100644 tools/packaging/tests/Dockerfile/FedoraDockerfile.in delete mode 100755 tools/packaging/tests/run_obs_testing.sh delete mode 100755 tools/packaging/tests/run_packages_testing.sh diff --git a/tools/packaging/tests/Dockerfile/Dockerfile.in b/tools/packaging/tests/Dockerfile/Dockerfile.in deleted file mode 100644 index 31b7377bb5..0000000000 --- a/tools/packaging/tests/Dockerfile/Dockerfile.in +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2019 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -# Usage: FROM [image name] -FROM @OS_DISTRIBUTION@ - -ARG TEST_REPO="https://github.com/kata-containers/tests" - -RUN @UPDATE@ - -RUN @DEPENDENCIES@ - -# Install packages -RUN cd "/home/" && git clone "${TEST_REPO}" -RUN cd "/home/tests" && ./cmd/kata-manager/kata-manager.sh install-packages -RUN kata-runtime kata-env - -CMD ["/bin/bash"] diff --git a/tools/packaging/tests/Dockerfile/FedoraDockerfile.in b/tools/packaging/tests/Dockerfile/FedoraDockerfile.in deleted file mode 100644 index e050ca971b..0000000000 --- a/tools/packaging/tests/Dockerfile/FedoraDockerfile.in +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2020 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -# Usage: FROM [image name] -FROM @OS_DISTRIBUTION@ - -ENV TESTS_REPO="github.com/kata-containers/tests" - -RUN @DEPENDENCIES@ - -ENV PATH=$PATH:/usr/local/go/bin -ENV GOPATH=/home/go -ENV TESTS_REPOSITORY_PATH="${GOPATH}/src/${TESTS_REPO}" -ENV AGENT_INIT=yes TEST_INITRD=yes OSBUILDER_DISTRO=alpine - -# Install packages and build and install Kata Containers -RUN dnf -y install kata-proxy kata-ksm-throttler kata-osbuilder kata-runtime kata-shim && \ - mkdir "${GOPATH}" && \ - dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo && \ - dnf makecache && dnf -y install docker-ce && dnf clean all && \ - go get -d "${TESTS_REPO}" && \ - cd "${TESTS_REPOSITORY_PATH}" && .ci/install_kata_image.sh && \ - cd "${TESTS_REPOSITORY_PATH}" && .ci/install_kata_kernel.sh && \ - kata-runtime kata-env - -CMD ["/bin/bash"] diff --git a/tools/packaging/tests/run_obs_testing.sh b/tools/packaging/tests/run_obs_testing.sh deleted file mode 100755 index 916ab3d3fb..0000000000 --- a/tools/packaging/tests/run_obs_testing.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2019 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -set -o errexit -set -o nounset -set -o pipefail - -SCRIPT_PATH=$(dirname "$(readlink -f "$0")") -http_proxy="${http_proxy:-}" -https_proxy="${https_proxy:-}" -DOCKERFILE_PATH="${SCRIPT_PATH}/Dockerfile" - -declare -a OS_DISTRIBUTION=( \ - 'ubuntu:16.04' \ - 'ubuntu:18.04' \ - 'fedora:30' \ - 'opensuse/leap:15.1' \ - 'debian:9' \ - 'debian:10' \ - 'centos:7' \ -) - -install_packages() { - for i in "${OS_DISTRIBUTION[@]}"; do - echo "Test OBS packages for ${OS_DISTRIBUTION}" - run_test "${i}" "${DOCKERFILE_PATH}" - remove_image_and_dockerfile "${i}" "${DOCKERFILE_PATH}" - done -} - -run_test() { - local OS_DISTRIBUTION=${1:-} - local DOCKERFILE_PATH=${2:-} - generate_dockerfile "${OS_DISTRIBUTION}" "${DOCKERFILE_PATH}" - build_dockerfile "${OS_DISTRIBUTION}" "${DOCKERFILE_PATH}" -} - - -generate_dockerfile() { - local OS_DISTRIBUTION=${1:-} - local DOCKERFILE_PATH=${2:-} - DISTRIBUTION_NAME=$(echo "${OS_DISTRIBUTION}" | cut -d ':' -f1) - case "${DISTRIBUTION_NAME}" in - centos) - UPDATE="yum -y update" - DEPENDENCIES="yum install -y curl git gnupg2 lsb-release sudo" - ;; - debian|ubuntu) - UPDATE="apt-get -y update" - DEPENDENCIES="apt-get --no-install-recommends install -y apt-utils ca-certificates curl git gnupg2 lsb-release sudo" - ;; - fedora) - UPDATE="dnf -y update" - DEPENDENCIES="dnf install -y curl git gnupg2 sudo" - ;; - opensuse/leap) - UPDATE="zypper -n refresh" - DEPENDENCIES="zypper -n install curl git gnupg sudo" - esac - - echo "Building dockerfile for ${OS_DISTRIBUTION}" - sed \ - -e "s|@OS_DISTRIBUTION@|${OS_DISTRIBUTION}|g" \ - -e "s|@UPDATE@|${UPDATE}|g" \ - -e "s|@DEPENDENCIES@|${DEPENDENCIES}|g" \ - "${DOCKERFILE_PATH}/Dockerfile.in" > "${DOCKERFILE_PATH}"/Dockerfile -} - -build_dockerfile() { - local OS_DISTRIBUTION=${1:-} - local DOCKERFILE_PATH=${2:-} - pushd "${DOCKERFILE_PATH}" - sudo docker build \ - --build-arg http_proxy="${http_proxy}" \ - --build-arg https_proxy="${https_proxy}" \ - --tag "obs-kata-test-${OS_DISTRIBUTION}" . - popd -} - -remove_image_and_dockerfile() { - local OS_DISTRIBUTION=${1:-} - local DOCKERFILE_PATH=${2:-} - echo "Removing image test-${OS_DISTRIBUTION}" - sudo docker rmi "obs-kata-test-${OS_DISTRIBUTION}" - - echo "Removing dockerfile" - sudo rm -f "${DOCKERFILE_PATH}/Dockerfile" -} - -function main() { - echo "Run OBS testing" - install_packages -} - -main "$@" diff --git a/tools/packaging/tests/run_packages_testing.sh b/tools/packaging/tests/run_packages_testing.sh deleted file mode 100755 index 81decefe46..0000000000 --- a/tools/packaging/tests/run_packages_testing.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2020 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -set -o errexit -set -o nounset -set -o pipefail - -SCRIPT_PATH=$(dirname "$(readlink -f "$0")") -http_proxy="${http_proxy:-}" -https_proxy="${https_proxy:-}" -DOCKERFILE_PATH="${SCRIPT_PATH}/Dockerfile" -OS_DISTRIBUTION="${OS_DISTRIBUTION:-fedora:31}" - -install_packages() { - echo "Test distribution packages for ${OS_DISTRIBUTION}" - run_test - remove_image_and_dockerfile -} - -run_test() { - generate_dockerfile - build_dockerfile -} - -generate_dockerfile() { - UPDATE="dnf -y update" - DEPENDENCIES="dnf install -y curl git make sudo golang dnf-plugin-config-manager" - - echo "Building dockerfile for ${OS_DISTRIBUTION}" - sed \ - -e "s|@OS_DISTRIBUTION@|${OS_DISTRIBUTION}|g" \ - -e "s|@DEPENDENCIES@|${DEPENDENCIES}|g" \ - "${DOCKERFILE_PATH}/FedoraDockerfile.in" > "${DOCKERFILE_PATH}"/Dockerfile -} - -build_dockerfile() { - pushd "${DOCKERFILE_PATH}" - sudo docker build \ - --build-arg http_proxy="${http_proxy}" \ - --build-arg https_proxy="${https_proxy}" \ - --tag "packaging-kata-test-${OS_DISTRIBUTION}" . - popd -} - -remove_image_and_dockerfile() { - echo "Removing image test-${OS_DISTRIBUTION}" - sudo docker rmi "packaging-kata-test-${OS_DISTRIBUTION}" - - echo "Removing dockerfile" - sudo rm -f "${DOCKERFILE_PATH}/Dockerfile" -} - -function main() { - echo "Run packaging testing" - install_packages -} - -main "$@"