Repository navigation
Replies: 2 comments 2 replies
|
Thanks for writing this up, @sandstrom. Good idea! Hot Cell was built to be extensible, so you can try this today without changing Hot Cell.
The default transport, To call a containerized cell from Rails on macOS through an HTTP relay, do the following:
Your operation code and call sites don't change.
|
|
Hello @flavorjones! I saw Before I start working, is the HTTP relay the approach you'd be most likely to upstream? Or is another approach something you'd prefer? I understand you cannot give any guarantees now, but I'm pretty agnostic on the approach myself, so if I'm building something, I'd rather build whatever has the highest likelihood of getting into hotcell, since that would make it useful to people besides myself. macOS is a pretty popular developer platform, so I'll imagine others will run into this as well. |
Uh oh!
There was an error while loading. Please reload this page.
Hello again 😄 Trying to integrate Hotcell and ran into something that made me pause.
We run Rails directly on macOS and use Docker Compose for supporting services. We’d like to run Hotcell in Docker too, so developers don’t need to install libvips or other processing dependencies on their Macs.
The file-descriptor protocol makes that impossible today, since descriptors cannot cross into Docker’s Linux VM. The dcoumented options are to run the cell natively or move the application into Docker. Running the cell natively means installing the dependencies we’d hoped to keep mostly inside its image (apart for when working on hotcell itself).
Keeping them in Docker would let developers use the same processing libraries and versions as production without maintaining a separate macOS installation. It would also fit our existing workflow, where Rails runs locally for debugging and supporting services run in containers.
Would you consider supporting another transport for development?
A few possibilities come to mind:
A small HTTP relay running alongside the hotcell server could receive file bytes and operation arguments from macOS, create temporary files inside Linux, and call the cell through the existing descriptor protocol.
A helper invoked through docker exec could do similar work using stdin/stdout, avoiding a published HTTP endpoint.
Mount a dedicated exchange directory into Docker. The macOS client writes inputs there and sends a small request containing operation arguments and relative filenames. A Linux helper opens those files and forwards descriptors to the hotcell server.
These involve copying or staging files across the VM boundary. They wouldn’t have the same properties as the production transport, but that seems like a reasonable tradeoff for development.
There’s already a transport abstraction in the client. Perhaps this could be an optional implementation, or a documented extension point that lets teams build one without depending on internal APIs.
We’d like to keep operation code and application calls the same, with the transport chosen through development configuration.
Let me konw what you think!
All reactions