https://prefect.io logo
Title
j

jack

12/03/2020, 8:17 PM
Hi folks, quick question about getting a basic demo set up with Prefect installed on a Virtualbox VM: How do I get the UI (on the host browser) to see the projects and agents created inside the VM (guest)? From the VM, the following commands have been issued:
# In window #1 
prefect backend server
prefect agent start
prefect project create test-1

# In window #2
prefect server start

# In window #3
prefect agent start
When I go to http://IP_OF_VM:8080 the UI is visible, but when I click "Dashboard" and then "Agents", it says there are no agents. Also in the upper right corner of the UI there is a drop-down for "Project", but there are no items in the drop-down. Even created a config.toml (and restarted server and agent), but still no change.
[server]

  [server.ui]

    apollo_url = "<http://IP_OF_VM:4200/graphql>"
n

nicholas

12/03/2020, 8:40 PM
Hi @jack - first thing to test: what do you see when you visit http://IP_OF_VM:4200/graphql in your browser?
j

jack

12/04/2020, 2:46 AM
@nicholas It shows the graphql page and says Write your query or mutation here
When I open the javascript console from http://IP_OF_VM:8080 and look at the network traffic, it is making lots of failed requests to localhost:4200
When I open localhost:8080 from inside the VM, the agent shows up.
Where is the config file supposed to live? Found a place to set the apollo url via the web page, but still not able to set it via config file.
I've tried putting the config in the following locations, to no avail:
~/.apollo/config.toml
/path/to/project/apollo/config.toml
/path/to/project/.apollo/config.toml
n

nicholas

12/04/2020, 3:09 PM
Hi @jack - which version of Prefect are you running to spin up Server?
j

jack

12/04/2020, 3:10 PM
pip freeze shows 0.13.18
n

nicholas

12/04/2020, 3:12 PM
Great, and where did you create your original config.toml? Is that on the host machine?
j

jack

12/04/2020, 3:13 PM
I've tried it in several places, all on the guest machine
n

nicholas

12/04/2020, 3:14 PM
It would need to be placed in the
~/.prefect/
directory.
j

jack

12/04/2020, 3:14 PM
On the guest machine?
n

nicholas

12/04/2020, 3:16 PM
That’s correct. We don’t officially support the container in container deployment you’re running, since Prefect Server already runs in a containerized environment with Docker.
j

jack

12/04/2020, 3:17 PM
$ cat ~/.prefect/config.toml
[server]

[server.ui]

apollo_url = "<http://192.168.1.197:4200/graphql>"
n

nicholas

12/04/2020, 3:19 PM
What do you see when you visit the UI endpoint
/settings.json
?
j

jack

12/04/2020, 3:20 PM
n

nicholas

12/04/2020, 3:21 PM
Great, that tells us the environment variable is being populated correctly. If you open up the JavaScript console, can you type
localStorage.clear()
and do a hard refresh of your browser tab?
j

jack

12/04/2020, 3:39 PM
Yay---some progress... The network tab now shows POST data being sent to 192.168.1.197
n

nicholas

12/04/2020, 3:40 PM
Great! Are you able to fetch data?
j

jack

12/04/2020, 3:42 PM
Yes, I can see my agent now
It looks like the empty project I created is not visible---do I need to recreate that now that there is a config file in place?
n

nicholas

12/04/2020, 3:44 PM
Hm, I'm not sure, but you can try doing so
j

jack

12/04/2020, 3:46 PM
Creating an additional project, and it shows up...I have restarted the server a few times, but I assumed it would store the projects. Still new at this, so hopefully I can work my quirks out
Thank you for helping me get it to read from the config file.
Perhaps this piece of documentation could be updated. It says to put the config file in a different place than what you showed me:
n

nicholas

12/04/2020, 3:51 PM
No worries! You’ll want to look into persisting the database across restarts by either enabling a volume or standing up an independent db and pointing Prefect Server at that instead
Hm yeah I think that . Should be a ~!
j

jack

12/04/2020, 4:05 PM
Ah....that's why there's an option to specify a volume 🤩
😄 1