oneibl.patcher

Classes

FTPPatcher

This is used to register from anywhere without write access to FlatIron

GlobusPatcher

Requires GLOBUS keys access

Patcher

SSHPatcher

Requires SSH keys access on the FlatIron

class Patcher(one=None)[source]

Bases: abc.ABC

register_dataset(file_list, **kwargs)[source]

Registers a set of files belonging to a session only on the server :param file_list: (list of pathlib.Path) :param created_by: (string) name of user in Alyx (defaults to ‘root’) :param repository: optional: (string) name of the server repository in Alyx :param versions: optional (list of strings): versions tags (defaults to ibllib version) :param dry: (bool) False by default :return:

register_datasets(file_list, **kwargs)[source]

Same as register_dataset but works with files belonging to different sessions

patch_dataset(file_list, dry=False, ftp=False, **kwargs)[source]

Creates a new dataset on FlatIron and uploads it from arbitrary location. Rules for creation/patching are the same that apply for registration via Alyx as this uses the registration endpoint to get the dataset. An existing file (same session and path relative to session) will be patched. :param path: full file path. Must be whithin an ALF session folder (subject/date/number) can also be a list of full file pathes belonging to the same session. :param server_repository: Alyx server repository name :param created_by: alyx username for the dataset (optional, defaults to root) :param ftp: flag for case when using ftppatcher. Don’t adjust windows path in _patch_dataset when ftp=True :return: the registrations response, a list of dataset records

patch_datasets(file_list, **kwargs)[source]

Same as create_dataset method but works with several sessions

class GlobusPatcher(one=None, globus_client_id=None, local_endpoint=None, label='ibllib patch')[source]

Bases: oneibl.patcher.Patcher

Requires GLOBUS keys access

patch_datasets(file_list, **kwargs)[source]

Calls the super method that registers and updates the current computer to Python transfer Then, creates individual transfer items for each local server so that after the update on Flatiron, local server files are also updated :param file_list: :param kwargs: :return:

launch_transfers()[source]

Launches the globus transfer and delete from the local patch computer to the flat-rion :param: local_servers (False): if True, sync the local servers after the main transfer :return: None

launch_transfers_secondary()[source]

patcher.launch_transfer_secondary() Launches the globus transfers from flatiron to third-party repositories (local servers) This should run after the the main transfer from patch computer to the flatiron :return: None

class SSHPatcher(one=None, globus_client=None)[source]

Bases: oneibl.patcher.Patcher

Requires SSH keys access on the FlatIron

class FTPPatcher(one=None, globus_client=None)[source]

Bases: oneibl.patcher.Patcher

This is used to register from anywhere without write access to FlatIron

create_dataset(path, created_by='root', dry=False, repository='ibl_patcher')[source]
mktree(remote_path)[source]

Browse to the tree on the ftp server, making directories on the way