Add parallel rsync sessions with fpsync - #202
Conversation
…slash in the config file this doesn't construct the rsync path incorrectly
…s for XNAT downloads
…ases URLs for XNAT downloads" This reverts commit 26d1939.
HChughtai
left a comment
There was a problem hiding this comment.
fpsync looks useful, but a couple of comments. Have you seen improvements in practice using it?
| rsync_source, | ||
| "fpsync", | ||
| "-n", | ||
| "8", |
There was a problem hiding this comment.
Why 8 parallel jobs? Will this depend on the number of physical and logical CPU cores, and so need to be something that is different dependning on the machine running it?
There was a problem hiding this comment.
Yeah it will depend on physical and logical CPU cores so maybe having 8 as a default max and I could have it as an optional input i.e. parallel_jobs to the cli rsync command
Then within the cli command:
@app.command
def rsync(
source: str,
source_rsync: str,
destination_rsync: str,
log_dir: pathlib.Path = pathlib.Path("logs"),
source_projects: list[str] | None = None,
parallel_jobs: int | None = None,
) -> None:
if parallel_jobs is None:
parallel_jobs = min(8, os.cpu_count() or 1)
run_rsync(
destination_rsync,
destination_proj,
source_rsync,
source_proj,
parallel_jobs,
)
What do you think @HChughtai ?
There was a problem hiding this comment.
Yeah, looks like a sensible approach. Only thing I would say is to add some handling so that you can't pass in numbers less than 1
There was a problem hiding this comment.
Sounds good, I'll do those changes and ask you to re-review after
Yep definitely improvements using it |
Towards #197
This PR:
rsync.pystrips the trailing/to handle the user specifying the rsync paths with or without a trailing/and then adds a trailing/torsync_sourcesince it is required for the rsync commandrsync.pyreplaces simplersynccommand withfpsyncwhich runs 8 parallelrsyncsessions