|
1 | 1 | """Dummy Prefect workflow that prints a message on an OSW page. |
2 | 2 |
|
3 | | -Usage (PowerShell): |
4 | | - $env:PREFECT_API_URL="https://osw.example.com:4200/api" |
5 | | - $env:PREFECT_PUBLIC_URL="https://osw.example.com/w/rest.php/apigateway/v1/prefect" |
6 | | - $env:OSW_USER="Bot@name" |
7 | | - $env:OSW_SERVER="osw.example.com" |
8 | | - $env:OSW_PASSWORD="bot-password" |
9 | | - python examples/prefect/hello_world.py |
10 | | -
|
11 | | -Usage (Bash): |
12 | | - export PREFECT_API_URL="https://osw.example.com:4200/api" |
13 | | - export PREFECT_PUBLIC_URL="https://osw.example.com/w/rest.php/apigateway/v1/prefect" |
14 | | - export OSW_USER="Bot@name" |
15 | | - export OSW_SERVER="osw.example.com" |
16 | | - export OSW_PASSWORD="bot-password" |
17 | | - python examples/prefect/hello_world.py |
| 3 | +Option A — Direct Prefect access (worker can reach Prefect server directly): |
| 4 | +
|
| 5 | + PowerShell: |
| 6 | + $env:PREFECT_API_URL="https://osw.example.com:4200/api" |
| 7 | + $env:PREFECT_PUBLIC_URL="https://osw.example.com/w/rest.php/apigateway/v1/prefect" |
| 8 | + $env:OSW_USER="Bot@name"; $env:OSW_SERVER="osw.example.com" |
| 9 | + $env:OSW_PASSWORD="bot-password" |
| 10 | + python examples/prefect/hello_world.py |
| 11 | +
|
| 12 | + Bash: |
| 13 | + export PREFECT_API_URL="https://osw.example.com:4200/api" |
| 14 | + export PREFECT_PUBLIC_URL="https://osw.example.com/w/rest.php/apigateway/v1/prefect" |
| 15 | + export OSW_USER="Bot@name" OSW_SERVER="osw.example.com" |
| 16 | + export OSW_PASSWORD="bot-password" |
| 17 | + python examples/prefect/hello_world.py |
| 18 | +
|
| 19 | +Option B — ApiGateway only (Prefect server behind firewall, only reachable |
| 20 | + through MediaWiki ApiGateway extension): |
| 21 | +
|
| 22 | + PowerShell: |
| 23 | + $env:PREFECT_API_URL="https://osw.example.com/w/rest.php/apigateway/v1/prefect" |
| 24 | + $env:OSW_USER="Bot@name"; $env:OSW_SERVER="osw.example.com" |
| 25 | + $env:OSW_PASSWORD="bot-password" |
| 26 | + python examples/prefect/hello_world.py |
| 27 | +
|
| 28 | + Bash: |
| 29 | + export PREFECT_API_URL="https://osw.example.com/w/rest.php/apigateway/v1/prefect" |
| 30 | + export OSW_USER="Bot@name" OSW_SERVER="osw.example.com" |
| 31 | + export OSW_PASSWORD="bot-password" |
| 32 | + python examples/prefect/hello_world.py |
18 | 33 |
|
19 | 34 | Environment variables: |
20 | | - PREFECT_API_URL Prefect server API URL (used by the worker) |
| 35 | + PREFECT_API_URL Prefect server API URL (used by the worker). |
| 36 | + Can be a direct URL or an ApiGateway URL. |
21 | 37 | PREFECT_PUBLIC_URL (optional) Public URL stored in PrefectFlow entity, |
22 | | - for use by browser clients (e.g. prefect.js). |
| 38 | + for browser clients (e.g. prefect.js). |
23 | 39 | Falls back to PREFECT_API_URL if not set. |
| 40 | + Only needed when PREFECT_API_URL differs from the |
| 41 | + public gateway URL (Option A). |
24 | 42 | OSW_USER OSW bot username |
25 | 43 | OSW_SERVER OSW instance domain |
26 | 44 | OSW_PASSWORD OSW bot password. If not set, falls back to a |
|
0 commit comments