Skip to content
Open
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
8 changes: 8 additions & 0 deletions components/kueue/development/tekton-kueue/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ cel:

# Set resource requests for multi platform pipelines which doesn't use the build-platforms parameter (old style)
- |
!(
has(pipelineRun.spec.params) &&
pipelineRun.spec.params.exists(p, p.name == 'build-platforms')
) &&
has(pipelineRun.spec.pipelineSpec) &&
has(pipelineRun.spec.pipelineSpec.tasks) &&
pipelineRun.spec.pipelineSpec.tasks.size() > 0 ?
Expand All @@ -53,6 +57,10 @@ cel:

# Request AWS IP for AWS-based platforms which doesn't use the build-platforms parameter (old style)
- |
!(
has(pipelineRun.spec.params) &&
pipelineRun.spec.params.exists(p, p.name == 'build-platforms')
) &&
has(pipelineRun.spec.pipelineSpec) &&
has(pipelineRun.spec.pipelineSpec.tasks) &&
pipelineRun.spec.pipelineSpec.tasks.size() > 0 ?
Expand Down
8 changes: 8 additions & 0 deletions components/kueue/staging/base/tekton-kueue/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ cel:

# Set resource requests for multi platform pipelines which doesn't use the build-platforms parameter (old style)
- |
!(
has(pipelineRun.spec.params) &&
pipelineRun.spec.params.exists(p, p.name == 'build-platforms')
) &&
has(pipelineRun.spec.pipelineSpec) &&
has(pipelineRun.spec.pipelineSpec.tasks) &&
pipelineRun.spec.pipelineSpec.tasks.size() > 0 ?
Expand All @@ -53,6 +57,10 @@ cel:

# Request AWS IP for AWS-based platforms which doesn't use the build-platforms parameter (old style)
- |
!(
has(pipelineRun.spec.params) &&
pipelineRun.spec.params.exists(p, p.name == 'build-platforms')
) &&
has(pipelineRun.spec.pipelineSpec) &&
has(pipelineRun.spec.pipelineSpec.tasks) &&
pipelineRun.spec.pipelineSpec.tasks.size() > 0 ?
Expand Down
67 changes: 67 additions & 0 deletions hack/test-tekton-kueue-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,65 @@ def check_prerequisites(should_print: bool = True) -> Dict[str, TestConfig]:
}
},

"prefer-new-parameters": {
"name": "Only use new platform parameters when both old and new parameters exist",
"pipelinerun": {
"apiVersion": "tekton.dev/v1",
"kind": "PipelineRun",
"metadata": {
"name": "prefer-new-platform-parameters",
"namespace": "default",
"labels": {
"pipelinesascode.tekton.dev/event-type": "push",
}
},
"spec": {
"pipelineRef": {"name": "build-pipeline"},
"params": [
{
"name": "build-platforms",
"value": ["linux/amd64", "linux/arm64", "linux/s390x"]
},
{
"name": "other-param",
"value": "test"
}
],
"pipelineSpec": {
"tasks": [
{
"name": "build-task-amd64",
"params": [{"name": "PLATFORM", "value": "linux/amd64"}],
"taskRef": {"name": "build-task"}
},
{
"name": "build-task-arm64",
"params": [{"name": "PLATFORM", "value": "linux/arm64"}],
"taskRef": {"name": "build-task"}
},
{
"name": "other-task",
"taskRef": {"name": "other-task"}
}
]
},
"workspaces": [{"name": "shared-workspace", "emptyDir": {}}]
}
},
"expected": {
"annotations": {
"kueue.konflux-ci.dev/requests-linux-amd64": "1",
"kueue.konflux-ci.dev/requests-linux-s390x": "1",
"kueue.konflux-ci.dev/requests-linux-arm64": "1",
"kueue.konflux-ci.dev/requests-aws-ip": "2",
},
"labels": {
"kueue.x-k8s.io/queue-name": "pipelines-queue",
"kueue.x-k8s.io/priority-class": "konflux-post-merge-build",
}
}
},

}

# Configuration combinations that can be applied to any PipelineRun
Expand Down Expand Up @@ -658,6 +717,10 @@ def check_prerequisites(should_print: bool = True) -> Dict[str, TestConfig]:
"pipelinerun_key": "mixed_platforms_excluded_included",
"config_key": "development"
},
"prefer_new_parameters_dev": {
"pipelinerun_key": "prefer-new-parameters",
"config_key": "development"
},

# multiplatform_old edge cases
"multiplatform_old_no_pipelineSpecTasks": {
Expand All @@ -682,6 +745,10 @@ def check_prerequisites(should_print: bool = True) -> Dict[str, TestConfig]:
"pipelinerun_key": "integration_test_push",
"config_key": "staging"
},
"prefer_new_parameters_staging": {
"pipelinerun_key": "prefer-new-parameters",
"config_key": "staging"
},

# Test key PipelineRuns with production config
"multiplatform_new_production": {
Expand Down
Loading