Hi all! I am running the server locally and initia...
# prefect-community
s
Hi all! I am running the server locally and initially when opening the UI Id be able to see the toolbar but nothing else. After some mindless googling, I found an instruction from here https://github.com/flavienbwk/prefect-docker-compose says I need to run
Copy code
prefect backend server
prefect server create-tenant --name default --slug default
And doing this does seem to fix the problem. Is there a way I can specify in the config options or somewhere in the docker-compose that I’d like to ensure this tenant exists on server startup?
z
There isn't currently a way to do this, you should only have to run it the one time unless you aren't persisting the database. You can also just run that command every time the server starts and it won't hurt anything -- it'll just return an already existing error if it does.
j
Adding on to what @Zanie said, if you’re running your server using docker-compose and the
prefect server start
command this step is automatically taken for you (ref)
s
Ah I see. The main reason for asking is because as part of a swarm we might be bundling this up and deploying it on brand new instances and it all needs to happen in an automated fashion. Because the prefect swarm services have to be integrated with others, I cant use prefect start, and will have to have my own docker-compose. Is there a service in the https://github.com/PrefectHQ/prefect/blob/master/src/prefect/cli/docker-compose.yml file I can add an extra command to (however prefect server start does it?)
z
From the link josh added, the command is just run after the docker-compose command runs. I'm not sure where it would fit in to the main docker-compose file which is why the helm chart also makes you create your own tenant. It seems pretty overkill to create a whole container just to run that command.
s
Yeah, a container just to run an init script seems excessive. Would it be possible to add this in as a command on the apollo service. Or perhaps if I have a container which acts as an agent and thus needs prefect pip installed anyway would run that to start with? EDIT: Unsure this would work, as
prefect server create-tenant
has no way of specifying the location of the server to talk to like
prefect agent
has. @Zanie or @josh - do you know how I could specify the location of the server to talk to, Im not sure how it work right now