Skip to content

Commit d2bce4e

Browse files
committed
WIP Add dataplane service dependency graph and fallback ordering
Introduce dependsOn on services and fallbackToListOrder (*bool, default true) on deployments. Services are topologically sorted into execution levels. Explicit dependsOn stays authoritative, while services without dependsOn can temporarily fall back to list predecessor order. Change-Id: I3bdeb6e51dbba7dda14f2c7a60a496cc3df85260 Signed-off-by: rabi <ramishra@redhat.com>
1 parent c31bbb1 commit d2bce4e

39 files changed

Lines changed: 715 additions & 157 deletions

File tree

api/bases/dataplane.openstack.org_openstackdataplanedeployments.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ spec:
9696
description: Time before the deployment is requeued in seconds
9797
minimum: 1
9898
type: integer
99+
fallbackToListOrder:
100+
default: true
101+
description: |-
102+
FallbackToListOrder preserves service list order for services
103+
without explicit dependsOn. Defaults to true.
104+
type: boolean
99105
nodeSets:
100106
description: NodeSets is the list of NodeSets deployed
101107
items:

api/bases/dataplane.openstack.org_openstackdataplaneservices.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ spec:
116116
x-kubernetes-map-type: atomic
117117
type: object
118118
type: array
119+
dependsOn:
120+
description: |-
121+
DependsOn is a list of EDPMServiceType or CR name values that must
122+
complete before this service runs. If empty, the service depends on
123+
the preceding entry in the NodeSet service list.
124+
items:
125+
type: string
126+
type: array
119127
deployOnAllNodeSets:
120128
description: |-
121129
DeployOnAllNodeSets - should the service be deploy across all nodesets

api/dataplane/v1beta1/openstackdataplanedeployment_types.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ type OpenStackDataPlaneDeploymentSpec struct {
7878
// variables to inject into the Ansible Execution Environment pod.
7979
// If not specified, defaults to "openstack-aee-default-env".
8080
AnsibleEEEnvConfigMapName string `json:"ansibleEEEnvConfigMapName,omitempty"`
81+
82+
// FallbackToListOrder preserves service list order for services
83+
// without explicit dependsOn. Defaults to true.
84+
// +kubebuilder:validation:Optional
85+
// +kubebuilder:default=true
86+
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
87+
FallbackToListOrder *bool `json:"fallbackToListOrder"`
8188
}
8289

8390
// AnsibleExecutionSummary captures the final ansible-runner execution result

api/dataplane/v1beta1/openstackdataplaneservice_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ 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 is a list of EDPMServiceType or CR name values that must
122+
// complete before this service runs. If empty, the service depends on
123+
// the preceding entry in the NodeSet service list.
124+
// +kubebuilder:validation:Optional
125+
DependsOn []string `json:"dependsOn,omitempty" yaml:"dependsOn,omitempty"`
120126
}
121127

122128
// OpenStackDataPlaneServiceStatus defines the observed state of OpenStackDataPlaneService

api/dataplane/v1beta1/zz_generated.deepcopy.go

Lines changed: 10 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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19035,6 +19035,12 @@ spec:
1903519035
description: Time before the deployment is requeued in seconds
1903619036
minimum: 1
1903719037
type: integer
19038+
fallbackToListOrder:
19039+
default: true
19040+
description: |-
19041+
FallbackToListOrder preserves service list order for services
19042+
without explicit dependsOn. Defaults to true.
19043+
type: boolean
1903819044
nodeSets:
1903919045
description: NodeSets is the list of NodeSets deployed
1904019046
items:
@@ -21399,6 +21405,14 @@ spec:
2139921405
x-kubernetes-map-type: atomic
2140021406
type: object
2140121407
type: array
21408+
dependsOn:
21409+
description: |-
21410+
DependsOn is a list of EDPMServiceType or CR name values that must
21411+
complete before this service runs. If empty, the service depends on
21412+
the preceding entry in the NodeSet service list.
21413+
items:
21414+
type: string
21415+
type: array
2140221416
deployOnAllNodeSets:
2140321417
description: |-
2140421418
DeployOnAllNodeSets - should the service be deploy across all nodesets

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ spec:
9696
description: Time before the deployment is requeued in seconds
9797
minimum: 1
9898
type: integer
99+
fallbackToListOrder:
100+
default: true
101+
description: |-
102+
FallbackToListOrder preserves service list order for services
103+
without explicit dependsOn. Defaults to true.
104+
type: boolean
99105
nodeSets:
100106
description: NodeSets is the list of NodeSets deployed
101107
items:

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ spec:
116116
x-kubernetes-map-type: atomic
117117
type: object
118118
type: array
119+
dependsOn:
120+
description: |-
121+
DependsOn is a list of EDPMServiceType or CR name values that must
122+
complete before this service runs. If empty, the service depends on
123+
the preceding entry in the NodeSet service list.
124+
items:
125+
type: string
126+
type: array
119127
deployOnAllNodeSets:
120128
description: |-
121129
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)