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

Add health check command #46

Merged
merged 10 commits into from
Jan 17, 2023
Merged

Add health check command #46

merged 10 commits into from
Jan 17, 2023

Conversation

dmah42
Copy link
Contributor

@dmah42 dmah42 commented Jan 13, 2023

Part of #42

This also introduces a gRPC client with an implementation for the Discovery service that can be copied for Runtime services later.

NOTE: this assumes all instances of auraed are listening on the same port, which is not guaranteed.. more flexibility can be added.

to test

  • run auraed: sudo -E auraed --socket "0.0.0.0:8080"
  • run ae: ae health --cidr <local network cidr: 192.168.0.0/24> --port 8080

experience output :)

@krisnova
Copy link
Contributor

krisnova commented Jan 14, 2023

Can we have cidr as the 3rd subcommand?

ae health cidr <cidr range>
ae health cidr 10.0.0.1/24

ae health <host>
ae health nivenly.biz
ae health 10.0.0.17

The reason I say this is because I believe we are going to need to start moving our clustering/networking paradigms into common libraries. If it is a 3rd subcommand this allows us to add others in the future such as

ae health cluster <primary-node>
ae health hostpattern <DNS regular expression>
ae health arp // everyone in the arp tables
ae health route // everyone in the route tables

I believe that the scheduler core libraries will likely end up starting/living here in the ae repository. Which means we will likely need some libraries that enable behavior such as:

worker := func() error { return nil } // TODO add work here
sched := scheduler.CIDRIterator()
sched.Work(worker)
err := sched.Run()

such that we can easily perform tasks at scale.

I suspect we will have many scheduler/iterators/walkers as we grow. For example I could also see something like

worker := func() error { return nil } // TODO add work here
sched := scheduler.ClusterWalker("hachyderm.io")
sched.Work(worker)
err := sched.Run()

Then we can just have an interface for all of our valid worker commands, and health is just yet-another-worker implementation that can be passed to any scheduler/iterator/walker.

cmd/health/health.go Outdated Show resolved Hide resolved
cmd/health/health.go Outdated Show resolved Hide resolved
cmd/health/health.go Outdated Show resolved Hide resolved
cmd/health/health.go Outdated Show resolved Hide resolved
cmd/health/health.go Outdated Show resolved Hide resolved
@dmah42
Copy link
Contributor Author

dmah42 commented Jan 16, 2023

i'm iterating on this.

@dmah42 dmah42 changed the title Add health check command WIP: Add health check command Jan 16, 2023
@dmah42
Copy link
Contributor Author

dmah42 commented Jan 16, 2023

./bin/ae health cidr 192.168.178.85/29 --port 8080

@dmah42
Copy link
Contributor Author

dmah42 commented Jan 16, 2023

./bin/ae health ip 192.168.172.86 --port 8080 also works, as does ./bin/ae health ip 2a02:8012:b1c:0:6ff3:68fd:38e8:396f --port 8080

@dmah42 dmah42 changed the title WIP: Add health check command Add health check command Jan 16, 2023
Copy link
Contributor

@krisnova krisnova left a comment

Choose a reason for hiding this comment

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

Great job pulling things out into /health

@krisnova krisnova merged commit f65f3f6 into main Jan 17, 2023
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