Skip to content

Adding external cosmos db scaler#1

Merged
ahmelsayed merged 10 commits into
kedacore:mainfrom
divyagandhisethi:main
Aug 19, 2021
Merged

Adding external cosmos db scaler#1
ahmelsayed merged 10 commits into
kedacore:mainfrom
divyagandhisethi:main

Conversation

@divyagandhisethi

@divyagandhisethi divyagandhisethi commented Mar 5, 2021

Copy link
Copy Markdown
Contributor

Provide a description of what has been changed

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO)
  • A PR is opened to update the documentation on our docs repo

Fixes #

Comment thread Keda.Cosmosdb.Scaler/src/Services/ExternalScalerService.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/ExternalScalerService.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/ExternalScalerService.cs Outdated
@divyagandhisethi

Copy link
Copy Markdown
Contributor Author

@pragnagopa

@tomkerkhove tomkerkhove left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a good start but think we need some more work.

Main topics are:

  • Please add a CI on GitHub Actions
  • Removing the deprecated approach and use new instead
  • Use connection string parser from official SDK, if available
  • Create a file per class instead

Thanks for the PR!

Comment thread Keda.Cosmosdb.Scaler/src/ConsoleLogger.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDbTrigger.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDbTrigger.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/ExternalScalerService.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Startup.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDbTrigger.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDbTrigger.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/ExternalScalerService.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/ExternalScalerService.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/ExternalScalerService.cs Outdated

@pragnagopa pragnagopa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the PR! Added few comments. Please add unit test project as well.

Comment thread Keda.Cosmosdb.Scaler/Dockerfile Outdated
Comment thread Keda.Cosmosdb.Scaler/src/ConsoleLogger.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Program.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Program.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Protos/externalscaler.proto Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDbTrigger.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDbTrigger.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDbTrigger.cs Outdated
public string AccountName { get; internal set; }
}

internal class CosmosDbTriggerMetadata

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread Keda.Cosmosdb.Scaler/src/Services/ExternalScalerService.cs Outdated
@ahmelsayed

Copy link
Copy Markdown
Contributor

regarding @tomkerkhove note

Please add a CI on GitHub Actions

@divyagandhisethi I can help set this up if you're not familiar with github actions.

@divyagandhisethi

Copy link
Copy Markdown
Contributor Author

regarding @tomkerkhove note

Please add a CI on GitHub Actions

@divyagandhisethi I can help set this up if you're not familiar with github actions.

Thanks. As discussed we will open a tracking issue for adding CI

@divyagandhisethi

Copy link
Copy Markdown
Contributor Author

@tomkerkhove Can you please take a look?

@pragnagopa pragnagopa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Added few more comments. Thanks!

Comment thread Keda.Cosmosdb.Scaler/Dockerfile Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Protos/externalscaler.proto
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDBExternalScaler.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDBExternalScaler.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDBExternalScaler.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDBLeaseMetadata.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDBTriggerMetadata.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDbTrigger.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDbTrigger.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/HostPropertiesCollection.cs Outdated
@tomkerkhove

Copy link
Copy Markdown
Member

Created an issue for CI - #2

@tomkerkhove tomkerkhove left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A few more things that I'd change to build a solid foundation, but almost there.

Also opened an issue for integration tests: #4

Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDBConnectionString.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDBConnectionString.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDBExternalScaler.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDBExternalScaler.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDBExternalScaler.cs Outdated
CosmosDBTrigger trigger)
{
CosmosDBConnectionString triggerConnection = new CosmosDBConnectionString(trigger.CosmosDBConnectionString);
DocumentCollectionInfo documentCollectionLocation = new DocumentCollectionInfo

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We definately should do that

Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDBExternalScaler.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDBExternalScaler.cs Outdated
return builder;
}

private static string NormalizeString(string inputString)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's move it to Extensions/StringExtensions instead, otherwise Utilities will become a dump :D

Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDBExternalScaler.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Startup.cs Outdated

@pragnagopa pragnagopa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Posting partial feedback.

Main feedback in this iteration - move to https://github.com/Azure/azure-cosmos-dotnet-v3

Comment thread Keda.Cosmosdb.Scaler/src/Extensions/StringExtensions.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Keda.Cosmosdb.Scaler.csproj Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Program.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Repository/ChangeFeedProcessorBuilderFactory.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDBExternalScaler.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDBExternalScaler.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Keda.Cosmosdb.Scaler.csproj Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Repository/ChangeFeedEstimatorFactory.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Repository/CosmosDBRepository.cs Outdated

@pragnagopa pragnagopa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Added more feedback. Please ping once review is addressed

Comment thread Keda.Cosmosdb.Scaler/src/Extensions/StringExtensions.cs
Comment thread Keda.Cosmosdb.Scaler/test/Keda.CosmosDB.Scaler.UnitTest.csproj
Comment thread Keda.Cosmosdb.Scaler/src/Keda.Cosmosdb.Scaler.csproj Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Constants.cs
Comment thread Keda.Cosmosdb.Scaler/Dockerfile
Comment thread Keda.Cosmosdb.Scaler/src/Repository/ChangeFeedEstimatorFactory.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDBExternalScaler.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Services/CosmosDBConnectionString.cs Outdated
Comment thread Keda.Cosmosdb.Scaler/src/Repository/ChangeFeedEstimatorFactory.cs
Comment thread Keda.Cosmosdb.Scaler/src/Repository/ChangeFeedEstimatorFactory.cs Outdated
Comment thread Keda.CosmosDB.Scaler/src/Repository/ChangeFeedEstimatorFactory.cs
Comment thread Keda.CosmosDB.Scaler/src/Services/CosmosDBLease.cs Outdated
Comment thread Keda.CosmosDB.Scaler/src/Services/CosmosDBLease.cs Outdated

