redhat-performance / benchmark-runner

Containerized Python based Framework for running and visualizing benchmark workloads on any Kubernetes/ OpenShift and runtime kinds pods, kata containers and kubevirt virtual machines simply and safely
Apache License 2.0
20 stars 19 forks source link

PerfCI Chaos Jenkinsfile Workflows #883

Closed ebattat closed 2 months ago

ebattat commented 2 months ago

Type of change

Note: Fill x in []

Description

  1. Add PerfCI Chaos Jenkinsfile Workflows under jenkins/PerfCI-Chaos

    • 01-PerfCI-Chaos-OpenShift-Deployment
    • 02-PerfCI-Chaos-Operators-Deployment
    • 03-PerfCI-Choas-Windows-VMs-Deployment
    • 04-PerfCI-Chaos-Upgrade-OpenShift-Deployment
    • 05-PerfCI-Chaos-Verify-Windows-VMs-Deployment
  2. Reformat all the folder names under jenkins/PerfCI

    • 01-PerfCI-OpenShift-Deployment
    • 02-PerfCI-Operators-Deployment
    • 03-PerfCI-Workloads-Deployment
    • 04-PerfCI-Grafana-Deployment
    • 05-PerfCI-Backup-Report-Deployment

For security reasons, all pull requests need to be approved first before running any automated CI

ebattat commented 2 months ago

@RobertKrawitz, any comments ?

ebattat commented 2 months ago

@RobertKrawitz, You right, fix it with the following code:

# Check if the image exists
if [[ "$(sudo podman images -q ${QUAY_BENCHMARK_RUNNER_REPOSITORY} 2> /dev/null)" != "" ]]; then

    # Get containers using the image
    containers=$(sudo podman ps -a --filter ancestor=${QUAY_BENCHMARK_RUNNER_REPOSITORY} -q)

    if [[ "$containers" != "" ]]; then
        echo "Stopping and removing containers using the image..."
        sudo podman stop $containers
        sudo podman rm $containers
    fi

    # Now remove the image
    sudo podman rmi -f $(sudo podman images -q ${QUAY_BENCHMARK_RUNNER_REPOSITORY} 2> /dev/null)
fi
RobertKrawitz commented 2 months ago

@RobertKrawitz, You right, fix it with the following code:

# Check if the image exists
if [[ "$(sudo podman images -q ${QUAY_BENCHMARK_RUNNER_REPOSITORY} 2> /dev/null)" != "" ]]; then

    # Get containers using the image
    containers=$(sudo podman ps -a --filter ancestor=${QUAY_BENCHMARK_RUNNER_REPOSITORY} -q)

    if [[ "$containers" != "" ]]; then
        echo "Stopping and removing containers using the image..."
        sudo podman stop $containers
        sudo podman rm $containers
    fi

    # Now remove the image
    sudo podman rmi -f $(sudo podman images -q ${QUAY_BENCHMARK_RUNNER_REPOSITORY} 2> /dev/null)
fi

Might as well do podman rm -f just to be certain.

ebattat commented 2 months ago

I want to remove the image and not only the running container, thats the reason I must use rmi and not rm

RobertKrawitz commented 2 months ago

I want to remove the image and not only the running container, thats the reason I must use rmi and not rm

Agreed, but when you do podman rm (if there are any containers), you should use podman rm -f to ensure that the containers are removed before you try to podman rmi.

ebattat commented 2 months ago

@RobertKrawitz, got it. fixed.

ebattat commented 2 months ago

@RobertKrawitz, do you have any further comments?