Skip to content

🌱 ci: Several CI fixes #1718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 3 additions & 23 deletions hack/ci/gce-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,37 +85,17 @@ function create_vm {
local machine_type="GCP_MACHINE_TYPE_${name}"
machine_type=${!machine_type}
local servername="${CLUSTER_NAME}-${name}"
local diskname="${CLUSTER_NAME}-disk"
local imagename="${servername}-image"

# Loop over all zones in the GCP region to ignore a full zone.
# We are not able to use 'gcloud compute zones list' as the gcloud.compute.zones.list permission is missing.
for GCP_ZONE in "${GCP_REGION}-a" "${GCP_REGION}-b" "${GCP_REGION}-c"; do
# Check if image was already created.
# Images are not zone specific, but the disk is.
if ! gcloud compute images describe "$imagename" --project "$GCP_PROJECT" >/dev/null; then
# Create the base disk image based on the public Ubuntu 22.04 LTS cloud image
# Note that this has also been verified to work with CentOS 8 as of
# 2021-01-12, but this is not tested regularly.
# To use CentOS 8:
# --image-project centos-cloud --image-family centos-stream-8
if ! gcloud compute disks describe "$diskname" --project "$GCP_PROJECT" --zone "$GCP_ZONE" >/dev/null; then
gcloud compute disks create "$diskname" \
--project "$GCP_PROJECT" \
--image-project ubuntu-os-cloud --image-family ubuntu-2204-lts \
--zone "$GCP_ZONE"
fi
gcloud compute images create "$imagename" \
--project "$GCP_PROJECT" \
--source-disk "$diskname" --source-disk-zone "$GCP_ZONE" \
--licenses "https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
fi

if ! gcloud compute instances describe "$servername" --project "$GCP_PROJECT" --zone "$GCP_ZONE" >/dev/null; then
if gcloud compute instances create "$servername" \
--project "$GCP_PROJECT" \
--zone "$GCP_ZONE" \
--image "$imagename" \
--enable-nested-virtualization \
--image-project ubuntu-os-cloud \
--image-family ubuntu-2004-lts \
--boot-disk-size 200G \
--boot-disk-type pd-ssd \
--can-ip-forward \
Expand Down
2 changes: 1 addition & 1 deletion hack/ensure-kubectl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ verify_kubectl_version() {
fi

local kubectl_version
IFS=" " read -ra kubectl_version <<< "$(kubectl version --client --short)"
IFS=" " read -ra kubectl_version <<< "$(kubectl version --client)"
if [[ "${MINIMUM_KUBECTL_VERSION}" != $(echo -e "${MINIMUM_KUBECTL_VERSION}\n${kubectl_version[2]}" | sort -s -t. -k 1,1 -k 2,2n -k 3,3n | head -n1) ]]; then
cat <<EOF
Detected kubectl version: ${kubectl_version[2]}.
Expand Down
8 changes: 3 additions & 5 deletions scripts/ci-conformance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,12 @@ cleanup() {
}
trap cleanup EXIT

# Ensure that python3-pip is installed.
apt-get update -y
apt-get install -y python3-pip
# Install requests module explicitly for HTTP calls.
# libffi required for pip install cffi (yoga dependency)
apt-get install -y python3-requests libffi-dev
rm -rf /var/lib/apt/lists/*

# Install/upgrade pip and requests module explicitly for HTTP calls.
python3 -m pip install --upgrade pip requests

# If BOSKOS_HOST is set then acquire a resource of type ${RESOURCE_TYPE} from Boskos.
if [ -n "${BOSKOS_HOST:-}" ]; then
# Check out the account from Boskos and store the produced environment
Expand Down
8 changes: 3 additions & 5 deletions scripts/ci-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@ cleanup() {
}
trap cleanup EXIT

# Ensure that python3-pip is installed.
apt-get update -y
apt-get install -y python3-pip
# Install requests module explicitly for HTTP calls.
# libffi required for pip install cffi (yoga dependency)
apt-get install -y python3-requests libffi-dev
rm -rf /var/lib/apt/lists/*

# Install/upgrade pip and requests module explicitly for HTTP calls.
python3 -m pip install --upgrade pip requests

# If BOSKOS_HOST is set then acquire a resource of type ${RESOURCE_TYPE} from Boskos.
if [ -n "${BOSKOS_HOST:-}" ]; then
# Check out the account from Boskos and store the produced environment
Expand Down