summaryrefslogtreecommitdiffhomepage
path: root/.buildkite/hooks
diff options
context:
space:
mode:
authorKevin Krakauer <krakauer@google.com>2021-07-21 15:17:42 -0700
committergVisor bot <gvisor-bot@google.com>2021-07-21 15:20:19 -0700
commitbc0ab8ea0f2035ac143a5285f09839882e866705 (patch)
tree84f9adc7c41cf4fa83908d36d934371f4fad5d86 /.buildkite/hooks
parentc259978dbd793fedd8d1068b875c763ffba09d26 (diff)
buildkite: update Go
#6322 tried to update Go to 1.16, but existing nodes fail to upgrade due to the presence of old Go [1]. Specifically when trying to add Go to `/usr/bin`: ``` ln: failed to create symbolic link '/usr/bin/go': File exists ``` Also: - Removing `golang-go` also removes apt installs of `gcc` and `pkg-config`, so those are installed explicitly. - Add `-c` to wget, which will prevent re-downloading Go for each run. - Disable GO111MODULE when building cri-tools and containerd, since we're using pre-module versions of each. 1 - https://buildkite.com/gvisor/pipeline/builds/7285#3593244c-e411-472d-804a-9c7fbbd24762 PiperOrigin-RevId: 386106881
Diffstat (limited to '.buildkite/hooks')
-rw-r--r--.buildkite/hooks/pre-command10
1 files changed, 9 insertions, 1 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.