Closed rgbkrk closed 8 years ago
OK, so if I am understanding this right (first time diving into tmpnb-redirector
codebase), we would like to:
/api/spawn
route to the tmpnb-redirector
app.Does that seem correct? Also, how do we want to select the "node with availability" in step 2?
Add a /api/spawn route to the tmpnb-redirector app.
Yup!
Select a node within self.settings.stats that contains the most available containers.
Yup!
Redirect to that host with the payload originally provided in 1.
Eh... There won't be a payload, the message body will be empty, just like the tmpnb /api/spawn
endpoint.
how do we want to select the "node with availability" in step 2?
This currently gets done in the Reroute Handler, randomly selected from the available. You can use that for now, likely adapted into a separate function.
Eh... There won't be a payload, the message body will be empty, just like the tmpnb /api/spawn endpoint.
Totally knew that! Was checking to see if you did! ;) But yes, I got it.
This currently gets done in the Reroute Handler, randomly selected from the available. You can use that for now, likely adapted into a separate function.
Saw that but wasn't sure if we wanted to carry that over. This sounds reasonable and also extension-able.
I think I've got enough here to be able to cook something up! I'll open up a WIP PR and ping you on that if I have any questions.
OK, I'm gonna be absolutely silly and create a bunch of issues for different parts of this right now. For my own sanity. :)
create a bunch of issues for different parts of this right now
Breaking it up is a great way to go. Thank you!
Wow that pink haired hard working cat. :smile_cat:
I'm waiting for you to realize that I'm actually a cat dressed in a human costume.
When a user hits the
/api/spawn
endpoint:tmpnb redirector would then pass the POST on to one of the tmpnb nodes that has availability, returning their response but with a full path:
/cc @captainsafia