ajbouh / substrate

8 stars 3 forks source link

bridge: move into substrate #47

Closed progrium closed 2 months ago

progrium commented 7 months ago

This is to track getting the new bridge code in webrtc-sessions into the substrate repo. I might suggest moving it in as bridge2 for now because there are still a few minor things missing or will be temporarily lost in a full replacement, but lets consider this against what will be gained:

new bridge gains

missing/lost functionality at present time

backing services

There are new equivalents of the asr-* and python-llama-cpp services named by functional role (so model/impl can change) based on the existing ones, except they run on CPU and dont have any shared dependency so they are self contained and individually iterable. These include minor DX additions including readmes, resource usage info, and test scripts/programs. They can be started with a docker-compose file.

These services will need:

They are currently made to include models in their container images to be self contained and easy to setup, but this needs to be modified to happen optionally when running in substrate and set up to use resourcedirs.

other considerations

Bridge sessions are stored on disk, so the bridge substrate service will probably also need this to integrate with resourcedirs.

move recommendation

It seems like it would be easy to move the webrtc-sessions/bridge project into the substrate repo as bridge2 during transition. Work could continue to happen running/developing outside substrate system, but with the project source in the substrate repo. The changes/additions needed for this to work inside substrate can be added in parallel to development by somebody more familiar with substrate. Once it can run in/on substrate and state of gains/losses is acceptable, it can be renamed to replace bridge.

progrium commented 6 months ago

This issue has been updated with a rough outline of what needs to be done to run on substrate and a plan to start integrating it while development continues as is.

ajbouh commented 6 months ago

Excellent, thanks for laying out these steps.

I agree putting it in /images/bridge2 would make sense.

There should be a corresponding /defs/bridge2.cue file as well.

backing services

resourcedirs

spaces

For saving data, we'll use substrate's concept of a "space". A space is a directory that is mounted (rw) into the container on start. Each space has a unique (randomly generated) ID.

A service can declare the spaces they use as spawn.parameters in its corresponding .cue file.

progrium commented 6 months ago

Shall we close this? Has everything else needed to be done ended up in new issues?

progrium commented 6 months ago

@ajbouh ^

ajbouh commented 6 months ago

let's add issues for the functionality still missing, then yes sounds good to close

mgood commented 2 months ago

I think this seems safe to close now, right?