From 0585213d01963c6f82c4ed93c961d75fd932829b Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Tue, 10 Nov 2020 16:54:30 +0900 Subject: [PATCH] remove unused hack/* files - hack/test-cri-integration.sh : called from Makefile - hack/test-utils.sh : called from hack/test-cri-integration.sh - hack/utils.sh : called from hack/test-utils.sh Other files are no longer used and can be safely removed. Kube test-infra doesn't seem to require the removed file as well: https://github.com/kubernetes/test-infra/search?q=containerd+hack Signed-off-by: Akihiro Suda --- hack/boilerplate/boilerplate | 15 --- hack/install/install-cni-config.sh | 57 --------- hack/install/install-cni.sh | 45 -------- hack/install/install-containerd.sh | 49 -------- hack/install/install-critools.sh | 40 ------- hack/install/install-deps.sh | 44 ------- hack/install/install-runc.sh | 37 ------ hack/install/utils.sh | 55 --------- hack/install/windows/install-cni-config.sh | 86 -------------- hack/install/windows/install-cni.sh | 39 ------- hack/install/windows/install-deps.sh | 47 -------- hack/install/windows/install-hcsshim.sh | 37 ------ hack/push.sh | 67 ----------- hack/release-windows.sh | 75 ------------ hack/release.sh | 127 --------------------- hack/sort-vendor.sh | 38 ------ hack/sync-vendor.sh | 59 ---------- hack/test-cri.sh | 69 ----------- hack/test-e2e-node.sh | 104 ----------------- hack/update-proto.sh | 44 ------- hack/verify-gofmt.sh | 35 ------ hack/verify-vendor.sh | 25 ---- 22 files changed, 1194 deletions(-) delete mode 100644 hack/boilerplate/boilerplate delete mode 100755 hack/install/install-cni-config.sh delete mode 100755 hack/install/install-cni.sh delete mode 100755 hack/install/install-containerd.sh delete mode 100755 hack/install/install-critools.sh delete mode 100755 hack/install/install-deps.sh delete mode 100755 hack/install/install-runc.sh delete mode 100755 hack/install/utils.sh delete mode 100755 hack/install/windows/install-cni-config.sh delete mode 100755 hack/install/windows/install-cni.sh delete mode 100755 hack/install/windows/install-deps.sh delete mode 100755 hack/install/windows/install-hcsshim.sh delete mode 100755 hack/push.sh delete mode 100755 hack/release-windows.sh delete mode 100755 hack/release.sh delete mode 100755 hack/sort-vendor.sh delete mode 100755 hack/sync-vendor.sh delete mode 100755 hack/test-cri.sh delete mode 100755 hack/test-e2e-node.sh delete mode 100755 hack/update-proto.sh delete mode 100755 hack/verify-gofmt.sh delete mode 100755 hack/verify-vendor.sh diff --git a/hack/boilerplate/boilerplate b/hack/boilerplate/boilerplate deleted file mode 100644 index c073fa4ad..000000000 --- a/hack/boilerplate/boilerplate +++ /dev/null @@ -1,15 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ diff --git a/hack/install/install-cni-config.sh b/hack/install/install-cni-config.sh deleted file mode 100755 index 93f574408..000000000 --- a/hack/install/install-cni-config.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - -# Copyright The containerd Authors. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o errexit -set -o nounset -set -o pipefail - -source $(dirname "${BASH_SOURCE[0]}")/utils.sh -CNI_CONFIG_DIR=${DESTDIR}/etc/cni/net.d -${SUDO} mkdir -p ${CNI_CONFIG_DIR} -${SUDO} bash -c 'cat >'${CNI_CONFIG_DIR}'/10-containerd-net.conflist <"'"${CRICTL_CONFIG_DIR}"'"/crictl.yaml <= 8 )); then - mask=255 - elif (( len > 0 )); then - mask=$(( 256 - 2 ** ( 8 - len ) )) - else - mask=0 - fi - (( len -= 8 )) - result_array[i]=$(( gateway_array[i] & mask )) - done - result="$(printf ".%s" "${result_array[@]}")" - result="${result:1}" - echo "$result/$((32 - prefix_len))" -} - -# nat already exists on the Windows VM, the subnet and gateway -# we specify should match that. -gateway="$(powershell -c "(Get-NetIPAddress -InterfaceAlias 'vEthernet (nat)' -AddressFamily IPv4).IPAddress")" -prefix_len="$(powershell -c "(Get-NetIPAddress -InterfaceAlias 'vEthernet (nat)' -AddressFamily IPv4).PrefixLength")" - -subnet="$(calculate_subnet "$gateway" "$prefix_len")" - -# The "name" field in the config is used as the underlying -# network type right now (see -# https://github.com/microsoft/windows-container-networking/pull/45), -# so it must match a network type in: -# https://docs.microsoft.com/en-us/windows-server/networking/technologies/hcn/hcn-json-document-schemas -bash -c 'cat >"'"${CNI_CONFIG_DIR}"'"/0-containerd-nat.conf < /dev/null; then - create_ttl_bucket ${DEPLOY_BUCKET} -fi - -if [ -z "${DEPLOY_DIR}" ]; then - DEPLOY_PATH="${DEPLOY_BUCKET}" -else - DEPLOY_PATH="${DEPLOY_BUCKET}/${DEPLOY_DIR}" -fi - -# TODO(random-liu): Add checksum for the tarball. -gsutil cp ${release_tar} "gs://${DEPLOY_PATH}/" -gsutil cp ${release_tar_checksum} "gs://${DEPLOY_PATH}/" -echo "Release tarball is uploaded to: - https://storage.googleapis.com/${DEPLOY_PATH}/${TARBALL}" - -if ${PUSH_VERSION}; then - if [[ -z "${VERSION}" ]]; then - echo "VERSION is not set" - exit 1 - fi - echo ${VERSION} | gsutil cp - "gs://${DEPLOY_PATH}/${LATEST}" - echo "Latest version is uploaded to: - https://storage.googleapis.com/${DEPLOY_PATH}/${LATEST}" -fi diff --git a/hack/release-windows.sh b/hack/release-windows.sh deleted file mode 100755 index da01f5384..000000000 --- a/hack/release-windows.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash - -# Copyright The containerd Authors. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o errexit -set -o nounset -set -o pipefail - -source $(dirname "${BASH_SOURCE[0]}")/utils.sh -cd ${ROOT} - -umask 0022 - -# BUILD_DIR is the directory to generate release tar. -# TARBALL is the name of the release tar. -BUILD_DIR=${BUILD_DIR:-"_output"} -# Convert to absolute path if it's relative. -if [[ ${BUILD_DIR} != /* ]]; then - BUILD_DIR=${ROOT}/${BUILD_DIR} -fi -TARBALL=${TARBALL:-"cri-containerd.tar.gz"} -# INCLUDE_CNI indicates whether to install CNI. By default don't -# include CNI in release tarball. -INCLUDE_CNI=${INCLUDE_CNI:-false} -# CUSTOM_CONTAINERD indicates whether to install customized containerd -# for CI test. -CUSTOM_CONTAINERD=${CUSTOM_CONTAINERD:-false} - -destdir=${BUILD_DIR}/release-stage - -if [[ -z "${VERSION}" ]]; then - echo "VERSION is not set" - exit 1 -fi - -# Remove release-stage directory to avoid including old files. -rm -rf ${destdir} - -# Install dependencies into release stage. -# Install hcsshim -HCSSHIM_DIR=${destdir} ./hack/install/windows/install-hcsshim.sh - -if ${INCLUDE_CNI}; then - # Install cni - NOSUDO=true WINCNI_BIN_DIR=${destdir}/cni ./hack/install/windows/install-cni.sh -fi - -# Build containerd from source -NOSUDO=true CONTAINERD_DIR=${destdir} ./hack/install/install-containerd.sh -# Containerd makefile always installs into a "bin" directory. -mv "${destdir}"/bin/* "${destdir}" -rm -rf "${destdir}/bin" - -if ${CUSTOM_CONTAINERD}; then - make install -e BINDIR=${destdir} -fi - -# Create release tar -tarball=${BUILD_DIR}/${TARBALL} -tar -zcvf ${tarball} -C ${destdir} . --owner=0 --group=0 -checksum=$(sha256 ${tarball}) -echo "sha256sum: ${checksum} ${tarball}" -echo ${checksum} > ${tarball}.sha256 diff --git a/hack/release.sh b/hack/release.sh deleted file mode 100755 index a70c53268..000000000 --- a/hack/release.sh +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/bash - -# Copyright The containerd Authors. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o errexit -set -o nounset -set -o pipefail - -source $(dirname "${BASH_SOURCE[0]}")/utils.sh -cd ${ROOT} - -umask 0022 - -# BUILD_DIR is the directory to generate release tar. -# TARBALL is the name of the release tar. -BUILD_DIR=${BUILD_DIR:-"_output"} -# Convert to absolute path if it's relative. -if [[ ${BUILD_DIR} != /* ]]; then - BUILD_DIR=${ROOT}/${BUILD_DIR} -fi -TARBALL=${TARBALL:-"cri-containerd.tar.gz"} -# INCLUDE_CNI indicates whether to install CNI. By default don't -# include CNI in release tarball. -INCLUDE_CNI=${INCLUDE_CNI:-false} -# CUSTOM_CONTAINERD indicates whether to install customized containerd -# for CI test. -CUSTOM_CONTAINERD=${CUSTOM_CONTAINERD:-false} -# OFFICIAL_RELEASE indicates whether to use official containerd release. -OFFICIAL_RELEASE=${OFFICIAL_RELEASE:-false} -# LOCAL_RELEASE indicates that containerd has been built and released -# locally. -LOCAL_RELEASE=${LOCAL_RELEASE:-false} -if [ -z "${GOOS:-}" ] -then - GOOS=$(go env GOOS) -fi -if [ -z "${GOARCH:-}" ] -then - GOARCH=$(go env GOARCH) -fi - - -destdir=${BUILD_DIR}/release-stage - -if [[ -z "${VERSION}" ]]; then - echo "VERSION is not set" - exit 1 -fi - -# Remove release-stage directory to avoid including old files. -rm -rf ${destdir} - -# download_containerd downloads containerd from official release. -download_containerd() { - local -r tmppath="$(mktemp -d /tmp/download-containerd.XXXX)" - local -r tarball="${tmppath}/containerd.tar.gz" - local -r url="https://github.com/containerd/containerd/releases/download/v${VERSION}/containerd-${VERSION}.linux-amd64.tar.gz" - wget -O "${tarball}" "${url}" - tar -C "${destdir}/usr/local" -xzf "${tarball}" - rm -rf "${tmppath}" -} - -# copy_local_containerd copies local containerd release. -copy_local_containerd() { - local -r tarball="${GOPATH}/src/github.com/containerd/containerd/releases/containerd-${VERSION}.${GOOS}-${GOARCH}.tar.gz" - if [[ ! -e "${tarball}" ]]; then - echo "Containerd release is not built" - exit 1 - fi - tar -C "${destdir}/usr/local" -xzf "${tarball}" -} - -# Install dependencies into release stage. -# Install runc -NOSUDO=true DESTDIR=${destdir} ./hack/install/install-runc.sh - -if ${INCLUDE_CNI}; then - # Install cni - NOSUDO=true DESTDIR=${destdir} ./hack/install/install-cni.sh -fi - -# Install critools -NOSUDO=true DESTDIR=${destdir} ./hack/install/install-critools.sh - -# Install containerd -if $OFFICIAL_RELEASE; then - download_containerd -elif $LOCAL_RELEASE; then - copy_local_containerd -else - # Build containerd from source - NOSUDO=true DESTDIR=${destdir} ./hack/install/install-containerd.sh -fi - -if ${CUSTOM_CONTAINERD}; then - make install -e DESTDIR=${destdir} -fi - -# Install systemd units into release stage. -mkdir -p ${destdir}/etc/systemd/system -cp ${ROOT}/contrib/systemd-units/* ${destdir}/etc/systemd/system/ -# Install cluster directory into release stage. -mkdir -p ${destdir}/opt/containerd -cp -r ${ROOT}/cluster ${destdir}/opt/containerd -# Write a version file into the release tarball. -cat > ${destdir}/opt/containerd/cluster/version < ${tarball}.sha256 diff --git a/hack/sort-vendor.sh b/hack/sort-vendor.sh deleted file mode 100755 index 988d1560d..000000000 --- a/hack/sort-vendor.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# Copyright The containerd Authors. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o errexit -set -o nounset -set -o pipefail - -source $(dirname "${BASH_SOURCE[0]}")/utils.sh -cd ${ROOT} - -echo "Sort vendor.conf..." -tmpdir="$(mktemp -d)" -trap "rm -rf ${tmpdir}" EXIT - -awk -v RS= '{print > "'${tmpdir}/'TMP."NR}' vendor.conf -for file in ${tmpdir}/*; do - if [[ -e "${tmpdir}/vendor.conf" ]]; then - echo >> "${tmpdir}/vendor.conf" - fi - sort -Vru "${file}" >> "${tmpdir}/vendor.conf" -done - -mv "${tmpdir}/vendor.conf" vendor.conf - -echo "Please commit the change made by this file..." diff --git a/hack/sync-vendor.sh b/hack/sync-vendor.sh deleted file mode 100755 index c5feaf6cd..000000000 --- a/hack/sync-vendor.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -# Copyright The containerd Authors. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o errexit -set -o nounset -set -o pipefail - -source $(dirname "${BASH_SOURCE[0]}")/utils.sh -cd ${ROOT} - -echo "Compare vendor with containerd vendors..." -containerd_vendor=$(mktemp /tmp/containerd-vendor.conf.XXXX) -from-vendor CONTAINERD github.com/containerd/containerd -curl -s https://raw.githubusercontent.com/${CONTAINERD_REPO#*/}/${CONTAINERD_VERSION}/vendor.conf > ${containerd_vendor} -# Create a temporary vendor file to update. -tmp_vendor=$(mktemp /tmp/vendor.conf.XXXX) -while read vendor; do - repo=$(echo ${vendor} | awk '{print $1}') - commit=$(echo ${vendor} | awk '{print $2}') - alias=$(echo ${vendor} | awk '{print $3}') - vendor_in_containerd=$(grep ${repo} ${containerd_vendor} || true) - if [ -z "${vendor_in_containerd}" ]; then - echo ${vendor} >> ${tmp_vendor} - continue - fi - commit_in_containerd=$(echo ${vendor_in_containerd} | awk '{print $2}') - alias_in_containerd=$(echo ${vendor_in_containerd} | awk '{print $3}') - if [[ "${commit}" != "${commit_in_containerd}" || "${alias}" != "${alias_in_containerd}" ]]; then - echo ${vendor_in_containerd} >> ${tmp_vendor} - else - echo ${vendor} >> ${tmp_vendor} - fi -done < vendor.conf -# Update vendors if temporary vendor.conf is different from the original one. -if ! diff vendor.conf ${tmp_vendor} > /dev/null; then - if [ $# -gt 0 ] && [ ${1} = "-only-verify" ]; then - echo "Need to update vendor.conf." - diff vendor.conf ${tmp_vendor} - rm ${tmp_vendor} - exit 1 - else - echo "Updating vendor.conf." - mv ${tmp_vendor} vendor.conf - fi -fi -rm ${containerd_vendor} diff --git a/hack/test-cri.sh b/hack/test-cri.sh deleted file mode 100755 index 3667bece8..000000000 --- a/hack/test-cri.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -# Copyright The containerd Authors. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o nounset -set -o pipefail - -source $(dirname "${BASH_SOURCE[0]}")/test-utils.sh - -# FOCUS focuses the test to run. -FOCUS=${FOCUS:-} -# SKIP skips the test to skip. -SKIP=${SKIP:-""} -# REPORT_DIR is the the directory to store test logs. -REPORT_DIR=${REPORT_DIR:-"/tmp/test-cri"} -# RUNTIME is the runtime handler to use in the test. -RUNTIME=${RUNTIME:-""} - -# Check GOPATH -if [[ -z "${GOPATH}" ]]; then - echo "GOPATH is not set" - exit 1 -fi - -# For multiple GOPATHs, keep the first one only -GOPATH=${GOPATH%%:*} - -CRITEST=${GOPATH}/bin/critest - -GINKGO_PKG=github.com/onsi/ginkgo/ginkgo - -# Install ginkgo -if [ ! -x "$(command -v ginkgo)" ]; then - go get -u ${GINKGO_PKG} -fi - -# Install critest -if [ ! -x "$(command -v ${CRITEST})" ]; then - go get -d ${CRITOOL_PKG}/... - cd ${GOPATH}/src/${CRITOOL_PKG} - git fetch --all - git checkout ${CRITOOL_VERSION} - make critest - make install-critest -e BINDIR="${GOPATH}/bin" -fi -which ${CRITEST} - -mkdir -p ${REPORT_DIR} -test_setup ${REPORT_DIR} - -# Run cri validation test -sudo env PATH=${PATH} GOPATH=${GOPATH} ${CRITEST} --runtime-endpoint=${CONTAINERD_SOCK} --ginkgo.focus="${FOCUS}" --ginkgo.skip="${SKIP}" --parallel=8 --runtime-handler=${RUNTIME} -test_exit_code=$? - -test_teardown - -exit ${test_exit_code} diff --git a/hack/test-e2e-node.sh b/hack/test-e2e-node.sh deleted file mode 100755 index 9038a7f22..000000000 --- a/hack/test-e2e-node.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/bash - -# Copyright The containerd Authors. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o nounset -set -o pipefail - -source $(dirname "${BASH_SOURCE[0]}")/test-utils.sh - -DEFAULT_SKIP="\[Flaky\]|\[Slow\]|\[Serial\]" -DEFAULT_SKIP+="|querying\s\/stats\/summary" - -# FOCUS focuses the test to run. -export FOCUS=${FOCUS:-""} -# SKIP skips the test to skip. -export SKIP=${SKIP:-${DEFAULT_SKIP}} -# REPORT_DIR is the the directory to store test logs. -REPORT_DIR=${REPORT_DIR:-"/tmp/test-e2e-node"} -# UPLOAD_LOG indicates whether to upload test log to gcs. -UPLOAD_LOG=${UPLOAD_LOG:-false} -# TIMEOUT is the timeout of the test. -TIMEOUT=${TIMEOUT:-"40m"} -# FAIL_SWAP_ON makes kubelet fail when swap is on. -# Many dev environments run with swap on, so we don't fail by default. -FAIL_SWAP_ON=${FAIL_SWAP_ON:-"false"} - -# Check GOPATH -if [[ -z "${GOPATH}" ]]; then - echo "GOPATH is not set" - exit 1 -fi - -ORIGINAL_RULES=`mktemp` -sudo iptables-save > ${ORIGINAL_RULES} - -# Update ip firewall -# We need to add rules to accept all TCP/UDP/ICMP packets. -if sudo iptables -L INPUT | grep "Chain INPUT (policy DROP)" > /dev/null; then - sudo iptables -A INPUT -w -p TCP -j ACCEPT - sudo iptables -A INPUT -w -p UDP -j ACCEPT - sudo iptables -A INPUT -w -p ICMP -j ACCEPT -fi -if sudo iptables -L FORWARD | grep "Chain FORWARD (policy DROP)" > /dev/null; then - sudo iptables -A FORWARD -w -p TCP -j ACCEPT - sudo iptables -A FORWARD -w -p UDP -j ACCEPT - sudo iptables -A FORWARD -w -p ICMP -j ACCEPT -fi - -# For multiple GOPATHs, keep the first one only -GOPATH=${GOPATH%%:*} - -# Get kubernetes -KUBERNETES_REPO="https://github.com/kubernetes/kubernetes" -KUBERNETES_PATH="${GOPATH}/src/k8s.io/kubernetes" -if [ ! -d "${KUBERNETES_PATH}" ]; then - mkdir -p ${KUBERNETES_PATH} - cd ${KUBERNETES_PATH} - git clone https://${KUBERNETES_REPO} . -fi -cd ${KUBERNETES_PATH} -git fetch --all -git checkout ${KUBERNETES_VERSION} - -mkdir -p ${REPORT_DIR} -test_setup ${REPORT_DIR} - -timeout "${TIMEOUT}" make test-e2e-node \ - RUNTIME=remote \ - CONTAINER_RUNTIME_ENDPOINT=unix://${CONTAINERD_SOCK} \ - ARTIFACTS=${REPORT_DIR} \ - TEST_ARGS='--kubelet-flags=--cgroups-per-qos=true \ - --kubelet-flags=--cgroup-root=/ \ - --kubelet-flags=--fail-swap-on='${FAIL_SWAP_ON}' \ - --prepull-images=false' -test_exit_code=$? - -test_teardown - -sudo iptables-restore < ${ORIGINAL_RULES} -rm ${ORIGINAL_RULES} - -# UPLOAD_LOG_PATH is bucket to upload test logs. -UPLOAD_LOG_PATH=cri-containerd_test-e2e-node -if ${UPLOAD_LOG}; then - if [ -z "${VERSION}" ]; then - echo "VERSION is not set" - exit 1 - fi - upload_logs_to_gcs "${UPLOAD_LOG_PATH}" "${VERSION}-$(date +%Y%m%d-%H%M%S)" "${REPORT_DIR}" -fi - -exit ${test_exit_code} diff --git a/hack/update-proto.sh b/hack/update-proto.sh deleted file mode 100755 index 505bb8d6c..000000000 --- a/hack/update-proto.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -# Copyright The containerd Authors. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o errexit -set -o nounset -set -o pipefail - -ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/.. -API_ROOT="${ROOT}/${API_PATH-"pkg/api/v1"}" - -go get k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo -if ! which protoc-gen-gogo >/dev/null; then - echo "GOPATH is not in PATH" - exit 1 -fi - -function cleanup { - rm -f ${API_ROOT}/api.pb.go.bak -} - -trap cleanup EXIT - -protoc \ - --proto_path="${API_ROOT}" \ - --proto_path="${ROOT}/vendor" \ - --gogo_out=plugins=grpc:${API_ROOT} ${API_ROOT}/api.proto - -# Update boilerplate for the generated file. -echo "$(cat hack/boilerplate/boilerplate ${API_ROOT}/api.pb.go)" > ${API_ROOT}/api.pb.go - -gofmt -l -s -w ${API_ROOT}/api.pb.go diff --git a/hack/verify-gofmt.sh b/hack/verify-gofmt.sh deleted file mode 100755 index 60992016f..000000000 --- a/hack/verify-gofmt.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# Copyright The containerd Authors. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o errexit -set -o nounset -set -o pipefail - -find_files() { - find . -not \( \ - \( \ - -wholename '*/vendor/*' \ - \) -prune \ - \) -name '*.go' -} - -GOFMT="gofmt -s" -bad_files=$(find_files | xargs $GOFMT -l) -if [[ -n "${bad_files}" ]]; then - echo "!!! '$GOFMT' needs to be run on the following files: " - echo "${bad_files}" - exit 1 -fi diff --git a/hack/verify-vendor.sh b/hack/verify-vendor.sh deleted file mode 100755 index a095b80ae..000000000 --- a/hack/verify-vendor.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash - -# Copyright The containerd Authors. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o errexit -set -o nounset -set -o pipefail - -tmpdir="$(mktemp -d)" -trap "rm -rf ${tmpdir}" EXIT - -git clone "https://github.com/containerd/project" "${tmpdir}" -"${tmpdir}"/script/validate/vendor