Hi, when self-hosting the hamilton UI, is there a ...
# hamilton-help
m
Hi, when self-hosting the hamilton UI, is there a way to manage authentication? it seems to just ask me for name but I don't see how I could potentially use a password or token so that it's not publicly available
also, I've been looking into
hamilton ui
command, and it seems like there's no way to configure custom db beyond port, is there? I thought that maybe the same variables as with docker deployment would work, but I don't think they do...
e
Hey so we should chat! Currently the authentication stuff is in a separate, private repository, happy to discuss deployment options. Re the UI command, it currently works with sqlite, locally. By “custom db” do you mean a different db file (easy to add — currently under
~/.hamilton/db
), or postgres/s3?
m
I mean postgres
e
Yep so currently the postgres database is run through the docker setup, whereas the
hamilton ui
is in mini-mode, running on a local sqlite db (generally meant for dev work)
m
just to clarify, I mean that I have a postgres instance and I just want to connect to it
e
Yeah, so the right way to do that would be through
docker-compose
— you should be able to set the correct variables with
backend
and comment out the db here: https://github.com/DAGWorks-Inc/hamilton/blob/5585c24c7b3813fcfadf180c8c24771e43781e15/ui/deployment/docker-compose.yml#L4. Happy to add more instructions on that! The
hamilton ui
command is (currently) meant for local dev. That said, it simplifies things quite a bit, so might be worth adding the ability to connect to postgres?
m
I got excited about the command because that would simplify my deployment 😂
I have some time to look into it this week, so I'll check out the alternatives as well
e
Yeah! I think it’s really nice that it couples the BE/FE, making it one instance. Might be able to hack it to get it to work with an existing DB — will take a look this morning.
m
unfortunately, I cannot use docker-compose in my deployment env, but I might be able to work around that by deploying two separate things
yeah I might look into it too, haven't had the time to look too closely at the code yet, but will
I'll check out the docker-compose route first though
and as for the auth, I honestly don't need much, but I would need something, like a pass or token
it wouldn't have to be configured in UI or anything, but I need to put it behind some kind of auth
even though this data is not that sensitive, I still can't just open it up (an alternative would be to not expose an external route to it, but then we'd have to port-forward with kubernetes, and that's a pain!)
e
That would be helpful! I can take a look to see how hard it would be to get
hamilton ui
attached to a running one. It should be doable to run in prod. Should be simple its just a matter of setting the right settings. See this file: https://github.com/DAGWorks-Inc/hamilton/blob/main/ui/backend/server/commands.py#L63.
m
btw can I use an s3 bucket for blobs or only local path?
e
Re: auth, we have a fairly sophisticated approach, it’s just under an enterprise repo. @Stefan Krawczyk and I will chat about it and get back to you. By “external” you mean “public-facing”? Our mental model was that most people would deploy this in a VPN (so that the unauthed version could work), but happy to think through.
m
it's in vpn
by external I mean available to everyone in the vpn
not public as in to the world
e
Got it — 👍 will get back to you shortly on that
m
sure, thanks
e
Re: s3, it’s definitely doable, just a matter of settings
👍 1