-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: build and push locally for metal tests
Because we now push much larger files, replace our in-memory storage with disk-backed storage.
- Loading branch information
Showing
9 changed files
with
439 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2024 The Kubernetes 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. | ||
|
||
# This is a convenience script for developing kOps on Metal. | ||
# It builds the code, including nodeup, and uploads to our fake S3 storage server. | ||
# It also sets KOPS_BASE_URL to point to that storage server. | ||
# To use, source the script. For example `. hack/dev-build-metal.sh` (note the initial `.`) | ||
|
||
# Can't use set -e in a script we want to source | ||
#set -e | ||
|
||
#set -x | ||
|
||
REPO_ROOT=$(git rev-parse --show-toplevel) | ||
cd "${REPO_ROOT}" || return | ||
|
||
# Dev environments typically do not need to test multiple architectures | ||
KOPS_ARCH=amd64 | ||
export KOPS_ARCH | ||
|
||
# Configure aws cli to talk to local storage | ||
aws configure --profile metal set aws_access_key_id accesskey | ||
aws configure --profile metal set aws_secret_access_key secret | ||
aws configure --profile metal set aws_region us-east-1 | ||
aws configure --profile metal set endpoint_url http://10.123.45.1:8443 | ||
export AWS_ENDPOINT_URL=http://10.123.45.1:8443 | ||
export AWS_PROFILE=metal | ||
export AWS_REGION=us-east-1 | ||
|
||
# Avoid chunking in S3 uploads (not supported by our mock yet) | ||
aws configure --profile metal set s3.multipart_threshold 64GB | ||
|
||
export UPLOAD_DEST=s3://kops-dev-build/ | ||
aws --version | ||
aws s3 ls "${UPLOAD_DEST}" || aws s3 mb "${UPLOAD_DEST}" || return | ||
make kops-install dev-version-dist-${KOPS_ARCH} || return | ||
|
||
hack/upload .build/upload/ "${UPLOAD_DEST}" || return | ||
|
||
# Set KOPS_BASE_URL | ||
(tools/get_version.sh | grep VERSION | awk '{print $2}') || return | ||
KOPS_VERSION=$(tools/get_version.sh | grep VERSION | awk '{print $2}') | ||
export KOPS_BASE_URL=http://10.123.45.1:8443/kops-dev-build/kops/${KOPS_VERSION}/ | ||
echo "set KOPS_BASE_URL=${KOPS_BASE_URL}" | ||
|
||
# Set feature flags needed on Metal | ||
# export KOPS_FEATURE_FLAGS= | ||
|
||
echo "SUCCESS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,5 +51,6 @@ for vm in 0 1 2; do | |
vm_name="vm${vm}" | ||
mkdir -p ${ARTIFACTS}/vms/${vm_name}/logs/ | ||
scp -o StrictHostKeyChecking=accept-new -i ${REPO_ROOT}/.build/.ssh/id_ed25519 [email protected]:/var/log/etcd* ${ARTIFACTS}/vms/${vm_name}/logs/ || true | ||
ssh -o StrictHostKeyChecking=accept-new -i ${REPO_ROOT}/.build/.ssh/id_ed25519 [email protected] journalctl --no-pager -u kubelet 2>&1 > ${ARTIFACTS}/vms/${vm_name}/logs/journal-kubelet.service || true | ||
ssh -o StrictHostKeyChecking=accept-new -i ${REPO_ROOT}/.build/.ssh/id_ed25519 [email protected] journalctl --no-pager -u kubelet 2>&1 > ${ARTIFACTS}/vms/${vm_name}/logs/kubelet.service || true | ||
ssh -o StrictHostKeyChecking=accept-new -i ${REPO_ROOT}/.build/.ssh/id_ed25519 [email protected] journalctl --no-pager -u kops-configuration 2>&1 > ${ARTIFACTS}/vms/${vm_name}/logs/kops-configuration.service || true | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.