Commit ab82a867 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

Merge branch 'dev' into 'main'

Dev

See merge request !4
parents ca429894 84189b1b
Pipeline #11907 passed with stage
in 0 seconds
......@@ -209,6 +209,7 @@ class Pipeline:
@staticmethod
def dump_oss_file(rpath: str, lpath: str) -> str:
"""Copy OSS file `file_src` to `file_dist`."""
print(f"rpath={rpath}, lpath={lpath}")
s3_fs.get(rpath, lpath)
assert os.path.exists(lpath), f"Failed to dump OSS file {rpath} to {lpath}!"
return lpath
......@@ -232,14 +233,14 @@ class Pipeline:
"""Create new file in output directory."""
return os.path.join(self.dir_output, file_name)
@staticmethod
def dump_file(remote_file_path: str, local_file_path: str = None) -> str:
def dump_file(self, remote_file_path: str, local_file_path: str = None) -> str:
"""Copy file `remote_file_path` to `local_file_path`."""
is_oss = remote_file_path.__contains__(":")
self.logger.info(f"Dumping file: {remote_file_path} -> {local_file_path}")
if is_oss:
local_file_path = Pipeline.dump_oss_file(remote_file_path, local_file_path)
local_file_path = self.dump_oss_file(remote_file_path, local_file_path)
else:
local_file_path = Pipeline.copy_nas_file(remote_file_path, local_file_path)
local_file_path = self.copy_nas_file(remote_file_path, local_file_path)
return local_file_path
# abspath
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment