obs-packaging: adjust for building on kata-containers repo

As we do not need to build on other repositories any more.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
Peng Tao 2020-07-15 15:46:26 +08:00
parent 7b54ef69f9
commit f56f68bf2f
30 changed files with 10 additions and 718 deletions

View File

@ -49,5 +49,5 @@ echo "$commit"
agent_repository="github.com/kata-containers/agent" agent_repository="github.com/kata-containers/agent"
tarball_name="kata-containers-${version}-${commit:0:${short_commit_length}}-$(uname -m).tar.gz" tarball_name="kata-containers-${version}-${commit:0:${short_commit_length}}-$(uname -m).tar.gz"
image_url="https://${agent_repository}/releases/download/${version}/${tarball_name}" image_url="https://${agent_repository}/releases/download/${version}/${tarball_name}"
curl -OL "${image_url}" #curl -OL "${image_url}"
tar xvf "${tarball_name}" #tar xvf "${tarball_name}"

View File

@ -21,7 +21,7 @@ ARCH=${ARCH:-$(arch_to_golang "$(uname -m)")}
get_kata_version() { get_kata_version() {
local branch="$1" local branch="$1"
curl -SsL "https://raw.githubusercontent.com/${project}/runtime/${branch}/VERSION" curl -SsL "https://raw.githubusercontent.com/${project}/kata-containers/${branch}/VERSION"
} }
gen_version_file() { gen_version_file() {
@ -36,12 +36,6 @@ gen_version_file() {
ref="refs/tags/${kata_version}^{}" ref="refs/tags/${kata_version}^{}"
fi fi
kata_runtime_hash=$(get_kata_hash "runtime" "${ref}")
kata_proxy_hash=$(get_kata_hash "proxy" "${ref}")
kata_shim_hash=$(get_kata_hash "shim" "${ref}")
kata_agent_hash=$(get_kata_hash "agent" "${ref}")
kata_ksm_throttler_hash=$(get_kata_hash "ksm-throttler" "${ref}")
qemu_vanilla_branch=$(get_from_kata_deps "assets.hypervisor.qemu.version" "${kata_version}") qemu_vanilla_branch=$(get_from_kata_deps "assets.hypervisor.qemu.version" "${kata_version}")
# Check if qemu.version can be used to get the version and hash, otherwise use qemu.tag # Check if qemu.version can be used to get the version and hash, otherwise use qemu.tag
qemu_vanilla_ref="refs/heads/${qemu_vanilla_branch}" qemu_vanilla_ref="refs/heads/${qemu_vanilla_branch}"
@ -57,7 +51,6 @@ gen_version_file() {
kernel_version=${kernel_version#v} kernel_version=${kernel_version#v}
golang_version=$(get_from_kata_deps "languages.golang.meta.newest-version" "${kata_version}") golang_version=$(get_from_kata_deps "languages.golang.meta.newest-version" "${kata_version}")
golang_sha256=$(curl -s -L "https://storage.googleapis.com/golang/go${golang_version}.linux-${ARCH}.tar.gz.sha256")
# - is not a valid char for rpmbuild # - is not a valid char for rpmbuild
# see https://github.com/semver/semver/issues/145 # see https://github.com/semver/semver/issues/145
@ -68,21 +61,6 @@ gen_version_file() {
kata_version=${kata_version} kata_version=${kata_version}
kata_runtime_version=${kata_version}
kata_runtime_hash=${kata_runtime_hash}
kata_proxy_version=${kata_version}
kata_proxy_hash=${kata_proxy_hash}
kata_shim_version=${kata_version}
kata_shim_hash=${kata_shim_hash}
kata_agent_version=${kata_version}
kata_agent_hash=${kata_agent_hash}
kata_ksm_throttler_version=${kata_version}
kata_ksm_throttler_hash=${kata_ksm_throttler_hash}
# Dependencies # Dependencies
kata_osbuilder_version=${kata_version} kata_osbuilder_version=${kata_version}
@ -93,7 +71,6 @@ kernel_version=${kernel_version}
# Golang # Golang
go_version=${golang_version} go_version=${golang_version}
go_checksum=${golang_sha256}
EOT EOT
} }
@ -164,11 +141,11 @@ main() {
[ -n "${tag}" ] || die "No tag specified" "1" [ -n "${tag}" ] || die "No tag specified" "1"
# use the runtime's repository to determine branch information # use the runtime's repository to determine branch information
local repo="github.com/kata-containers/runtime" local repo="github.com/kata-containers/kata-containers"
local repo_dir="runtime" local repo_dir="kata-containers"
git clone --quiet "https://${repo}.git" "${repo_dir}" git clone --quiet "https://${repo}.git" "${repo_dir}"
pushd "${repo_dir}" >> /dev/null pushd "${repo_dir}" >> /dev/null
local branch=$(git branch -r -q --contains "${tag}" | grep -E "master|stable" | grep -v HEAD) local branch=$(git branch -r -q --contains "${tag}" | grep -E "master|stable|2.0-dev" | grep -v HEAD)
popd >> /dev/null popd >> /dev/null
rm -rf ${repo_dir} rm -rf ${repo_dir}

View File

@ -13,9 +13,8 @@ set -o pipefail
readonly script_name="$(basename "${BASH_SOURCE[0]}")" readonly script_name="$(basename "${BASH_SOURCE[0]}")"
readonly script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" readonly script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly project="kata-containers"
readonly tmp_dir=$(mktemp -d -t build-image-tmp.XXXXXXXXXX) readonly tmp_dir=$(mktemp -d -t build-image-tmp.XXXXXXXXXX)
readonly osbuilder_url=https://github.com/${project}/osbuilder.git readonly osbuilder_url=https://github.com/kata-containers/kata-containers.git
export GOPATH="${tmp_dir}/go" export GOPATH="${tmp_dir}/go"
export GOPATH=${GOPATH:-${HOME}/go} export GOPATH=${GOPATH:-${HOME}/go}
@ -126,8 +125,8 @@ main() {
initrd_os_version=$(get_from_kata_deps "assets.image.architecture.${arch_target}.version" "${kata_version}") initrd_os_version=$(get_from_kata_deps "assets.image.architecture.${arch_target}.version" "${kata_version}")
shift "$((OPTIND - 1))" shift "$((OPTIND - 1))"
git clone "$osbuilder_url" "${tmp_dir}/osbuilder" git clone "$osbuilder_url" "${tmp_dir}/kata-containers"
pushd "${tmp_dir}/osbuilder" pushd "${tmp_dir}/kata-containers/tools/osbuilder"
git checkout "${osbuider_version}" git checkout "${osbuider_version}"
build_initrd build_initrd
build_image build_image

View File

@ -1,24 +0,0 @@
<!--- XML Structure defined here: https://en.opensuse.org/openSUSE:Build_Service_Concept_SourceService -->
<services>
<service name="tar_scm">
<param name="scm">git</param>
<param name="url">https://github.com/kata-containers/ksm-throttler.git</param>
<param name="filename">kata-ksm-throttler</param>
<param name="versionformat">@VERSION@</param>
<param name="revision">@HASH@</param>
</service>
<service name="recompress">
<param name="file">*.tar*</param>
<param name="compression">gz</param>
</service>
<service name="download_url">
<param name="protocol">https</param>
<param name="host">storage.googleapis.com</param>
<param name="path">golang/go@GO_VERSION@.linux-@GO_ARCH@.tar.gz</param>
</service>
<service name="verify_file">
<param name="file">_service:download_url:go@GO_VERSION@.linux-@GO_ARCH@.tar.gz</param>
<param name="verifier">sha256</param>
<param name="checksum">@GO_CHECKSUM@</param>
</service>
</services>

View File

@ -1,13 +0,0 @@
Source: kata-ksm-throttler
Section: devel
Priority: optional
Maintainer: Kata containers team <https://github.com/kata-containers/>
Standards-Version: 3.9.6
Homepage: https://katacontainers.io
Build-Depends: dh-make, git, ca-certificates, execstack, devscripts, debhelper, build-essential, dh-autoreconf, make, pkg-config, dh-systemd, systemd
Package: kata-ksm-throttler
Architecture: @deb_arch@
Description:
This project implements a Kernel Same-page Merging throttling daemon.
Its goal is to regulate KSM by dynamically modifying the KSM sysfs entries, in order to minimize memory duplication as fast as possible while keeping the KSM daemon load low.

View File

@ -1,37 +0,0 @@
#!/usr/bin/make -f
DOMAIN = github.com
ORG = kata-containers
PROJECT = ksm-throttler
IMPORTNAME = $(DOMAIN)/$(ORG)/$(PROJECT)
GO_VERSION = @GO_VERSION@
export DH_VERBOSE=1
export DH_GOPKG:=$(DOMAIN)/$(ORG)/$(PROJECT)
export DEB_BUILD_OPTIONS=nocheck
export GOPATH=/usr/src/packages/BUILD/go
export GOROOT=/tmp/local/go
export PATH:=/tmp/local/go/bin:$(PATH)
export DH_OPTIONS
%:
dh $@
override_dh_auto_build:
mkdir -p /tmp/local/
mkdir -p /usr/src/packages/BUILD/go/src/$(DOMAIN)/$(ORG)
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 \
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

View File

@ -1,16 +0,0 @@
Format: 3.0 (quilt)
Source: kata-ksm-throttler
Version: @VERSION@-@RELEASE@
Section: devel
Priority: optional
Maintainer: Kata containers team <https://github.com/kata-containers/>
Standards-Version: 3.9.6
Homepage: https://katacontainers.io
Build-Depends: dh-make, git, ca-certificates, fakeroot, execstack, devscripts, debhelper, build-essential, dh-autoreconf, make, pkg-config, dh-systemd, systemd
Debtransform-Tar: kata-ksm-throttler-@VERSION@.tar.gz
Package: kata-ksm-throttler
Architecture: @deb_arch@
Description:
This project implements a Kernel Same-page Merging throttling daemon.
Its goal is to regulate KSM by dynamically modifying the KSM sysfs entries, in order to minimize memory duplication as fast as possible while keeping the KSM daemon load low.

View File

@ -1,82 +0,0 @@
%global PREFIX /usr/
%global DOMAIN github.com
%global ORG kata-containers
%global PROJECT ksm-throttler
%global IMPORTNAME %{DOMAIN}/%{ORG}/%{PROJECT}
%global GO_VERSION @GO_VERSION@
%global GO_ARCH @GO_ARCH@
%if 0%{?suse_version}
%define LIBEXECDIR %{_libdir}
%else
%define LIBEXECDIR %{_libexecdir}
%endif
%undefine _missing_build_ids_terminate_build
%define debug_package %{nil}
Name: kata-ksm-throttler
Version: @VERSION@
Release: @RELEASE@
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Summary : No detailed summary available
Group : Development/Tools
License : Apache-2.0
BuildRequires: git
BuildRequires: systemd
# Patches
@RPM_PATCH_LIST@
%description
.. contents::
.. sectnum::
``kata-ksm-throttler``
===================
Overview
--------
%prep
mkdir local
tar -C local -xzf ../SOURCES/go%{GO_VERSION}.linux-%{GO_ARCH}.tar.gz
%setup -q
%autosetup -S git
@RPM_APPLY_PATCHES@
%build
export GOROOT=$HOME/rpmbuild/BUILD/local/go
export PATH=$PATH:$HOME/rpmbuild/BUILD/local/go/bin
export GOPATH=$HOME/rpmbuild/BUILD/go/
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}
%install
export GOROOT=$HOME/rpmbuild/BUILD/local/go
export PATH=$PATH:$HOME/rpmbuild/BUILD/local/go/bin
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}
%files
%defattr(-,root,root,-)
%{LIBEXECDIR}/kata-ksm-throttler
%{LIBEXECDIR}/kata-ksm-throttler/kata-ksm-throttler
%{LIBEXECDIR}/kata-ksm-throttler/trigger
%{LIBEXECDIR}/kata-ksm-throttler/trigger/virtcontainers
%{LIBEXECDIR}/kata-ksm-throttler/trigger/virtcontainers/vc
/usr/lib/systemd/system/kata-ksm-throttler.service
/usr/lib/systemd/system/kata-vc-throttler.service

View File

@ -1,56 +0,0 @@
#!/bin/bash
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
# Automation script to create specs to build ksm-throttler.
# Default: Build is the one specified in file configure.ac
# located at the root of the repository.
[ -z "${DEBUG}" ] || set -o xtrace
set -o errexit
set -o nounset
set -o pipefail
source ../versions.txt
source ../scripts/pkglib.sh
SCRIPT_NAME=$0
SCRIPT_DIR=$(dirname $0)
PKG_NAME="kata-ksm-throttler"
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)
# Parse arguments
cli "$@"
[ "$VERBOSE" == "true" ] && set -x
PROJECT_REPO=${PROJECT_REPO:-home:${OBS_PROJECT}:${OBS_SUBPROJECT}/ksm-throttler}
RELEASE=$(get_obs_pkg_release "${PROJECT_REPO}")
((RELEASE++))
set_versions "$kata_ksm_throttler_hash"
replace_list=(
"GO_CHECKSUM=$go_checksum"
"GO_VERSION=$go_version"
"GO_ARCH=$GO_ARCH"
"HASH=${short_hashtag}"
"RELEASE=$RELEASE"
"VERSION=$VERSION"
)
verify
echo "Verify succeed."
get_git_info
changelog_update $VERSION
generate_files "$SCRIPT_DIR" "${replace_list[@]}"
build_pkg "${PROJECT_REPO}"

View File

@ -1,24 +0,0 @@
<!--- XML Structure defined here: https://en.opensuse.org/openSUSE:Build_Service_Concept_SourceService -->
<services>
<service name="tar_scm">
<param name="scm">git</param>
<param name="url">https://github.com/kata-containers/proxy.git</param>
<param name="filename">kata-proxy</param>
<param name="versionformat">@VERSION@</param>
<param name="revision">@HASH@</param>
</service>
<service name="recompress">
<param name="file">*.tar*</param>
<param name="compression">gz</param>
</service>
<service name="download_url">
<param name="protocol">https</param>
<param name="host">storage.googleapis.com</param>
<param name="path">golang/go@GO_VERSION@.linux-@GO_ARCH@.tar.gz</param>
</service>
<service name="verify_file">
<param name="file">_service:download_url:go@GO_VERSION@.linux-@GO_ARCH@.tar.gz</param>
<param name="verifier">sha256</param>
<param name="checksum">@GO_CHECKSUM@</param>
</service>
</services>

View File

@ -1,13 +0,0 @@
Source: kata-proxy
Section: devel
Priority: optional
Maintainer: Kata containers team <https://github.com/kata-containers/>
Standards-Version: 3.9.6
Homepage: https://katacontainers.io
Build-Depends: dh-make, git, ca-certificates, execstack, devscripts, debhelper, build-essential, dh-autoreconf, make
Package: kata-proxy
Architecture: @deb_arch@
Description:
kata-proxy works alongside the Kata Containers runtime and shim to provide a VM-based OCI runtime solution.
kata-proxy is a daemon offering access to the hyperstart VM agent to both the runtime and shim processes.

View File

@ -1,23 +0,0 @@
#!/usr/bin/make -f
export DH_OPTIONS
export DH_GOPKG:=github.com/kata-containers/proxy
export DEB_BUILD_OPTIONS=nocheck
export PATH:=/usr/src/packages/BUILD/local/go/bin:$(PATH)
export GOROOT:=/usr/src/packages/BUILD/local/go
export GOPATH=/usr/src/packages/BUILD/go
GO_VERSION=@GO_VERSION@
%:
dh $@
override_dh_auto_build:
mkdir -p /usr/src/packages/BUILD/local/
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 COMMIT=@HASH@
override_dh_auto_install:
mkdir debian/kata-proxy
make install DESTDIR=$(shell pwd)/debian/kata-proxy COMMIT=@HASH@

View File

@ -1,16 +0,0 @@
format: 3.0 (quilt)
Source: kata-proxy
Version: @VERSION@-@RELEASE@
Section: devel
Priority: optional
Maintainer: Kata containers team <https://github.com/kata-containers/>
Standards-Version: 3.9.6
Build-Depends: dh-make, git, ca-certificates, execstack, fakeroot, devscripts, debhelper, build-essential, dh-autoreconf, make
Homepage: https://katacontainers.io
Debtransform-Tar: kata-proxy-@VERSION@.tar.gz
Package: kata-proxy
Architecture: @deb_arch@
Description:
kata-proxy works alongside the Kata Containers runtime and shim to provide a VM-based OCI runtime solution.
kata-proxy is a daemon offering access to the hyperstart VM agent to both the runtime and shim processes.

View File

@ -1,80 +0,0 @@
%global PREFIX /usr/
%global BINDIR %{PREFIX}/bin
%global DOMAIN github.com
%global ORG kata-containers
%global PROJECT proxy
%global IMPORTNAME %{DOMAIN}/%{ORG}/%{PROJECT}
%global GO_VERSION @GO_VERSION@
%define LIBEXECDIR /usr/libexec
%undefine _missing_build_ids_terminate_build
Name: kata-proxy
Version: @VERSION@
Release: @RELEASE@
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: pkgconfig(systemd)
BuildRequires: git
Summary : No detailed summary available
Group : Development/Tools
License : Apache-2.0
Requires: kata-proxy-bin
#!BuildIgnore: post-build-checks
# Patches
@RPM_PATCH_LIST@
%description
.. contents::
.. sectnum::
``kata-proxy``
===================
Overview
--------
%global debug_package %{nil}
%define _unpackaged_files_terminate_build 0
%package bin
Summary: bin components for the kata-proxy package.
Group: Binaries
%description bin
bin components for the kata-proxy package.
%prep
mkdir local
tar -C local -xzf ../SOURCES/go%{GO_VERSION}.linux-@GO_ARCH@.tar.gz
%setup -q
# Patches
@RPM_APPLY_PATCHES@
%build
export GOROOT=$HOME/rpmbuild/BUILD/local/go
export PATH=$PATH:$HOME/rpmbuild/BUILD/local/go/bin
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 COMMIT=@HASH@
%clean
echo "Clean build root"
rm -rf %{buildroot}
%install
make install DESTDIR=%{buildroot} COMMIT=@HASH@
%files
%defattr(-,root,root,-)
%files bin
%defattr(-,root,root,-)
%{LIBEXECDIR}/kata-containers
%{LIBEXECDIR}/kata-containers/kata-proxy

View File

@ -1,52 +0,0 @@
#!/bin/bash
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
# Automation script to create specs to build kata-proxy
[ -z "${DEBUG}" ] || set -o xtrace
set -o errexit
set -o nounset
set -o pipefail
source ../versions.txt
source ../scripts/pkglib.sh
SCRIPT_NAME=$0
SCRIPT_DIR=$(dirname "$0")
PKG_NAME="kata-proxy"
VERSION=$kata_proxy_version
GENERATED_FILES=(kata-proxy.spec kata-proxy.dsc debian.control debian.rules _service)
STATIC_FILES=(debian.compat)
# Parse arguments
cli "$@"
[ "$VERBOSE" == "true" ] && set -x
PROJECT_REPO=${PROJECT_REPO:-home:${OBS_PROJECT}:${OBS_SUBPROJECT}/proxy}
RELEASE=$(get_obs_pkg_release "${PROJECT_REPO}")
((RELEASE++))
set_versions $kata_proxy_hash
replace_list=(
"GO_CHECKSUM=$go_checksum"
"GO_VERSION=$go_version"
"GO_ARCH=$GO_ARCH"
"HASH=$short_hashtag"
"RELEASE=$RELEASE"
"VERSION=$VERSION"
)
verify
echo "Verify succeed."
get_git_info
changelog_update $VERSION
generate_files "$SCRIPT_DIR" "${replace_list[@]}"
build_pkg "${PROJECT_REPO}"

View File

@ -11,9 +11,6 @@ Package: kata-runtime
Architecture: @deb_arch@ Architecture: @deb_arch@
Depends: kata-containers-image (= @kata_osbuilder_version_release@), Depends: kata-containers-image (= @kata_osbuilder_version_release@),
kata-linux-container (= @linux_container_version_release@), kata-linux-container (= @linux_container_version_release@),
kata-proxy (= @kata_proxy_version_release@),
kata-shim (= @kata_shim_version_release@),
kata-ksm-throttler(= @ksm_throttler_version_release@),
qemu-vanilla(= @qemu_vanilla_version_release@) qemu-vanilla(= @qemu_vanilla_version_release@)
Description: Description:
An Open Containers Initiative (OCI) "runtime" that launches an Intel VT-x An Open Containers Initiative (OCI) "runtime" that launches an Intel VT-x

View File

@ -16,9 +16,6 @@ Package: kata-runtime
Architecture: @deb_arch@ Architecture: @deb_arch@
Depends: kata-containers-image (= @kata_osbuilder_version_release@), Depends: kata-containers-image (= @kata_osbuilder_version_release@),
kata-linux-container (= @linux_container_version_release@), kata-linux-container (= @linux_container_version_release@),
kata-proxy (= @kata_proxy_version_release@),
kata-shim (= @kata_shim_version_release@),
kata-ksm-throttler(= @ksm_throttler_version_release@),
qemu-vanilla(= @qemu_vanilla_version_release@) qemu-vanilla(= @qemu_vanilla_version_release@)
Description: Description:
An Open Containers Initiative (OCI) "runtime" that launches an Intel VT-x An Open Containers Initiative (OCI) "runtime" that launches an Intel VT-x

View File

@ -26,9 +26,6 @@ BuildRequires: git
Requires: kata-containers-image = @kata_osbuilder_version@ Requires: kata-containers-image = @kata_osbuilder_version@
Requires: kata-linux-container = @linux_container_version@ Requires: kata-linux-container = @linux_container_version@
Requires: kata-proxy = @kata_proxy_version@
Requires: kata-shim = @kata_shim_version@
Requires: kata-ksm-throttler = @ksm_throttler_version@
Requires: qemu-vanilla = @qemu_vanilla_version@ Requires: qemu-vanilla = @qemu_vanilla_version@
# Patches # Patches

View File

@ -90,37 +90,18 @@ cli "$@"
declare -a pkgVersions declare -a pkgVersions
# Package depedencies # Package depedencies
info "Requires:" info "Requires:"
pkgVersions=($(pkg_required_ver "kata_proxy"))
declare -A PROXY_REQUIRED_VERSION
PROXY_REQUIRED_VERSION["deb"]=${pkgVersions[0]}
PROXY_REQUIRED_VERSION["rpm"]=${pkgVersions[1]}
info "proxy ${PROXY_REQUIRED_VERSION[@]}"
declare -A SHIM_REQUIRED_VERSION
pkgVersions=($(pkg_required_ver "kata_shim"))
SHIM_REQUIRED_VERSION["deb"]=${pkgVersions[0]}
SHIM_REQUIRED_VERSION["rpm"]=${pkgVersions[1]}
info "shim ${SHIM_REQUIRED_VERSION[@]}"
declare -A KERNEL_REQUIRED_VERSION declare -A KERNEL_REQUIRED_VERSION
pkgVersions=($(pkg_required_ver "kernel")) pkgVersions=($(pkg_required_ver "kernel"))
KERNEL_REQUIRED_VERSION["deb"]=${pkgVersions[0]} KERNEL_REQUIRED_VERSION["deb"]=${pkgVersions[0]}
KERNEL_REQUIRED_VERSION["rpm"]=${pkgVersions[1]} KERNEL_REQUIRED_VERSION["rpm"]=${pkgVersions[1]}
info "kata-linux-container ${KERNEL_REQUIRED_VERSION[@]}" info "kata-linux-container ${KERNEL_REQUIRED_VERSION[@]}"
declare -A KSM_THROTTLER_REQUIRED_VERSION
pkgVersions=($(pkg_required_ver "kata_ksm_throttler"))
KSM_THROTTLER_REQUIRED_VERSION["deb"]=${pkgVersions[0]}
KSM_THROTTLER_REQUIRED_VERSION["rpm"]=${pkgVersions[1]}
info "ksm-throttler ${KSM_THROTTLER_REQUIRED_VERSION[@]}"
declare -A KATA_IMAGE_REQUIRED_VERSION declare -A KATA_IMAGE_REQUIRED_VERSION
pkgVersions=($(pkg_required_ver "kata_osbuilder")) pkgVersions=($(pkg_required_ver "kata_osbuilder"))
KATA_IMAGE_REQUIRED_VERSION["deb"]=${pkgVersions[0]} KATA_IMAGE_REQUIRED_VERSION["deb"]=${pkgVersions[0]}
KATA_IMAGE_REQUIRED_VERSION["rpm"]=${pkgVersions[1]} KATA_IMAGE_REQUIRED_VERSION["rpm"]=${pkgVersions[1]}
info "image ${KATA_IMAGE_REQUIRED_VERSION[@]}" info "image ${KATA_IMAGE_REQUIRED_VERSION[@]}"
declare -A KATA_QEMU_VANILLA_REQUIRED_VERSION declare -A KATA_QEMU_VANILLA_REQUIRED_VERSION
pkgVersions=($(pkg_required_ver "qemu_vanilla")) pkgVersions=($(pkg_required_ver "qemu_vanilla"))
KATA_QEMU_VANILLA_REQUIRED_VERSION["deb"]=${pkgVersions[0]} KATA_QEMU_VANILLA_REQUIRED_VERSION["deb"]=${pkgVersions[0]}
@ -140,14 +121,6 @@ replace_list+=(
"HASH=$short_hashtag" "HASH=$short_hashtag"
"RELEASE=$RELEASE" "RELEASE=$RELEASE"
"VERSION=$VERSION" "VERSION=$VERSION"
"kata_osbuilder_version=${KATA_IMAGE_REQUIRED_VERSION["rpm"]}"
"kata_osbuilder_version_release=${KATA_IMAGE_REQUIRED_VERSION["deb"]}"
"kata_proxy_version=${PROXY_REQUIRED_VERSION["rpm"]}"
"kata_proxy_version_release=${PROXY_REQUIRED_VERSION["deb"]}"
"kata_shim_version=${SHIM_REQUIRED_VERSION["rpm"]}"
"kata_shim_version_release=${SHIM_REQUIRED_VERSION["deb"]}"
"ksm_throttler_version=${KSM_THROTTLER_REQUIRED_VERSION["rpm"]}"
"ksm_throttler_version_release=${KSM_THROTTLER_REQUIRED_VERSION["deb"]}"
"linux_container_version=${KERNEL_REQUIRED_VERSION["rpm"]}" "linux_container_version=${KERNEL_REQUIRED_VERSION["rpm"]}"
"linux_container_version_release=${KERNEL_REQUIRED_VERSION["deb"]}" "linux_container_version_release=${KERNEL_REQUIRED_VERSION["deb"]}"
"qemu_vanilla_version=${KATA_QEMU_VANILLA_REQUIRED_VERSION["rpm"]}" "qemu_vanilla_version=${KATA_QEMU_VANILLA_REQUIRED_VERSION["rpm"]}"

View File

@ -15,8 +15,5 @@ OBS_PKGS_PROJECTS+=(
qemu-vanilla qemu-vanilla
linux-container linux-container
kata-containers-image kata-containers-image
proxy
shim
ksm-throttler
runtime runtime
) )

View File

@ -1,24 +0,0 @@
<!--- XML Structure defined here: https://en.opensuse.org/openSUSE:Build_Service_Concept_SourceService -->
<services>
<service name="tar_scm">
<param name="scm">git</param>
<param name="url">https://github.com/kata-containers/shim.git</param>
<param name="filename">kata-shim</param>
<param name="versionformat">@VERSION@</param>
<param name="revision">@HASH@</param>
</service>
<service name="recompress">
<param name="file">*.tar*</param>
<param name="compression">gz</param>
</service>
<service name="download_url">
<param name="protocol">https</param>
<param name="host">storage.googleapis.com</param>
<param name="path">golang/go@GO_VERSION@.linux-@GO_ARCH@.tar.gz</param>
</service>
<service name="verify_file">
<param name="file">_service:download_url:go@GO_VERSION@.linux-@GO_ARCH@.tar.gz</param>
<param name="verifier">sha256</param>
<param name="checksum">@GO_CHECKSUM@</param>
</service>
</services>

View File

@ -1,14 +0,0 @@
Source: kata-shim
Section: devel
Priority: optional
Maintainer: Kata containers team <https://github.com/kata-containers/>
Standards-Version: 3.9.6
Homepage: https://katacontainers.io
Build-Depends: debhelper (>= 9), git, ca-certificates, execstack, devscripts, dh-make
Package: kata-shim
Architecture: @deb_arch@
Description:
kata-shim is a process spawned by the Intel VT-x secured Kata Containers runtime per container workload.
The runtime provides the pid of the kata-shim process to containerd-shim on OCI create command.

View File

@ -1,21 +0,0 @@
#!/usr/bin/make -f
export DEB_BUILD_OPTIONS=nocheck
export PATH:=/usr/src/packages/BUILD/local/go/bin:$(PATH)
export GOROOT:=/usr/src/packages/BUILD/local/go
export GOPATH=/usr/src/packages/BUILD/go
GO_VERSION=@GO_VERSION@
%:
dh $@
override_dh_auto_build:
mkdir -p /usr/src/packages/BUILD/local/
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 COMMIT=@HASH@
override_dh_auto_install:
mkdir -p debian/kata-shim
make install LIBEXECDIR=$(shell pwd)/debian/kata-shim/usr/libexec COMMIT=@HASH@

View File

@ -1,17 +0,0 @@
Format: 3.0 (quilt)
Source: kata-shim
Version: @VERSION@-@RELEASE@
Section: devel
Priority: optional
Maintainer: Kata containers team <https://github.com/kata-containers/>
Standards-Version: 3.9.6
Build-Depends: debhelper (>= 9), git, ca-certificates, execstack, fakeroot, devscripts, dh-make
Homepage: https://katacontainers.io
Debtransform-Tar: kata-shim-@VERSION@.tar.gz
Package: kata-shim
Architecture: @deb_arch@
Description:
kata-shim is a process spawned by the Intel VT-x secured Kata Containers runtime per container workload.
The runtime provides the pid of the kata-shim process to containerd-shim on OCI create command.

View File

@ -1,78 +0,0 @@
%global DOMAIN github.com
%global ORG kata-containers
%global PROJECT shim
%global IMPORTNAME %{DOMAIN}/%{ORG}/%{PROJECT}
%global GO_VERSION @GO_VERSION@
%define LIBEXECDIR /usr/libexec
%undefine _missing_build_ids_terminate_build
Name: kata-shim
Version: @VERSION@
Release: @RELEASE@
Summary : No detailed summary available
Group : Development/Tools
License : Apache-2.0
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: git
Requires: kata-shim-bin
%global debug_package %{nil}
# Patches
@RPM_PATCH_LIST@
%description
.. contents::
.. sectnum::
``kata-shim``
===================
Overview
--------
%package bin
Summary: bin components for the kata-shim package.
Group: Binaries
%description bin
bin components for the kata-shim package.
%prep
mkdir local
tar -C local -xzf ../SOURCES/go%{GO_VERSION}.linux-@GO_ARCH@.tar.gz
%setup -q
# Patches
@RPM_APPLY_PATCHES@
%build
export GOROOT=$HOME/rpmbuild/BUILD/local/go
export PATH=$PATH:$HOME/rpmbuild/BUILD/local/go/bin
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 COMMIT=@HASH@
%check
export http_proxy=http://127.0.0.1:9/
export https_proxy=http://127.0.0.1:9/
export no_proxy=localhost
%install
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} COMMIT=@HASH@
%files
%defattr(-,root,root,-)
%files bin
%defattr(-,root,root,-)
%dir %{LIBEXECDIR}
%dir %{LIBEXECDIR}/kata-containers
%{LIBEXECDIR}/kata-containers/kata-shim

View File

@ -1,52 +0,0 @@
#!/bin/bash
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
# Automation script to create specs to build kata-shim
[ -z "${DEBUG}" ] || set -o xtrace
set -o errexit
set -o nounset
set -o pipefail
source ../versions.txt
source ../scripts/pkglib.sh
SCRIPT_NAME=$0
SCRIPT_DIR=$(dirname "$0")
PKG_NAME="kata-shim"
VERSION=$kata_shim_version
GENERATED_FILES=(kata-shim.spec kata-shim.dsc _service debian.control debian.rules)
STATIC_FILES=(debian.compat)
# Parse arguments
cli "$@"
[ "$VERBOSE" == "true" ] && set -x
PROJECT_REPO=${PROJECT_REPO:-home:${OBS_PROJECT}:${OBS_SUBPROJECT}/shim}
RELEASE=$(get_obs_pkg_release "${PROJECT_REPO}")
((RELEASE++))
set_versions $kata_shim_hash
replace_list=(
"GO_CHECKSUM=$go_checksum"
"GO_VERSION=$go_version"
"GO_ARCH=$GO_ARCH"
"HASH=$short_hashtag"
"RELEASE=$RELEASE"
"VERSION=$VERSION"
)
verify
echo "Verify succeed."
get_git_info
changelog_update $VERSION
generate_files "$SCRIPT_DIR" "${replace_list[@]}"
build_pkg "${PROJECT_REPO}"

View File

@ -50,7 +50,7 @@ get_from_kata_deps() {
install_yq >&2 install_yq >&2
if [ ! -e "${versions_file}" ]; then if [ ! -e "${versions_file}" ]; then
yaml_url="https://raw.githubusercontent.com/kata-containers/runtime/${branch}/versions.yaml" yaml_url="https://raw.githubusercontent.com/kata-containers/kata-containers/${branch}/versions.yaml"
echo "versions file (${versions_file}) does not exist" >&2 echo "versions file (${versions_file}) does not exist" >&2
echo "Download from ${yaml_url}" >&2 echo "Download from ${yaml_url}" >&2
curl --silent -o "${versions_file}" "$yaml_url" curl --silent -o "${versions_file}" "$yaml_url"