Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3852 from GabyCT/topic/removevariable
Browse files Browse the repository at this point in the history
ci: Remove duplicated runtime definitions
  • Loading branch information
GabyCT authored Aug 23, 2021
2 parents 3afc5dc + 553db63 commit 4cd975e
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 23 deletions.
5 changes: 2 additions & 3 deletions integration/ksm/ksm_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ trap teardown EXIT
function run_with_ksm() {
setup

CONTAINERD_RUNTIME="io.containerd.kata.v2"
sudo ctr image pull "${IMAGE}"

# Running the first container
sudo ctr run -d --runtime="${CONTAINERD_RUNTIME}" "${IMAGE}" test sh -c "${PAYLOAD_ARGS}"
sudo ctr run -d --runtime="${CTR_RUNTIME}" "${IMAGE}" test sh -c "${PAYLOAD_ARGS}"

echo "Entering KSM settle mode on first container"
wait_ksm_settle "${WAIT_TIME}"
Expand All @@ -53,7 +52,7 @@ function run_with_ksm() {
echo "Pages merged $first_pages_merged"

# Running the second container
sudo ctr run -d --runtime="${CONTAINERD_RUNTIME}" "${IMAGE}" test1 sh -c "${PAYLOAD_ARGS}"
sudo ctr run -d --runtime="${CTR_RUNTIME}" "${IMAGE}" test1 sh -c "${PAYLOAD_ARGS}"

echo "Entering KSM settle mode on second container"
wait_ksm_settle "${WAIT_TIME}"
Expand Down
1 change: 0 additions & 1 deletion integration/sandbox_cgroup/sandbox_cgroup_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ fi

function setup() {
restart_containerd_service
CONTAINERD_RUNTIME="io.containerd.kata.v2"
check_processes
}

Expand Down
2 changes: 1 addition & 1 deletion integration/stability/agent_stability_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ end_time=$((start_time+timeout))
function setup {
restart_containerd_service
sudo ctr image pull $IMAGE
sudo ctr run --runtime=$CONTAINERD_RUNTIME -d $IMAGE $CONTAINER_NAME sh -c $PAYLOAD_ARGS
sudo ctr run --runtime=$CTR_RUNTIME -d $IMAGE $CONTAINER_NAME sh -c $PAYLOAD_ARGS
}

function exec_loop {
Expand Down
2 changes: 1 addition & 1 deletion integration/stability/hypervisor_stability_kill_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ setup() {
sudo ctr image pull $IMAGE
[ $? != 0 ] && die "Unable to get image $IMAGE"

sudo ctr run --runtime=$CONTAINERD_RUNTIME -d $IMAGE $CONTAINER_NAME sh -c $PAYLOAD_ARGS
sudo ctr run --runtime=$CTR_RUNTIME -d $IMAGE $CONTAINER_NAME sh -c $PAYLOAD_ARGS
num=$(pidof ${HYPERVISOR_NAME} | wc -w)
[ ${num} -eq 1 ] || die "hypervisor count:${num} expected:1"
}
Expand Down
8 changes: 4 additions & 4 deletions integration/stability/soak_parallel_rm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ check_all_running() {
fi

# if this is kata-runtime, check how many pods virtcontainers thinks we have
if [[ "$RUNTIME" == "$KATA_RUNTIME_NAME" ]]; then
if [[ "$RUNTIME" == "containerd-shim-kata-v2" ]]; then
num_vc_pods=$(sudo ls -1 ${VC_POD_DIR} | wc -l)

if (( ${how_many_running} != ${num_vc_pods} )); then
Expand Down Expand Up @@ -118,7 +118,7 @@ go() {

for ((i=1; i<= ${MAX_CONTAINERS}; i++)); do
containers+=($(random_name))
sudo ctr run --runtime=${CONTAINERD_RUNTIME} -d ${nginx_image} ${containers[-1]} sh -c ${COMMAND}
sudo ctr run --runtime=${CTR_RUNTIME} -d ${nginx_image} ${containers[-1]} sh -c ${COMMAND}
((how_many++))
done

Expand Down Expand Up @@ -167,8 +167,8 @@ init() {
initial_mount_count=$(count_mounts)

# Only check Kata items if we are using a Kata runtime
if [[ "$RUNTIME" == "$KATA_RUNTIME_NAME" ]]; then
echo "Checking Kata runtime $RUNTIME"
if [[ "$RUNTIME" == "containerd-shim-kata-v2" ]]; then
echo "Checking Kata runtime"
check_kata_components=1
else
echo "Not a Kata runtime, not checking for Kata components"
Expand Down
3 changes: 1 addition & 2 deletions integration/vcpus/default_vcpus_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ function setup() {
}

function test_ctr_with_vcpus() {
CONTAINERD_RUNTIME="io.containerd.kata.v2"
sudo ctr image pull "${IMAGE}"
[ $? != 0 ] && die "Unable to get image $IMAGE"
sudo ctr run --runtime="${CONTAINERD_RUNTIME}" -d "${IMAGE}" \
sudo ctr run --runtime="${CTR_RUNTIME}" -d "${IMAGE}" \
"${CONTAINER_NAME}" sh -c "${PAYLOAD_ARGS}" || die "Test failed"
}

Expand Down
15 changes: 4 additions & 11 deletions metrics/lib/common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ CTR_EXE="${CTR_EXE:-ctr}"
DOCKER_EXE="${DOCKER_EXE:-docker}"
CTR_RUNTIME="${CTR_RUNTIME:-io.containerd.run.kata.v2}"
RUNTIME="${RUNTIME:-containerd-shim-kata-v2}"
KATA_RUNTIME_NAME="containerd-shim-kata-v2"
CONTAINERD_RUNTIME="io.containerd.kata.v2"

KSM_BASE="/sys/kernel/mm/ksm"
KSM_ENABLE_FILE="${KSM_BASE}/run"
Expand Down Expand Up @@ -199,17 +197,12 @@ show_system_ctr_state() {
}

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
if [ "$CTR_RUNTIME" == "io.containerd.runc.v2" ] || [ "$RUNTIME" == "containerd-shim-kata-v2" ]; then
extract_kata_env
else
# We know we have nothing to do for runc or shimv2
if [ "$RUNTIME" != "runc" ]; then
warning "Unrecognised runtime ${RUNTIME}"
if [ "$CTR_RUNTIME" != "io.containerd.runc.v2" ] || [ "$RUNTIME" != "runc" ]; then
warning "Unrecognised runtime"
fi
fi
}
Expand Down Expand Up @@ -282,7 +275,7 @@ check_for_ksm(){
#
# arg1 - timeout in seconds
wait_ksm_settle(){
[[ "$RUNTIME" == "runc" ]] || [[ "$RUNTIME" == "kata-fc" ]] && return
[[ "$RUNTIME" == "runc" ]] || [[ "$RUNTIME" == "kata-fc" ]] || [[ "$CTR_RUNTIME" == "io.containerd.runc.v2" ]] && return
local t pcnt
local oldscan=-1 newscan
local oldpages=-1 newpages
Expand Down

0 comments on commit 4cd975e

Please sign in to comment.