sablierapp / sablier

Start your containers on demand, shut them down automatically when there's no activity. Docker, Docker Swarm Mode and Kubernetes compatible.
https://sablierapp.dev/
GNU Affero General Public License v3.0
1.36k stars 46 forks source link

Add `nomad` provider #217

Open livioribeiro opened 1 year ago

livioribeiro commented 1 year ago

Describe the provider Nomad is an orchestrator from Hashicorp, similar to Kubernetes but with simpler deployment and operation.

Does the provider provides the following APIs An instance is a generic term used to describe containers, pods, deployments, and more

API Yes No I don't know
Start an instance
Stop an instance
Get info about an instance
Listening for external events happening

Does the provider has a Go API SDK? Yes https://pkg.go.dev/github.com/hashicorp/nomad/api

Does the provider can be started locally Yes

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

acouvreur commented 8 months ago

Unstale, I believe someone has something working

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

acouvreur commented 7 months ago

Unstale, issues will now be considered stale after a much longer peeiod of time

ijcd commented 5 months ago

Is there any work in progress for this that can be shared? What is involved in creating this?

justmiles commented 5 months ago

I've got a functional start here: https://github.com/justmiles/sablier

There are still a few bugs (mainly traffic being sent before the service is healthy) but feel free to jump in.

ijcd commented 3 months ago

@justmiles Cool, I can spend a bit of time on it. I haven't used sablier yet. I have nomad clusters with traefik border proxies that this could help with. I can look at the early-traffic issue -- any thoughts on how other plugins handle that? Where can I look for ideas?

justmiles commented 3 months ago

It seems to be that sablier is picking up that a service is healthy before traefik's service discovery configs have determined where to send it. After a refresh or two it gets in sync, though.

It's working well enough to solve my self-hosted needs, but I wouldn't push it to production in this current state. Would love a second set of eyes on it if you have the time.

acouvreur commented 3 months ago

If you can have a single test with a Docker compose that sets up nomad, sablier, traefik and a service that'd be great!

It will definitely help setting things up to properly have this provider. (Edit: you ready have all of that covered!)

You can submit a draft pull request targeting the beta branch!

We can also mark providers as unstable or non full feature ready, it's fine 🙂

justmiles commented 3 months ago

I started a draft PR but my fork is off of main. We'll need to rebase off of beta to get it ready-to-go. I haven't dug into the beta branch yet but looks like there's several changes!