HI .. Can someone explains how to change the defau...
# prefect-community
i
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
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
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
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
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
You will need that in the place you register from I think
i
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
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
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
So that the UI knows what API to use