Merge pull request #14147 from spowelljr/addGoModulesCrom

Add cron to cleanup go modules
pull/14155/head
Steven Powell 2022-05-12 13:34:30 -07:00 committed by GitHub
commit ce2a6e1394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 91 additions and 78 deletions

View File

@ -100,6 +100,13 @@ sudo ARCH="$ARCH" ./installers/check_install_docker.sh || true
# install gotestsum if not present
GOROOT="/usr/local/go" ./installers/check_install_gotestsum.sh || true
# install cron jobs
if [ "$OS" == "linux" ]; then
source ./installers/check_install_linux_crons.sh
else
source ./installers/check_install_osx_crons.sh
fi
# let's just clean all docker artifacts up
docker system prune --force --volumes || true
docker system df || true

View File

@ -0,0 +1,17 @@
#!/bin/bash
# Copyright 2022 The Kubernetes Authors All rights reserved.
#
# 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.
go clean -modcache

0
hack/jenkins/installers/check_install_gotestsum.sh Normal file → Executable file
View File

View File

@ -0,0 +1,21 @@
#!/bin/bash
# Copyright 2022 The Kubernetes Authors All rights reserved.
#
# 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 -e
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP AND REBOOT"
sudo install cron/cleanup_go_modules.sh /etc/cron.monthly/cleanup_go_modules || echo "FAILED TO INSTALL GO MODULES CLEANUP"

View File

@ -0,0 +1,24 @@
#!/bin/bash
# Copyright 2022 The Kubernetes Authors All rights reserved.
#
# 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 -e
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
install cron/cleanup_and_reboot_Darwin.sh $HOME/cleanup_and_reboot.sh || echo "FAILED TO INSTALL CLEANUP AND REBOOT"
echo "*/30 * * * * $HOME/cleanup_and_reboot.sh" | crontab
install cron/cleanup_go_modules.sh $HOME/cleanup_go_modules.sh || echo "FAILED TO INSTALL GO MODULES CLEANUP"
echo "0 0 1 * * $HOME/cleanup_go_modules.sh" | crontab
crontab -l

View File

@ -31,9 +31,6 @@ DRIVER="docker"
JOB_NAME="Docker_Linux"
CONTAINER_RUNTIME="docker"
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP"
# removing possible left over docker containers from previous runs
docker rm -f -v $(docker ps -aq) >/dev/null 2>&1 || true

15
hack/jenkins/linux_integration_tests_docker_arm64.sh Normal file → Executable file
View File

@ -22,18 +22,17 @@
# COMMIT: Actual commit ID from upstream build
# EXTRA_BUILD_ARGS (optional): Extra args to be passed into the minikube integrations tests
# access_token: The GitHub API access token. Injected by the Jenkins credential provider.
set -e
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP"
ARCH="arm64"
OS="linux"
DRIVER="docker"
JOB_NAME="$JOB_NAME"
CONTAINER_RUNTIME="docker"
EXTERNAL="yes"
# removing possible left over docker containers from previous runs
docker rm -f -v "$(docker ps -aq)" >/dev/null 2>&1 || true
ARCH="arm64" \
OS="linux" \
DRIVER="docker" \
JOB_NAME="$JOB_NAME" \
CONTAINER_RUNTIME="docker" \
EXTERNAL="yes" \
source ./common.sh

View File

@ -31,11 +31,6 @@ DRIVER="docker"
JOB_NAME="Docker_Linux_containerd"
CONTAINER_RUNTIME="containerd"
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP"
# removing possible left over docker containers from previous runs
docker rm -f -v $(docker ps -aq) >/dev/null 2>&1 || true

View File

@ -22,18 +22,17 @@
# COMMIT: Actual commit ID from upstream build
# EXTRA_BUILD_ARGS (optional): Extra args to be passed into the minikube integrations tests
# access_token: The GitHub API access token. Injected by the Jenkins credential provider.
set -e
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP"
ARCH="arm64"
OS="linux"
DRIVER="docker"
JOB_NAME="$JOB_NAME"
CONTAINER_RUNTIME="containerd"
EXTERNAL="yes"
# removing possible left over docker containers from previous runs
docker rm -f -v "$(docker ps -aq)" >/dev/null 2>&1 || true
ARCH="arm64" \
OS="linux" \
DRIVER="docker" \
JOB_NAME="$JOB_NAME" \
CONTAINER_RUNTIME="containerd" \
EXTERNAL="yes" \
source ./common.sh

View File

@ -31,11 +31,6 @@ DRIVER="docker"
JOB_NAME="Docker_Linux_crio"
CONTAINER_RUNTIME="crio"
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP"
# removing possible left over docker containers from previous runs
docker rm -f -v $(docker ps -aq) >/dev/null 2>&1 || true

View File

