Learn how Prefect flow deployments enable configuring flows for scheduled and remote execution with workers.
.serve
processsudo
commands.sudo yum install -y python3 python3-pip
.
serve
process when Linux starts.
This approach provides resilience by automatically restarting the process if it crashes.
prefect
account.
Next, log in to the prefect
account by running:
prefect
application in the bin
subdirectory of your virtual environment.
Next, set up your environment so the Prefect client knows which server to connect to.
If connecting to Prefect Cloud, follow the instructions
to obtain an API key, and then run the following:
exit
command to sign out of the prefect
Linux account.
This command switches you back to your sudo-enabled account where you can run the commands in the
next section.
.serve
process.
/etc/systemd/system
folder and open a file for editing.
We use the Vim text editor below.
.serve
/home
directory (or the directory of your choice).
Here’s a basic example flow:
flow.from_source().serve()
,
as in the example below.
/etc/systemd/system
folder and open a file for editing.
This example below uses Vim.
:wq!
, then press the return key.
Next, make systemd aware of your new service by running:
systemctl status my-prefect-service
.
You now have a systemd service that starts when your system boots, which will restart if it ever crashes.