https://prefect.io logo
#prefect-community
Title
# prefect-community
i

ibrahem

06/26/2022, 6:37 PM
HI .. Can someone explains how to change the default configuration files locations such as storage directory and flows locations, the default is HOME/.prefect/ would like to move it to /data/prefect_server/. Can someone point me to the proper docs
k

Kevin Kho

06/26/2022, 8:59 PM
For Prefect 2, there is an env variable. See this. There is a snippet that lists all of the environment variables. For Prefect 1, check this
i

ibrahem

06/26/2022, 9:25 PM
Thanks @Kevin Kho. Using version 1. What I did was: 1. export PREFECT__USER_CONFIG_PATH = /data/prefect_home/.prefect/config.toml 2. inside the config.toml: a. home_dir = "/data/prefect_home/.prefect" 3. prefect server stop 4. prefect server start 5. create a flow 6. go to the UI open a flow and open the overview tab a. toggle the details tab in left box, the Flow Locations still points to /home/{user}/.prefect/flows/prefect/{timestamp}
k

Kevin Kho

06/26/2022, 9:32 PM
Where is the
config.toml
? Server side or on the local machine side? I think that looks right. I would expect the config.toml to be on the machine you are registering from You can also do:
Copy code
flow.storage = Local(directory=..)
and it would save it there.
i

ibrahem

06/26/2022, 9:35 PM
all on the server side. what I did was: cp .prefect from my home directory to /data/prefect_home then I sat the env variable to this new location (steps mentioned above)
k

Kevin Kho

06/26/2022, 9:40 PM
You will need that in the place you register from I think
i

ibrahem

06/26/2022, 9:47 PM
I deleted .prefect from my home directory now the UI works but I can't registry new flows .. not sure why but still the env variable is not being used. The error received now "prefect.exceptions.AuthorizationError: Malformed response received from Cloud - please ensure that you are authenticated. See
prefect auth login --help
." strange since I'm using server backend not cloud.
k

Kevin Kho

06/26/2022, 9:49 PM
Do
Copy code
prefect backend server
to point to server and set
Copy code
PREFECT__SERVER__ENDPOINT=<http://IP_OF_VIRTUAL_MACHINE/graphql:4200>
on local
i

ibrahem

06/26/2022, 9:49 PM
okay i see now.. the default is cloud once I did
Copy code
$ prefect backend server
the .prefect created in the home of the user once again
Not sure what I did wrong but thanks @Kevin Kho for taking the time, I'll keep testing this case. From the look of it it seems simple and straight forward, if you managed to search at your end please share with me your finding and I'll do the same. Thanks.
@Kevin Kho quick question kevin. why do we need to set the graphql endpoint at the client side?
k

Kevin Kho

06/27/2022, 3:14 PM
So that the UI knows what API to use
8 Views