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

Timo

08/26/2022, 1:59 PM
Hi there, I started a Orion Server on a on-prem Linux VM (prefect orion start) and if I access it via browser it shows me my local flow runs. I expected the flow runs which are startet for this particular instance. How can I access the flow runs of the remote instance?
1
r

Ryan Peden

08/26/2022, 2:20 PM
Hi Timo, did you create and apply a deployment and then start a Prefect agent on the remote instance?
prefect orion start
only runs the Prefect API and UI. If you want flows that run remotely, you will need to set up remote storage for your flow, create a deployment, and then start an agent that connects to your deployment's work queue. You can start an agent on the same machine as the API and UI if you want to, or you can run the agent on a different machine. Just make sure you run
prefect config set PREFECT_API_URL=<http://your-prefect-url>
so the agent knows how to reach the API server.
t

Timo

08/26/2022, 2:24 PM
Hi Ryan, I don't deployed anything. I simply run
prefect orion start
on the remote VM. If I call it on the browser I see the exact same things (flow runs, blocks...) like if I run it on my local machine. I expected an empty environment when I access the remote instance.
I think it uses my local orion.db in my profile right? Is there a way to use the remote one?
r

Ryan Peden

08/26/2022, 2:44 PM
If you run
prefect config view
on your local machine, does it show the address of the remote Orion server for PREFECT_API_URL? The reason I ask is that if you run flows locally with PREFECT_API_URL set to the remote Orion server's address, your local flow run results will be sent to the remote Orion server and will show up there.
t

Timo

08/26/2022, 2:56 PM
it's only printing
I didn't run any flow after starting the remote server
to be more precise : I started the remote server like this:
prefect orion start --port 4444 --host 0.0.0.0
If I look at the settings page on the REMOTE server it prints out this:
Copy code
Orion Settings
PREFECT_HOME: ~/.prefect
PREFECT_DEBUG_MODE: false
PREFECT_CLI_COLORS: true
PREFECT_CLI_WRAP_LINES: true
PREFECT_TEST_MODE: false
PREFECT_TEST_SETTING: 
PREFECT_API_URL: 
PREFECT_API_KEY: 
PREFECT_CLOUD_URL: <https://api.prefect.cloud/api>
PREFECT_API_REQUEST_TIMEOUT: 30
PREFECT_PROFILES_PATH: ${PREFECT_HOME}/profiles.toml
PREFECT_LOCAL_STORAGE_PATH: ${PREFECT_HOME}/storage
PREFECT_LOGGING_LEVEL: INFO
PREFECT_LOGGING_SERVER_LEVEL: WARNING
PREFECT_LOGGING_SETTINGS_PATH: ${PREFECT_HOME}/logging.yml
PREFECT_LOGGING_EXTRA_LOGGERS: 
PREFECT_LOGGING_ORION_ENABLED: true
PREFECT_LOGGING_ORION_BATCH_INTERVAL: 2
PREFECT_LOGGING_ORION_BATCH_SIZE: 4000000
PREFECT_LOGGING_ORION_MAX_LOG_SIZE: 1000000
PREFECT_AGENT_QUERY_INTERVAL: 5
PREFECT_AGENT_PREFETCH_SECONDS: 10
PREFECT_ORION_DATABASE_PASSWORD: 
PREFECT_ORION_DATABASE_CONNECTION_URL: sqlite+aiosqlite:///${PREFECT_HOME}/orion.db
PREFECT_ORION_DATABASE_ECHO: false
PREFECT_ORION_DATABASE_MIGRATE_ON_START: true
PREFECT_ORION_DATABASE_TIMEOUT: 1
PREFECT_ORION_DATABASE_CONNECTION_TIMEOUT: 5
PREFECT_ORION_SERVICES_SCHEDULER_LOOP_SECONDS: 60
PREFECT_ORION_SERVICES_SCHEDULER_DEPLOYMENT_BATCH_SIZE: 100
PREFECT_ORION_SERVICES_SCHEDULER_MAX_RUNS: 100
PREFECT_ORION_SERVICES_SCHEDULER_MAX_SCHEDULED_TIME: 8640000
PREFECT_ORION_SERVICES_SCHEDULER_INSERT_BATCH_SIZE: 500
PREFECT_ORION_SERVICES_LATE_RUNS_LOOP_SECONDS: 5
PREFECT_ORION_SERVICES_LATE_RUNS_AFTER_SECONDS: 5
PREFECT_ORION_API_DEFAULT_LIMIT: 200
PREFECT_ORION_API_HOST: 127.0.0.1
PREFECT_ORION_API_PORT: 4200
PREFECT_ORION_UI_ENABLED: true
PREFECT_ORION_UI_API_URL: 
PREFECT_ORION_ANALYTICS_ENABLED: true
PREFECT_ORION_SERVICES_SCHEDULER_ENABLED: true
PREFECT_ORION_SERVICES_LATE_RUNS_ENABLED: true
PREFECT_ORION_SERVICES_FLOW_RUN_NOTIFICATIONS_ENABLED: true
what I try to achieve is to run a orion server on remote for "production" and still want to use the local server for "development". Both should be accessible in parallel
r

Ryan Peden

08/26/2022, 3:54 PM
Hmm. I'm not sure why you're seeing this. When I start Orion a remote instance I see no flow runs in the UI, as expected. Perhaps run
prefect orion database reset -y
on the remote Orion instance?
t

Timo

08/27/2022, 7:42 AM
Ok this is weird. I tried it again today and now I'm facing two issues 1. Started the remote instance without running a local instance of orion server gives me a "clear" view but I can't add blocks (catalog is empty), other views (flow runs, settings, notifications) are empty (not showing the hint "Create a .... to start..."). If I run
prefect block type ls
I can see all the default blocks in the terminal but they are not visible in the UI. I tried different browsers and even tried to access the instance from a remote terminal server (same behavior). I noticed in the browser console that it tries to connect to the api of localhost. This doesn't seem to be right (see image in the post below). 2. After starting the local instance I see all the flow_runs, blocks etc. of my local instance even if I access the URL of the remote Again I started
prefect orion start --host 0.0.0.0 --port 8445
on the remote server. I also resetted the remote database with no success.
This was made on a remote terminal server trying to access the remote orion server. On the terminal server there was no prefect installed:
TLDR; after setting
prefect config set PREFECT_API_URL="http://<<server ip/url>>:<<server port>>/api"
on the remote machine it works now. 🎉
4 Views