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

v3.0: how to run locally? #25

Open
dimaqq opened this issue Jul 10, 2024 · 3 comments
Open

v3.0: how to run locally? #25

dimaqq opened this issue Jul 10, 2024 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@dimaqq
Copy link
Contributor

dimaqq commented Jul 10, 2024

I'm at a loss at how to run the v3.0 branch, currently at 2903b1b.

My current best attempt is:

env GUBER_HTTP_ADDRESS=0.0.0.0:9080 GUBER_GRPC_ADDRESS=0.0.0.0:9081 GUBER_PEER_DISCOVERY_TYPE=member-list GUBER_MEMBERLIST_KNOWN_NODES=localhost:7964 GUBER_MEMBERLIST_ADVERTISE_ADDRESS=localhost:9081 go run cmd/gubernator/main.go

but that still fails with ERRO[0000] while spawning daemon: while creating member list pool: MemberListAddress=%sis invalid;: expected format isaddress:port category=gubernator

When I build a binary and run it in k8s, the service starts, but I can't get results on the endpoints documented in the readme, for example:

root@hexanator-0:/# curl http://localhost:80/v1/GetRateLimits   --header 'Content-Type: application/json'   --data '{
    "requests": [
        {
            "name": "requests_per_sec",
            "uniqueKey": "account:12345",
            "hits": "1",
            "limit": "10",
            "duration": "1000"
        }
    ]
}'
{"code":501, "codeText":"Not Implemented", "message":"no such method; /v1/GetRateLimits"}

(Run with GUBER_HTTP_ADDRESS=0.0.0.0:80 GUBER_GRPC_ADDRESS=0.0.0.0:81 env)

@dimaqq
Copy link
Contributor Author

dimaqq commented Jul 10, 2024

The only URL path that seems to work is /healthz

@dimaqq
Copy link
Contributor Author

dimaqq commented Jul 10, 2024

Having followed the source code and made some guesses, I was able to get this to work:

root@hexanator-0:/# curl http://localhost:80/v1/rate-limit.check --header 'Content-Type: application/json'   --data '{
    "requests": [
        {
            "name": "requests_per_sec",
            "unique_key": "account:12345",
            "hits": "1",
            "limit": "10",
            "duration": "1000"
        }
    ]
}'
{"responses":[{"limit":"10", "remaining":"9", "reset_time":"1720592294506"}]}

Maybe it's worth updating the README.md in this branch 🙇🏻

@thrawn01
Copy link
Collaborator

I plan on getting back to 3.0 and updating all the documentation soon. I'm working on an other project at the moment, but will get to this! I'm excited for gubernator 3.0.

@thrawn01 thrawn01 self-assigned this Jul 26, 2024
@thrawn01 thrawn01 added this to the V3 milestone Jul 26, 2024
@thrawn01 thrawn01 added the bug Something isn't working label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants