I set the Deployment of my flow in the CICD runnin...
# marvin-in-the-wild
r
I set the Deployment of my flow in the CICD running inside a gitlab runner. There I do "Deployment.build_from_flow" to set it up, and then I do ".apply()" so that it become visible on the prefect gui as a deployment. I set up as a storage for the code the localStorage as a block, and it looks like "/opt/prefect/user-model-mlops-friendly". When I go to run the code from the prefect gui, I get an error: ValueError: Provided path /builds/Pzkp4_xU/0/abx/user-model is outside of the base path /opt/prefect/user-model-mlops-friendly. it is using the path of the CICD, why? how do i fix it @Marvin?
m
The error you're encountering suggests that the path being set for the deployment is taken from the CI/CD environment (where your flow is built) rather than the ultimate execution environment designated by your storage block. This is possibly due to a relative path or incorrect base path configuration when setting up the deployment. It seems to be a common issue, as seen in some of the GitHub issues related to base paths and storage blocks: - One user had a situation where the agent failed to get the flow from a storage block with a path set as a relative path (#9001). A suggested workaround for a local file system block was to modify the deployment manifest to set the path to an absolute path corresponding to the storage block basepath. - Another issue reported a ValueError thrown when deploying flows outside of the current directory (#6777). This error was happening because the path provided to
build_from_flow
was not relative to the current directory, which may also be relevant to your situation. I couldn't find a direct solution for your specific problem, but based on these similar issues, you might want to try to ensure that: 1. The path in your
Deployment.build_from_flow
must be correctly referenced regarding your storage base path set in the block configuration. 2. Check and potentially adjust the deployment manifest file manually to correct any path discrepancies. 3. Make sure the path in your Prefect deployment is absolute and points to the correct location where the flow file will be at runtime. Unfortunately, the specific details of how to make these adjustments in Prefect 2.x or how they relate to the Prefect UI were not provided in these pieces of documentation. If the issues above don't seem to address your problem directly, you may need to seek further help from the Prefect community or support channels, and consider reporting this as a bug if it seems to be a recurrent problem with Prefect.