Anton L.
04/15/2024, 1:17 PMMarvin
04/15/2024, 1:18 PMpip install prefect
2. Start the Local Server: Use prefect orion start
command to start the Prefect Orion local development server.
3. Set Local API URL: Configure Prefect to use the local API server by setting the PREFECT_API_URL
environment variable to the local server's URL. The default is usually <http://localhost:4200/api>
.
bash
export PREFECT_API_URL="<http://localhost:4200/api>"
Or you can set the PREFECT_API_URL
configuration in the Prefect user configuration file (~/.prefect/config.toml).
4. Create a Local Work Queue: Create a work queue for your local server that your flows will be submitted to:
bash
prefect work-queue create local-queue
5. Run Worker: Start a Prefect worker that pulls from the local work queue. Make sure the API URL points to your local server:
bash
prefect worker start -q local-queue
6. Register and Run Flows: When defining your flows, make sure to specify local-runner
as your flow runner. Then you can register your flow with the local server and run it using the Prefect CLI.
The documentation pages returned in the search were not specific to Prefect Core's local server mode.
For more detailed instructions, you should consult the Prefect Core documentation on local execution and the tutorial on flow orchestration with Prefect, which will have the most up-to-date and relevant information:
- Prefect Docs - FAQ
- Prefect Docs - Cloud Connecting
Please note that, at the time of writing, the Prefect Orion local development server (part of Prefect 2.0+) would be the actual server to start. If you're using Prefect Core 1.0, the instructions might differ slightly. You should consult the Prefect documentation for the version you're using for exact details.Anton L.
04/15/2024, 1:24 PMprefect orion start
I get
Usage: prefect [OPTIONS] COMMAND [ARGS]...
Try 'prefect --help' for help.
╭─ Error ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ No such command 'orion'. │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
(venv) avl@avl-mac isolated-short % prefect --help
Marvin
04/15/2024, 1:24 PMprefect orion start
but rather just prefect server start
for starting a local server instance with Prefect Core 1.0. This command will spin up a local Prefect server UI that you can access by default at <http://127.0.0.1:4200>
.
Based on the error message you've received and the accompanying help output, it's possible that you might be using an older version of Prefect Core that pre-dates Orion features or Prefect 2.0 commands. Make sure you have the latest version of Prefect installed, which you can check by running:
bash
prefect version
If you indeed want to use Prefect 2.0 features (Orion), you may need to install or update to the latest version. You can do this with the following pip command:
bash
pip install -U "prefect>=2.0"
After updating to Prefect 2.0, the Orion server can be started with:
bash
prefect orion start
Please note that as Prefect 2.0 was approaching a stable release in early 2022, if you are looking to use the very latest features, the commands might differ. Always refer to the Prefect documentation for the most current and version-specific information.