Hi team, I need help I want to install boto3 to connect to AWS from my flyte sandbox environment running locally
I tried adding the boto3 python package in the ImageSpec in my workflow but when I register the workflow it does not install it inside the container and the workflow fails.
Any support for this?
below is the code:and the command I used to register the workflow is:
pyflyte register workflows/aws_identity.py --project flytesnacks --domain development
Code:
from flytekit import task, workflow, ImageSpec
image_spec = ImageSpec(
packages=["boto3", "pandas"],
registry="ghcr.io/flyteorg",
)
if image_spec.is_container():
import boto3
@task(container_image="image_spec")
def whoami() -> str:
import boto3
client = boto3.client("sts")
identity = client.get_caller_identity()
return f"Hello from account: {identity['Account']} as {identity['Arn']}"
@workflow
def identity_wf() -> str:
return whoami()