<@ULVA73B9P> i'm trying to deploy to ECS and creat...
# ask-marvin
b
@Marvin i'm trying to deploy to ECS and create the docker image with the following
main
- the "platform" argument isn't working here. What's the proper way to specify the architecture?
Copy code
if __name__ == "__main__":
    dead_pool_status_check.deploy(
        name="dka-ecs-deployment", 
        work_pool_name="dka-ecs-pool", 
        image="<http://222975130657.dkr.ecr.us-east-1.amazonaws.com/prefect-flows:latest|222975130657.dkr.ecr.us-east-1.amazonaws.com/prefect-flows:latest>",
        platform="linux/arm64",
    )
m
platform argument no worky in
dead_pool_status_check.deploy
. Me check docs and issues for you. What version of Prefect you use?
b
3.0.1
@Marvin version 3.0.1
m
Okay, Grug find some info. Looks like
platform
might not be directly supported as argument in
deploy
. Instead, use it within Docker build config. For ECS and Prefect 3, you probably need to specify the Docker platform during the build process using Dockerfile or Docker commands, not in the
deploy
function. Here some links help: - Prefect Deployment Examples - GitHub Issue and PR Tracking Deployment Config Try focusing on specifying architecture in your Docker build. If still no work, Grug suggests looking at how Docker build platforms are set up in those examples.
b
@Marvin I found the following which seemed to take the platform variable:
Copy code
if __name__ == "__main__":
    dead_pool_status_check.deploy(
        name="dka-ecs-deployment",
        work_pool_name="dka-ecs-pool",
        image=DockerImage(
            name="<http://222975130657.dkr.ecr.us-east-1.amazonaws.com/prefect-flows:latest|222975130657.dkr.ecr.us-east-1.amazonaws.com/prefect-flows:latest>",
            platform="linux/arm64",
        ),
    )
However - i'm getting the following error when running my Flow:
Copy code
This may be caused by attempting to run an image with a misspecified platform or architecture.
It seems like it's not fully accepting that parameter - the "Task" in ECS is not being set to ARM
m
Grug couldn't find exact match for your error, but close enough. Maybe problem in ECS Task definition not recognizing
platform
. Possible solutions: 1. Double-check Docker image built with correct platform:
docker buildx build --platform linux/arm64 ...
2. Confirm ECS Task definition sets architecture correctly. You might need to adjust it directly on AWS console. Some helpful links: - Deployment Examples in Prefect - GitHub PR with related info If issue persists, could be worth opening new issue on Prefect GitHub with detailed error and setup. Grug hope this helps!
b
I got it - I actually needed to force it to AMD and not ARM (normally I'm running arm)