Skip to content

Commit 24e5a69

Browse files
committed
feat(dataplane): add service dep graph and leveled execution
- 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 Signed-off-by: rabi <ramishra@redhat.com>
1 parent e22415e commit 24e5a69

35 files changed

Lines changed: 844 additions & 176 deletions

File tree

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/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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22175,6 +22175,13 @@ spec:
2217522175
x-kubernetes-map-type: atomic
2217622176
type: object
2217722177
type: array
22178+
dependsOn:
22179+
description: |-
22180+
DependsOn lists EDPMServiceType or CR names that must complete before
22181+
this service runs; if empty, the list predecessor is used instead.
22182+
items:
22183+
type: string
22184+
type: array
2217822185
deployOnAllNodeSets:
2217922186
description: |-
2218022187
DeployOnAllNodeSets - should the service be deploy across all nodesets

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

config/services/dataplane_v1beta1_openstackdataplaneservice_configure_os.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_os
77
edpmServiceType: configure-os
8+
dependsOn:
9+
- install-os

config/services/dataplane_v1beta1_openstackdataplaneservice_download_cache.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.download_cache
77
edpmServiceType: download-cache
8+
dependsOn:
9+
- redhat

config/services/dataplane_v1beta1_openstackdataplaneservice_frr.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ metadata:
44
name: frr
55
spec:
66
playbook: osp.edpm.frr
7+
dependsOn:
8+
- run-os
9+
- validate-network
710
containerImageFields:
811
- EdpmFrrImage
912
edpmServiceType: frr

0 commit comments

Comments
 (0)