https://prefect.io logo
Title
a

André Dias

05/23/2023, 2:52 PM
Hey team ! I’m trying to run my flows in ECS Tasks but I’m constantly facing the same issue: It seems tasks are running the container image and not actually pointing to the flow entrypoint and path. I’m using a ECSTask block and defining my custom image in the
containerDefinition
inside my
task_definition
field. I created the Deployment from:
deployment = Deployment.build_from_flow(
    flow=template_local_flow,
    name="staging",
    infrastructure=ECSTask.load("staging"),
    work_queue_name="staging",
    path="/opt/prefect/flows",
    output='staging-deployment.yaml'
)
My docker image looks like this:
FROM prefecthq/prefect:2-python3.10
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
    apt-get dist-upgrade -y && \
    apt-get autoremove -y

COPY --from=golang:latest /usr/local/go/ /usr/local/go/

ENV PATH="/usr/local/go/bin:${PATH}"

RUN apt-get install -y python3 python3-dev python3-pip git

RUN cd /opt && \
    git clone <https://github.com/zmap/zdns> && \
    cd zdns && \
    go build && \
    ln -s /opt/zdns/zdns /usr/local/bin

RUN mkdir -p /opt/prefect/flows

ADD . /opt/prefect/flows

RUN pip3 install -r /opt/prefect/flows/requirements.txt

WORKDIR /opt/prefect/flows

ENV PYTHONPATH "${PYTHONPATH}:/opt/prefect/flows"
My
deployment.yaml
specifies:
storage: null
path: /opt/prefect/flows
entrypoint: flow.py:template_local_flow
But when I run and trigger a flow in the UI, all my container outputs is the
PREFECT
message. Can anyone help please?