Open VallariAg opened 10 months ago
I'd like to work on this issue. So basically instead of the YAML file path the request would contain the contents of the file, and we need to save it as a temporary file (something like <username>_<timestamp>.yaml
) and pass that to the teuthology function?
Correct! You can create the temporary file using https://docs.python.org/3/library/tempfile.html and then delete it after the scheduling is finished.
Understood, I'll take a look at this library and start working on it!
I looked at the tempfile
module and this is what I was able to gather. Once the with block is over, the temporary file will be deleted automatically and until then it will show as a temporary file on the system.
after writing the YAML content to this tmp, we can pass it on to the teuthology.main
function, and can put the user's name as suffix if required
Yes, that sounds good! Like in our docker setup, we use this yaml config while scheduling: https://github.com/ceph/teuthology/blob/main/docs/docker-compose/teuthology/containerized_node.yaml
Also it's possible to get multiple configs which is why "teuthology.main
.
So after creating temporary files for all configs, I should replace the <config_yaml>
key with the list of names of those temporary files?
can i work on this? @VallariAg
So after creating temporary files for all configs, I should replace the
key with the list of names of those temporary files?
@Devansh3712 sorry for late reply! And yes, you pass the path of all the temporary config files like: {"<config_yaml>": ["path/to/config.yaml"] ....}
. I think that should work!
@octonawish-akcodes please check with Devansh if he's still working on this issue.
understood, and yes i'm working on this issue
Route /suite has
<config_yaml>
in request schema. It takes path to the yaml config file in the data body, for example:https://github.com/ceph/teuthology-api/blob/9af7fb0d39501feedac82f030c7060eb4b7e8a03/src/teuthology_api/schemas/suite.py#L44
This would mean that the config file should already exist on t-api's server. For more practical use-case, we can accept a string with the yaml config content. After receiving a request, teuthology-api can save this yaml content in a temporary file and then pass path to that file to
teuthology.suite.main
function.