From 749b7499246004e31560bb370a0e901ff265fd5a Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Fri, 29 Jun 2018 13:49:44 -0500 Subject: [PATCH 01/19] pkglib: Make default alpha We should point to alpha to allow test scripts. Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/scripts/pkglib.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/obs-packaging/scripts/pkglib.sh b/obs-packaging/scripts/pkglib.sh index 4911800fbc..b00a5d354a 100644 --- a/obs-packaging/scripts/pkglib.sh +++ b/obs-packaging/scripts/pkglib.sh @@ -9,7 +9,7 @@ LOG_DIR=${PACKAGING_DIR}/build_logs # OBS Project info OBS_PROJECT="${OBS_PROJECT:-katacontainers}" -OBS_SUBPROJECT="${OBS_SUBPROJECT:-release}" +OBS_SUBPROJECT="${OBS_SUBPROJECT:-alpha}" # BUILD OPTIONS BUILD_DISTROS=${BUILD_DISTROS:-Fedora_27 xUbuntu_16.04 CentOS_7} @@ -35,10 +35,10 @@ fi function display_help() { - cat <<-EOL + cat <<-EOL $SCRIPT_NAME - This script is intended to create Kata Containers 3.X packages for the OBS + This script is intended to create Kata Containers packages for the OBS (Open Build Service) platform. Usage: @@ -89,7 +89,7 @@ function verify() # Make sure this script is called from ./ [ "$SCRIPT_DIR" != "." ] && die "The script must be called from its base dir." - + # Verify if osc is installed, exit otherwise. [ ! -x "$(command -v osc)" ] && die "osc is not installed." @@ -131,7 +131,7 @@ function set_versions() else hash_tag=$commit_hash fi - short_hashtag="${hash_tag:0:7}" + short_hashtag="${hash_tag:0:7}" } function changelog_update { @@ -190,7 +190,6 @@ function checkout_repo() cp ${STATIC_FILES[@]} $OBS_WORKDIR } - function obs_push() { pushd $OBS_WORKDIR @@ -258,7 +257,7 @@ function generate_files () { replace_list+=("RPM_PATCH_LIST=$RPM_PATCH_LIST") replace_list+=("RPM_APPLY_PATCHES=$RPM_APPLY_PATCHES") - # check replace list + # check replace list # key=val for replace in "${replace_list[@]}" ; do [[ "$replace" = *"="* ]] || die "invalid replace $replace" @@ -322,7 +321,6 @@ function get_obs_pkg_release() { release=$(grep -oP '%define\s+release\s+[0-9]+' "${spec_file}" | grep -oP '[0-9]+') fi - rm -r "${repo_dir}" echo "${release}" } From 51a3c71dc11402746da13eb645a7051047bfba99 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Fri, 29 Jun 2018 14:12:20 -0500 Subject: [PATCH 02/19] proxy: Allow build any commit Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/proxy/_service-template | 4 ++-- obs-packaging/proxy/update.sh | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/obs-packaging/proxy/_service-template b/obs-packaging/proxy/_service-template index 1b94f806c1..e2277f62a2 100644 --- a/obs-packaging/proxy/_service-template +++ b/obs-packaging/proxy/_service-template @@ -4,8 +4,8 @@ git https://github.com/kata-containers/proxy.git kata-proxy - @VERSION@+git.%h - @REVISION@ + @VERSION@+git.@HASH@ + @HASH@ *.tar* diff --git a/obs-packaging/proxy/update.sh b/obs-packaging/proxy/update.sh index f80a5bc2c4..c62fe23c82 100755 --- a/obs-packaging/proxy/update.sh +++ b/obs-packaging/proxy/update.sh @@ -38,7 +38,6 @@ replace_list=( "GO_ARCH=$GO_ARCH" "HASH=$short_hashtag" "RELEASE=$RELEASE" -"REVISION=$VERSION" "VERSION=$VERSION" ) From 8552b5cca94e82ac0b791e63e5427e4afbb4fd4a Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Fri, 29 Jun 2018 14:26:36 -0500 Subject: [PATCH 03/19] dockerfile: pkgs: Installation vebose the installation takes a long time without print anything add verbose to know is doing something. Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs-packaging/Dockerfile b/obs-packaging/Dockerfile index 648aef10ac..9b8c143d3d 100644 --- a/obs-packaging/Dockerfile +++ b/obs-packaging/Dockerfile @@ -5,7 +5,7 @@ ARG SUSE_VERSION=${SUSE_VERSION:-42.3} ARG GO_ARCH=${GO_ARCH:-amd64} # Get OBS client, plugins and dependencies -RUN zypper -n install osc-plugin-install vim curl bsdtar git sudo pcre-tools +RUN zypper -v -n install osc-plugin-install vim curl bsdtar git sudo pcre-tools RUN curl -OkL https://download.opensuse.org/repositories/openSUSE:Tools/openSUSE_${SUSE_VERSION}/openSUSE:Tools.repo RUN zypper -n addrepo openSUSE:Tools.repo RUN zypper --gpg-auto-import-keys refresh From 37864534cf62728e3efd9f76fee8f277a1bdaba6 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Fri, 29 Jun 2018 14:35:30 -0500 Subject: [PATCH 04/19] pkgs: shim: Allow build any commit Allow to build any commit Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/shim/_service-template | 4 ++-- obs-packaging/shim/update.sh | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/obs-packaging/shim/_service-template b/obs-packaging/shim/_service-template index 7ea8e373e0..edb29511ef 100644 --- a/obs-packaging/shim/_service-template +++ b/obs-packaging/shim/_service-template @@ -4,8 +4,8 @@ git https://github.com/kata-containers/shim.git kata-shim - @VERSION@+git.%h - @REVISION@ + @VERSION@+git.@HASH@ + @HASH@ *.tar* diff --git a/obs-packaging/shim/update.sh b/obs-packaging/shim/update.sh index 6dca7c284b..fc83fd1607 100755 --- a/obs-packaging/shim/update.sh +++ b/obs-packaging/shim/update.sh @@ -38,7 +38,6 @@ replace_list=( "GO_ARCH=$GO_ARCH" "HASH=$short_hashtag" "RELEASE=$RELEASE" -"REVISION=$VERSION" "VERSION=$VERSION" ) From 24ff32d8331a583d1d66271dbc27b6c916951140 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Fri, 29 Jun 2018 14:45:39 -0500 Subject: [PATCH 05/19] pkgs: ksm-throttler: allow to build any commit Build any commit not only a tag. Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/ksm-throttler/_service-template | 6 +++--- obs-packaging/ksm-throttler/update.sh | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/obs-packaging/ksm-throttler/_service-template b/obs-packaging/ksm-throttler/_service-template index 38abb0ffff..15c4d64b9f 100644 --- a/obs-packaging/ksm-throttler/_service-template +++ b/obs-packaging/ksm-throttler/_service-template @@ -1,11 +1,11 @@ - + git https://github.com/kata-containers/ksm-throttler.git kata-ksm-throttler - @VERSION@.git+%h - @REVISION@ + @VERSION@.git+@HASH@ + @HASH@ *.tar* diff --git a/obs-packaging/ksm-throttler/update.sh b/obs-packaging/ksm-throttler/update.sh index dd63f97f66..ad54d340aa 100755 --- a/obs-packaging/ksm-throttler/update.sh +++ b/obs-packaging/ksm-throttler/update.sh @@ -34,16 +34,14 @@ RELEASE=$(get_obs_pkg_release "${PROJECT_REPO}") ((RELEASE++)) [ -n "$APIURL" ] && APIURL="-A ${APIURL}" - set_versions "$ksm_throttler_hash" replace_list=( "GO_CHECKSUM=$go_checksum" "GO_VERSION=$go_version" "GO_ARCH=$GO_ARCH" -"HASH=${HASH:0:7}" +"HASH=${short_hashtag}" "RELEASE=$RELEASE" -"REVISION=$HASH" "VERSION=$VERSION" ) From 2a55deb30ddb217e5ee9b5e385677fb6d03a4049 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Fri, 29 Jun 2018 15:04:53 -0500 Subject: [PATCH 06/19] pkgs: runtime: Allow to build any commit. Allow to build any commit instead of a tag. Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/runtime/_service-template | 4 ++-- obs-packaging/runtime/update.sh | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/obs-packaging/runtime/_service-template b/obs-packaging/runtime/_service-template index 22078cc666..b776d9bd7f 100644 --- a/obs-packaging/runtime/_service-template +++ b/obs-packaging/runtime/_service-template @@ -6,8 +6,8 @@ https://github.com/kata-containers/runtime.git kata-runtime - @VERSION@+git.%h - @REVISION@ + @VERSION@+git.@HASH@ + @HASH@ *.tar* diff --git a/obs-packaging/runtime/update.sh b/obs-packaging/runtime/update.sh index 00267e149f..f05318e482 100755 --- a/obs-packaging/runtime/update.sh +++ b/obs-packaging/runtime/update.sh @@ -84,7 +84,6 @@ replace_list=( "GO_ARCH=$GO_ARCH" "HASH=$short_hashtag" "RELEASE=$RELEASE" -"REVISION=$VERSION" "VERSION=$VERSION" "kata_osbuilder_version=${KATA_IMAGE_REQUIRED_VERSION}" "kata_proxy_version=${PROXY_REQUIRED_VERESION}" @@ -95,7 +94,6 @@ replace_list=( "qemu_vanilla_version=${KATA_QEMU_VANILLA_REQUIRED_VERSION}" ) - verify echo "Verify succeed." get_git_info From 90c62f8da11d558a1fb58b8314ebde166d0166fc Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Sat, 30 Jun 2018 00:29:17 -0500 Subject: [PATCH 07/19] pkgs: runtime: use DESTDIR variable. Use DESTDIR to install kata-runtime. Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/runtime/debian.rules-template | 10 ++++------ obs-packaging/runtime/kata-runtime.spec-template | 6 ++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/obs-packaging/runtime/debian.rules-template b/obs-packaging/runtime/debian.rules-template index 4a2a02d972..2c9d2cee74 100644 --- a/obs-packaging/runtime/debian.rules-template +++ b/obs-packaging/runtime/debian.rules-template @@ -29,15 +29,13 @@ override_dh_auto_build: cd $(GOPATH)/src/$(IMPORTNAME)/; \ make QEMUPATH=/usr/bin/$(DEFAULT_QEMU) - override_dh_auto_install: mkdir -p debian/$(PKG_NAME) cd $(GOPATH)/src/$(IMPORTNAME)/; \ make install \ - SCRIPTS_DIR=$(shell pwd)/debian/usr/bin \ - DESTTARGET=$(shell pwd)/debian/$(PKG_NAME)/usr/bin/kata-runtime \ - QEMUPATH=/usr/bin/$(DEFAULT_QEMU) \ - DESTCONFIG=$(shell pwd)/debian/$(PKG_NAME)/usr/share/defaults/kata-containers/configuration.toml + DESTDIR=$(shell pwd)/debian/$(PKG_NAME)/ \ + PREFIX=/usr \ + QEMUPATH=/usr/bin/$(DEFAULT_QEMU) - sed -i -e '/^initrd =/d' $(shell pwd)/debian/$(PKG_NAME)/usr/share/defaults/kata-containers/configuration.toml + sed -i -e '/^initrd =/d' $(shell pwd)/debian/$(PKG_NAME)/usr/share/defaults/kata-containers/configuration.toml diff --git a/obs-packaging/runtime/kata-runtime.spec-template b/obs-packaging/runtime/kata-runtime.spec-template index 6d4b12f5bb..9a87dc5fc0 100644 --- a/obs-packaging/runtime/kata-runtime.spec-template +++ b/obs-packaging/runtime/kata-runtime.spec-template @@ -86,10 +86,8 @@ export GOPATH=$HOME/rpmbuild/BUILD/go/ cd $HOME/rpmbuild/BUILD/go/src/%{IMPORTNAME} make \ - DESTTARGET=%{buildroot}/usr/bin/kata-runtime \ - DESTCONFIG=%{buildroot}/usr/share/defaults/kata-containers/configuration.toml \ - SCRIPTS_DIR=%{buildroot}/usr/bin \ - BASH_COMPLETIONSDIR=%{buildroot}/usr/share/bash-completion/completions/kata-runtime \ + DESTDIR=%{buildroot} \ + PREFIX=/usr \ QEMUPATH=/usr/bin/%{DEFAULT_QEMU} \ install sed -i -e '/^initrd =/d' %{buildroot}/usr/share/defaults/kata-containers/configuration.toml From 6396e7c6d6d6250de175c88f63c6e90ffc874234 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Sat, 30 Jun 2018 01:10:25 -0500 Subject: [PATCH 08/19] pkgs: Add commit to build. We dont have commit when we build the pkg. Lets define the COMMIT variable to kwnow the commit from each project. Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/ksm-throttler/debian.rules-template | 6 ++++-- .../ksm-throttler/kata-ksm-throttler.spec-template | 2 ++ obs-packaging/proxy/debian.rules-template | 4 ++-- obs-packaging/proxy/kata-proxy.spec-template | 4 ++-- obs-packaging/runtime/debian.rules-template | 3 ++- obs-packaging/runtime/kata-runtime.spec-template | 3 ++- obs-packaging/shim/debian.rules-template | 4 ++-- obs-packaging/shim/kata-shim.spec-template | 4 ++-- 8 files changed, 18 insertions(+), 12 deletions(-) diff --git a/obs-packaging/ksm-throttler/debian.rules-template b/obs-packaging/ksm-throttler/debian.rules-template index 61d07f00fb..c4dc9a7b59 100644 --- a/obs-packaging/ksm-throttler/debian.rules-template +++ b/obs-packaging/ksm-throttler/debian.rules-template @@ -23,13 +23,15 @@ override_dh_auto_build: tar xzf /usr/src/packages/SOURCES/go$(GO_VERSION).linux-@GO_ARCH@.tar.gz -C /tmp/local ln -s /usr/src/packages/BUILD /usr/src/packages/BUILD/go/src/$(IMPORTNAME) cd $(GOPATH)/src/$(IMPORTNAME); \ - make TARGET=kata-ksm-throttler - + make \ + COMMIT=@HASH@ \ + TARGET=kata-ksm-throttler override_dh_auto_install: mkdir -p debian/$(PROJECT) cd $(GOPATH)/src/$(IMPORTNAME); \ make install \ + COMMIT=@HASH@ \ DESTDIR=$(shell pwd)/debian/kata-ksm-throttler \ TARGET=kata-ksm-throttler diff --git a/obs-packaging/ksm-throttler/kata-ksm-throttler.spec-template b/obs-packaging/ksm-throttler/kata-ksm-throttler.spec-template index fe8dfc309a..d1a6752e8f 100644 --- a/obs-packaging/ksm-throttler/kata-ksm-throttler.spec-template +++ b/obs-packaging/ksm-throttler/kata-ksm-throttler.spec-template @@ -58,6 +58,7 @@ mkdir -p $HOME/rpmbuild/BUILD/go/src/%{DOMAIN}/%{ORG} ln -s $HOME/rpmbuild/BUILD/kata-ksm-throttler-%{version} $HOME/rpmbuild/BUILD/go/src/%{IMPORTNAME} cd $HOME/rpmbuild/BUILD/go/src/%{IMPORTNAME} make \ + COMMIT=@HASH@ \ TARGET=kata-ksm-throttler \ LIBEXECDIR=%{LIBEXECDIR} @@ -68,6 +69,7 @@ export GOPATH=$HOME/rpmbuild/BUILD/go/ cd $HOME/rpmbuild/BUILD/go/src/%{IMPORTNAME} make install \ + COMMIT=@HASH@ \ TARGET=kata-ksm-throttler \ DESTDIR=%{buildroot} \ LIBEXECDIR=%{LIBEXECDIR} diff --git a/obs-packaging/proxy/debian.rules-template b/obs-packaging/proxy/debian.rules-template index c21602a675..32892cbebe 100644 --- a/obs-packaging/proxy/debian.rules-template +++ b/obs-packaging/proxy/debian.rules-template @@ -16,8 +16,8 @@ override_dh_auto_build: mkdir -p /usr/src/packages/BUILD/go/src/github.com/kata-containers/ tar xzf /usr/src/packages/SOURCES/go$(GO_VERSION).linux-@GO_ARCH@.tar.gz -C /usr/src/packages/BUILD/local/ ln -s /usr/src/packages/BUILD/ /usr/src/packages/BUILD/go/src/github.com/kata-containers/proxy - cd $(GOPATH)/src/github.com/kata-containers/proxy && make + cd $(GOPATH)/src/github.com/kata-containers/proxy && make COMMIT=@HASH@ override_dh_auto_install: mkdir debian/kata-proxy - make install LIBEXECDIR=$(shell pwd)/debian/kata-proxy/usr/libexec + make install LIBEXECDIR=$(shell pwd)/debian/kata-proxy/usr/libexec COMMIT=@HASH@ diff --git a/obs-packaging/proxy/kata-proxy.spec-template b/obs-packaging/proxy/kata-proxy.spec-template index 34742dcb7c..8986b47923 100644 --- a/obs-packaging/proxy/kata-proxy.spec-template +++ b/obs-packaging/proxy/kata-proxy.spec-template @@ -66,14 +66,14 @@ export GOPATH=$HOME/rpmbuild/BUILD/go/ mkdir -p $HOME/rpmbuild/BUILD/go/src/%{DOMAIN}/%{ORG} ln -s %{_builddir}/%{name}-%{version} $HOME/rpmbuild/BUILD/go/src/%{IMPORTNAME} cd $HOME/rpmbuild/BUILD/go/src/%{IMPORTNAME} -make +make COMMIT=@HASH@ %clean echo "Clean build root" rm -rf %{buildroot} %install -make install LIBEXECDIR=%{buildroot}%{LIBEXECDIR} +make install LIBEXECDIR=%{buildroot}%{LIBEXECDIR} COMMIT=@HASH@ %files %defattr(-,root,root,-) diff --git a/obs-packaging/runtime/debian.rules-template b/obs-packaging/runtime/debian.rules-template index 2c9d2cee74..a7b0be48c7 100644 --- a/obs-packaging/runtime/debian.rules-template +++ b/obs-packaging/runtime/debian.rules-template @@ -27,7 +27,7 @@ override_dh_auto_build: tar xzf /usr/src/packages/SOURCES/go$(GO_VERSION).linux-@GO_ARCH@.tar.gz -C /usr/src/packages/BUILD/local ln -s /usr/src/packages/BUILD /usr/src/packages/BUILD/go/src/$(IMPORTNAME) cd $(GOPATH)/src/$(IMPORTNAME)/; \ - make QEMUPATH=/usr/bin/$(DEFAULT_QEMU) + make QEMUPATH=/usr/bin/$(DEFAULT_QEMU) COMMIT=@HASH@ override_dh_auto_install: mkdir -p debian/$(PKG_NAME) @@ -36,6 +36,7 @@ override_dh_auto_install: make install \ DESTDIR=$(shell pwd)/debian/$(PKG_NAME)/ \ PREFIX=/usr \ + COMMIT=@HASH@ \ QEMUPATH=/usr/bin/$(DEFAULT_QEMU) sed -i -e '/^initrd =/d' $(shell pwd)/debian/$(PKG_NAME)/usr/share/defaults/kata-containers/configuration.toml diff --git a/obs-packaging/runtime/kata-runtime.spec-template b/obs-packaging/runtime/kata-runtime.spec-template index 9a87dc5fc0..9d676e7ece 100644 --- a/obs-packaging/runtime/kata-runtime.spec-template +++ b/obs-packaging/runtime/kata-runtime.spec-template @@ -71,7 +71,7 @@ export GOPATH=$HOME/rpmbuild/BUILD/go/ mkdir -p $HOME/rpmbuild/BUILD/go/src/%{DOMAIN}/%{ORG} ln -s $HOME/rpmbuild/BUILD/kata-runtime-%{version} $HOME/rpmbuild/BUILD/go/src/%{IMPORTNAME} cd $HOME/rpmbuild/BUILD/go/src/%{IMPORTNAME} -make QEMUPATH=/usr/bin/%{DEFAULT_QEMU} +make QEMUPATH=/usr/bin/%{DEFAULT_QEMU} COMMIT=@HASH@ %check export http_proxy=http://127.0.0.1:9/ @@ -89,6 +89,7 @@ make \ DESTDIR=%{buildroot} \ PREFIX=/usr \ QEMUPATH=/usr/bin/%{DEFAULT_QEMU} \ + COMMIT=@HASH@ \ install sed -i -e '/^initrd =/d' %{buildroot}/usr/share/defaults/kata-containers/configuration.toml diff --git a/obs-packaging/shim/debian.rules-template b/obs-packaging/shim/debian.rules-template index ae8f7909dd..dfea7abbe1 100644 --- a/obs-packaging/shim/debian.rules-template +++ b/obs-packaging/shim/debian.rules-template @@ -14,8 +14,8 @@ override_dh_auto_build: mkdir -p /usr/src/packages/BUILD/go/src/github.com/kata-containers/ tar xzf /usr/src/packages/SOURCES/go$(GO_VERSION).linux-@GO_ARCH@.tar.gz -C /usr/src/packages/BUILD/local/ ln -s /usr/src/packages/BUILD/ /usr/src/packages/BUILD/go/src/github.com/kata-containers/shim - cd $(GOPATH)/src/github.com/kata-containers/shim && make + cd $(GOPATH)/src/github.com/kata-containers/shim && make COMMIT=@HASH@ override_dh_auto_install: mkdir -p debian/kata-shim - make install LIBEXECDIR=$(shell pwd)/debian/kata-shim/usr/libexec + make install LIBEXECDIR=$(shell pwd)/debian/kata-shim/usr/libexec COMMIT=@HASH@ diff --git a/obs-packaging/shim/kata-shim.spec-template b/obs-packaging/shim/kata-shim.spec-template index 59da009f84..4237d7a404 100644 --- a/obs-packaging/shim/kata-shim.spec-template +++ b/obs-packaging/shim/kata-shim.spec-template @@ -58,7 +58,7 @@ export GOPATH=$HOME/rpmbuild/BUILD/go/ mkdir -p $HOME/rpmbuild/BUILD/go/src/%{DOMAIN}/%{ORG} ln -s %{_builddir}/%{name}-%{version} $HOME/rpmbuild/BUILD/go/src/%{IMPORTNAME} cd $HOME/rpmbuild/BUILD/go/src/%{IMPORTNAME} -make +make COMMIT=@HASH@ %check export http_proxy=http://127.0.0.1:9/ @@ -70,7 +70,7 @@ export GOROOT=$HOME/rpmbuild/BUILD/local/go export PATH=$PATH:$HOME/rpmbuild/BUILD/local/go/bin export GOPATH=$HOME/rpmbuild/BUILD/go/ -make install LIBEXECDIR=%{buildroot}%{LIBEXECDIR} +make install LIBEXECDIR=%{buildroot}%{LIBEXECDIR} COMMIT=@HASH@ %files %defattr(-,root,root,-) From a26187069c513397daf5d8fd8d234b92338f6e2b Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Sat, 30 Jun 2018 01:53:40 -0500 Subject: [PATCH 09/19] versions: Update to master update packages to master Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/versions.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/obs-packaging/versions.txt b/obs-packaging/versions.txt index 036602ce2e..e90f7f3754 100644 --- a/obs-packaging/versions.txt +++ b/obs-packaging/versions.txt @@ -1,8 +1,8 @@ -kata_runtime_hash=086d197f2c60e733a1aa4b033841ec922273ecd5 -kata_proxy_hash=a69326b63802952b14203ea9c1533d4edb8c1d64 -kata_shim_hash=74cbc1ee7645916a994b767790da4c6116d28270 -kata_agent_hash=a099747be287d30d7f1efcd6ba2bda88fc4a0f15 -ksm_throttler_hash=422c7f7ea05400ecdb06e892235fa75854ba2b11 +kata_runtime_hash=b7e3997bc1deed9eb40347d31557bce8dba6ae6b +kata_proxy_hash=15459f4b4ac6f6a242445ff284fec14135bc0045 +kata_shim_hash=5296edac3823b31eecebd90ad0b3e7ad81d6e88a +kata_agent_hash=994ac9c5e439571ee399cc10d5f18636170f7779 +ksm_throttler_hash=67307e510b7295f9fe1503ee0ebc4f71eacc1561 qemu_lite_hash=6ba2bfbee9a80bfd03605c5eb2ca743c8b68389e qemu_vanilla_hash=e3050471ff1daa7fefe88388dfa4e1d97ba1f0bc @@ -14,7 +14,7 @@ ksm_throttler_version=1.0.0 kata_osbuilder_version=1.0.0 qemu_lite_version=2.11.0 qemu_vanilla_version=2.11 -kernel_version=4.14.22 +kernel_version=4.14.51 # Default osbuilder image options osbuilder_default_os=clearlinux From 1a8fd811dbfd1badce907526fa6d3ff94cc1d74f Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Mon, 2 Jul 2018 11:43:54 -0500 Subject: [PATCH 10/19] versions: Update to 1.1.0 Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/versions.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/obs-packaging/versions.txt b/obs-packaging/versions.txt index e90f7f3754..b654ffa7b7 100644 --- a/obs-packaging/versions.txt +++ b/obs-packaging/versions.txt @@ -6,12 +6,12 @@ ksm_throttler_hash=67307e510b7295f9fe1503ee0ebc4f71eacc1561 qemu_lite_hash=6ba2bfbee9a80bfd03605c5eb2ca743c8b68389e qemu_vanilla_hash=e3050471ff1daa7fefe88388dfa4e1d97ba1f0bc -kata_runtime_version=1.0.0 -kata_proxy_version=1.0.0 -kata_shim_version=1.0.0 -kata_agent_version=1.0.0 -ksm_throttler_version=1.0.0 -kata_osbuilder_version=1.0.0 +kata_runtime_version=1.1.0 +kata_proxy_version=1.1.0 +kata_shim_version=1.1.0 +kata_agent_version=1.1.0 +ksm_throttler_version=1.1.0 +kata_osbuilder_version=1.1.0 qemu_lite_version=2.11.0 qemu_vanilla_version=2.11 kernel_version=4.14.51 From a4355a7104d7451526c296b504973d91b193ce87 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Mon, 2 Jul 2018 12:37:48 -0500 Subject: [PATCH 11/19] pkgs: Make constent variables names for versions. Add `kata` prefix to versions variables. Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/ksm-throttler/update.sh | 6 +++--- obs-packaging/runtime/update.sh | 2 +- obs-packaging/versions.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/obs-packaging/ksm-throttler/update.sh b/obs-packaging/ksm-throttler/update.sh index ad54d340aa..18a1d719d8 100755 --- a/obs-packaging/ksm-throttler/update.sh +++ b/obs-packaging/ksm-throttler/update.sh @@ -19,8 +19,8 @@ source ../scripts/pkglib.sh SCRIPT_NAME=$0 SCRIPT_DIR=$(dirname $0) PKG_NAME="kata-ksm-throttler" -VERSION=$ksm_throttler_version -HASH=$ksm_throttler_hash +VERSION="${kata_ksm_throttler_version}" +HASH="${kata_ksm_throttler_hash}" GENERATED_FILES=(_service kata-ksm-throttler.spec kata-ksm-throttler.dsc debian.control debian.rules) STATIC_FILES=(debian.compat) @@ -34,7 +34,7 @@ RELEASE=$(get_obs_pkg_release "${PROJECT_REPO}") ((RELEASE++)) [ -n "$APIURL" ] && APIURL="-A ${APIURL}" -set_versions "$ksm_throttler_hash" +set_versions "$kata_ksm_throttler_hash" replace_list=( "GO_CHECKSUM=$go_checksum" diff --git a/obs-packaging/runtime/update.sh b/obs-packaging/runtime/update.sh index f05318e482..9a61971715 100755 --- a/obs-packaging/runtime/update.sh +++ b/obs-packaging/runtime/update.sh @@ -55,7 +55,7 @@ KERNEL_REQUIRED_VERSION=$(pkg_version "${kernel_version}.${KERNEL_CONFIG_VERSION info "kata-linux-container ${KERNEL_REQUIRED_VERSION}" KSM_THROTTLER_RELEASE=$(get_obs_pkg_release "home:${OBS_PROJECT}:${OBS_SUBPROJECT}/ksm-throttler") -KSM_THROTTLER_REQUIRED_VERSION=$(pkg_version "${ksm_throttler_version}" "${KSM_THROTTLER_RELEASE}" "${ksm_throttler_hash}") +KSM_THROTTLER_REQUIRED_VERSION=$(pkg_version "${kata_ksm_throttler_version}" "${KSM_THROTTLER_RELEASE}" "${kata_ksm_throttler_hash}") info "ksm-throttler ${KSM_THROTTLER_REQUIRED_VERSION}" KATA_CONTAINERS_IMAGE_RELEASE=$(get_obs_pkg_release "home:${OBS_PROJECT}:${OBS_SUBPROJECT}/kata-containers-image") diff --git a/obs-packaging/versions.txt b/obs-packaging/versions.txt index b654ffa7b7..7c75f46748 100644 --- a/obs-packaging/versions.txt +++ b/obs-packaging/versions.txt @@ -2,7 +2,7 @@ kata_runtime_hash=b7e3997bc1deed9eb40347d31557bce8dba6ae6b kata_proxy_hash=15459f4b4ac6f6a242445ff284fec14135bc0045 kata_shim_hash=5296edac3823b31eecebd90ad0b3e7ad81d6e88a kata_agent_hash=994ac9c5e439571ee399cc10d5f18636170f7779 -ksm_throttler_hash=67307e510b7295f9fe1503ee0ebc4f71eacc1561 +kata_ksm_throttler_hash=67307e510b7295f9fe1503ee0ebc4f71eacc1561 qemu_lite_hash=6ba2bfbee9a80bfd03605c5eb2ca743c8b68389e qemu_vanilla_hash=e3050471ff1daa7fefe88388dfa4e1d97ba1f0bc @@ -10,7 +10,7 @@ kata_runtime_version=1.1.0 kata_proxy_version=1.1.0 kata_shim_version=1.1.0 kata_agent_version=1.1.0 -ksm_throttler_version=1.1.0 +kata_ksm_throttler_version=1.1.0 kata_osbuilder_version=1.1.0 qemu_lite_version=2.11.0 qemu_vanilla_version=2.11 From 69e4f933585e373643981782c64e079ac03736fe Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Mon, 2 Jul 2018 12:43:12 -0500 Subject: [PATCH 12/19] pkgs: sort versions variables. Make easy to identify variables. Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/versions.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/obs-packaging/versions.txt b/obs-packaging/versions.txt index 7c75f46748..249fe0aa5d 100644 --- a/obs-packaging/versions.txt +++ b/obs-packaging/versions.txt @@ -1,8 +1,8 @@ -kata_runtime_hash=b7e3997bc1deed9eb40347d31557bce8dba6ae6b -kata_proxy_hash=15459f4b4ac6f6a242445ff284fec14135bc0045 -kata_shim_hash=5296edac3823b31eecebd90ad0b3e7ad81d6e88a kata_agent_hash=994ac9c5e439571ee399cc10d5f18636170f7779 kata_ksm_throttler_hash=67307e510b7295f9fe1503ee0ebc4f71eacc1561 +kata_proxy_hash=15459f4b4ac6f6a242445ff284fec14135bc0045 +kata_runtime_hash=b7e3997bc1deed9eb40347d31557bce8dba6ae6b +kata_shim_hash=5296edac3823b31eecebd90ad0b3e7ad81d6e88a qemu_lite_hash=6ba2bfbee9a80bfd03605c5eb2ca743c8b68389e qemu_vanilla_hash=e3050471ff1daa7fefe88388dfa4e1d97ba1f0bc From 5dfc0c1f234780b7bb2f00ce1de678cc6da3603b Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Tue, 3 Jul 2018 10:36:53 -0500 Subject: [PATCH 13/19] kata: 1.1.0 hashes Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/versions.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/obs-packaging/versions.txt b/obs-packaging/versions.txt index 249fe0aa5d..e981df7f63 100644 --- a/obs-packaging/versions.txt +++ b/obs-packaging/versions.txt @@ -1,8 +1,10 @@ -kata_agent_hash=994ac9c5e439571ee399cc10d5f18636170f7779 -kata_ksm_throttler_hash=67307e510b7295f9fe1503ee0ebc4f71eacc1561 -kata_proxy_hash=15459f4b4ac6f6a242445ff284fec14135bc0045 -kata_runtime_hash=b7e3997bc1deed9eb40347d31557bce8dba6ae6b -kata_shim_hash=5296edac3823b31eecebd90ad0b3e7ad81d6e88a +kata_agent_hash=7b458b18ffcbb90a1aed1644d109ea438f39c9a0 +kata_ksm_throttler_hash=1fecaffc98386fdb080979d38d5688566eec54a1 +kata_proxy_hash=8a305e5a61856c7510350b0ade5a5dc5e9255dbf +kata_runtime_hash=bf1cf684f5d48d3142665f98daf719faf94039e2 +kata_shim_hash=de2d2a67659cab7928b81f836a8f64450c998453 + +# Dependencies qemu_lite_hash=6ba2bfbee9a80bfd03605c5eb2ca743c8b68389e qemu_vanilla_hash=e3050471ff1daa7fefe88388dfa4e1d97ba1f0bc From 4eae71e4b39d1970e9a7b0bcc6506a3709276078 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Tue, 3 Jul 2018 13:43:21 -0500 Subject: [PATCH 14/19] pkgs: kernel: add symlink to patches. Packaging scripts search for patches in a directory called 'patches'. We store the kernel patches in a diferent place to make easy to mantain them. Lets do a symlink to allow the automation find the patches. Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/kernel/update.sh | 1 + obs-packaging/scripts/pkglib.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/obs-packaging/kernel/update.sh b/obs-packaging/kernel/update.sh index d6d55e4ce1..1c82be14a2 100755 --- a/obs-packaging/kernel/update.sh +++ b/obs-packaging/kernel/update.sh @@ -57,5 +57,6 @@ verify echo "Verify succeed." get_git_info changelog_update "${VERSION}-${KATA_CONFIG_VERSION}" +ln -sfT "${SCRIPT_DIR}/../../kernel/patches" "${SCRIPT_DIR}/patches" generate_files "$SCRIPT_DIR" "${replace_list[@]}" build_pkg "${PROJECT_REPO}" diff --git a/obs-packaging/scripts/pkglib.sh b/obs-packaging/scripts/pkglib.sh index b00a5d354a..d1b9bfc8e5 100644 --- a/obs-packaging/scripts/pkglib.sh +++ b/obs-packaging/scripts/pkglib.sh @@ -337,7 +337,7 @@ function find_patches() { export RPM_APPLY_PATCHES="#Apply patches"$'\n' [ ! -d patches ] && info "No patches found" && return local patches - patches=$(find patches -type f -name '*.patch' -exec basename {} \;) + patches=$(find patches/ -type f -name '*.patch' -exec basename {} \;) n="1" rm -f debian.series for p in ${patches} ; do From 2d0c9cc4f7229d649fd167dd318596e572a00e0a Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Tue, 3 Jul 2018 14:43:30 -0500 Subject: [PATCH 15/19] scripts: Fix qemu build. Fix build when we are not building as static qemu. Signed-off-by: Jose Carlos Venegas Munoz --- scripts/configure-hypervisor.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/configure-hypervisor.sh b/scripts/configure-hypervisor.sh index 15f71116c3..50f055e95c 100755 --- a/scripts/configure-hypervisor.sh +++ b/scripts/configure-hypervisor.sh @@ -308,7 +308,7 @@ main() qemu_options+=(security:--disable-static) fi - if [ -n ${static} ]; then + if [ "${static}" == "true" ]; then qemu_options+=(misc:--static) fi From 8e558bed75628bf03e7773c8d93028501cf0f21c Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Tue, 3 Jul 2018 17:38:44 -0500 Subject: [PATCH 16/19] pkgs: pkglib: Clean OBS repository. We populate all the conent of a OBS project. Lets remove after we checkout to the OBS project. Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/scripts/pkglib.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/obs-packaging/scripts/pkglib.sh b/obs-packaging/scripts/pkglib.sh index d1b9bfc8e5..98552dec94 100644 --- a/obs-packaging/scripts/pkglib.sh +++ b/obs-packaging/scripts/pkglib.sh @@ -185,9 +185,10 @@ function checkout_repo() OBS_WORKDIR=$(mktemp -d -u -t ${temp}.XXXXXXXXXXX) || exit 1 osc $APIURL co $REPO -o $OBS_WORKDIR fi + find ${OBS_WORKDIR} -maxdepth 1 -mindepth 1 ! -name '.osc' -prune -exec echo remove {} \; -exec rm -rf {} \; - mv ${GENERATED_FILES[@]} $OBS_WORKDIR - cp ${STATIC_FILES[@]} $OBS_WORKDIR + mv ${GENERATED_FILES[@]} "$OBS_WORKDIR" + cp ${STATIC_FILES[@]} "$OBS_WORKDIR" } function obs_push() From 122a8cc1984977f51695fcd0eed8b6d54b5a261a Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Tue, 3 Jul 2018 23:17:27 -0500 Subject: [PATCH 17/19] pkgs: build add flag to do local builds. Add PUSH flag to to do a local build. Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/build_all.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/obs-packaging/build_all.sh b/obs-packaging/build_all.sh index 064f286588..9d7acbb7a4 100755 --- a/obs-packaging/build_all.sh +++ b/obs-packaging/build_all.sh @@ -4,7 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 # -set -e +set -e script_dir=$(dirname "$0") #Note:Lets update qemu and the kernel first, they take longer to build. @@ -47,7 +47,7 @@ fi if [ -n "${PUSH}" ]; then # push to obs PUSH_TO_OBS="-p" -else +elif [ -n "${LOCAL}" ]; then # local build PUSH_TO_OBS="-l" fi From 9e93b510e2fa28f62593881049ae21feb3f89ff6 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Tue, 3 Jul 2018 23:36:07 -0500 Subject: [PATCH 18/19] Makefile: fix test path. obs scripts are now in a new directory. Signed-off-by: Jose Carlos Venegas Munoz --- Makefile | 2 +- obs-packaging/build_from_docker.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 059f5bba0b..4510c6b14f 100644 --- a/Makefile +++ b/Makefile @@ -18,4 +18,4 @@ test-static-build: @make -f $(MK_DIR)/static-build/qemu/Makefile test-packaging-tools: - @$(MK_DIR)/build_from_docker.sh + @$(MK_DIR)/obs-packaging/build_from_docker.sh diff --git a/obs-packaging/build_from_docker.sh b/obs-packaging/build_from_docker.sh index baddcdc130..063384816b 100755 --- a/obs-packaging/build_from_docker.sh +++ b/obs-packaging/build_from_docker.sh @@ -28,9 +28,9 @@ export GO_ARCH=$(go env GOARCH) sudo docker build \ --build-arg http_proxy="${http_proxy}" \ --build-arg https_proxy="${https_proxy}" \ - -t $obs_image . + -t $obs_image ${script_dir} -pushd kata-containers-image/ >> /dev/null +pushd "${script_dir}/kata-containers-image/" >> /dev/null ./build_image.sh popd >> /dev/null From ad6faf0d598d8ca5c8dd975d11d81f9408746c6c Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Wed, 4 Jul 2018 15:19:52 -0500 Subject: [PATCH 19/19] ci: Skip pkgs test on CI. The zypper still hangs in the CI. Signed-off-by: Jose Carlos Venegas Munoz --- .ci/test.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.ci/test.sh b/.ci/test.sh index 051f2bba79..e035dd1077 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -17,6 +17,10 @@ make_target() { target=$1 dir=$2 + if [ -n "${CI}" ] && [ "${target}" == "test-packaging-tools" ];then + echo "skip $target see https://github.com/kata-containers/packaging/issues/72" + return + fi pushd "${script_dir}/.." >> /dev/null if [ -n "${CI}" ] && ! git whatchanged origin/master..HEAD "${dir}" | grep "${dir}" >> /dev/null; then echo "Not changes in ${dir}" @@ -24,7 +28,7 @@ make_target() { fi popd >> /dev/null echo "Changes found in $dir" - make -f "${toplevel_mk}" ${target} + make -f "${toplevel_mk}" "${target}" } make_target test-release-tools "release/"