VROOM-Project / vroom-scripts

BSD 2-Clause "Simplified" License
34 stars 20 forks source link

Using Minimize Completion Time via Docker/ API Calls #35

Closed dvortsis closed 2 years ago

dvortsis commented 2 years ago

Dear @jcoupey ,

Thank you so much for working on #31 . This is extremely helpful for what I've been attempting to accomplish!

Pardon my question but I'm a noob when it comes to all this and I desperately want to utilize your solution. I'm using vroom in a docker container, which receives HTTP API requests. How would I incorporate this script into such a configuration?

jcoupey commented 2 years ago

The HTTP requests are going through vroom-express, so what you should do is replace the usual vroom system call happening there:

https://github.com/VROOM-Project/vroom-express/blob/2add746cf8909175ffaea739037c783064114b87/src/index.js#L137

The vroomCommand variable should be replaced by a call to the new script, looking like python3 /path/to/asap.py. So you'll also have to make the asap.py script available (probably by cloning this repo into your container).

dvortsis commented 2 years ago

Hi @jcoupey ,

You rock! I truly appreciate the assistance. That makes perfect sense.

I will work on it this afternoon. Have a great rest of your week :)

SirTypesALot commented 2 years ago

Hi, I'm trying to find the index file you have aforementioned in the vroom docker folder, however I'm failing to do so. Could you maybe tell me where would I be able to find the file a bit more specific? Thanks

jcoupey commented 2 years ago

@SirTypesALot fetching the vroom-express stuff happens here in the Dockerfile https://github.com/VROOM-Project/vroom-docker/blob/de87a26c5ee0eae89ffc486741106b0e40505c56/Dockerfile#L28-L38 so there should be a vroom-express folder somewhere, containing the src/index.js file.