You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "wmedvede (via GitHub)" <gi...@apache.org> on 2026/02/09 13:21:57 UTC
[PR] incubator-kie-tools-3432: [sonataflow-operator] Implement nativelly HPA support for SonataFlow workflows and Data Index service deployments [incubator-kie-tools]
wmedvede opened a new pull request, #3433:
URL: https://github.com/apache/incubator-kie-tools/pull/3433
closes: #3432
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] incubator-kie-tools-3432: [sonataflow-operator] Implement nativelly HPA support for SonataFlow workflows and Data Index service deployments [incubator-kie-tools]
Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede merged PR #3433:
URL: https://github.com/apache/incubator-kie-tools/pull/3433
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] incubator-kie-tools-3432: [sonataflow-operator] Implement nativelly HPA support for SonataFlow workflows and Data Index service deployments [incubator-kie-tools]
Posted by "jakubschwan (via GitHub)" <gi...@apache.org>.
jakubschwan commented on code in PR #3433:
URL: https://github.com/apache/incubator-kie-tools/pull/3433#discussion_r2826824242
##########
packages/sonataflow-operator/test/e2e/platform_test.go:
##########
@@ -468,4 +468,77 @@ var _ = Describe("Platform Use Cases :: ", Label("platform"), Ordered, func() {
Entry("and with broker and platform in the same namespace", test.GetPathFromE2EDirectory("platform", "services", "gitops", "knative", "platform-level-broker"), false),
Entry("and with broker and platform in a separate namespace", test.GetPathFromE2EDirectory("platform", "services", "gitops", "knative", "platform-level-broker"), true),
)
+
+ DescribeTable("when deploying a SonataFlowPlatform combined with HPA for the Data Index", func(testcaseDir string, dataIndexHPAPath string, createHPABeforePlatform bool) {
+ if createHPABeforePlatform {
+ By("Create the data index HPA before the platform")
+ EventuallyWithOffset(1, func() error {
+ return kubectlApplyFileOnCluster(dataIndexHPAPath, targetNamespace)
+ }, 3*time.Minute, time.Second).Should(Succeed())
+ }
+
+ By("Deploy the platform and database CRs")
+ EventuallyWithOffset(1, func() error {
+ return kubectlApplyKustomizeOnCluster(testcaseDir, targetNamespace)
+ }, 2*time.Minute, time.Second).Should(Succeed())
+
+ By("Wait for SonataFlowPlatform CR to complete deployments")
+ EventuallyWithOffset(1, func() error {
+ return verifyDataIndexAndJobsServiceAreReady(targetNamespace, "5s")
+ }, 10*time.Minute, 5).Should(Succeed())
+
+ By("Evaluate status of all service's health endpoint")
+ verifyDataIndexAndJobsServiceAreHealthy(targetNamespace)
+
+ if createHPABeforePlatform {
+ By("Check that the Data Index deployment has 3 replicas since the HPA was already created")
+ EventuallyWithOffset(3, func() bool {
+ return verifyDeploymentReplicas("sonataflow-platform-data-index-service", targetNamespace, int32(3))
+ }, 3*time.Minute, 30*time.Second).Should(BeTrue())
+ } else {
+ By("Check that the Data Index deployment has 1 replica before creating the HPA")
+ EventuallyWithOffset(1, func() bool {
+ return verifyDeploymentReplicas("sonataflow-platform-data-index-service", targetNamespace, int32(1))
+ }, 3*time.Minute, 30*time.Second).Should(BeTrue())
+
+ By("Create the data index HPA after the platform")
+ EventuallyWithOffset(1, func() error {
+ return kubectlApplyFileOnCluster(dataIndexHPAPath, targetNamespace)
+ }, 3*time.Minute, time.Second).Should(Succeed())
+
+ By("Check that the data index has 3 replicas after creating the HPA")
+ EventuallyWithOffset(1, func() bool {
+ return verifyDeploymentReplicas("sonataflow-platform-data-index-service", targetNamespace, int32(3))
+ }, 3*time.Minute, 30*time.Second).Should(BeTrue())
+ }
+
+ By("Delete the data index HPA")
+ EventuallyWithOffset(1, func() error {
+ return kubectlDeleteFileOnCluster(dataIndexHPAPath, targetNamespace)
+ }, 3*time.Minute, 30*time.Second).Should(Succeed())
+
+ By("Check that the data index has 1 replica after deleting the HPA")
+ EventuallyWithOffset(1, func() bool {
+ return verifyDeploymentReplicas("sonataflow-platform-data-index-service", targetNamespace, int32(3))
Review Comment:
```suggestion
return verifyDeploymentReplicas("sonataflow-platform-data-index-service", targetNamespace, int32(1))
```
Check that the data index has 1 replica after deleting the HPA
##########
packages/sonataflow-operator/internal/controller/sonataflowplatform_controller.go:
##########
@@ -346,3 +368,36 @@ func contains(slice []operatorapi.WorkFlowCapability, s operatorapi.WorkFlowCapa
}
return false
}
+
+// mapHPAToPlatformRequests determines if the referred HorizontalPodAutoscaler targets a DI service in given namespace,
+// if any. Analyses if that namespace has an SPF that manges the DI service. If that is the case, enqueues a Request to
+// the SPF to give the chance to take an action if needed. We normally want to do that in situations where the
+// HorizontalPodAutoscaler was removed (DeleteEvent) to let the SFP restore back the DI replicas. In other situations
Review Comment:
```suggestion
// if any. Analyses if that namespace has an SFP that manges the DI service. If that is the case, enqueues a Request to
// the SFP to give the chance to take an action if needed. We normally want to do that in situations where the
// HorizontalPodAutoscaler was removed (DeleteEvent) to let the SFP restore back the DI replicas. In other situations
```
small typos in function comment
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] incubator-kie-tools-3432: [sonataflow-operator] Implement nativelly HPA support for SonataFlow workflows and Data Index service deployments [incubator-kie-tools]
Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on code in PR #3433:
URL: https://github.com/apache/incubator-kie-tools/pull/3433#discussion_r2832845252
##########
packages/sonataflow-operator/test/e2e/platform_test.go:
##########
@@ -468,4 +468,77 @@ var _ = Describe("Platform Use Cases :: ", Label("platform"), Ordered, func() {
Entry("and with broker and platform in the same namespace", test.GetPathFromE2EDirectory("platform", "services", "gitops", "knative", "platform-level-broker"), false),
Entry("and with broker and platform in a separate namespace", test.GetPathFromE2EDirectory("platform", "services", "gitops", "knative", "platform-level-broker"), true),
)
+
+ DescribeTable("when deploying a SonataFlowPlatform combined with HPA for the Data Index", func(testcaseDir string, dataIndexHPAPath string, createHPABeforePlatform bool) {
+ if createHPABeforePlatform {
+ By("Create the data index HPA before the platform")
+ EventuallyWithOffset(1, func() error {
+ return kubectlApplyFileOnCluster(dataIndexHPAPath, targetNamespace)
+ }, 3*time.Minute, time.Second).Should(Succeed())
+ }
+
+ By("Deploy the platform and database CRs")
+ EventuallyWithOffset(1, func() error {
+ return kubectlApplyKustomizeOnCluster(testcaseDir, targetNamespace)
+ }, 2*time.Minute, time.Second).Should(Succeed())
+
+ By("Wait for SonataFlowPlatform CR to complete deployments")
+ EventuallyWithOffset(1, func() error {
+ return verifyDataIndexAndJobsServiceAreReady(targetNamespace, "5s")
+ }, 10*time.Minute, 5).Should(Succeed())
+
+ By("Evaluate status of all service's health endpoint")
+ verifyDataIndexAndJobsServiceAreHealthy(targetNamespace)
+
+ if createHPABeforePlatform {
+ By("Check that the Data Index deployment has 3 replicas since the HPA was already created")
+ EventuallyWithOffset(3, func() bool {
+ return verifyDeploymentReplicas("sonataflow-platform-data-index-service", targetNamespace, int32(3))
+ }, 3*time.Minute, 30*time.Second).Should(BeTrue())
+ } else {
+ By("Check that the Data Index deployment has 1 replica before creating the HPA")
+ EventuallyWithOffset(1, func() bool {
+ return verifyDeploymentReplicas("sonataflow-platform-data-index-service", targetNamespace, int32(1))
+ }, 3*time.Minute, 30*time.Second).Should(BeTrue())
+
+ By("Create the data index HPA after the platform")
+ EventuallyWithOffset(1, func() error {
+ return kubectlApplyFileOnCluster(dataIndexHPAPath, targetNamespace)
+ }, 3*time.Minute, time.Second).Should(Succeed())
+
+ By("Check that the data index has 3 replicas after creating the HPA")
+ EventuallyWithOffset(1, func() bool {
+ return verifyDeploymentReplicas("sonataflow-platform-data-index-service", targetNamespace, int32(3))
+ }, 3*time.Minute, 30*time.Second).Should(BeTrue())
+ }
+
+ By("Delete the data index HPA")
+ EventuallyWithOffset(1, func() error {
+ return kubectlDeleteFileOnCluster(dataIndexHPAPath, targetNamespace)
+ }, 3*time.Minute, 30*time.Second).Should(Succeed())
+
+ By("Check that the data index has 1 replica after deleting the HPA")
+ EventuallyWithOffset(1, func() bool {
+ return verifyDeploymentReplicas("sonataflow-platform-data-index-service", targetNamespace, int32(3))
Review Comment:
good catch
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] incubator-kie-tools-3432: [sonataflow-operator] Implement nativelly HPA support for SonataFlow workflows and Data Index service deployments [incubator-kie-tools]
Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on PR #3433:
URL: https://github.com/apache/incubator-kie-tools/pull/3433#issuecomment-3933770497
@jakubschwan your suggestions were addressed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] incubator-kie-tools-3432: [sonataflow-operator] Implement nativelly HPA support for SonataFlow workflows and Data Index service deployments [incubator-kie-tools]
Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on PR #3433:
URL: https://github.com/apache/incubator-kie-tools/pull/3433#issuecomment-3901555175
Documentation PR: https://github.com/apache/incubator-kie-kogito-docs/pull/747
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org