mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 12:14:48 +00:00
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 <gabriela.cervantes.tellez@intel.com>
This commit is contained in:
parent
e6e5d2593a
commit
b48322d44e
@ -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"]
|
@ -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"]
|
@ -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 "$@"
|
@ -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 "$@"
|
Loading…
Reference in New Issue
Block a user