Skip to content

Updating to python3.11#309

Merged
paigerube14 merged 1 commit intokrkn-chaos:mainfrom
paigerube14:python3.11
Feb 2, 2026
Merged

Updating to python3.11#309
paigerube14 merged 1 commit intokrkn-chaos:mainfrom
paigerube14:python3.11

Conversation

@paigerube14
Copy link
Collaborator

@paigerube14 paigerube14 commented Feb 2, 2026

User description

Description

Need to update the python version that runs to 3.11

Documentation

  • Is documentation needed for this update?

If checked, a documentation PR must be created and merged in the website repository.

Related Documentation PR (if applicable)


PR Type

Enhancement


Description

  • Update Python runtime from 3.9 to 3.11 across all scenario scripts

  • Replace python3.9 with python3.11 in 24 run.sh files

  • Remove obsolete prow pod-network-chaos script


Diagram Walkthrough

flowchart LR
  A["Python 3.9"] -- "upgrade" --> B["Python 3.11"]
  B --> C["24 scenario scripts"]
  B --> D["validation scripts"]
Loading

File Walkthrough

Relevant files
Configuration changes
21 files
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+2/-2     
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+2/-2     
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+1/-1     
run.sh
Update Python version to 3.11                                                       
+1/-1     
Miscellaneous
1 files
prow_run.sh
Remove obsolete prow script file                                                 
+0/-37   

@qodo-code-review
Copy link

qodo-code-review bot commented Feb 2, 2026

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link

qodo-code-review bot commented Feb 2, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
Avoid hardcoding the Python executable

Instead of hardcoding the Python version in over 20 scripts, use a generic
python3 command or a shared variable. This will simplify future version upgrades
and improve maintainability.

Examples:

application-outages/run.sh [26]
python3.11 run_kraken.py --config=config/app_outage_config.yaml $extra_var
chaos-recommender/run.sh [40-54]
python3.11 utils/chaos_recommender/chaos_recommender.py \
-o -k $KRKN_KUBE_CONFIG \
-M $MEM_TESTS \
-G $GENERIC_TESTS \
-N $NETWORK_TESTS \
-C $CPU_TESTS \
-k $KUBECONFIG_PATH \
-n $NAMESPACE \
-p $PROMETHEUS_ENDPOINT \
-t $PROMETHEUS_TOKEN \

 ... (clipped 5 lines)

Solution Walkthrough:

Before:

# In application-outages/run.sh
...
python3.11 run_kraken.py --config=config/app_outage_config.yaml $extra_var

# In chaos-recommender/run.sh
...
python3.11 utils/chaos_recommender/chaos_recommender.py \
  -o -k $KRKN_KUBE_CONFIG \
  ...

# In node-scenarios-bm/run.sh
...
python3.11 /home/krkn/validate_config.py ...
...
python3.11 run_kraken.py --config=config/node_scenarios_bm.yaml $extra_var

After:

# In a new shared file, e.g., 'scripts/common.sh'
PYTHON_EXEC="python3"

# In application-outages/run.sh
source ../scripts/common.sh
...
$PYTHON_EXEC run_kraken.py --config=config/app_outage_config.yaml $extra_var

# In chaos-recommender/run.sh
source ../scripts/common.sh
...
$PYTHON_EXEC utils/chaos_recommender/chaos_recommender.py \
  -o -k $KRKN_KUBE_CONFIG \
  ...

# The specific python version (3.11) would be set in the environment,
# for example, in the Dockerfile.
Suggestion importance[1-10]: 8

__

Why: The suggestion addresses a significant maintainability issue by advising against hardcoding the Python version across many files, proposing a more robust and scalable solution.

Medium
Possible issue
Add interpreter existence check

Add a check to verify the python3.11 interpreter exists before execution, and
exit with an error message if it is not found.

application-outages/run.sh [26]

+if ! command -v python3.11 > /dev/null; then
+  echo "[ERROR] python3.11 not found; please install or adjust the script."
+  exit 1
+fi
 python3.11 run_kraken.py --config=config/app_outage_config.yaml $extra_var
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: This suggestion improves the script's robustness by adding a check for the python3.11 interpreter and providing a clear error message if it's not found, which is a good practice.

Low
  • Update

Signed-off-by: Paige Patton <prubenda@redhat.com>
@paigerube14 paigerube14 merged commit 55f0a1b into krkn-chaos:main Feb 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant