Hi everyone, as mentioned a bit in the meeting, I have been looking to get involved helping out initially with general topic of containerization / running nicely in different cloud environments. Will have a relatively simple PR soon that sets up a Dockerfile / Docker Compose which should be helpful for both dev/testing now, and prod environments later. Will post updates here about it and any other follow up PRs.
Initial containerization attempt: https://github.com/bytecodealliance/registry/pull/96. @Peter Huene, it is set up with postgres and has placeholders for running a database migration.
As mentioned during wg meeting, I'm nearing completion on creating a PR to optionally add health check endpoints to the server. Since I'm new to Rust, I'm not sure if it was intended or not, but the server partially moves itself during the run method because items in its config member gets moved? Which leads me to follow ups: 1) should config just be used as a parameter object for new, or 2) should things in server/config be "taken" out of optional or made copies when needed like for address for binding? I came across it since I wasn't able to refer to itself since partially moved when optionally adding another listener setup like the existing code.
Or perhaps that is when I was playing with the code and had changed &mut self to &self if no reason to move the listeners to self.
Is there a reason the health check isn't added into the server next to the other APIs using the patterns they do to get access to what they need?
I can make it work, I'm just wondering if partially moving self is intended. Although contrived, doesn't that mean a server could only be "run once".
once you call run on a server the server variable isn't usable anymore that is?
Yes, it is intended
I don't think it matters for the registry server at this moment, but enforcing that a server can only be run once is great: it means you never have to worry about someone trying to do that, so you don't have to care about the state of the server after shutdown
Actually it probably does matter because of how listener
is managed
ok. well i'll get the PR up soon that will probably have to change the listener storage thing
Basic health checks / lifecycle draft PR posted: https://github.com/bytecodealliance/registry/pull/111. I could possibly split it into separate server listener refactor and health check PRs. Still need to verify health check endpoints work as expected and maybe add tests, but would be good to see if this refactoring approach is appropriate.
Last updated: Dec 23 2024 at 12:05 UTC