-
Notifications
You must be signed in to change notification settings - Fork 204
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
Support SKU spec upgrade #459
Conversation
Test Results127 files ±0 127 suites ±0 6m 24s ⏱️ ±0s For more details on these failures, see this check. Results for commit e179555. ± Comparison against base commit b119679. ♻️ This comment has been updated with latest results. |
Uploaded ArtifactsTo use these artifacts in your Gradle project, paste the following lines in your build.gradle.
|
@Nullable | ||
MantisResourceClusterSpec resourceClusterSpec; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: why do we need this here? Do we not have a separate endpoint to update the cluster spec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking along the lines of:
resourceCluster.sku(SKU).clusterSpec(NEW_SPEC).image(IMAGE).reconcile()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is served as a translation between actors to Temporal workflow invoker. It's probably cleaner to have another intermediate contract class here instead.
upgradeFut = this.resourceClusterStorageProvider.getResourceClusterSpecWritable(req.getClusterId()) | ||
.thenCompose(specW -> { | ||
if (specW == null) { | ||
return CompletableFuture.completedFuture(UpgradeClusterContainersResponse.builder() | ||
.responseCode(ResponseCode.CLIENT_ERROR_NOT_FOUND) | ||
.build()); | ||
} | ||
|
||
UpgradeClusterContainersRequest enrichedReq = | ||
req.toBuilder() | ||
.resourceClusterSpec(specW.getClusterSpec()) | ||
.build(); | ||
return this.resourceClusterProvider.upgradeContainerResource(enrichedReq); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ideally we should not have this here as it increases the complexity of this endpoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Temporal workflow doesn't understand how to get the spec from internal kvDal translation. So the choices are between:
- Have workflow calling back to master endpoint to GET resource spec then apply it in the workflow.
- Have the actor include the spec to send to workflow invoker directly (current). I think this is cleaner and less interactions needed.
|
||
pipe(this.resourceClusterProvider.upgradeContainerResource(req), getContext().dispatcher()).to(getSender()); | ||
// For scaling-down the decision requires getting idle hosts first. | ||
// if enableSkuSpecUpgrade is true, first fetch the latest spec to override the sku spec during upgrade |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of fetching this, could we send this as an argument to the workflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is sending the spec over the wire.
|
||
String region; | ||
|
||
String optionalImageId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This need not be optional, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it current default to "latest"
|
||
int optionalBatchMaxSize; | ||
|
||
boolean forceUpgradeOnSameImage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/forceUpgradeOnSameImage/force
|
||
MantisResourceClusterEnvType optionalEnvType; | ||
|
||
int optionalBatchMaxSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this batchMaxSize for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per upgrade batch settings where each batch in upgrade should not have more than x agents involved.
Context
Currently upgrade operation on RC is for the image version.
Support a new flag in upgrade RC to be able to upgrade Sku spec in upgrade operation.
Checklist
./gradlew build
compiles code correctly./gradlew test
passes all tests