metrics: use RUNTIME to determine RuntimeClass

If we have $RUNTIME set in the env, then we set up the pod
RuntimeClass, otherwise, just use the default node runtimes.

Clean up some of the un-used library code around docker/RUNTIME
as well whilst we are there.

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
This commit is contained in:
Graham Whaley
2019-07-30 13:13:35 -06:00
committed by David Lyle
parent 6e238d7cd9
commit bead9c7dfc
3 changed files with 1 additions and 42 deletions
-19
View File
@@ -14,7 +14,6 @@ source /etc/os-release || source /usr/lib/os-release
# Set variables to reasonable defaults if unset or empty
DOCKER_EXE="${DOCKER_EXE:-docker}"
RUNTIME="${RUNTIME:-kata-runtime}"
KSM_BASE="/sys/kernel/mm/ksm"
KSM_ENABLE_FILE="${KSM_BASE}/run"
@@ -188,23 +187,6 @@ show_system_state() {
done
}
common_init(){
# If we are running a kata runtime, go extract its environment
# for later use.
local iskata=$(is_a_kata_runtime "$RUNTIME")
if [ "$iskata" == "1" ]; then
extract_kata_env
else
# We know we have nothing to do for runc
if [ "$RUNTIME" != "runc" ]; then
warning "Unrecognised runtime ${RUNTIME}"
fi
fi
}
# Save the current KSM settings so we can restore them later
save_ksm_settings(){
echo "saving KSM settings"
@@ -307,4 +289,3 @@ wait_ksm_settle(){
echo "Timed out after ${1}s waiting for KSM to settle"
}
common_init
-18
View File
@@ -31,24 +31,6 @@ info() {
echo "INFO: $msg"
}
# Check if the $1 argument is the name of a 'known'
# Kata runtime. Of course, the end user can choose any name they
# want in reality, but this function knows the names of the default
# and recommended Kata docker runtime install names.
is_a_kata_runtime(){
case "$1" in
"kata-runtime") ;& # fallthrough
"kata-qemu") ;& # fallthrough
"kata-fc")
echo "1"
return
;;
esac
echo "0"
}
# Try to find the real runtime path for the docker runtime passed in $1
get_docker_kata_path(){
local jpaths=$(docker info --format "{{json .Runtimes}}" || true)
+1 -5
View File
@@ -18,7 +18,6 @@ deployment="busybox"
stats_pod="stats"
export RUNTIME="kata-qemu"
NUM_PODS=${NUM_PODS:-20}
STEP=${STEP:-1}
@@ -29,7 +28,6 @@ LABELVALUE=${LABELVALUE:-gandalf}
wait_time=${wait_time:-30}
delete_wait_time=${delete_wait_time:-600}
settle_time=${settle_time:-5}
use_kata_runtime=${use_kata_runtime:-no}
use_api=${use_api:-yes}
# Set some default metrics env vars
@@ -165,7 +163,7 @@ run() {
# Generate the next yaml file
local runtime_command
if [ "$use_kata_runtime" != "no" ]; then
if [ -n "$RUNTIME" ]; then
runtime_command="s|@RUNTIMECLASS@|${RUNTIME}|g"
else
runtime_command="/@RUNTIMECLASS@/d"
@@ -271,8 +269,6 @@ show_vars()
echo -e "\t\tSeconds to wait for all pods to be deleted"
echo -e "\tsettle_time (${settle_time})"
echo -e "\t\tSeconds to wait after pods ready before taking measurements"
echo -e "\tuse_kata_runtime (${use_kata_runtime})"
echo -e "\t\tspecify yes or no to use kata runtime"
echo -e "\tuse_api (${use_api})"
echo -e "\t\tspecify yes or no to use the API to launch pods"
}