Azure-Samples / rag-postgres-openai-python

A RAG app to ask questions about rows in a database table. Deployable on Azure Container Apps with PostgreSQL Flexible Server.
MIT License
263 stars 132 forks source link

Prepackage hooks runs after building the docker image #53

Closed john0isaac closed 4 months ago

john0isaac commented 5 months ago

Description

The first deployment fails (obviously as the static folder was not included in the docker image)

image

After deploying again the website works (as the static folder is already there from the first deployment)

Proposal

Is this an azd failure or do we understand the service lifecycle wrong? The frontend build step is in the prepackage stage yet it happens after building the docker image.

john0isaac commented 4 months ago

So Wallace Breza says that this should be a prebuild hook not prepackage but let's see what he will say on the issue. Changing the step from prepackage to prebuild should resolve this issue. https://github.com/Azure/azure-dev/issues/3546#issuecomment-2005003062

I'm just wondering why is not consistent in the behavior he described only the first run follows the behavior he mentioned.

pamelafox commented 4 months ago

Huh, thanks for linking the issue. Let's change to prebuild then.

john0isaac commented 4 months ago

FYI this needs to be done for all of the samples that has a "build" stage in their lifecycle where it builds a docker image. Any sample with ACA that has prepackage command that runs frontend build needs to be changed to prebuild