https://prefect.io logo
Title
c

Cody Webb

06/22/2020, 1:37 AM
hello everybody i have a project i am working on where i am trying to get jupyter and prefectui//agent wokring in docker so i can use prefect with jupyter but i cant seem to get connection between the ui//agent //jupyter have shared here->
c

Chris White

06/22/2020, 1:40 AM
Hi @Cody Webb - it would be better if you create a github gist to share your code, I don’t think anyone will feel comfortable downloading a random zip file :)
c

Cody Webb

06/22/2020, 1:41 AM
ok cool will do one sec
c

Chris White

06/22/2020, 1:42 AM
Awesome thanks!
c

Cody Webb

06/22/2020, 1:43 AM
thank you chris for the timely response =]
👍 1
c

Chris White

06/22/2020, 1:54 AM
I probably can’t give specific advice without knowing a little more about what you’re seeing, but this is a common issue: in short, Prefect server sets up the infrastructure to host a local API (by default exposed at
localhost:4200
) that both the agent and the UI need access to. To deploy this outside of a single local machine requires understanding how to setup the networking configuration between Docker / where the API is hosted / the browser running the UI. This blog post sheds some light on how it all ties together and might be useful to read over: https://medium.com/the-prefect-blog/prefect-server-101-deploying-to-google-cloud-platform-47354b16afe2
(although there might be others in the community who might have some thoughts!)
c

Cody Webb

06/22/2020, 1:55 AM
oh, im just trying to get it set up for prefect flows to run the more intensive jupyter cells so i dont continuously crash my notebook on long running processes
🚀 1
c

Chris White

06/22/2020, 2:00 AM
in that case it might be worthwhile to grab a free account for Prefect Cloud’s API / UI: https://cloud.prefect.io/ That will allow you to ignore all the networking complexities of an API and still run your flows as you want
c

Cody Webb

06/22/2020, 2:01 AM
interesting ok ill check it out
👍 1
k

Kai Weber

06/23/2020, 5:54 AM
Hi Cody, I am new in the Prefect business too. But at least I got my Docker-Anaconda (and some other Docker container) running with prefect. I tried to use GraphQL from Jupyter to communicate with Prefect-Local-Server. The magic is that you have to start all docker container with the parameter "--network prefect-server". Now you can talk to Prefect-Server: from gql import gql, Client from gql.transport.requests import RequestsHTTPTransport sample_transport=RequestsHTTPTransport( url='http://172.18.0.7:4200/graphql', verify=False, retries=3, ) client = Client( transport=sample_transport, fetch_schema_from_transport=True, ) query = gql(''' { flow(distinct_on: name) { name id description } } ''') client.execute(query)