diff --git a/.travis.yml b/.travis.yml index 10294e008..9bebf2fcb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ dist: bionic os: linux language: go -go: 1.13.9 +go: 1.14.4 env: target_branch=$TRAVIS_BRANCH before_install: diff --git a/src/runtime/.ci/go-no-os-exit.sh b/src/runtime/.ci/go-no-os-exit.sh deleted file mode 100755 index 5f0f98436..000000000 --- a/src/runtime/.ci/go-no-os-exit.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# Copyright (c) 2018 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 -# -# Check there are no os.Exit() calls creeping into the code -# We don't use that exit path in the Kata codebase. - -# Allow the path to check to be over-ridden. -# Default to the current directory. -go_packages=${1:-.} - -echo "Checking for no os.Exit() calls for package [${go_packages}]" - -candidates=`go list -f '{{.Dir}}/*.go' $go_packages` -for f in $candidates; do - filename=`basename $f` - # skip all go test files - [[ $filename == *_test.go ]] && continue - # skip exit.go where, the only file we should call os.Exit() from. - [[ $filename == "exit.go" ]] && continue - files="$f $files" -done - -[ -z "$files" ] && echo "No files to check, skipping" && exit 0 - -if egrep -n '\' $files; then - echo "Direct calls to os.Exit() are forbidden, please use exit() so atexit() works" - exit 1 -fi diff --git a/src/runtime/.ci/go-test.sh b/src/runtime/.ci/go-test.sh deleted file mode 100755 index 36fcd9ce4..000000000 --- a/src/runtime/.ci/go-test.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# Copyright (c) 2018 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -set -e - -cidir=$(dirname "$0") -source "${cidir}/lib.sh" -export CI_JOB="${CI_JOB:-default}" - -if [ "${CI_JOB}" != "PODMAN" ]; then - run_go_test -fi diff --git a/src/runtime/.ci/install-yq.sh b/src/runtime/.ci/install-yq.sh deleted file mode 100755 index d9b57053a..000000000 --- a/src/runtime/.ci/install-yq.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2018 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 -# - -# If we fail for any reason a message will be displayed -die() { - msg="$*" - echo "ERROR: $msg" >&2 - exit 1 -} - -# Install the yq yaml query package from the mikefarah github repo -# Install via binary download, as we may not have golang installed at this point -function install_yq() { - GOPATH=${GOPATH:-${HOME}/go} - local yq_path="${GOPATH}/bin/yq" - local yq_pkg="github.com/mikefarah/yq" - [ -x "${GOPATH}/bin/yq" ] && return - - read -r -a sysInfo <<< "$(uname -sm)" - - case "${sysInfo[0]}" in - "Linux" | "Darwin") - goos="${sysInfo[0],}" - ;; - "*") - die "OS ${sysInfo[0]} not supported" - ;; - esac - - case "${sysInfo[1]}" in - "aarch64") - goarch=arm64 - ;; - "ppc64le") - goarch=ppc64le - ;; - "x86_64") - goarch=amd64 - ;; - "s390x") - goarch=s390x - ;; - "*") - die "Arch ${sysInfo[1]} not supported" - ;; - esac - - mkdir -p "${GOPATH}/bin" - - # Check curl - if ! command -v "curl" >/dev/null; then - die "Please install curl" - fi - - local yq_version=3.1.0 - - local yq_url="https://${yq_pkg}/releases/download/${yq_version}/yq_${goos}_${goarch}" - curl -o "${yq_path}" -LSsf ${yq_url} - [ $? -ne 0 ] && die "Download ${yq_url} failed" - chmod +x ${yq_path} - - if ! command -v "${yq_path}" >/dev/null; then - die "Cannot not get ${yq_path} executable" - fi -} - -install_yq diff --git a/src/runtime/.ci/install_go.sh b/src/runtime/.ci/install_go.sh deleted file mode 100755 index 55c3383cc..000000000 --- a/src/runtime/.ci/install_go.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2019 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -set -e - -cidir=$(dirname "$0") -source "${cidir}/lib.sh" - -clone_tests_repo - -pushd "${tests_repo_dir}" -.ci/install_go.sh -p -f -popd diff --git a/src/runtime/.ci/lib.sh b/src/runtime/.ci/lib.sh deleted file mode 100644 index 96c151444..000000000 --- a/src/runtime/.ci/lib.sh +++ /dev/null @@ -1,34 +0,0 @@ -# -# Copyright (c) 2018 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -export tests_repo="${tests_repo:-github.com/kata-containers/tests}" -export tests_repo_dir="$GOPATH/src/$tests_repo" - -clone_tests_repo() -{ - # KATA_CI_NO_NETWORK is (has to be) ignored if there is - # no existing clone. - if [ -d "$tests_repo_dir" -a -n "$KATA_CI_NO_NETWORK" ] - then - return - fi - - go get -d -u "$tests_repo" || true - if [ -n "${TRAVIS_BRANCH:-}" ]; then - ( cd "${tests_repo_dir}" && git checkout "${TRAVIS_BRANCH}" ) - fi -} - -run_static_checks() -{ - clone_tests_repo - bash "$tests_repo_dir/.ci/static-checks.sh" "github.com/kata-containers/runtime" -} - -run_go_test() -{ - clone_tests_repo - bash "$tests_repo_dir/.ci/go-test.sh" -} diff --git a/src/runtime/.ci/run.sh b/src/runtime/.ci/run.sh deleted file mode 100755 index 3b2b7d7c2..000000000 --- a/src/runtime/.ci/run.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2018 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -set -e - -cidir=$(dirname "$0") -source "${cidir}/lib.sh" - -pushd "${tests_repo_dir}" -.ci/run.sh -popd diff --git a/src/runtime/.ci/setup.sh b/src/runtime/.ci/setup.sh deleted file mode 100755 index 9c0526754..000000000 --- a/src/runtime/.ci/setup.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2018 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -set -e - -cidir=$(dirname "$0") -source "${cidir}/lib.sh" -export CI_JOB="${CI_JOB:-default}" - -clone_tests_repo - -pushd "${tests_repo_dir}" -.ci/setup.sh -popd - -if [ "${CI_JOB}" != "PODMAN" ]; then - echo "Setup virtcontainers environment" - chronic sudo -E PATH=$PATH bash -c "${cidir}/../virtcontainers/utils/virtcontainers-setup.sh" - - echo "Install virtcontainers" - make -C "${cidir}/../virtcontainers" && chronic sudo make -C "${cidir}/../virtcontainers" install -fi diff --git a/src/runtime/.ci/static-checks.sh b/src/runtime/.ci/static-checks.sh deleted file mode 100755 index 5d0317e41..000000000 --- a/src/runtime/.ci/static-checks.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2018 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -set -e - -cidir=$(dirname "$0") -source "${cidir}/lib.sh" - -# Build kata-runtime before running static checks -make -C "${cidir}/../" - -# Run static checks -run_static_checks diff --git a/src/runtime/.ci/versions_checker.sh b/src/runtime/.ci/versions_checker.sh deleted file mode 100755 index d722d37b9..000000000 --- a/src/runtime/.ci/versions_checker.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2019 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 -# -# The purpose of this script is to -# run the tag_repos.sh script that is in the -# packaging repository which checks the VERSION -# file from the components in order to verify -# that the VERSION matches between them. -# This ensures that the rest -# of the components are merged before the runtime - -set -o errexit -set -o nounset -set -o pipefail -set -o errtrace - -GOPATH=${GOPATH:-${HOME}/go} - -PACKAGING_REPO="github.com/kata-containers/packaging" -RUNTIME_REPO="github.com/kata-containers/runtime" -KATA_BRANCH=${target_branch:-master} - -go get -d "${PACKAGING_REPO}" || true - -if ! check_changes=$(git diff --name-only "origin/${KATA_BRANCH}" | grep VERSION); then - echo "No changes in VERSION file - this is not a bump - nothing to check" - exit 0 -fi -version_to_check=$(cat "${GOPATH}/src/${RUNTIME_REPO}/VERSION") - -if [ ! -z "$check_changes" ]; then - echo "Changes detected on VERSION" - echo "Check versions in branch ${KATA_BRANCH}" - pushd "${GOPATH}/src/${PACKAGING_REPO}" - ./release/tag_repos.sh -b "${KATA_BRANCH}" pre-release "${version_to_check}" - popd -fi diff --git a/src/runtime/.gitignore b/src/runtime/.gitignore index 17686ab0f..83adef772 100644 --- a/src/runtime/.gitignore +++ b/src/runtime/.gitignore @@ -13,6 +13,7 @@ coverage.html /cli/config/configuration-qemu-virtiofs.toml /cli/config/configuration-clh.toml /cli/config-generated.go +/cli/containerd-shim-kata-v2/config-generated.go /cli/coverage.html /containerd-shim-kata-v2 /data/kata-collect-data.sh diff --git a/src/runtime/.travis.yml b/src/runtime/.travis.yml deleted file mode 100644 index 36d79fbba..000000000 --- a/src/runtime/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -# -# Copyright (c) 2018 Intel Corporation -# Copyright (c) 2018 IBM -# -# SPDX-License-Identifier: Apache-2.0 -# - -sudo: required -dist: xenial - -language: go -go: - - 1.13.9 - -os: - - linux - - linux-ppc64le - -matrix: - allow_failures: - - os: linux-ppc64le - -go_import_path: github.com/kata-containers/runtime - -env: - - target_branch=$TRAVIS_BRANCH - -before_install: - - git remote set-branches --add origin "${TRAVIS_BRANCH}" - - git fetch - - ".ci/setup.sh" - - ".ci/versions_checker.sh" - -before_script: - - ".ci/static-checks.sh" - - ".ci/versions_checker.sh" - -install: - - cd ${TRAVIS_BUILD_DIR} - - ".ci/install-yq.sh" - - make - - sudo -E PATH=$PATH make install diff --git a/src/runtime/vendor/github.com/intel/govmm/qemu/qmp.go b/src/runtime/vendor/github.com/intel/govmm/qemu/qmp.go index bf9a77dda..5585a8792 100644 --- a/src/runtime/vendor/github.com/intel/govmm/qemu/qmp.go +++ b/src/runtime/vendor/github.com/intel/govmm/qemu/qmp.go @@ -993,7 +993,7 @@ func (q *QMP) ExecuteNetdevAddByFds(ctx context.Context, netdevType, netdevID st } if len(vhostFdNames) > 0 { vhostFdNameStr := strings.Join(vhostFdNames, ":") - args["vhost"] = "on" + args["vhost"] = true args["vhostfds"] = vhostFdNameStr } diff --git a/src/runtime/vendor/modules.txt b/src/runtime/vendor/modules.txt index 02151a74b..dde51337c 100644 --- a/src/runtime/vendor/modules.txt +++ b/src/runtime/vendor/modules.txt @@ -162,7 +162,7 @@ github.com/hashicorp/go-multierror # github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d ## explicit github.com/hashicorp/yamux -# github.com/intel/govmm v0.0.0-20200304142514-e969afbec52c +# github.com/intel/govmm v0.0.0-20200602145448-7cc469641b7b ## explicit github.com/intel/govmm/qemu # github.com/konsorten/go-windows-terminal-sequences v1.0.1 diff --git a/versions.yaml b/versions.yaml index 073fe04bf..ac75ffe51 100644 --- a/versions.yaml +++ b/versions.yaml @@ -302,7 +302,7 @@ languages: description: | 'newest-version' is the latest version known to work when building Kata - newest-version: "1.13.9" + newest-version: "1.14.4" rust: description: "rust language"