Stream: warg

Topic: containerization


view this post on Zulip Kristopher Wuollett (Apr 26 2023 at 19:13):

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.

view this post on Zulip Kristopher Wuollett (Apr 26 2023 at 23:51):

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.

created Dockerfile and Docker Copmose files to cover server, client, and potential utilities like database migration package added local-infra.sh script to act as both documentation and ease of use...

view this post on Zulip Kristopher Wuollett (May 11 2023 at 13:22):

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.

view this post on Zulip Kristopher Wuollett (May 11 2023 at 13:30):

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.

view this post on Zulip Robin Brown (May 11 2023 at 13:47):

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?

view this post on Zulip Kristopher Wuollett (May 11 2023 at 13:57):

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".

view this post on Zulip Kristopher Wuollett (May 11 2023 at 13:58):

once you call run on a server the server variable isn't usable anymore that is?

view this post on Zulip Lann Martin (May 11 2023 at 14:07):

Yes, it is intended

view this post on Zulip Lann Martin (May 11 2023 at 14:08):

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

view this post on Zulip Lann Martin (May 11 2023 at 14:10):

Actually it probably does matter because of how listener is managed

view this post on Zulip Kristopher Wuollett (May 11 2023 at 14:23):

ok. well i'll get the PR up soon that will probably have to change the listener storage thing

view this post on Zulip Kristopher Wuollett (May 11 2023 at 22:06):

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.

progress on #81 refactors server bind/run methods into start/join in order to return endpoint socket addresses from start for testing health checks if enabled can optionally be bound to another por...

Last updated: Nov 22 2024 at 16:03 UTC