@pragnagopa pragnagopa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Added few more comments. Please open an issue here to add E2E test

Comment thread Keda.CosmosDB.Scaler/src/Services/CosmosDBTrigger.cs Outdated

@pragnagopa pragnagopa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Changes look good. Please open following issues:

  • Add E2E test in K4Apps
  • Add readme in this repo - brief description and getting started instructions
  • If you do not have already, please follow up setting up CI to produce the right artifacts needed - I recommend publishing artifacts with -beta or -preview in the version / name

@divyagandhisethi

Copy link
Copy Markdown
Contributor Author

Changes look good. Please open following issues:

* Add E2E test in K4Apps

* Add readme in this repo - brief description and getting started instructions

* If you do not have already, please follow up setting up CI to produce the right artifacts needed - I recommend publishing artifacts with   -beta or -preview in the version / name

Issue for readme - #3
Issue for integration tests - #4
For CI artifacts - we can generate the preview image manually until we have the CI setup

@divyagandhisethi

Copy link
Copy Markdown
Contributor Author

@tomkerkhove This PR is blocked on your review. Please do take a look when possible.

@tomkerkhove

Copy link
Copy Markdown
Member

For CI artifacts - we can generate the preview image manually until we have the CI setup

Let's have a GitHub action to build & push an image to GHCR similar to our core. We use a different experimental tag AFAIK

@tomkerkhove

Copy link
Copy Markdown
Member

@divyagandhisethi Would you mind fixing DCO please?

@tomkerkhove

Copy link
Copy Markdown
Member

What is the status on this PR?

@pragnagopa

Copy link
Copy Markdown

@divyagandhisethi - Please merge the PR once you address DCO

@pragnagopa

Copy link
Copy Markdown

cc @JatinSanghvi and @SushmithaVReddy

@eskaufel

Copy link
Copy Markdown

You are so close... you can do this! 👍🏻

@borqosky

Copy link
Copy Markdown

@divyagandhisethi could you just address DCO?
THIS PR is really interesting and as soon you merge it, I'm going to try it 😺

Signed-off-by: Divya Gandhi <digandhi@microsoft.com>
Signed-off-by: Divya Gandhi <digandhi@microsoft.com>
Signed-off-by: Divya Gandhi <digandhi@microsoft.com>
Signed-off-by: Divya Gandhi <digandhi@microsoft.com>
Signed-off-by: Divya Gandhi <digandhi@microsoft.com>
Signed-off-by: Divya Gandhi <digandhi@microsoft.com>
Signed-off-by: Divya Gandhi <digandhi@microsoft.com>
Signed-off-by: Divya Gandhi <digandhi@microsoft.com>
Signed-off-by: Divya Gandhi <digandhi@microsoft.com>
Signed-off-by: Divya Gandhi <digandhi@microsoft.com>
@divyagandhisethi

Copy link
Copy Markdown
Contributor Author

You are so close... you can do this! 👍🏻

Thanks @eskaufel .

@divyagandhisethi

Copy link
Copy Markdown
Contributor Author

@divyagandhisethi could you just address DCO?
THIS PR is really interesting and as soon you merge it, I'm going to try it 😺

Thanks @borqosky . The commits are now signed. I don't have write permissions on the repo, so can't merge this PR in.

@divyagandhisethi

divyagandhisethi commented Aug 19, 2021

Copy link
Copy Markdown
Contributor Author

For CI artifacts - we can generate the preview image manually until we have the CI setup

Let's have a GitHub action to build & push an image to GHCR similar to our core. We use a different experimental tag AFAIK

@pragnagopa @JatinSanghvi @SushmithaVReddy - please follow up on this and publish this image as an experimental scaler.

@divyagandhisethi

Copy link
Copy Markdown
Contributor Author

@pragnagopa @JatinSanghvi @SushmithaVReddy A PR needs to be open against the docs repo

@tomkerkhove

Copy link
Copy Markdown
Member

@pragnagopa @JatinSanghvi @SushmithaVReddy A PR needs to be open against the docs repo

This is only for built-in scalers but feel free to tackle #7 and use documentation in the README!

@tomkerkhove

Copy link
Copy Markdown
Member

We are planning to surface external scalers on KEDA.sh based on Artifact Hub

@tomkerkhove

Copy link
Copy Markdown
Member

@divyagandhisethi could you just address DCO?
THIS PR is really interesting and as soon you merge it, I'm going to try it 😺

Thanks @borqosky . The commits are now signed. I don't have write permissions on the repo, so can't merge this PR in.

Happy to merge if you want.

@divyagandhisethi

Copy link
Copy Markdown
Contributor Author

@divyagandhisethi could you just address DCO?
THIS PR is really interesting and as soon you merge it, I'm going to try it 😺

Thanks @borqosky . The commits are now signed. I don't have write permissions on the repo, so can't merge this PR in.

Happy to merge if you want.

Thanks @tomkerkhove . Yes, please go ahead and merge it in.

@ahmelsayed ahmelsayed merged commit bcade15 into kedacore:main Aug 19, 2021
@luna8418 luna8418 mentioned this pull request Sep 11, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants