Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ func main() {
SetOverrideUserAgent(mainConfig.UserAgent.Component, mainConfig.UserAgent.Version)
sso.SetUserAgent(mainConfig.UserAgent.Component, mainConfig.UserAgent.Version)

// E2E subcommands return before the flag-configured logger is set up below.
// Set a default logger now so e2e log output is not silently discarded;
// the controller path will override it with the flag-configured zap instance.
ctrl.SetLogger(zap.New())

// Custom entrypoint for scheduler e2e tests.
// Usage: /main <subcommand> [json-override]
// The optional json-override is merged on top of the ConfigMap config, e.g.:
Expand Down
12 changes: 12 additions & 0 deletions internal/knowledge/extractor/plugins/compute/flavor_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,23 @@ func (e *FlavorGroupExtractor) Extract() ([]plugins.Feature, error) {

// Group flavors by flavorGroupIdentifierName
groupMap := make(map[string][]FlavorInGroup)
var skippedParseErr, skippedNoHWVersion int

for _, row := range rows {
// Parse extra_specs JSON
var extraSpecs map[string]string
if row.ExtraSpecs != "" {
if err := json.Unmarshal([]byte(row.ExtraSpecs), &extraSpecs); err != nil {
flavorGroupLog.V(1).Info("failed to parse extra_specs for flavor", "flavor", row.Name, "error", err)
skippedParseErr++
continue
}
}

hwVersion, exists := extraSpecs["quota:hw_version"]
if !exists || hwVersion == "" {
flavorGroupLog.V(1).Info("flavor missing hw_version extra_spec", "flavor", row.Name)
skippedNoHWVersion++
continue
}

Expand All @@ -175,6 +178,7 @@ func (e *FlavorGroupExtractor) Extract() ([]plugins.Feature, error) {

// Convert map to features
features := make([]FlavorGroupFeature, 0, len(groupMap))
var skippedInvalidGroup int
for groupName, flavors := range groupMap {
if len(flavors) == 0 {
continue
Expand Down Expand Up @@ -243,6 +247,7 @@ func (e *FlavorGroupExtractor) Extract() ([]plugins.Feature, error) {
}
if err := fg.Validate(); err != nil {
flavorGroupLog.Error(err, "skipping flavor group with invalid data", "groupName", groupName)
skippedInvalidGroup++
continue
}
features = append(features, fg)
Expand All @@ -253,6 +258,13 @@ func (e *FlavorGroupExtractor) Extract() ([]plugins.Feature, error) {
return features[i].Name < features[j].Name
})

flavorGroupLog.Info("flavor group extraction complete",
"totalFlavors", len(rows),
"skippedParseError", skippedParseErr,
"skippedNoHWVersion", skippedNoHWVersion,
"skippedInvalidGroup", skippedInvalidGroup,
"groups", len(features))

return e.Extracted(features)
}

Expand Down
10 changes: 6 additions & 4 deletions internal/scheduling/reservations/commitments/e2e_checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func e2eRoundTripResource(
"resource", resourceName, "reason", rejectionReason)
return
}
e2eLog.V(1).Info("round-trip check: commitment accepted", "resource", resourceName, "uuid", testUUID)
e2eLog.Info("round-trip check: commitment accepted", "resource", resourceName, "uuid", testUUID)

// Register cleanup immediately so it runs even if the usage check panics.
defer func() {
Expand Down Expand Up @@ -428,7 +428,7 @@ func e2eBatchFlavorGroupResource(
"resource", resourceName, "reason", reason)
return
}
e2eLog.V(1).Info("batch check: batch confirmed", "resource", resourceName, "uuidA", uuidA, "uuidB", uuidB)
e2eLog.Info("batch check: batch confirmed", "resource", resourceName, "uuidA", uuidA, "uuidB", uuidB)

report := e2eFetchUsageReport(ctx, baseURL, az, projectID)
e2eLogUsageReport(report, az, projectID)
Expand Down Expand Up @@ -549,10 +549,12 @@ func e2eDryRunResource(
rejectionReason := e2eSendChangeCommitments(ctx, baseURL, req, requestTimeout)
switch {
case rejectionReason == "":
e2eLog.V(1).Info("dry-run check: accepted", "resource", resourceName, "az", az)
e2eLog.Info("dry-run check: accepted", "resource", resourceName, "az", az)
case strings.Contains(rejectionReason, "not sufficient capacity") || strings.Contains(rejectionReason, "insufficient CPU cores"):
e2eLog.Info("dry-run check: capacity rejection (expected in constrained clusters)",
"resource", resourceName, "az", az, "reason", rejectionReason)
case strings.Contains(rejectionReason, "internal error processing dry-run request"):
panic(fmt.Sprintf("dry-run check: internal error for resource %s in %s (likely controller timeout or misconfiguration): %s", resourceName, az, rejectionReason))
default:
panic(fmt.Sprintf("dry-run check: unexpected rejection for resource %s in %s: %s", resourceName, az, rejectionReason))
}
Expand Down Expand Up @@ -822,7 +824,7 @@ func e2eMarketplaceTransferResource(
},
}

e2eLog.V(1).Info("transfer check: transferring commitment from projectA to projectB",
e2eLog.Info("transfer check: transferring commitment from projectA to projectB",
"resource", resourceName, "uuid", testUUID, "projectA", projectA, "projectB", projectB, "az", az)
if reason := e2eSendChangeCommitments(ctx, baseURL, transferReq, requestTimeout); reason != "" {
if !strings.Contains(reason, "not sufficient capacity") && !strings.Contains(reason, "insufficient CPU cores") {
Expand Down
Loading