summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.buildkite/hooks/pre-command10
-rwxr-xr-xtools/installers/containerd.sh11
2 files changed, 16 insertions, 5 deletions
diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command
index fb2b1892d..6f197436c 100644
--- a/.buildkite/hooks/pre-command
+++ b/.buildkite/hooks/pre-command
@@ -8,9 +8,17 @@ function install_pkgs() {
done
}
install_pkgs make "linux-headers-$(uname -r)" linux-libc-dev \
- graphviz jq curl binutils gnupg gnupg-agent golang-go \
+ graphviz jq curl binutils gnupg gnupg-agent gcc pkg-config \
apt-transport-https ca-certificates software-properties-common
+# Install Go 1.16, as only 1.13 is available via apt. If it's installed via apt,
+# remove it.
+sudo apt-get autoremove -y golang-go
+declare -r go_archive=go1.16.6.linux-amd64.tar.gz
+wget -c "https://golang.org/dl/${go_archive}"
+sudo tar -xzf "${go_archive}" -C /usr/local
+sudo ln -s /usr/local/go/bin/go /usr/bin/go
+
# Setup for parallelization with PARTITION and TOTAL_PARTITIONS.
export PARTITION=${BUILDKITE_PARALLEL_JOB:-0}
PARTITION=$((${PARTITION}+1)) # 1-indexed, but PARALLEL_JOB is 0-indexed.
diff --git a/tools/installers/containerd.sh b/tools/installers/containerd.sh
index e598bce89..b8da1fe42 100755
--- a/tools/installers/containerd.sh
+++ b/tools/installers/containerd.sh
@@ -20,6 +20,9 @@ declare -r CONTAINERD_VERSION=${1:-1.3.0}
declare -r CONTAINERD_MAJOR="$(echo ${CONTAINERD_VERSION} | awk -F '.' '{ print $1; }')"
declare -r CONTAINERD_MINOR="$(echo ${CONTAINERD_VERSION} | awk -F '.' '{ print $2; }')"
+# We're running Go 1.16, but using pre-module containerd and cri-tools.
+export GO111MODULE=off
+
# Default to an older version for crictl for containerd <= 1.2.
if [[ "${CONTAINERD_MAJOR}" -eq 1 ]] && [[ "${CONTAINERD_MINOR}" -le 2 ]]; then
declare -r CRITOOLS_VERSION=${CRITOOLS_VERSION:-1.13.0}
@@ -29,8 +32,8 @@ fi
# Helper for Go packages below.
install_helper() {
- PACKAGE="${1}"
- TAG="${2}"
+ declare -r PACKAGE="${1}"
+ declare -r TAG="${2}"
# Clone the repository.
mkdir -p "${GOPATH}"/src/$(dirname "${PACKAGE}") && \
@@ -71,8 +74,8 @@ done
# Install containerd & cri-tools.
declare -rx GOPATH=$(mktemp -d --tmpdir gopathXXXXX)
-install_helper github.com/containerd/containerd "v${CONTAINERD_VERSION}" "${GOPATH}"
-install_helper github.com/kubernetes-sigs/cri-tools "v${CRITOOLS_VERSION}" "${GOPATH}"
+install_helper github.com/containerd/containerd "v${CONTAINERD_VERSION}"
+install_helper github.com/kubernetes-sigs/cri-tools "v${CRITOOLS_VERSION}"
# Configure containerd-shim.
declare -r shim_config_path=/etc/containerd/runsc/config.toml