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

Added resource group isolation to DeploymentCache #103

Merged
merged 5 commits into from
Oct 18, 2024
Merged

Conversation

CharlesDuboisSAP
Copy link
Contributor

@CharlesDuboisSAP CharlesDuboisSAP commented Oct 17, 2024

Context

AI/ai-sdk-java-backlog#54.

The deployment cache needs to isolate between resource groups.
Also customers should be able to reset the cache

Feature scope:

  • Added resource group isolation to DeploymentCache
  • Added AiCoreService.resetCache(client, resourceGroup)

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Aligned changes with the JavaScript SDK
  • Documentation updated
  • Release notes updated

@CharlesDuboisSAP CharlesDuboisSAP changed the title Added resource group to DeploymentCache Added resource group isolation to DeploymentCache Oct 17, 2024
core/src/main/java/com/sap/ai/sdk/core/AiCoreService.java Outdated Show resolved Hide resolved
.orElseThrow(
() ->
new NoSuchElementException(
"No running deployment found for scenario: " + scenarioId));
});
}

private Optional<String> getDeploymentIdByScenario(@Nonnull final String scenarioId) {
return CACHE.stream()
private Optional<String> getDeploymentIdByScenario(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(minor) It would be nice to stick to either VAVRs Option<> or Javas Optional. Mixing the two is a bit awkward, and mixing them in public API might be confusing for users. In Cloud SDK we used VAVR because it's more powerful and integrated with Try etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not public API it's just a private helper function to reduce code duplication.

@MatKuhr MatKuhr enabled auto-merge (squash) October 18, 2024 07:58
@MatKuhr MatKuhr merged commit 759fff0 into main Oct 18, 2024
4 checks passed
@MatKuhr MatKuhr deleted the cache-resource-group branch October 18, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants