Ben Muller

11/02/2022, 2:20 AM
Hi Community - me again. I have a strange one, I have set up an agent in ECS with a custom image that has
deps installed. I have an infrastructure
block that pulls a custom image:
FROM        prefecthq/prefect:2.6.5-python3.9

RUN         pip install prefect-aws s3fs==2022.5.0
This installs everything I need to run a demo flow that is:
import prefect
from prefect import flow, task, get_run_logger
from utilities import AN_IMPORTED_MESSAGE

from prefect_aws.ecs import ECSTask

ecs_task_block = ECSTask.load("staging-test")

def log_task():
    logger = get_run_logger()
    <|>("Hello %s!", "BEN")
    <|>("Prefect Version = %s ๐Ÿš€", prefect.__version__)

def my_test_flow(name: str):

if __name__ == "__main__":
This flow is using S3 Block Storage, now when I trigger this flow from the cloud UI the task is generated in my cluster, it just fails with a
ModuleNotFoundError: No module named 'prefect_aws.ecs'
More details in ๐Ÿงต
โœ… 1
Steps to reproduce locally with the Dockerfile :upvote:
$ docker build  . -t prefect
$ docker run -it --name my_prefect prefect /bin/sh
$ pip show prefect-aws
( it is there )
$ python -c "from prefect_aws.ecs import ECSTask"
โŒ What am I doing here or not understanding about how storage runs and executes?
Ok - I think I have this solved. For anyone else out there that runs into a similar issue, the default
version was 0.1.2 So I had to specify 0.1.7. This then caused issues with the
version I had specified, so I then had to relax those to include any version and it worked.
๐Ÿ™Œ 2
:thank-you: 1