@ -22,18 +22,17 @@
# COMMIT: Actual commit ID from upstream build
# EXTRA_BUILD_ARGS (optional): Extra args to be passed into the minikube integrations tests
# access_token: The GitHub API access token. Injected by the Jenkins credential provider.
set -e
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP"
ARCH="arm64"
OS="linux"
DRIVER="docker"
JOB_NAME="$JOB_NAME"
CONTAINER_RUNTIME="crio"
EXTERNAL="yes"
# removing possible left over docker containers from previous runs
docker rm -f -v "$(docker ps -aq)" >/dev/null 2>&1 || true
ARCH="arm64" \
OS="linux" \
DRIVER="docker" \
JOB_NAME="$JOB_NAME" \
CONTAINER_RUNTIME="crio" \
EXTERNAL="yes" \
source ./common.sh

View File

@ -34,9 +34,6 @@ EXPECTED_DEFAULT_DRIVER="kvm2"
# We pick kvm as our gvisor testbed because it is fast & reliable
EXTRA_TEST_ARGS="-gvisor"
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP"
sudo apt-get update
sudo apt-get -y install qemu-system libvirt-clients libvirt-daemon-system ebtables iptables dnsmasq
sudo adduser jenkins libvirt || true

View File

@ -31,11 +31,6 @@ DRIVER="kvm2"
JOB_NAME="KVM_Linux_containerd"
CONTAINER_RUNTIME="containerd"
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP"
sudo apt-get update
sudo apt-get -y install qemu-system libvirt-clients libvirt-daemon-system ebtables iptables dnsmasq
sudo adduser jenkins libvirt || true

View File

@ -31,11 +31,6 @@ DRIVER="kvm2"
JOB_NAME="KVM_Linux_crio"
CONTAINER_RUNTIME="crio"
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP"
sudo apt-get update
sudo apt-get -y install qemu-system libvirt-clients libvirt-daemon-system ebtables iptables dnsmasq
sudo adduser jenkins libvirt || true

View File

@ -23,7 +23,6 @@
# EXTRA_BUILD_ARGS (optional): Extra args to be passed into the minikube integrations tests
# access_token: The GitHub API access token. Injected by the Jenkins credential provider.
set -e
OS="linux"
@ -66,9 +65,6 @@ if ! which socat &>/dev/null; then
sudo apt-get -qq -y install socat
fi
mkdir -p cron && gsutil -m rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP"
# We need this for reasons now
sudo sysctl fs.protected_regular=0

View File

@ -31,9 +31,6 @@ DRIVER="podman"
JOB_NAME="Experimental_Podman_Linux"
CONTAINER_RUNTIME="containerd"
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP"
# remove possible left over podman containers
sudo podman rm -f -v $(sudo podman ps -aq) || true

View File

@ -32,7 +32,4 @@ JOB_NAME="VirtualBox_Linux"
EXTRA_TEST_ARGS=""
EXPECTED_DEFAULT_DRIVER="kvm2"
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP"
source ./common.sh 2h

View File

@ -47,9 +47,4 @@ do
fi
done
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
install cron/cleanup_and_reboot_Darwin.sh $HOME/cleanup_and_reboot.sh || echo "FAILED TO INSTALL CLEANUP"
echo "*/30 * * * * $HOME/cleanup_and_reboot.sh" | crontab
crontab -l
source common.sh

View File

@ -34,9 +34,4 @@ EXTRA_TEST_ARGS=""
EXPECTED_DEFAULT_DRIVER="hyperkit"
EXTERNAL="yes"
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
install cron/cleanup_and_reboot_Darwin.sh $HOME/cleanup_and_reboot.sh || echo "FAILED TO INSTALL CLEANUP"
echo "*/30 * * * * $HOME/cleanup_and_reboot.sh" | crontab
crontab -l
source common.sh

View File

@ -33,10 +33,4 @@ EXTRA_START_ARGS="--bootstrapper=kubeadm"
# Assumes that hyperkit is also installed on the VirtualBox CI host.
EXPECTED_DEFAULT_DRIVER="hyperkit"
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
install cron/cleanup_and_reboot_Darwin.sh $HOME/cleanup_and_reboot.sh || echo "FAILED TO GET INSTALL CLEANUP"
echo "*/30 * * * * $HOME/cleanup_and_reboot.sh" | crontab
crontab -l
source common.sh

0
hack/jenkins/prbot.sh Normal file → Executable file
View File

3
hack/jenkins/preload_generation.sh Normal file → Executable file
View File

@ -20,8 +20,7 @@
set -eux -o pipefail
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/master/cron" cron || echo "FAILED TO GET CRON FILES"
sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP"
source ./hack/jenkins/installers/check_install_linux_crons.sh
# Make sure the right golang version is installed based on Makefile
./hack/jenkins/installers/check_install_golang.sh /usr/local

0
hack/jenkins/test-flake-chart/compute_flake_rate.sh Normal file → Executable file
View File

0
hack/jenkins/test-flake-chart/sync_tests.sh Normal file → Executable file
View File

0
hack/jenkins/upload_integration_report.sh Normal file → Executable file
View File