Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "streams/scale/" API #3554

Closed
sabbyanandan opened this issue Oct 15, 2019 · 5 comments
Closed

Add "streams/scale/" API #3554

sabbyanandan opened this issue Oct 15, 2019 · 5 comments
Assignees
Labels
type/enhancement Is an enhancement request

Comments

@sabbyanandan
Copy link
Contributor

sabbyanandan commented Oct 15, 2019

As a continuation of spring-cloud/spring-cloud-deployer#62, we will have a platform-specific implementation of the SPI, which can then be automatically backed by a public-facing RESTful endpoint exposed in SCDF.

We will have to decide whether this API would be chained under the /streams API or something more application-specific.

Depends on:

Acceptance:

  • Include new API under /streams/scale
  • The new API is included in the Java DSL and DataFlowTemplate
  • Include IT tests to validate this via DockerComposeIT
@sabbyanandan sabbyanandan added the type/enhancement Is an enhancement request label Oct 15, 2019
@jvalkeal
Copy link
Contributor

Before trying to add new rest api's we could simply try to use existing stream update and see if simply updating deployment property deployer.*.count=2 would suit our needs. This would surely result minimal changes as we wouldn't necessarily need to change anything on a scdf side.

@tzolov
Copy link
Contributor

tzolov commented Oct 16, 2019

The update command changes the functionality of the deployed pipeline. E.g. by update/rollback an app in a pipeline you effectively change the functional behavior of the running pipeline. The non-functional operations such as scale or binder (re)partition on the other hand are used to improve the performance or tackle overload issues but they do NOT alter the logic of the running pipeline.

IMO it is important to keep this separation and keep the functional (e.g. update) and non-functional (e.g. scale, repartition ...) operations orthogonal to each other. We should not aim to reuse update in place of scale just because it might feel easy to hack it that way.

@sabbyanandan
Copy link
Contributor Author

@tzolov: Once when we have this API, let's make sure we have the necessary infrastructure to include it in the Java DSL and DataflowTemplate.

@sabbyanandan sabbyanandan changed the title Add scale() API Add "streams/scale/" API Oct 16, 2019
@jvalkeal
Copy link
Contributor

Btw, this depends on spring-cloud/spring-cloud-skipper#910 which will be on other PR.

@tzolov
Copy link
Contributor

tzolov commented Oct 19, 2019

The scale method uses deploymentId, count and properties (e.g. AppScaleRequest) for every application. Two Data Flow Scale API extension are provided below for bulks (multi-app) and single app scaling:

  • Streams Deployments Scale API - as the scale is only applicable for deployed streams it is natural to make it part of the existing /streams/deployments resource instead of creating a new /streams/scale.
POST /streams/deployments/scale/{streamName}
Content-Type: application/json
BODY: 
[ 
 {"appName": "", "count": "", "properties": {...optional...}},
 {"appName": "", "count": "", "properties": {...optional...}},
 ...
]

appName stands for the name/label as defined in the stream DSL, not the depmoment-Id!

  • Runtime Scale API - The GET /runtime/apps/ offers runtime information about deployed apps identified by the deploymentid. Later can be used to as reference to scale the deployed app:
POST /runtime/apps/{appId}/scale/{count}
Content-Type: application/json
BODY: { ... properties ...} // optional

appId stands for the deployementId not the app name/label in the DSL

tzolov added a commit to tzolov/spring-cloud-dataflow that referenced this issue Oct 19, 2019
tzolov added a commit to tzolov/spring-cloud-dataflow that referenced this issue Oct 21, 2019
 - Add scale shell command.
 - Add Stream scale DSL.
 - Basic Stream and controller tests

 Resolves spring-cloud#3554
tzolov added a commit to tzolov/spring-cloud-dataflow that referenced this issue Oct 22, 2019
 - Add scale shell command.
 - Add Stream scale DSL.
 - Basic Stream and controller tests

 Resolves spring-cloud#3554
tzolov added a commit to tzolov/spring-cloud-dataflow that referenced this issue Oct 22, 2019
 - Add scale shell command.
 - Add Stream scale DSL.
 - Basic Stream and controller tests

 Resolves spring-cloud#3554
tzolov added a commit to tzolov/spring-cloud-dataflow that referenced this issue Oct 23, 2019
 - Add scale shell command.
 - Add Stream scale DSL.
 - Basic Stream and controller tests

 Resolves spring-cloud#3554
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Is an enhancement request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants