https://prefect.io logo
#prefect-community
Title
# prefect-community
h

Horatiu Bota

05/17/2022, 9:09 PM
hi community! i'm trying to run a flow on AWS ECS using the ECS run config (https://docs.prefect.io/api/latest/run_configs.html#ecsrun) but my flow get stuck in a submitted state (already checked-out https://discourse.prefect.io/t/why-is-my-flow-stuck-in-a-submitted-state/201). I can see in the AWS console that the ECS task fails because the run command is
Command ["/bin/sh","-c","prefect execute flow-run"]
(however i need to run prefect in bash with a conda environment activated). Is there any way to configure the ECS task to remove the
["/bin/sh/", "-c",]
before the prefect command? My container is configured with the appropriate entrypoint, runs bash and activates conda at startup, but
/bin/sh -c
undoes that setup
tried setting something like this in the ECSRun setup:
Copy code
flow.run_config = ECSRun(
    task_definition_path="s3://<bucket>/task.yml",
    run_task_kwargs={
        "cluster": "test-prefect-cluster", 
        "overrides": {
        "containerOverrides": [{
                "name": "flow",
                "command": ["echo hello", "prefect execute flow-run"]
            }]
        }
    }
)
but no success
k

Kevin Kho

05/17/2022, 9:33 PM
You shouldn’t need to set the entrypoint. The agent will do that for you. I think the issue here is more of activating conda is tricky. Do you need conda? The container should already provide isolation
h

Horatiu Bota

05/17/2022, 9:38 PM
conda is active in the container (i followed the article you linked above 😅), so running:
docker run -it image-tag
locally starts a shell with the conda env activated
k

Kevin Kho

05/17/2022, 9:41 PM
Ah ok. There must be something wrong with Flow spinup. Check this thread and there is a code example you can use to add logs to the Flow to get better error messages
h

Horatiu Bota

05/17/2022, 9:45 PM
thanks! already read through that and have logs enabled - the only log message i'm getting is
/bin/sh: /bin/sh: cannot execute binary file
k

Kevin Kho

05/17/2022, 9:48 PM
Ok I re-read again. I know what you are saying now. I am actually confused where
"/bin/sh"
is added because I think we just add the
prefect execute flow run
here
Oh my bad. It’s hardcoded here
I dont think you can override this on the entrypoint though because this is a command added on top of that
h

Horatiu Bota

05/17/2022, 9:53 PM
hm, ok, thank you!
3 Views