MCPcopy Create free account
hub / github.com/SeldonIO/seldon-server / copy

Method copy

python/seldon/fileutil.py:238–263  ·  view source on GitHub ↗

copy files. local->local, S3->local, local->S3 (S3->S3 not supported) Args: fromPath (str): local or S3 URL toPath (str): local or S3 URL

(self,fromPath,toPath)

Source from the content-addressed store, hash-verified

236
237
238 def copy(self,fromPath,toPath):
239 """copy files. local->local, S3->local, local->S3 (S3->S3 not supported)
240
241 Args:
242 fromPath (str): local or S3 URL
243 toPath (str): local or S3 URL
244 """
245 if fromPath.startswith("s3n://") or fromPath.startswith("s3://"):
246 fromS3 = True
247 else:
248 fromS3 = False
249 if toPath.startswith("s3n://") or toPath.startswith("s3://"):
250 toS3 = True
251 else:
252 toS3 = False
253 if not fromS3 and not toS3:
254 self.copy_local(fromPath,toPath)
255 elif not fromS3 and toS3:
256 self.upload_s3(fromPath,toPath)
257 elif fromS3 and not toS3:
258 if os.path.isdir(toPath):
259 self.download_s3(fromPath,toPath)
260 else:
261 logger.error("Local destination folder must exist :%s",toPath)
262 else:
263 logger.warn("can't copy from s3 to s3")
264
265
266

Callers 14

save_recommenderMethod · 0.95
load_recommenderMethod · 0.95
load_extensionMethod · 0.95
save_extensionMethod · 0.95
save_dataframeMethod · 0.95
create_dataframeMethod · 0.95
save_pipelineMethod · 0.95
load_pipelineMethod · 0.95
__getstate__Method · 0.80
__getstate__Method · 0.80
__getstate__Method · 0.80
__getstate__Method · 0.80

Calls 3

copy_localMethod · 0.95
upload_s3Method · 0.95
download_s3Method · 0.95

Tested by

no test coverage detected