From d29427d353958ca66a1cf365ff78e1c4dad280ec Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Thu, 4 Jul 2019 14:43:03 -0500 Subject: [PATCH 1/3] qemu: static: Apply qemu patches depending on the verison. qemu static is using all the patches that we have for qemu, we only want to apply depending the version. Fixes: #619 Signed-off-by: Jose Carlos Venegas Munoz --- static-build/qemu/Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/static-build/qemu/Dockerfile b/static-build/qemu/Dockerfile index 34ab29805f..410a17e2c3 100644 --- a/static-build/qemu/Dockerfile +++ b/static-build/qemu/Dockerfile @@ -39,9 +39,15 @@ RUN git clone https://github.com/qemu/capstone.git capstone RUN git clone https://github.com/qemu/keycodemapdb.git ui/keycodemapdb ADD scripts/configure-hypervisor.sh /root/configure-hypervisor.sh -ADD qemu/patches/* /root/kata_qemu_patches +ADD qemu/patches/ /root/kata_qemu_patches -RUN for patch in /root/kata_qemu_patches/*.patch; do git apply "$patch"; done +RUN \ + cat VERSION; \ + stable_branch=$(cat VERSION | awk 'BEGIN{FS=OFS="."}{print $1 "." $2 ".x"}');\ + for patch in $(find /root/kata_qemu_patches/${stable_branch}/ -name '*.patch'); do\ + echo "apply $patch";\ + git apply "$patch"; \ + done RUN PREFIX="${PREFIX}" /root/configure-hypervisor.sh -s kata-qemu | xargs ./configure \ --with-pkgversion=kata-static From f9fe9440a77baae6e05d2ac6796e19502fb4dc2e Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Thu, 4 Jul 2019 14:44:58 -0500 Subject: [PATCH 2/3] ci: cd: Use the same obs script for CD. We want to use the same script for both PRs and new package CD. Depending if CI is set a release push will be done or a ci. Fixes: #617 Signed-off-by: Jose Carlos Venegas Munoz --- .ci/packaging/request_to_obs.sh | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.ci/packaging/request_to_obs.sh b/.ci/packaging/request_to_obs.sh index 4c7653947b..145f4dd1dc 100755 --- a/.ci/packaging/request_to_obs.sh +++ b/.ci/packaging/request_to_obs.sh @@ -14,7 +14,7 @@ set -o nounset set -o pipefail set -o errtrace -[ -z "${DEBUG:-}" ] || set -x +[ -z "${DEBUG:-}" ] || set -x readonly script_dir=$(dirname $(readlink -f "$0")) readonly packaging_dir="${script_dir}/../.." @@ -30,10 +30,9 @@ fi # Push to anywhere, variable used by release scripts to push PUSH=1 -# dont use release kata image -BUILD_HEAD=true +BUILD_HEAD=${BUILD_HEAD:-${CI:-}} -if [ "${CI:-}" == "true" ];then +if [ "${CI:-}" == "true" ]; then SUBPROJECT_TYPE="ci" else SUBPROJECT_TYPE="releases" @@ -55,13 +54,25 @@ echo "INFO: BUILD_HEAD=${BUILD_HEAD}" echo "INFO: BRANCH=${BRANCH}" echo "INFO: OBS_BRANCH=${OBS_SUBPROJECT}" echo "INFO: PUSH=${PUSH}" +echo "INFO: SUBPROJECT_TYPE=${SUBPROJECT_TYPE}" # Export in all pipeline tasks -cd "${packaging_dir}/obs-packaging" || exit 1 -echo "Building for head gen versions ..." -./gen_versions_txt.sh --head "${BRANCH}" +cd "${packaging_dir}/obs-packaging" || exit 1 +gen_versions_cmd="./gen_versions_txt.sh" +if [ "${BUILD_HEAD}" = "true" ]; then + echo "Building for head gen versions ..." + gen_versions_cmd+=" --head" +fi + +${gen_versions_cmd} "${BRANCH}" + # print versions just for debug/info cat versions.txt export NEW_VERSION=$(curl -s -L https://raw.githubusercontent.com/kata-containers/runtime/${BRANCH}/VERSION) -script -qefc bash -c './create-repo-branch.sh --ci ${OBS_BRANCH}' +create_repo_cmd="./create-repo-branch.sh" +if [ "${CI:-}" = "true" ]; then + create_repo_cmd+=" --ci" +fi +create_repo_cmd+=" ${OBS_BRANCH}" +script -qefc bash -c "${create_repo_cmd}" script -qefc bash -c './build_from_docker.sh ${NEW_VERSION}' From bfc922066327914524ec8f0082013935aba16e5e Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Thu, 4 Jul 2019 15:29:09 -0500 Subject: [PATCH 3/3] package: fix path to qemu-vanilla in debs Deb files has not a correct qemu vanilla path. Fixes: #620 Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/runtime/debian.rules-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs-packaging/runtime/debian.rules-template b/obs-packaging/runtime/debian.rules-template index b3d506bb69..df49ff6e3d 100644 --- a/obs-packaging/runtime/debian.rules-template +++ b/obs-packaging/runtime/debian.rules-template @@ -12,7 +12,7 @@ export GOPATH=/usr/src/packages/BUILD/go export GOROOT=/usr/src/packages/BUILD/local/go export DH_OPTIONS -export DEFAULT_QEMU=qemu-vanilla-x86_64 +export DEFAULT_QEMU=qemu-vanilla-system-x86_64 GO_VERSION=@GO_VERSION@