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

pubsub/azuresb: new auth method to support Service principal/kubelet identity/Workload identity auth methods #3360

Merged
merged 4 commits into from
Dec 21, 2023

Conversation

tsolodov
Copy link
Contributor

@tsolodov tsolodov commented Dec 17, 2023

new auth method to support Service principal/kubelet identity/Workload identity auth methods.(handled by Azure golang SDK)

How to use:
depends on method(Workload, kubelet, Service), set ENV variables:
AZURE_SERVICEBUS_HOSTNAME - to trigger new method

For service principal auth, set ENV variables described here

If you use workload/kubelet identities, ENV variables are injected by AKS, some details can be found here

closes #3359

was able to run performance test using new auth model:

AZURE_CLIENT_SECRET='secret' AZURE_CLIENT_ID=2f370f8b-XXXX-4c60-b3c7-XXXXX AZURE_TENANT_ID=XXXX-a475-466f-ab08-XXXX AZURE_SERVICEBUS_HOSTNAME=xxxxxx.servicebus.windows.net /opt/homebrew/bin/go test -benchmem -run=^$ -bench ^BenchmarkAzureServiceBusPubSub$ gocloud.dev/pubsub/azuresb

benchmark-topic
goos: darwin
goarch: arm64
pkg: gocloud.dev/pubsub/azuresb
BenchmarkAzureServiceBusPubSub/BenchmarkReceive-10         	       1	154489245124 ns/op	  64.73 MB/s	88464128 B/op	 1556345 allocs/op
--- BENCH: BenchmarkAzureServiceBusPubSub/BenchmarkReceive-10
    drivertest.go:1039: published 10000 messages
    drivertest.go:1049: MB/s is actually number of messages received per second


BenchmarkAzureServiceBusPubSub/BenchmarkSend-10            	       1	4310127584 ns/op	2320.12 MB/s	45803056 B/op	  805866 allocs/op
--- BENCH: BenchmarkAzureServiceBusPubSub/BenchmarkSend-10
    drivertest.go:1039: published 10000 messages
    drivertest.go:1049: MB/s is actually number of messages received per second
PASS
ok  	gocloud.dev/pubsub/azuresb	289.383s

Not sure how to test it(should be tested against Azure cloud with real credentials)

Copy link

google-cla bot commented Dec 17, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@tsolodov tsolodov changed the title pubsub/azuresb: new auth method to support Service principal/kubelet identity/Workload identity auth metods pubsub/azuresb: new auth method to support Service principal/kubelet identity/Workload identity auth methods Dec 17, 2023
@tsolodov
Copy link
Contributor Author

PTAL

@tsolodov tsolodov requested a review from vinay92-ch December 20, 2023 17:39
@tsolodov
Copy link
Contributor Author

Hi @vangent , could you please take a look?

Copy link

codecov bot commented Dec 21, 2023

Codecov Report

Attention: 20 lines in your changes are missing coverage. Please review.

Comparison is base (8c8f558) 77.43% compared to head (aff0776) 77.37%.
Report is 2 commits behind head on master.

Files Patch % Lines
pubsub/azuresb/azuresb.go 20.00% 17 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3360      +/-   ##
==========================================
- Coverage   77.43%   77.37%   -0.07%     
==========================================
  Files         104      104              
  Lines       13935    13951      +16     
==========================================
+ Hits        10790    10794       +4     
- Misses       2384     2396      +12     
  Partials      761      761              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vangent vangent merged commit ddc7b99 into google:master Dec 21, 2023
6 checks passed
ybourgery pushed a commit to Simprints/go-cloud that referenced this pull request Jun 17, 2024
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.

pubsub/azuresb: support workload identity auth method
3 participants