Skip to content

feat(spot): more detailed debug logs#769

Merged
adrianriobo merged 1 commit intoredhat-developer:mainfrom
ppitonak:debugs_logs
Apr 9, 2026
Merged

feat(spot): more detailed debug logs#769
adrianriobo merged 1 commit intoredhat-developer:mainfrom
ppitonak:debugs_logs

Conversation

@ppitonak
Copy link
Copy Markdown
Collaborator

@ppitonak ppitonak commented Apr 8, 2026

  1. on demand: print which instance type was randomly chosen
  2. spot: print more details when no good choice was found

@ppitonak
Copy link
Copy Markdown
Collaborator Author

ppitonak commented Apr 9, 2026

Sample output

...
DEBU Found InstanceType inf2.8xlarge at Availability Zone sa-east-1c with spot price 0.680100 
DEBU Found InstanceType inf2.xlarge at Availability Zone sa-east-1c with spot price 0.186500 
DEBU Found InstanceType inf2.24xlarge at Availability Zone sa-east-1c with spot price 2.140200 
DEBU No spot choice found. Regions with pricing data: [sa-east-1 eu-central-1 eu-west-2 eu-west-1 us-east-2 ap-southeast-1 ap-south-1 us-west-2] 
DEBU No spot choice found. Regions with placement scores: [us-east-2 sa-east-1 ap-southeast-1 us-west-2 eu-central-1 eu-west-1 eu-west-2 ap-south-1] 
DEBU   Region sa-east-1, AZ sa-east-1b: 1 instance type(s) with pricing [trn2.3xlarge], has placement score: false (need 5 types per AZ) 
DEBU   Region sa-east-1, AZ sa-east-1c: 3 instance type(s) with pricing [inf2.xlarge inf2.8xlarge inf2.24xlarge], has placement score: true (need 5 types per AZ) 
DEBU   Region eu-central-1, AZ eu-central-1a: 3 instance type(s) with pricing [inf2.xlarge inf2.8xlarge inf2.24xlarge], has placement score: false (need 5 types per AZ) 
DEBU   Region eu-central-1, AZ eu-central-1b: 3 instance type(s) with pricing [inf2.xlarge inf2.8xlarge inf2.24xlarge], has placement score: true (need 5 types per AZ) 
DEBU   Region eu-west-2, AZ eu-west-2a: 3 instance type(s) with pricing [inf2.xlarge inf2.8xlarge inf2.24xlarge], has placement score: true (need 5 types per AZ) 
DEBU   Region eu-west-1, AZ eu-west-1c: 3 instance type(s) with pricing [inf2.xlarge inf2.8xlarge inf2.24xlarge], has placement score: false (need 5 types per AZ) 
DEBU   Region eu-west-1, AZ eu-west-1a: 3 instance type(s) with pricing [inf2.xlarge inf2.8xlarge inf2.24xlarge], has placement score: false (need 5 types per AZ) 
DEBU   Region eu-west-1, AZ eu-west-1b: 3 instance type(s) with pricing [inf2.xlarge inf2.8xlarge inf2.24xlarge], has placement score: true (need 5 types per AZ) 
DEBU   Region us-east-2, AZ us-east-2b: 3 instance type(s) with pricing [inf2.xlarge inf2.8xlarge inf2.24xlarge], has placement score: false (need 5 types per AZ) 
DEBU   Region us-east-2, AZ us-east-2a: 3 instance type(s) with pricing [inf2.xlarge inf2.8xlarge inf2.24xlarge], has placement score: true (need 5 types per AZ) 
DEBU   Region us-east-2, AZ us-east-2c: 4 instance type(s) with pricing [inf2.xlarge trn1.2xlarge inf2.8xlarge inf2.24xlarge], has placement score: true (need 5 types per AZ) 
DEBU   Region ap-southeast-1, AZ ap-southeast-1a: 3 instance type(s) with pricing [inf2.xlarge inf2.8xlarge inf2.24xlarge], has placement score: false (need 5 types per AZ) 
DEBU   Region ap-southeast-1, AZ ap-southeast-1c: 3 instance type(s) with pricing [inf2.xlarge inf2.8xlarge inf2.24xlarge], has placement score: true (need 5 types per AZ) 
DEBU   Region ap-south-1, AZ ap-south-1a: 3 instance type(s) with pricing [inf2.xlarge inf2.8xlarge inf2.24xlarge], has placement score: false (need 5 types per AZ) 
DEBU   Region ap-south-1, AZ ap-south-1b: 3 instance type(s) with pricing [inf2.xlarge inf2.8xlarge inf2.24xlarge], has placement score: true (need 5 types per AZ) 
DEBU   Region us-west-2, AZ us-west-2c: 3 instance type(s) with pricing [inf2.xlarge inf2.8xlarge inf2.24xlarge], has placement score: true (need 5 types per AZ) 
DEBU   Region us-west-2, AZ us-west-2a: 4 instance type(s) with pricing [inf2.xlarge trn1.2xlarge inf2.8xlarge inf2.24xlarge], has placement score: true (need 5 types per AZ) 
DEBU   Region us-west-2, AZ us-west-2b: 3 instance type(s) with pricing [inf2.xlarge inf2.8xlarge inf2.24xlarge], has placement score: false (need 5 types per AZ) 
DEBU   Region us-west-2, AZ us-west-2d: 4 instance type(s) with pricing [inf2.xlarge trn1.2xlarge inf2.8xlarge inf2.24xlarge], has placement score: false (need 5 types per AZ) 
INFO @ updating.......                            
INFO  +  pulumi:pulumi:Stack mapt-rhel-ppitonak-test-neuron-spotOption-mapt-rhel-ppitonak-test-neuron creating (4s) error: an unhandled error occurred: 1 error occurred: 
INFO @ updating....                               
INFO  +  pulumi:pulumi:Stack mapt-rhel-ppitonak-test-neuron-spotOption-mapt-rhel-ppitonak-test-neuron **creating failed (4s)** 1 error 
INFO Diagnostics:                                 
INFO   pulumi:pulumi:Stack (mapt-rhel-ppitonak-test-neuron-spotOption-mapt-rhel-ppitonak-test-neuron): 
INFO     error: an unhandled error occurred: 1 error occurred: 
INFO            * no good spot choice was found: need 5 instance types in the same AZ with both spot pricing and placement scores above minimum threshold, but no AZ met this requirement. Regions with pricing: [sa-east-1 eu-central-1 eu-west-2 eu-west-1 us-east-2 ap-southeast-1 ap-south-1 us-west-2], regions with placement scores: [us-east-2 sa-east-1 ap-southeast-1 us-west-2 eu-central-1 eu-west-1 eu-west-2 ap-south-1] 
INFO                                              
INFO Resources:                                   
INFO     + 1 created                              
INFO     1 errored                                
INFO                                              
INFO Duration: 6s

@ppitonak ppitonak marked this pull request as ready for review April 9, 2026 08:07
@ppitonak ppitonak requested a review from adrianriobo April 9, 2026 08:08
// Log diagnostic details to help understand why no choice was found
pricingRegions := utilMaps.Keys(args.spotPricing)
placementRegions := utilMaps.Keys(args.placementScores)
logging.Debugf("No spot choice found. Regions with pricing data: %v", pricingRegions)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want this always or just if debug is enabled? I think this will print the trace as debug always as that do not check the ctx.Debug flag?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I didn't realize that it works this way. I pushed the fix

1. on demand: print which instance type was randomly chosen
2. spot: print more details when no good choice was found

Signed-off-by: Pavol Pitonak <ppitonak@redhat.com>
Copy link
Copy Markdown
Collaborator

@adrianriobo adrianriobo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adrianriobo adrianriobo merged commit 59a2032 into redhat-developer:main Apr 9, 2026
7 checks passed
@ppitonak ppitonak deleted the debugs_logs branch April 9, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants