Yongchan Hong
02/13/2022, 1:38 PMKevin Kho
prefect backend server
and also in your config.toml
file, point to the server address with
[server]
endpoint = "YOUR_MACHINES_PUBLIC_IP:4200/graphql"
Yongchan Hong
02/14/2022, 3:46 PMKevin Kho
config.toml
. You can have an environment variable PREFECT__SERVER___ENDPOINT
also and it will do the same thingYongchan Hong
02/14/2022, 4:38 PM!prefect backend server
import os
os.environ['PREFECT_SERVER__ENDPOINT'] = "<https://prefect-apollo-dev.xtrm-data.io/graphql>"
from prefect import Client
client = Client()
client.create_project(project_name="Hello, World!")
Kevin Kho
prefect
is imported, it loads in the config (including the env variables). So the environment variable needs to be set before Prefect is imported. Your order is correct, but if it’s asking for an API key, it looks like it didn’t take effectYongchan Hong
02/14/2022, 4:52 PMHTTPConnectionPool(host='localhost', port=4200): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f070a1b2510>: Failed to establish a new connection: [Errno 111] Connection refused'))
@Kevin KhoKevin Kho
localhost
right?
You need to point to your server with your config.toml
file.
[server]
endpoint = "YOUR_MACHINES_PUBLIC_IP:4200/graphql"
Yongchan Hong
02/14/2022, 5:00 PMPREFECT__SERVER___ENDPOINT
as you told me… but it is still not working. @Kevin Kho Am I understanding something differently?Kevin Kho
config.toml
. I don’t know where this is on JupyterHub though. Give me a second to lookYongchan Hong
02/14/2022, 5:04 PMKevin Kho
~/.prefect
directory?config.toml
, you can just create one. You can just navigate in the file explorer right?Yongchan Hong
02/14/2022, 5:12 PMKevin Kho
Yongchan Hong
02/14/2022, 5:14 PMKevin Kho
Yongchan Hong
02/14/2022, 5:44 PMrun_config = KubernetesRun(
labels=["dev"],
service_account_name="prefect-server-serviceaccount"
)
@task(log_stdout=True)
def say_hello(name):
print("Hello, {}!".format(name))
with Flow("My Second Flow", run_config=run_config) as flow:
name = Parameter('name')
say_hello(name)
flow.register(project_name="Hello, World!")
client.create_flow_run(flow_id='5bcaf7c8-e8ac-4b4e-9f05-527dd610a12a', parameters={'name':'world'})
But it seems like it create flow run but it never actually runs at all… Is my agent configuration wrong? Also, when just run flow like flow.run(name=‘world’), is it running inside local agent? Sorry for repeated question 😞 @Kevin KhoKevin Kho
Yongchan Hong
02/14/2022, 6:03 PMKevin Kho
flow.storage = Local(…, add_default_labels=False)
Yongchan Hong
02/14/2022, 6:40 PMKevin Kho
Not Ready
state with some rror messageRicardo Gaspar
02/16/2022, 6:26 PM[api]
- https://docs.prefect.io/core/concepts/configuration.html#extensions
• It’s not clear if it’s something that a user needs to do on its prefect CLI installation or something to be done as part of server deployment - https://docs.prefect.io/orchestration/faq/config.html#connecting-to-a-different-api-endpointRicardo Gaspar
02/16/2022, 6:32 PMconfig.toml
file:
[server]
host_ip = "X.Y.Z.W"
host = "http://${server.host_ip}"
host_port = "4200"
endpoint = "${server.host}:${server.port}"
Kevin Kho
Ricardo Gaspar
02/16/2022, 6:36 PM0.15.13
prefect get flows <aws:sdlc-admin>
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "/usr/local/lib/python3.9/site-packages/urllib3/util/connection.py", line 96, in create_connection
raise err
File "/usr/local/lib/python3.9/site-packages/urllib3/util/connection.py", line 86, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused
Kevin Kho
prefect server start
?Ricardo Gaspar
02/16/2022, 6:40 PMprefect server start
.
I’ve followed this guide: https://pasaentuciudad.com.mx/deploying-prefect-server-with-aws-ecs-and-docker-storage/Kevin Kho
--expose
flag. prefect server start --expose
2. Was starting successful? Can you go check if the GraphQL API is up on server?--expose
flag hereRicardo Gaspar
02/17/2022, 4:13 PM--expose
flag.
with my config.toml file on my mac I’m able to interact with the prefect server and register flows.
I’m also able to use the graphql API to trigger flow runsKevin Kho
Ricardo Gaspar
02/17/2022, 8:18 PMYongchan Hong
02/18/2022, 4:23 AM