Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
e731686
Init scaffold computedecision
PhilippMatthes Sep 25, 2025
8f710b6
Remove duplicated
PhilippMatthes Sep 25, 2025
0692cd8
Rename to schedulingdecision
PhilippMatthes Sep 25, 2025
824fae1
Add test for reconciler
PhilippMatthes Sep 25, 2025
e4110a2
Explicitly init map
PhilippMatthes Sep 25, 2025
41fcd9e
Print description directly
PhilippMatthes Sep 25, 2025
9352171
Add state and optional error to spec
PhilippMatthes Sep 25, 2025
05c740e
Rename computedecision -> schedulingdecision
PhilippMatthes Sep 25, 2025
3b3ab1e
Also rename rbac files
PhilippMatthes Sep 25, 2025
242ac6f
Check there is at least one host in the input
Sep 25, 2025
ec3230b
Check that all hosts in output exist
Sep 25, 2025
941f700
Rename weights in spec to activations
PhilippMatthes Sep 25, 2025
bc78361
Merge branch 'main' into hackathon
SoWieMarkus Sep 25, 2025
ac96971
Merge branch 'main' into hackathon
SoWieMarkus Sep 25, 2025
b65e394
Get final actions of each host
Sep 25, 2025
858197f
Update ClusterRoleBinding names for computereservation and scheduling…
SoWieMarkus Sep 25, 2025
8525025
Simple description added in crd status
Sep 25, 2025
109b448
Integrate with scheduler
PhilippMatthes Sep 25, 2025
169ee99
Compare Cortex decision with input decision
Sep 25, 2025
9e24454
Role fix + add operator to tiltfile + e2e test fix
PhilippMatthes Sep 25, 2025
dd075a3
Add importance of steps
Sep 25, 2025
1d9f808
Cleanup & better make & add printercolumn for creation timestamp
PhilippMatthes Sep 25, 2025
0db0dc1
Fix reservations operator and hopefully delete last stale yaml
PhilippMatthes Sep 25, 2025
d32ec8e
Add description printer column
PhilippMatthes Sep 25, 2025
1c1406c
Update step impact
Sep 25, 2025
2cffc96
Don't reconcile in terminal states
PhilippMatthes Sep 25, 2025
884381f
Add scheduling decisions endpoint to cortex nova scheduler
SoWieMarkus Sep 25, 2025
bb411c9
Fix reconcile loop
Sep 26, 2025
abbc95c
Enhance scheduling decision functionality with new Flavor type and up…
SoWieMarkus Sep 26, 2025
7d4d547
Remove promotional "Hire me" text from scheduling decisions page
SoWieMarkus Sep 26, 2025
3585149
Refactor SchedulingDecision CRD: update property names for consistenc…
SoWieMarkus Sep 26, 2025
c0b3b3a
Use schedulingdecision consumer
PhilippMatthes Sep 26, 2025
4ec4f02
Fill in data in spec
PhilippMatthes Sep 26, 2025
e7c1b7f
final final polish
SoWieMarkus Sep 26, 2025
f694f2a
Refactor string ops
mblos Sep 26, 2025
ab854ef
Refactoring
mblos Sep 26, 2025
84a233c
Multiple scheduling decisions in CRD
mblos Sep 29, 2025
451620c
Cortex appends scheduling decision
mblos Sep 30, 2025
742a5d3
Merge branch 'main' into hackathon
mblos Oct 2, 2025
156b158
feat: ttl removal of old crds; adding global description if >1 decision
mblos Oct 6, 2025
d196b3d
fixing resolve; analysis
mblos Oct 6, 2025
8db6062
.
mblos Oct 6, 2025
e53bcab
refactor
mblos Oct 6, 2025
9eaaad6
Merge branch 'main' into hackathon
mblos Oct 6, 2025
3c50988
default changed
mblos Oct 6, 2025
010c03c
more generic flavor
mblos Oct 6, 2025
e217303
refactor
mblos Oct 6, 2025
dc28f3f
logs
mblos Oct 6, 2025
f38f9d5
github workflow
mblos Oct 7, 2025
5ceebd3
tests
mblos Oct 7, 2025
126b72e
config naming
mblos Oct 7, 2025
f7465f5
fix config
mblos Oct 7, 2025
bf70302
reconcile issue
mblos Oct 7, 2025
cc3be3a
reconcile issue
mblos Oct 7, 2025
2fd6e8c
adding ttl on startup
mblos Oct 7, 2025
6c7826d
fix id
mblos Oct 7, 2025
1cce015
always print global summary
mblos Oct 7, 2025
77c916b
Update MQTT scheduling decision fetch URL and add logging for debugging
SoWieMarkus Oct 7, 2025
255f62e
Adjust visualizer to use new kubebuilder api
SoWieMarkus Oct 8, 2025
ec6d1e0
Fix CSS style syntax in weight display for proper rendering
SoWieMarkus Oct 8, 2025
a3a0fdf
fix request id
mblos Oct 8, 2025
a7e1bf9
test added
mblos Oct 8, 2025
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
18 changes: 18 additions & 0 deletions .github/workflows/push-charts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,21 @@ jobs:
CHART_PACKAGE=$(ls $CHART_DIR/*.tgz)
helm push $CHART_PACKAGE oci://${{ env.REGISTRY }}/${{ github.repository }}/charts/
done
- name: Get all changed decisions Chart.yaml files
id: changed-chart-yaml-files-decisions
uses: tj-actions/changed-files@v47
with:
files: |
decisions/dist/chart/Chart.yaml
- name: Push decisions charts to registry
if: steps.changed-chart-yaml-files-decisions.outputs.all_changed_files != ''
shell: bash
env:
ALL_CHANGED_FILES: ${{ steps.changed-chart-yaml-files-decisions.outputs.all_changed_files }}
run: |
for CHART_FILE in ${ALL_CHANGED_FILES}; do
CHART_DIR=$(dirname $CHART_FILE)
helm package $CHART_DIR --dependency-update --destination $CHART_DIR
CHART_PACKAGE=$(ls $CHART_DIR/*.tgz)
helm push $CHART_PACKAGE oci://${{ env.REGISTRY }}/${{ github.repository }}/charts/
done
41 changes: 41 additions & 0 deletions .github/workflows/push-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,44 @@ jobs:
subject-name: ${{ env.REGISTRY }}/${{ github.repository }}-reservations-operator
subject-digest: ${{ steps.push_cortex_reservations.outputs.digest }}
push-to-registry: true
# Only build and push the decisions operator image if there are changes
# in the decisions directory.
- name: Get all changed decisions/ files
id: changed_decisions_files
uses: tj-actions/changed-files@v47
with:
files: |
decisions/**
- name: Docker Meta (Cortex Decisions)
if: steps.changed_decisions_files.outputs.all_changed_files != ''
id: meta_cortex_decisions
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}-decisions-operator
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
latest
- name: Build and Push Cortex Decisions Operator
if: steps.changed_decisions_files.outputs.all_changed_files != ''
id: push_cortex_decisions
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.kubebuilder
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta_cortex_decisions.outputs.tags }}
labels: ${{ steps.meta_cortex_decisions.outputs.labels }}
build-args: |
GO_MOD_PATH=decisions
GIT_TAG=${{ github.ref_name }}
GIT_COMMIT=${{ github.sha }}
- name: Generate Artifact Attestation for Cortex Decisions
if: steps.changed_decisions_files.outputs.all_changed_files != ''
uses: actions/attest-build-provenance@v3
with:
subject-name: ${{ env.REGISTRY }}/${{ github.repository }}-decisions-operator
subject-digest: ${{ steps.push_cortex_decisions.outputs.digest }}
push-to-registry: true
34 changes: 34 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
go test -v ./...
echo "Testing reservations module..."
cd reservations && go test -v ./...
echo "Testing decisions module..."
cd ../decisions && go test -v ./...

test-with-docker:
# We don't need to run this longer test if the previous one already failed.
Expand Down Expand Up @@ -61,13 +63,22 @@ jobs:
-coverprofile=reservations_profile.cov ./internal/...
go tool cover -func reservations_profile.cov > reservations_func_coverage.txt
cd ..

echo "Running tests for decisions module..."
cd decisions
go test -v \
-coverpkg=./internal/... \
-coverprofile=decisions_profile.cov ./internal/...
go tool cover -func decisions_profile.cov > decisions_func_coverage.txt
cd ..
- name: Upload coverage files
uses: actions/upload-artifact@v4
with:
name: pr-func-coverage
path: |
pr_func_coverage.txt
reservations/reservations_func_coverage.txt
decisions/decisions_func_coverage.txt
# Steps below are only executed if the workflow is triggered by a pull request
- name: Delete old coverage comments (PR only)
if: ${{ github.event_name == 'pull_request' }}
Expand Down Expand Up @@ -123,6 +134,19 @@ jobs:
reservationsCoverageReport = 'No coverage data available';
}

// Read decisions module coverage report
let decisionsCoverageReport = '';
let decisionsCoveragePercentage = 'unknown';
try {
decisionsCoverageReport = fs.readFileSync('decisions/decisions_func_coverage.txt', 'utf8');
const decisionsLines = decisionsCoverageReport.trim().split('\n');
const decisionsLastLine = decisionsLines[decisionsLines.length - 1];
const decisionsCoverageMatch = decisionsLastLine.match(/total:\s+\(statements\)\s+(\d+\.\d+)%/);
decisionsCoveragePercentage = decisionsCoverageMatch ? decisionsCoverageMatch[1] : 'unknown';
} catch (error) {
decisionsCoverageReport = 'No coverage data available';
}

let commentBody = '<!-- coverage-comment -->\n';
commentBody += '## Test Coverage Report\n\n';

Expand All @@ -144,6 +168,16 @@ jobs:
commentBody += '```text\n';
commentBody += reservationsCoverageReport;
commentBody += '```\n';
commentBody += '</details>\n\n';

// Decisions module coverage
commentBody += '<details>\n';
commentBody += '<summary>Coverage in decisions module (decisions/internal/): ';
commentBody += decisionsCoveragePercentage;
commentBody += '%</summary>\n\n';
commentBody += '```text\n';
commentBody += decisionsCoverageReport;
commentBody += '```\n';
commentBody += '</details>\n';

// Post the comment
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/update-appversion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ jobs:
files: |
postgres/**

- name: Get all changed decisions/ files
id: changed_decisions_files
uses: tj-actions/changed-files@v47
with:
files: |
decisions/**

# Always bumped
- name: Update appVersion in cortex-core Chart.yaml
run: |
Expand Down Expand Up @@ -69,3 +76,17 @@ jobs:
git add reservations/dist/chart/Chart.yaml
git commit -m "Bump cortex-reservations chart appVersions to ${{ steps.vars.outputs.sha }} [skip ci]" || echo "No changes to commit"
git push origin HEAD:main

# Only bumped if there are changes in the decisions directory.
- name: Update appVersion in cortex-decisions Chart.yaml
if: steps.changed_decisions_files.outputs.all_changed_files != ''
run: |
sed -i 's/^\([ ]*appVersion:[ ]*\).*/\1"${{ steps.vars.outputs.sha }}"/' decisions/dist/chart/Chart.yaml
- name: Commit and push changes for cortex-decisions
if: steps.changed_decisions_files.outputs.all_changed_files != ''
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add decisions/dist/chart/Chart.yaml
git commit -m "Bump cortex-decisions chart appVersions to ${{ steps.vars.outputs.sha }} [skip ci]" || echo "No changes to commit"
git push origin HEAD:main
13 changes: 12 additions & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,22 @@ def kubebuilder_binary_files(path):
docker_build('ghcr.io/cobaltcore-dev/cortex-reservations-operator', '.',
dockerfile='Dockerfile.kubebuilder',
build_args={'GO_MOD_PATH': 'reservations'},
only=kubebuilder_binary_files('reservations') + ['internal/', 'go.mod', 'go.sum'],
only=kubebuilder_binary_files('reservations') + ['internal/', 'decisions/', 'go.mod', 'go.sum'],
)
local('sh helm/sync.sh reservations/dist/chart')
k8s_yaml(helm('reservations/dist/chart', name='cortex-reservations', values=[tilt_values]))
k8s_resource('reservations-controller-manager', labels=['Reservations'])

########### Decisions Operator & CRDs
docker_build('ghcr.io/cobaltcore-dev/cortex-decisions-operator', '.',
dockerfile='Dockerfile.kubebuilder',
build_args={'GO_MOD_PATH': 'decisions'},
only=kubebuilder_binary_files('decisions') + ['internal/', 'go.mod', 'go.sum'],
)
local('sh helm/sync.sh decisions/dist/chart')
k8s_yaml(helm('decisions/dist/chart', name='cortex-decisions', values=[tilt_values]))
k8s_resource('decisions-controller-manager', labels=['Decisions'])

########### Dev Dependencies
local('sh helm/sync.sh helm/dev/cortex-prometheus-operator')
k8s_yaml(helm('./helm/dev/cortex-prometheus-operator', name='cortex-prometheus-operator')) # Operator
Expand Down Expand Up @@ -82,6 +92,7 @@ k8s_resource('cortex-plutono', port_forwards=[
docker_build('ghcr.io/cobaltcore-dev/cortex', '.', only=[
'internal/', 'commands/', 'main.go', 'go.mod', 'go.sum', 'Makefile',
'reservations/api/', # API module of the reservations operator needed for the scheduler.
'decisions/api/', # API module of the decisions operator needed for the scheduler.
])
docker_build('ghcr.io/cobaltcore-dev/cortex-postgres', 'postgres')

Expand Down
1 change: 1 addition & 0 deletions commands/checks/nova/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ func randomRequest(dc datacenter, seed int) api.ExternalSchedulerRequest {
slog.Info("using flavor extra specs", "extraSpecs", extraSpecs)
request := api.ExternalSchedulerRequest{
Spec: api.NovaObject[api.NovaSpec]{Data: api.NovaSpec{
InstanceUUID: "cortex-e2e-tests",
AvailabilityZone: az,
ProjectID: project.ID,
Flavor: api.NovaObject[api.NovaFlavor]{Data: api.NovaFlavor{
Expand Down
Loading
Loading