Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
153ef65
Cleanup: use corev1.LabelTopologyZone in az filter
PhilippMatthes Feb 10, 2026
bcd9856
Bump cortex chart appVersions to sha-153ef658 [skip ci]
github-actions[bot] Feb 10, 2026
8e0c4a0
Add missing license header to pkg/db/monitor.go
PhilippMatthes Feb 10, 2026
01883e7
Bump cortex chart appVersions to sha-8e0c4a03 [skip ci]
github-actions[bot] Feb 10, 2026
517140c
Upgrade to Golang v1.26
PhilippMatthes Feb 11, 2026
5dc3976
Bump cortex chart appVersions to sha-517140c5 [skip ci]
github-actions[bot] Feb 11, 2026
35c1781
Upgrade golangci-lint to version compatible with Go 1.26
PhilippMatthes Feb 11, 2026
b75b05a
Rename api/delegation -> api/external
PhilippMatthes Feb 11, 2026
0ffd4ae
Bump cortex chart appVersions to sha-b75b05a6 [skip ci]
github-actions[bot] Feb 11, 2026
f6d2064
Handle 404 errors for Limes API (#508)
SoWieMarkus Feb 11, 2026
f18856d
Bump cortex chart appVersions to sha-f6d20644 [skip ci]
github-actions[bot] Feb 11, 2026
cde959b
Determine hv type and nova request intent from nested spec (#510)
PhilippMatthes Feb 11, 2026
97dae5c
Bump cortex chart appVersions to sha-cde959b2 [skip ci]
github-actions[bot] Feb 11, 2026
0eaf785
Make testing.ptr.Ptr inlinable wrapper [skip ci]
PhilippMatthes Feb 12, 2026
bc2c617
Move pkg/db to knowledge/db (#511)
PhilippMatthes Feb 12, 2026
42aae96
Bump cortex chart appVersions to sha-bc2c617d [skip ci]
github-actions[bot] Feb 12, 2026
c731282
Cleanup: remove unnecessary struct conf.KeystoneConfig
PhilippMatthes Feb 12, 2026
1b4baf9
Cleanup: remove unnecessary struct conf.DBConfig
PhilippMatthes Feb 12, 2026
f892e7f
Cleanup: move conf.SSOConfig to pkg/sso
PhilippMatthes Feb 12, 2026
8f1c366
Move pkg/tools/histogram to knowledge/math (#512)
PhilippMatthes Feb 12, 2026
23fef01
Bump cortex chart appVersions to sha-8f1c366f [skip ci]
github-actions[bot] Feb 12, 2026
805c87f
Provide helper to initialize multicluster client, pull out config (#513)
PhilippMatthes Feb 12, 2026
89ac82a
Bump cortex chart appVersions to sha-805c87f0 [skip ci]
github-actions[bot] Feb 12, 2026
d34d055
Move monitoring config to monitoring module (#514)
PhilippMatthes Feb 12, 2026
7ffb84b
Cleanup: move reservations config to reservations module
PhilippMatthes Feb 12, 2026
53f4dee
Bump cortex chart appVersions to sha-7ffb84b4 [skip ci]
github-actions[bot] Feb 12, 2026
53e1998
fix: Tilt can use generic values from env (#509)
umswmayj Feb 12, 2026
1e28eeb
Bump cortex chart appVersions to sha-53e19988 [skip ci]
github-actions[bot] Feb 12, 2026
4016c95
Update hypervisor type handling in filter_capabilities
PhilippMatthes Feb 12, 2026
715230b
Fix filter_capabilities_test
PhilippMatthes Feb 12, 2026
81fba00
Bump cortex chart appVersions to sha-715230b7 [skip ci]
github-actions[bot] Feb 12, 2026
cbc704d
Enable deschedulings executor and cleanup config (#515)
PhilippMatthes Feb 12, 2026
79d737e
Bump cortex chart appVersions to sha-cbc704db [skip ci]
github-actions[bot] Feb 12, 2026
a6231ec
Split up shared config to improve self-sustainedness of modules (#516)
PhilippMatthes Feb 12, 2026
47a60b0
Bump cortex chart appVersions to sha-a6231ec8 [skip ci]
github-actions[bot] Feb 12, 2026
12407d8
Renovate: Update github.com/sapcc/go-bits digest to 791f29d (#520)
renovate[bot] Feb 13, 2026
cb3ec4e
Bump cortex chart appVersions to sha-12407d86 [skip ci]
github-actions[bot] Feb 13, 2026
2ab884c
Renovate: Update github.com/cobaltcore-dev/openstack-hypervisor-opera…
renovate[bot] Feb 13, 2026
ae52203
Renovate: Update External dependencies (#521)
renovate[bot] Feb 13, 2026
d2b52ef
Bump cortex chart appVersions to sha-ae522039 [skip ci]
github-actions[bot] Feb 13, 2026
f3955ac
Bump chart versions to 0.0.35 and update cortex dependency versions t…
SoWieMarkus Feb 16, 2026
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
4 changes: 2 additions & 2 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"commitMessageAction": "Renovate: Update",
"constraints": {
"go": "1.25"
"go": "1.26"
},
"dependencyDashboardOSVVulnerabilitySummary": "all",
"osvVulnerabilityAlerts": true,
Expand All @@ -27,7 +27,7 @@
"matchPackageNames": [
"golang"
],
"allowedVersions": "1.25.x"
"allowedVersions": "1.26.x"
},
{
"matchPackageNames": [
Expand Down
13 changes: 9 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@ vendor/**
go.work
go.work.sum

# env file
.env

# Just in case someone decides to put the secrets into the project dir.
cortex.secrets.yaml

# macOS specific files
.DS_Store
# exclude dot files
.*
# except
!.dockerignore
!.editorconfig
!.gitignore
!.golangci.yaml
!.license-scan-overrides.jsonl
!.license-scan-rules.json
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.25 AS builder
FROM golang:1.26 AS builder
ARG TARGETOS
ARG TARGETARCH
# Path of our go.mod
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint

CONTROLLER_TOOLS_VERSION ?= v0.20.0
GOLANGCI_LINT_VERSION ?= v2.8.0
GOLANGCI_LINT_VERSION ?= v2.9.0

.PHONY: controller-gen
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
Expand Down
33 changes: 27 additions & 6 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,27 @@ tilt_overrides = os.getenv('TILT_OVERRIDES_PATH')
if tilt_overrides and os.path.exists(tilt_overrides):
tilt_values.append(tilt_overrides)

# Build a list of --set overrides from environment variables
# Check for environment variables with CORTEX_ prefix and convert them to Helm set overrides
# CORTEX_AAA_BBB_CCC will be converted to AAA.BBB.CCC=value
env_set_overrides = []

print("=== Scanning for CORTEX_ environment variables ===")
for env_key in os.environ:
if env_key.startswith('CORTEX_'):
# Remove CORTEX_ prefix and convert underscores to dots
# CORTEX_AAA_BBB_CCC -> AAA_BBB_CCC -> AAA.BBB.CCC
value_key = env_key[7:].replace('_', '.').lower()
env_value = os.getenv(env_key)
override = value_key + '=' + env_value
env_set_overrides.append(override)
print(" Found: " + env_key)

if len(env_set_overrides) > 0:
print("=== Total environment overrides: " + str(len(env_set_overrides)) + " ===")
else:
print("=== No CORTEX_ environment variables found ===")

load('ext://helm_resource', 'helm_resource', 'helm_repo')
helm_repo(
'Prometheus Community Helm Repo',
Expand Down Expand Up @@ -131,7 +152,7 @@ k8s_yaml(helm('./helm/bundles/cortex-crds', name='cortex-crds', set=crd_extra_va

if 'nova' in ACTIVE_DEPLOYMENTS:
print("Activating Cortex Nova bundle")
k8s_yaml(helm('./helm/bundles/cortex-nova', name='cortex-nova', values=tilt_values))
k8s_yaml(helm('./helm/bundles/cortex-nova', name='cortex-nova', values=tilt_values, set=env_set_overrides))
k8s_resource('cortex-nova-postgresql', labels=['Cortex-Nova'], port_forwards=[
port_forward(8000, 5432),
])
Expand All @@ -149,7 +170,7 @@ if 'nova' in ACTIVE_DEPLOYMENTS:

if 'manila' in ACTIVE_DEPLOYMENTS:
print("Activating Cortex Manila bundle")
k8s_yaml(helm('./helm/bundles/cortex-manila', name='cortex-manila', values=tilt_values))
k8s_yaml(helm('./helm/bundles/cortex-manila', name='cortex-manila', values=tilt_values, set=env_set_overrides))
k8s_resource('cortex-manila-postgresql', labels=['Cortex-Manila'], port_forwards=[
port_forward(8002, 5432),
])
Expand All @@ -166,7 +187,7 @@ if 'manila' in ACTIVE_DEPLOYMENTS:
)

if 'cinder' in ACTIVE_DEPLOYMENTS:
k8s_yaml(helm('./helm/bundles/cortex-cinder', name='cortex-cinder', values=tilt_values))
k8s_yaml(helm('./helm/bundles/cortex-cinder', name='cortex-cinder', values=tilt_values, set=env_set_overrides))
k8s_resource('cortex-cinder-postgresql', labels=['Cortex-Cinder'], port_forwards=[
port_forward(8004, 5432),
])
Expand All @@ -189,7 +210,7 @@ if 'ironcore' in ACTIVE_DEPLOYMENTS:
k8s_yaml('samples/ironcore/crds/compute.ironcore.dev_machinepools.yaml')
k8s_yaml('samples/ironcore/crds/compute.ironcore.dev_machineclasses.yaml')
# Deploy IronCore controller
k8s_yaml(helm('./helm/bundles/cortex-ironcore', name='cortex-ironcore', values=tilt_values))
k8s_yaml(helm('./helm/bundles/cortex-ironcore', name='cortex-ironcore', values=tilt_values, set=env_set_overrides))
k8s_resource('cortex-ironcore-controller-manager', labels=['Cortex-IronCore'])
# Deploy resources in machines/samples
k8s_yaml('samples/ironcore/machinepool.yaml')
Expand All @@ -198,7 +219,7 @@ if 'ironcore' in ACTIVE_DEPLOYMENTS:

if 'pods' in ACTIVE_DEPLOYMENTS:
print("Activating Cortex Pods bundle")
k8s_yaml(helm('./helm/bundles/cortex-pods', name='cortex-pods', values=tilt_values),)
k8s_yaml(helm('./helm/bundles/cortex-pods', name='cortex-pods', values=tilt_values, set=env_set_overrides))
k8s_resource('cortex-pods-controller-manager', labels=['Cortex-Pods'])
# Deploy example resources
k8s_yaml('samples/pods/node.yaml')
Expand Down Expand Up @@ -239,4 +260,4 @@ k8s_resource('cortex-plutono', port_forwards=[
port_forward(5000, 3000, name='plutono'),
], links=[
link('http://localhost:5000/d/cortex/cortex?orgId=1', 'cortex dashboard'),
], labels=['Monitoring'])
], labels=['Monitoring'])
79 changes: 0 additions & 79 deletions api/delegation/nova/messages_test.go

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package ironcore
import (
"log/slog"

ironcorev1alpha1 "github.com/cobaltcore-dev/cortex/api/delegation/ironcore/v1alpha1"
ironcorev1alpha1 "github.com/cobaltcore-dev/cortex/api/external/ironcore/v1alpha1"
"github.com/cobaltcore-dev/cortex/internal/scheduling/lib"
)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"errors"
"fmt"
"log/slog"
"strings"

"github.com/cobaltcore-dev/cortex/internal/scheduling/lib"
)
Expand All @@ -33,15 +34,6 @@ type ExternalSchedulerRequest struct {
// Whether the request is a reservation.
Reservation bool `json:"reservation"`

// Whether the Nova scheduling request is a rebuild request.
Rebuild bool `json:"rebuild"`
// Whether the Nova scheduling request is a resize request.
Resize bool `json:"resize"`
// Whether the Nova scheduling request is a live migration.
Live bool `json:"live"`
// Whether the affected VM is a VMware VM.
VMware bool `json:"vmware"`

Hosts []ExternalSchedulerHost `json:"hosts"`
Weights map[string]float64 `json:"weights"`

Expand Down Expand Up @@ -82,6 +74,74 @@ func (r ExternalSchedulerRequest) FilterHosts(includedHosts map[string]float64)
return r
}

type HypervisorType string

const (
// HypervisorTypeQEMU represents QEMU/KVM hypervisors.
HypervisorTypeQEMU HypervisorType = "qemu"
// HypervisorTypeCH represents Cloud-Hypervisor/KVM hypervisors.
HypervisorTypeCH HypervisorType = "ch"
// HypervisorTypeVMware represents VMware hypervisors.
HypervisorTypeVMware HypervisorType = "vmware"
)

// GetHypervisorType determines the hypervisor type based on the requested flavor.
func (req ExternalSchedulerRequest) GetHypervisorType() (HypervisorType, error) {
extraSpecs := req.Spec.Data.Flavor.Data.ExtraSpecs
if val, ok := extraSpecs["capabilities:hypervisor_type"]; ok {
switch strings.ToLower(val) {
case "qemu":
return HypervisorTypeQEMU, nil
case "ch":
return HypervisorTypeCH, nil
case "vmware vcenter server":
return HypervisorTypeVMware, nil
}
return "", fmt.Errorf("unsupported hypervisor_type: %s", val)
}
return "", errors.New("hypervisor type not specified in flavor extra specs")
}

type RequestIntent string

const (
// LiveMigrationIntent indicates that the request is intended for live migration.
LiveMigrationIntent RequestIntent = "live_migration"
// RebuildIntent indicates that the request is intended for rebuilding a VM.
RebuildIntent RequestIntent = "rebuild"
// ResizeIntent indicates that the request is intended for resizing a VM.
ResizeIntent RequestIntent = "resize"
// EvacuateIntent indicates that the request is intended for evacuating a VM.
EvacuateIntent RequestIntent = "evacuate"
// CreateIntent indicates that the request is intended for creating a new VM.
CreateIntent RequestIntent = "create"
)

// GetIntent analyzes the request spec and determines the intent of the scheduling request.
func (req ExternalSchedulerRequest) GetIntent() (RequestIntent, error) {
str, err := req.Spec.Data.GetSchedulerHintStr("_nova_check_type")
if err != nil {
return "", err
}
switch str {
// See: https://github.com/sapcc/nova/blob/ba4813/nova/scheduler/utils.py#L1251
case "rebuild":
return RebuildIntent, nil
// See: https://github.com/sapcc/nova/blob/ba4813/nova/scheduler/utils.py#L1264
case "resize":
return ResizeIntent, nil
// See: https://github.com/sapcc/nova/blob/ba4813/nova/scheduler/utils.py#L1277C47-L1277C63
case "live_migrate":
return LiveMigrationIntent, nil
// Added in https://github.com/sapcc/nova/pull/594
// See: https://github.com/sapcc/nova/blob/c88393/nova/compute/api.py#L5770
case "evacuate":
return EvacuateIntent, nil
default:
return CreateIntent, nil
}
}

// Response generated by cortex for the Nova scheduler.
// Cortex returns an ordered list of hosts that the VM should be scheduled on.
type ExternalSchedulerResponse struct {
Expand Down
Loading