Skip to content

Commit 755d932

Browse files
committed
Add service dep graph, leveled execution with useParallelExecution flag
- dependsOn on services; deployment plan is a topological sort into levels that run concurrently - services without dependsOn depend on their list predecessor, so existing deployments keep serial order - unresolvable dependsOn refs are skipped with a log message - build per-service AnsibleEE spec only at job start; split Deploy into startLevel/isLevelReady - useParallelExecution flag on deployment CR (default false); when not set, dep graph is not built, services run sequentially in list order and a warning is logged that dependsOn is ignored - fail fast on missing service CRs: dedupe now returns MissingServiceError instead of logging and continuing, so a misconfigured service blocks the deployment early with per-service and nodeset conditions set, instead of failing at job start Signed-off-by: rabi <ramishra@redhat.com>
1 parent e22415e commit 755d932

40 files changed

Lines changed: 1112 additions & 174 deletions

File tree

‎api/bases/dataplane.openstack.org_openstackdataplanedeployments.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,17 @@ spec:
116116
items:
117117
type: string
118118
type: array
119+
useParallelExecution:
120+
default: false
121+
description: |-
122+
UseParallelExecution enables parallel execution of services based on
123+
their dependsOn dependencies. When not set (default), services run
124+
sequentially in list order and service dependencies are ignored.
125+
type: boolean
119126
required:
120127
- deploymentRequeueTime
121128
- nodeSets
129+
- useParallelExecution
122130
type: object
123131
status:
124132
description: OpenStackDataPlaneDeploymentStatus defines the observed state

‎api/bases/dataplane.openstack.org_openstackdataplaneservices.yaml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ spec:
116116
x-kubernetes-map-type: atomic
117117
type: object
118118
type: array
119+
dependsOn:
120+
description: |-
121+
DependsOn lists EDPMServiceType or CR names that must complete before
122+
this service runs; if empty, the list predecessor is used instead.
123+
items:
124+
type: string
125+
type: array
119126
deployOnAllNodeSets:
120127
description: |-
121128
DeployOnAllNodeSets - should the service be deploy across all nodesets

‎api/dataplane/v1beta1/openstackdataplanedeployment_types.go‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ type OpenStackDataPlaneDeploymentSpec struct {
7272
// AnsibleJobNodeSelector to target subset of worker nodes running the ansible jobs
7373
AnsibleJobNodeSelector map[string]string `json:"ansibleJobNodeSelector,omitempty"`
7474

75+
// UseParallelExecution enables parallel execution of services based on
76+
// their dependsOn dependencies. When not set (default), services run
77+
// sequentially in list order and service dependencies are ignored.
78+
// +kubebuilder:default:=false
79+
UseParallelExecution bool `json:"useParallelExecution"`
80+
7581
// +kubebuilder:validation:MaxLength:=253
7682
// +kubebuilder:default="openstack-aee-default-env"
7783
// AnsibleEEEnvConfigMapName is the name of the ConfigMap containing environment

‎api/dataplane/v1beta1/openstackdataplaneservice_types.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ type OpenStackDataPlaneServiceSpec struct {
117117
// to manage the service. If not set, will default to the
118118
// OpenStackDataPlaneService name.
119119
EDPMServiceType string `json:"edpmServiceType,omitempty" yaml:"edpmServiceType,omitempty"`
120+
121+
// DependsOn lists EDPMServiceType or CR names that must complete before
122+
// this service runs; if empty, the list predecessor is used instead.
123+
// +kubebuilder:validation:Optional
124+
DependsOn []string `json:"dependsOn,omitempty" yaml:"dependsOn,omitempty"`
120125
}
121126

122127
// OpenStackDataPlaneServiceStatus defines the observed state of OpenStackDataPlaneService

‎api/dataplane/v1beta1/zz_generated.deepcopy.go‎

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎bindata/crds/crds.yaml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20227,9 +20227,17 @@ spec:
2022720227
items:
2022820228
type: string
2022920229
type: array
20230+
useParallelExecution:
20231+
default: false
20232+
description: |-
20233+
UseParallelExecution enables parallel execution of services based on
20234+
their dependsOn dependencies. When not set (default), services run
20235+
sequentially in list order and service dependencies are ignored.
20236+
type: boolean
2023020237
required:
2023120238
- deploymentRequeueTime
2023220239
- nodeSets
20240+
- useParallelExecution
2023320241
type: object
2023420242
status:
2023520243
description: OpenStackDataPlaneDeploymentStatus defines the observed state
@@ -22175,6 +22183,13 @@ spec:
2217522183
x-kubernetes-map-type: atomic
2217622184
type: object
2217722185
type: array
22186+
dependsOn:
22187+
description: |-
22188+
DependsOn lists EDPMServiceType or CR names that must complete before
22189+
this service runs; if empty, the list predecessor is used instead.
22190+
items:
22191+
type: string
22192+
type: array
2217822193
deployOnAllNodeSets:
2217922194
description: |-
2218022195
DeployOnAllNodeSets - should the service be deploy across all nodesets

‎config/crd/bases/dataplane.openstack.org_openstackdataplanedeployments.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,17 @@ spec:
116116
items:
117117
type: string
118118
type: array
119+
useParallelExecution:
120+
default: false
121+
description: |-
122+
UseParallelExecution enables parallel execution of services based on
123+
their dependsOn dependencies. When not set (default), services run
124+
sequentially in list order and service dependencies are ignored.
125+
type: boolean
119126
required:
120127
- deploymentRequeueTime
121128
- nodeSets
129+
- useParallelExecution
122130
type: object
123131
status:
124132
description: OpenStackDataPlaneDeploymentStatus defines the observed state

‎config/crd/bases/dataplane.openstack.org_openstackdataplaneservices.yaml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ spec:
116116
x-kubernetes-map-type: atomic
117117
type: object
118118
type: array
119+
dependsOn:
120+
description: |-
121+
DependsOn lists EDPMServiceType or CR names that must complete before
122+
this service runs; if empty, the list predecessor is used instead.
123+
items:
124+
type: string
125+
type: array
119126
deployOnAllNodeSets:
120127
description: |-
121128
DeployOnAllNodeSets - should the service be deploy across all nodesets

‎config/services/dataplane_v1beta1_openstackdataplaneservice_bootstrap.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ spec:
66
playbook: osp.edpm.bootstrap
77
edpmServiceType: bootstrap
88
caCerts: combined-ca-bundle
9+
dependsOn:
10+
- redhat
11+
- download-cache

‎config/services/dataplane_v1beta1_openstackdataplaneservice_configure_network.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ metadata:
55
spec:
66
playbook: osp.edpm.configure_network
77
edpmServiceType: configure-network
8+
dependsOn:
9+
- bootstrap

0 commit comments

Comments
 (0)