Closed lebrice closed 5 months ago
Attention: Patch coverage is 80.25478%
with 93 lines
in your changes are missing coverage. Please review.
Project coverage is 62.21%. Comparing base (
ce86eae
) to head (212658b
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I will rebase this and make it much cleaner and easier for others to review. I'll mark this as "ready for review" when I'm done. Should probably be done today.
What this does
This PR adds some new functions and classes which will be used in the near future to significantly refactor most commands of milatools.
Once these commands are made to use the content of this PR, they will:
mila
cluster (such asmila code
).Highlights for reviewers (take a look at this first):
I would appreciate it if you could take a quick look at a few particular things, if you feel like it of course:
run
function: https://github.com/lebrice/milatools/blob/add_computenode_localv2/milatools/utils/local_v2.py#L102run_async
function: https://github.com/lebrice/milatools/blob/add_computenode_localv2/milatools/utils/local_v2.py#L102salloc
function: https://github.com/lebrice/milatools/blob/add_computenode_localv2/milatools/utils/compute_node.py#L278sbatch
function: https://github.com/lebrice/milatools/blob/add_computenode_localv2/milatools/utils/compute_node.py#L359ComputeNode.run
method : https://github.com/lebrice/milatools/blob/add_computenode_localv2/milatools/utils/compute_node.py#L69Here's a little class diagram illustrating the relationship between
Runner
,LocalV2
,RemoteV2
, andComputeNode
:Refactor:
RemoteV2.connect
, an asynchronous constructor for connecting to a cluster;salloc
andsbatch
function that request ressources and return aComputeNode
ComputeNode
class that can be used to run commands inside a job.LocalV1
,RemoteV1
andSlurmRemote
: Code editors will show that using these is now discouraged. Importantly, this will NOT raise a warning to the user.