bright-businessperson-42051
03/15/2023, 2:12 PM@task(cache=True, cache_version="2.0")
def process_video() -> FlyteFile:
"""
Run clip_extract on video
"""
input_path = FlyteFile("<s3://my-s3-bucket/dataset/test.asf>")
output_file = FlyteFile("output.mjpg")
command = ['ffmpeg', '-i', str(input_path), '-c:v', 'mjpeg', '-q:v', '3', '-an', str(output_file)]
subprocess.check_call(command)
return output_file
freezing-airport-6809
bright-businessperson-42051
03/15/2023, 2:44 PMfreezing-airport-6809
freezing-airport-6809
freezing-airport-6809
freezing-airport-6809
bright-businessperson-42051
03/16/2023, 2:08 PMfreezing-airport-6809
freezing-airport-6809
freezing-airport-6809
tall-lock-23197
FlyteFile
within a task. It's usually to handle the communication between the tasks, right? download()
won't work here because it's be a noop in this case. So if there's a file in minio and you aren't passing that as an input to a Flyte task, I believe it needs to be downloaded manually using, say, get_data
.
https://github.com/flyteorg/flytekit/blob/34f80ba12eda64431be4c21c78df81b7afbe2758/flytekit/types/file/file.py#L361tall-lock-23197
output_file = FlyteFile("output.mjpg")
needs to be output_file = "output.mjpg"
and you'll need to return FlyteFile(output_file)
.