示例#1
0
文件: docker.py 项目: eggie5/ray
    def sync_up(self,
                source: str,
                target: Tuple[str, str],
                exclude: Optional[List] = None) -> bool:
        """Here target is a tuple (target_node, target_dir)"""
        target_node, target_dir = target

        # Add trailing slashes for rsync
        source = os.path.join(source, "")
        target_dir = os.path.join(target_dir, "")
        import click
        try:
            rsync(cluster_config=self._cluster_config_file,
                  source=source,
                  target=target_dir,
                  down=False,
                  ip_address=target_node,
                  should_bootstrap=self._should_bootstrap,
                  use_internal_ip=True)
        except click.ClickException:
            if log_once("docker_rsync_up_fail"):
                logger.warning(
                    "Rsync-up failed. Consider using a durable trainable "
                    "or setting the `TUNE_SYNC_DISABLE_BOOTSTRAP=1` env var.")
            raise

        return True
示例#2
0
    def sync_down(self, source: Tuple[str, str], target: str) -> bool:
        """Here source is a tuple (source_node, source_dir)"""
        source_node, source_dir = source

        # Add trailing slashes for rsync
        source_dir = os.path.join(source_dir, "")
        target = os.path.join(target, "")

        rsync(cluster_config=self._cluster_config_file,
              source=source_dir,
              target=target,
              down=True,
              ip_address=source_node,
              use_internal_ip=True)

        return True
示例#3
0
    def sync_up(self, source: str, target: Tuple[str, str]) -> bool:
        """Here target is a tuple (target_node, target_dir)"""
        target_node, target_dir = target

        # Add trailing slashes for rsync
        source = os.path.join(source, "")
        target_dir = os.path.join(target_dir, "")

        rsync(cluster_config=self._cluster_config_file,
              source=source,
              target=target_dir,
              down=False,
              ip_address=target_node,
              use_internal_ip=True)

        return True