Max Kolasinski
01/09/2024, 11:54 PMMarvin
01/09/2024, 11:54 PMos
module to change directories, e.g., os.chdir('path/to/working/directory')
.
It would be beneficial to search GitHub issues for related discussions or possible enhancements, as this feature or its workaround might be a topic within the community. Would you like me to search GitHub issues for you?Max Kolasinski
01/09/2024, 11:54 PMMarvin
01/09/2024, 11:55 PMset_working_directory
) for the flow.
2. Encountered error while running prefect.deployments.steps.set_working_directory - FileNotFoundError (#10285):
A user encountered an error related to setting the working directory during flow deployment. It seems that Prefect attempts to set a working directory based on the local directory used when creating the deployment, which may not exist in the execution environment.
3. Cloning Error during pull step in deployment only after first run (#10420):
The issue here is with the cloning process during the pull step of a deployment, but it's interesting as it includes the use of set_working_directory
in the prefect.yaml. It seems that Prefect supports setting the working directory as part of the deployment process.
Based on this information, it appears that Prefect does allow for setting a working directory as part of the flow deployment process through configuration settings in the prefect.yaml file. The set_working_directory
step is a clue that you can, in fact, specify the working directory, but this functionality might be dependent upon how your Prefect environment and infrastructure are set up.
If you are encountering issues or need further details on this functionality, it might help to examine the GitHub issues that I found or consult the Prefect community or documentation for updated best practices.Nate
01/09/2024, 11:58 PMMax Kolasinski
01/10/2024, 12:01 AM/opt/prefect/flows
but Prefect appears to be looking for them in /opt/prefect
, eg;
FileNotFoundError: [Errno 2] No such file or directory: '/opt/prefect/cowsay_example.py'
Any recommendations?Nate
01/10/2024, 12:01 AMMax Kolasinski
01/10/2024, 12:02 AMflows.deploy()
paradigm has tools for building right then-and-there but I’d like to keep our existing CI/CD structure if possibleNate
01/10/2024, 12:04 AMNate
01/10/2024, 12:06 AMMax Kolasinski
01/10/2024, 12:06 AMNate
01/10/2024, 12:09 AMMarvin
01/10/2024, 12:09 AMset_working_directory
that you are looking for. However, it provided details about changing workspaces and configuring Prefect API settings in general. You might want to try looking for the example directly in the Prefect documentation at docs.prefect.io or by checking the Prefect GitHub repository for code snippets that might reference set_working_directory
. If you have the ability to open a web page, searching the documentation directly might be your fastest route to an answer.Nate
01/10/2024, 12:09 AMMax Kolasinski
01/10/2024, 12:09 AMNate
01/10/2024, 12:11 AMMax Kolasinski
01/10/2024, 1:28 AMset_working_directory
. One thing that has confused me a bit in learning these new deployment structures is what exactly the flow.deploy()
equivalent of the yaml
`build`/`pull` would be- I haven’t been able to find any examples of what those look like programmatically.
I was able to successfully run a flow by just manually moving the files from /opt/prefect/flows
to /opt/prefect
, so in theory my strategy should work if I can just figure out how to change the working directory. Unfortunately _`PREFECT_LOCAL_STORAGE_PATH`_ doesnt seem to work 😆Nate
01/10/2024, 2:02 AMNate
01/10/2024, 2:03 AMNate
01/10/2024, 2:03 AMMax Kolasinski
01/10/2024, 2:29 PMflow.deploy()
instead of defining it in yaml