Hi Prefect team, I used to have below deployment (...
# ask-community
b
Hi Prefect team, I used to have below deployment (tc_flow.py) under root, which worked fine. But after I re-structured the code structure, moved tc_flow.py to a subfolder
src
(i.e.
src/tc_flow.py
). When I deployed with
python src/tc_flow.py
, I got error when triggering the flow. Any thoughts? Thanks.
Copy code
Flow run infrastructure exited with non-zero status code:
 Container exited with non-zero code (Error Code: 1)
This may be caused by attempting to run an image with a misspecified platform or architecture.
Copy code
tc_flow.py

@flow 
def tc_flow():
    ...

if __name__ == "__main__":
    tc_flow.deploy(name="TC-Summary-ACR",
            work_pool_name="my-aci-pool",
            image= DockerImage(name="tc-summary-image:v1.0.0", platform="linux/amd64"),
            schedule= CronSchedule(cron="0 16 * * *", timezone="America/Los_Angeles")
            )
And I also tried to create a
main.py
under root folder, the deploy with
python main.py
, but I got the same error.
Copy code
main.py

from src.tc_flow import tc_flow

if __name__ == "__main__":
    tc_flow.deploy(name="TC-Summary-ACR",
            work_pool_name="my-aci-pool",
            image= DockerImage(name="tc-summary-image:v1.0.0", platform="linux/amd64"),
            schedule= CronSchedule(cron="0 16 * * *", timezone="America/Los_Angeles")
            )
n
hi @bobzheng258 - I don't think this is related to your directory structure, it seems like
This may be caused by attempting to run an image with a misspecified platform or architecture.
this is the issue which is about how your image is built and from what type of machine - do you have a mac?
b
Hi @Nate, thanks for your reply. I just figured out the issue (2 mins back😀). That's correct it's not about code structure. I used AI to help to refactored the code, somehow the some libs in the requirements.txt are missing. But I have them installed in .venv, that's the reason, I was to able to run the flow in local. I figured out this by run the built docker image locally using
docker run
, which gave me the lib missing errors. One suggestion: if the error can output the docker execution error, it would be more helpful, instead of just "Container exited with non-zero code (Error Code: 1)"