Pryce
04/06/2023, 3:52 AMKetan (kumare3)
Pryce
04/06/2023, 4:01 AMKetan (kumare3)
Pryce
04/06/2023, 5:00 AMKetan (kumare3)
Flytefile
is nothing but this message encapsulated in python,
https://github.com/flyteorg/flyteidl/blob/4b4743daa3cd9362dfbfd45765a3cbbc975d89fc/protos/flyteidl/core/literals.proto#L33-L36http://, s3://, gs://, file:///
etcPryce
04/06/2023, 5:11 AMKetan (kumare3)
Pryce
04/06/2023, 7:33 PMfrom flytekit import kwtypes, task, workflow
from flytekit.extras.tasks.shell import OutputLocation, ShellTask
from flytekit.types.directory import FlyteDirectory
from flytekit.types.file import FlyteFile
t1 = ShellTask(
name="task_1",
debug=True,
script="""
set -ex
echo "Hey there! Let's run some bash scripts using Flyte's ShellTask."
head {inputs.x}
""",
inputs=kwtypes(x=FlyteFile),
output_locs=[OutputLocation(var="i", var_type=FlyteFile, location="{inputs.x}")],
)
@workflow
def shell_wf() -> FlyteFile:
x = FlyteFile("<s3://my-s3-bucket/data/inputs/my_test.txt>")
t1_out = t1(x=x)
return t1_out
if __name__ == "__main__":
print(f"Running wf() {wf()}")
@workflow
def shell_wf(x: FlyteFile) -> FlyteFile:
t1_out = t1(x=x)
return t1_out
pyflyte run --remote cat_test.py shell_wf --x ./my_test.txt
Albert Wibowo
06/08/2023, 11:33 AMKetan (kumare3)
Albert Wibowo
06/08/2023, 1:49 PMKetan (kumare3)
Albert Wibowo
06/08/2023, 2:48 PM