 │ 🔶 aws         │ 📦 s3-bucket  │ s3://zenfiles  ┃┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┛

The ZenML CLI provides an even easier and more interactive way of connecting a stack component to an external resource. Just pass the -i command line argument and follow the interactive guide:

zenml artifact-store register s3-zenfiles --flavor s3 --path=s3://zenfiles

zenml artifact-store connect s3-zenfiles -i

The S3 Artifact Store Stack Component we just connected to the infrastructure is now ready to be used in a stack to run a pipeline:

zenml stack register s3-zenfiles -o default -a s3-zenfiles --set

A simple pipeline could look like this:

from zenml import step, pipeline

@step

def simple_step_one() -> str:

"""Simple step one."""

return "Hello World!"

@step

def simple_step_two(msg: str) -> None:

"""Simple step two."""

print(msg)

@pipeline

def simple_pipeline() -> None:

"""Define single step pipeline."""

message = simple_step_one()

simple_step_two(msg=message)

if __name__ == "__main__":

simple_pipeline()

Save this as run.py and run it with the following command:

python run.py

Example Command Output

Registered pipeline simple_pipeline (version 1).

Running pipeline simple_pipeline on stack s3-zenfiles (caching enabled)

Step simple_step_one has started.

Step simple_step_one has finished in 1.065s.

Step simple_step_two has started.

Hello World!

Step simple_step_two has finished in 5.681s.

Pipeline run simple_pipeline-2023_06_15-19_29_42_159831 has finished in 12.522s.

Dashboard URL: http://127.0.0.1:8237/workspaces/default/pipelines/8267b0bc-9cbd-42ac-9b56-4d18275bdbb4/runs